1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-09 09:34:57 +09:00

LibWeb: Dispatch pointer events to ::backdrop originating element

This commit is contained in:
Gingeh 2025-04-07 19:33:53 +10:00 committed by Sam Atkins
parent 4b9f5c6fb8
commit 972547635f
Notes: github-actions[bot] 2025-04-09 11:11:42 +00:00
7 changed files with 47 additions and 13 deletions

View file

@ -1002,13 +1002,9 @@
ladybird.sendMessage("restoreDefaultSettings");
});
// FIXME: Once we support `dialog::backdrop`, this event listener should be on `siteSettings`.
document.addEventListener("click", event => {
const close = dialog => {
if (!dialog.open) {
return;
}
// FIXME: This should be replaced once we support popover light dismissal.
document.querySelectorAll("dialog").forEach((dialog) =>
dialog.addEventListener("click", event => {
const rect = dialog.getBoundingClientRect();
if (
@ -1019,10 +1015,8 @@
) {
dialog.close();
}
};
document.querySelectorAll("dialog").forEach(close);
});
}
));
document.addEventListener("WebUILoaded", () => {
ladybird.sendMessage("loadAvailableEngines");