-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #104611 - notriddle:notriddle/scrape-examples-button,…
… r=GuillaumeGomez rustdoc: use real buttons for scrape examples controls This makes the expand and switch controls keyboard-accessible. Preview: https://notriddle.com/notriddle-rustdoc-demos/scrape-examples-button/test_dingus/fn.test.html
- Loading branch information
Showing
11 changed files
with
77 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test.html" | ||
store-property: (smallOffsetHeight, ".scraped-example-list > .scraped-example pre", "offsetHeight") | ||
assert-property-false: (".scraped-example-list > .scraped-example pre", { | ||
"scrollHeight": |smallOffsetHeight| | ||
}) | ||
focus: ".scraped-example-list > .scraped-example .expand" | ||
press-key: "Enter" | ||
assert-property-false: (".scraped-example-list > .scraped-example pre", { | ||
"offsetHeight": |smallOffsetHeight| | ||
}) | ||
store-property: (fullOffsetHeight, ".scraped-example-list > .scraped-example pre", "offsetHeight") | ||
assert-property: (".scraped-example-list > .scraped-example pre", { | ||
"scrollHeight": |fullOffsetHeight| | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This file is automatically @generated by Cargo. | ||
# It is not intended for manual editing. | ||
version = 3 | ||
|
||
[[package]] | ||
name = "scrape_examples" | ||
version = "0.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "scrape_examples" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
25 changes: 25 additions & 0 deletions
25
src/test/rustdoc-gui/src/scrape_examples/examples/check.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
fn main() { | ||
for i in 0..9 { | ||
println!("hello world!"); | ||
println!("hello world!"); | ||
println!("hello world!"); | ||
println!("hello world!"); | ||
println!("hello world!"); | ||
println!("hello world!"); | ||
println!("hello world!"); | ||
println!("hello world!"); | ||
println!("hello world!"); | ||
} | ||
scrape_examples::test(); | ||
for i in 0..9 { | ||
println!("hello world!"); | ||
println!("hello world!"); | ||
println!("hello world!"); | ||
println!("hello world!"); | ||
println!("hello world!"); | ||
println!("hello world!"); | ||
println!("hello world!"); | ||
println!("hello world!"); | ||
println!("hello world!"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/// # Examples | ||
/// | ||
/// ``` | ||
/// test(); | ||
/// test(); | ||
/// ``` | ||
pub fn test() {} |