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:
parent
4b9f5c6fb8
commit
972547635f
Notes:
github-actions[bot]
2025-04-09 11:11:42 +00:00
Author: https://github.com/Gingeh
Commit: 972547635f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4263
Reviewed-by: https://github.com/AtkinsSJ ✅
7 changed files with 47 additions and 13 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue