From dc58f6567f8f22151170b4b6a6d839563060cdef Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Fri, 31 Jan 2025 15:34:34 +0000 Subject: [PATCH] LibWeb: Support :open for file and color `` elements --- Libraries/LibWeb/CSS/SelectorEngine.cpp | 18 +++++++----- Libraries/LibWeb/DOM/Node.h | 1 + Libraries/LibWeb/HTML/HTMLInputElement.cpp | 32 ++++++++++++++++++++-- Libraries/LibWeb/HTML/HTMLInputElement.h | 6 ++++ 4 files changed, 48 insertions(+), 9 deletions(-) diff --git a/Libraries/LibWeb/CSS/SelectorEngine.cpp b/Libraries/LibWeb/CSS/SelectorEngine.cpp index 233b773c23c..f806dc8aaa4 100644 --- a/Libraries/LibWeb/CSS/SelectorEngine.cpp +++ b/Libraries/LibWeb/CSS/SelectorEngine.cpp @@ -386,20 +386,24 @@ static bool matches_read_write_pseudo_class(DOM::Element const& element) return element.is_editable_or_editing_host(); } -// https://www.w3.org/TR/selectors-4/#open-state +// https://drafts.csswg.org/selectors-4/#open-state static bool matches_open_state_pseudo_class(DOM::Element const& element, bool open) { // The :open pseudo-class represents an element that has both “open” and “closed” states, // and which is currently in the “open” state. - // The :closed pseudo-class represents an element that has both “open” and “closed” states, - // and which is currently in the closed state. - // NOTE: Spec specifically suggests supporting
, , and