Rustdoc mobile: put out-of-band on its own line
Before this, the item name and the stability, source link, and "collapse all docs" would compete for room on a single line, resulting in awkward wrapping behavior on mobile. This gives a separate line for that out-of-band information. It also removes the "copy path" icon on mobile to make a little more room. Also, switch to flex-wrap: wrap, so anytime there's not enough room for `source`, it gets bumped to the next line.
This commit is contained in:
17
src/test/rustdoc-gui/mobile.goml
Normal file
17
src/test/rustdoc-gui/mobile.goml
Normal file
@@ -0,0 +1,17 @@
|
||||
// Test various properties of the mobile UI
|
||||
goto: file://|DOC_PATH|/staged_api/struct.Foo.html
|
||||
size: (400, 600)
|
||||
|
||||
// The out-of-band info (source, stable version, collapse) should be below the
|
||||
// h1 when the screen gets narrow enough.
|
||||
assert-css: (".main-heading", {
|
||||
"display": "flex",
|
||||
"flex-direction": "column"
|
||||
})
|
||||
|
||||
// Note: We can't use assert-text here because the 'Since' is set by CSS and
|
||||
// is therefore not part of the DOM.
|
||||
assert-css: (".content .out-of-band .since::before", { "content": "\"Since \"" })
|
||||
|
||||
size: (1000, 1000)
|
||||
assert-css-false: (".content .out-of-band .since::before", { "content": "\"Since \"" })
|
||||
@@ -1,12 +1,12 @@
|
||||
goto: file://|DOC_PATH|/test_docs/struct.Foo.html
|
||||
size: (433, 600)
|
||||
assert-attribute: (".top-doc", {"open": ""})
|
||||
click: (4, 250) // This is the position of the top doc comment toggle
|
||||
click: (4, 270) // This is the position of the top doc comment toggle
|
||||
assert-attribute-false: (".top-doc", {"open": ""})
|
||||
click: (4, 250)
|
||||
click: (4, 270)
|
||||
assert-attribute: (".top-doc", {"open": ""})
|
||||
// To ensure that the toggle isn't over the text, we check that the toggle isn't clicked.
|
||||
click: (3, 250)
|
||||
click: (3, 270)
|
||||
assert-attribute: (".top-doc", {"open": ""})
|
||||
|
||||
// Assert the position of the toggle on the top doc block.
|
||||
@@ -22,10 +22,10 @@ assert-position: (
|
||||
// Now we do the same but with a little bigger width
|
||||
size: (600, 600)
|
||||
assert-attribute: (".top-doc", {"open": ""})
|
||||
click: (4, 250) // New Y position since all search elements are back on one line.
|
||||
click: (4, 270) // New Y position since all search elements are back on one line.
|
||||
assert-attribute-false: (".top-doc", {"open": ""})
|
||||
click: (4, 250)
|
||||
click: (4, 270)
|
||||
assert-attribute: (".top-doc", {"open": ""})
|
||||
// To ensure that the toggle isn't over the text, we check that the toggle isn't clicked.
|
||||
click: (3, 250)
|
||||
click: (3, 270)
|
||||
assert-attribute: (".top-doc", {"open": ""})
|
||||
|
||||
Reference in New Issue
Block a user