forked from mirrors/gecko-dev
This matches what the old display list code used to do: https://hg.mozilla.org/integration/autoland/rev/a75137d48b99#l6.818 Differential Revision: https://phabricator.services.mozilla.com/D208524
38 lines
890 B
JavaScript
38 lines
890 B
JavaScript
// Empty select to make sure that we click on the menulist button.
|
|
const PAGE = `
|
|
<!doctype html>
|
|
<select style="padding: 0">
|
|
<option></option>
|
|
</select>
|
|
`;
|
|
|
|
function tick() {
|
|
return new Promise(r =>
|
|
requestAnimationFrame(() => requestAnimationFrame(r))
|
|
);
|
|
}
|
|
|
|
add_task(async function () {
|
|
const url = "data:text/html," + encodeURI(PAGE);
|
|
await BrowserTestUtils.withNewTab(
|
|
{
|
|
gBrowser,
|
|
url,
|
|
},
|
|
async function (browser) {
|
|
await openSelectPopup("click");
|
|
await SpecialPowers.spawn(browser, [], () => {
|
|
is(
|
|
content.document.activeElement,
|
|
content.document.querySelector("select"),
|
|
"Select is the active element"
|
|
);
|
|
ok(
|
|
content.document.querySelector("select").matches(":focus"),
|
|
"Select matches :focus"
|
|
);
|
|
});
|
|
await hideSelectPopup();
|
|
}
|
|
);
|
|
});
|