mirror of
https://github.com/rust-lang/rust
synced 2024-09-06 01:11:17 +00:00
![Michael Howell](/assets/img/avatar_default.png)
This change constructs the search form HTML using JavaScript, instead of plain HTML. It uses a custom element because - the [parser]'s insert algorithm runs the connected callback synchronously, so we won't get layout jank - it requires very little HTML, so it's a real win in size [parser]: https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token This shrinks the standard library by about 60MiB, by my test.
21 lines
716 B
Plaintext
21 lines
716 B
Plaintext
// When JavaScript is disabled, we hide the search bar, because it
|
|
// can't be used without JS.
|
|
javascript: false
|
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
|
|
show-text: true
|
|
assert-false: ".sub"
|
|
|
|
// Even though JS is disabled, we should still have themes applied. Links are never black-colored
|
|
// if styles are applied so we check that they are not.
|
|
assert-css-false: ("a.src", {"color": "#000"})
|
|
|
|
javascript: true
|
|
fail-on-request-error: false
|
|
block-network-request: "*.js"
|
|
reload:
|
|
|
|
// JS is enabled but wasn't loaded, we should still have the light theme applied. Links are never
|
|
// black-colored if styles are applied so we check that they are not.
|
|
assert-css-false: ("a.src", {"color": "#000"})
|