mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWeb: Add a helper function for checking if element is a shadow host
This commit is contained in:
parent
2cc108a15e
commit
01e2cc5330
Notes:
sideshowbarker
2024-07-17 11:34:34 +09:00
Author: https://github.com/krkk
Commit: 01e2cc5330
Pull-request: https://github.com/SerenityOS/serenity/pull/17225
3 changed files with 9 additions and 1 deletions
|
@ -210,7 +210,7 @@ void run_unfocusing_steps(DOM::Node* old_focus_target)
|
|||
// with the focusing steps.
|
||||
|
||||
auto is_shadow_host = [](DOM::Node* node) {
|
||||
return is<DOM::Element>(node) && static_cast<DOM::Element*>(node)->shadow_root() != nullptr;
|
||||
return is<DOM::Element>(node) && static_cast<DOM::Element*>(node)->is_shadow_host();
|
||||
};
|
||||
|
||||
// 1. If old focus target is a shadow host whose shadow root's delegates focus is true, and old focus target's
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue