瀏覽代碼

LibWeb: Ignore vendor-prefixed at-rules

I don't know if I have ever seen one, but they are mentioned in the
spec, so we might as well do this.
https://wiki.csswg.org/spec/vendor-prefixes#css-vendor-prefixes
Sam Atkins 3 年之前
父節點
當前提交
6c27e2938a
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp

+ 3 - 1
Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp

@@ -1197,7 +1197,9 @@ Optional<URL> Parser::parse_url_function(ParsingContext const& context, StyleCom
 RefPtr<CSSRule> Parser::convert_to_rule(NonnullRefPtr<StyleRule> rule)
 {
     if (rule->m_type == StyleRule::Type::At) {
-        if (rule->m_name.equals_ignoring_case("import"sv) && !rule->prelude().is_empty()) {
+        if (has_ignored_vendor_prefix(rule->m_name)) {
+            return {};
+        } else if (rule->m_name.equals_ignoring_case("import"sv) && !rule->prelude().is_empty()) {
 
             Optional<URL> url;
             for (auto& token : rule->prelude()) {