Rollup merge of #106391 - ardislu:fix-popover-child-link, r=GuillaumeGomez
rustdoc: allow popover child links to work No need to prevent default click behavior on a `<div>`, it will also disable all child click behavior. Closes #106390
This commit is contained in:
commit
b41d81ca96
@ -1040,9 +1040,6 @@ function loadCss(cssUrl) {
|
|||||||
help_button.appendChild(container);
|
help_button.appendChild(container);
|
||||||
|
|
||||||
container.onblur = helpBlurHandler;
|
container.onblur = helpBlurHandler;
|
||||||
container.onclick = event => {
|
|
||||||
event.preventDefault();
|
|
||||||
};
|
|
||||||
help_button.onblur = helpBlurHandler;
|
help_button.onblur = helpBlurHandler;
|
||||||
help_button.children[0].onblur = helpBlurHandler;
|
help_button.children[0].onblur = helpBlurHandler;
|
||||||
}
|
}
|
||||||
|
@ -61,3 +61,12 @@ click: "#help-button > a"
|
|||||||
assert-css: ("#help", {"display": "none"})
|
assert-css: ("#help", {"display": "none"})
|
||||||
compare-elements-property-false: (".sub", "#help", ["offsetWidth"])
|
compare-elements-property-false: (".sub", "#help", ["offsetWidth"])
|
||||||
compare-elements-position-false: (".sub", "#help", ("x"))
|
compare-elements-position-false: (".sub", "#help", ("x"))
|
||||||
|
|
||||||
|
// This test ensures that the "the rustdoc book" anchor link within the help popover works.
|
||||||
|
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
|
||||||
|
size: (1000, 1000) // Popover only appears when the screen width is >700px.
|
||||||
|
assert-false: "#help"
|
||||||
|
click: "#help-button > a"
|
||||||
|
click: ".popover a[href='https://doc.rust-lang.org/rustdoc/']"
|
||||||
|
wait-for: 2000
|
||||||
|
assert-document-property: {"URL": "https://doc.rust-lang.org/rustdoc/"}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user