Преглед изворни кода

LibWeb: Ignore backslashes (\) in attribute selectors

This makes us at least parse selectors like [foo=bar\ baz] correctly.
The current solution here is quite hackish but the real fix will come
when we implement a spec-compliant CSS parser.
Andreas Kling пре 5 година
родитељ
комит
03da686aa2
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      Libraries/LibWeb/Parser/CSSParser.cpp

+ 3 - 0
Libraries/LibWeb/Parser/CSSParser.cpp

@@ -492,6 +492,9 @@ public:
                     }
                     }
                     continue;
                     continue;
                 }
                 }
+                // FIXME: This is a hack that will go away when we replace this with a big boy CSS parser.
+                if (ch == '\\')
+                    ch = consume_one();
                 buffer.append(ch);
                 buffer.append(ch);
             }
             }
             if (in_value)
             if (in_value)