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:
Matthias Krüger 2023-01-04 23:39:49 +01:00 committed by GitHub
commit b41d81ca96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -1040,9 +1040,6 @@ function loadCss(cssUrl) {
help_button.appendChild(container);
container.onblur = helpBlurHandler;
container.onclick = event => {
event.preventDefault();
};
help_button.onblur = helpBlurHandler;
help_button.children[0].onblur = helpBlurHandler;
}

View File

@ -61,3 +61,12 @@ click: "#help-button > a"
assert-css: ("#help", {"display": "none"})
compare-elements-property-false: (".sub", "#help", ["offsetWidth"])
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/"}