diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-11-19 18:22:12 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-11-19 18:23:09 +0100 |
commit | 56dad2272cf7f0254e4eab31f3f4e68226a7d5b1 (patch) | |
tree | c49b1cb9cd381519ea662a182d9b70556cfe3a87 /Libraries/LibHTML/CSS | |
parent | 516708aab292a7386cb6a7a1d245060a13b4c97e (diff) | |
download | serenity-56dad2272cf7f0254e4eab31f3f4e68226a7d5b1.zip |
LibHTML: Implement the universal selector ("*")
Diffstat (limited to 'Libraries/LibHTML/CSS')
-rw-r--r-- | Libraries/LibHTML/CSS/Selector.h | 1 | ||||
-rw-r--r-- | Libraries/LibHTML/CSS/SelectorEngine.cpp | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/Libraries/LibHTML/CSS/Selector.h b/Libraries/LibHTML/CSS/Selector.h index c30bad10d6..56e96a2569 100644 --- a/Libraries/LibHTML/CSS/Selector.h +++ b/Libraries/LibHTML/CSS/Selector.h @@ -9,6 +9,7 @@ public: struct Component { enum class Type { Invalid, + Universal, TagName, Id, Class, diff --git a/Libraries/LibHTML/CSS/SelectorEngine.cpp b/Libraries/LibHTML/CSS/SelectorEngine.cpp index 56ad75c050..58ef15bd01 100644 --- a/Libraries/LibHTML/CSS/SelectorEngine.cpp +++ b/Libraries/LibHTML/CSS/SelectorEngine.cpp @@ -30,6 +30,8 @@ bool matches(const Selector::Component& component, const Element& element) } switch (component.type) { + case Selector::Component::Type::Universal: + return true; case Selector::Component::Type::Id: return component.value == element.attribute("id"); case Selector::Component::Type::Class: |