LibWeb: Set inertness of HTMLElement when inert attribute is changed

This commit is contained in:
Tim Ledbetter 2025-02-05 23:24:47 +00:00 committed by Sam Atkins
commit a9ffc6359a
Notes: github-actions[bot] 2025-02-21 12:43:40 +00:00
4 changed files with 49 additions and 0 deletions

View file

@ -149,6 +149,8 @@ public:
static void hide_all_popovers_until(Variant<GC::Ptr<HTMLElement>, GC::Ptr<DOM::Document>> endpoint, FocusPreviousElement focus_previous_element, FireEvents fire_events);
static GC::Ptr<HTMLElement> topmost_popover_ancestor(GC::Ptr<DOM::Node> new_popover_or_top_layer_element, Vector<GC::Ref<HTMLElement>> const& popover_list, GC::Ptr<HTMLElement> invoker, IsPopover is_popover);
bool is_inert() const { return m_inert; }
protected:
HTMLElement(DOM::Document&, DOM::QualifiedName);
@ -169,6 +171,9 @@ protected:
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#implicitly-potentially-render-blocking
virtual bool is_implicitly_potentially_render_blocking() const { return false; }
void set_inert(bool inert) { m_inert = inert; }
void set_subtree_inertness(bool is_inert);
private:
virtual bool is_html_element() const final { return true; }
@ -200,6 +205,8 @@ private:
// https://html.spec.whatwg.org/multipage/interaction.html#click-in-progress-flag
bool m_click_in_progress { false };
bool m_inert { false };
// Popover API
// https://html.spec.whatwg.org/multipage/popover.html#popover-visibility-state