LibWeb: Add a helper function for checking if element is a shadow host

This commit is contained in:
Karol Kosek 2023-01-28 20:33:36 +01:00 committed by Andreas Kling
commit 01e2cc5330
Notes: sideshowbarker 2024-07-17 11:34:34 +09:00
3 changed files with 9 additions and 1 deletions

View file

@ -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