1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-02 23:12:08 +00:00

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
parent 2cc108a15e
commit 01e2cc5330
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