Title: [208059] trunk/Source/WebCore
Revision
208059
Author
d...@apple.com
Date
2016-10-28 11:49:43 -0700 (Fri, 28 Oct 2016)

Log Message

Allow new CSS parser to handle insertRule, etc via parseRule
https://bugs.webkit.org/show_bug.cgi?id=164122
<rdar://problem/29000101>

Reviewed by Darin Adler.

Call the new CSS parser from CSSParser::parseRule if enabled. This
allows style added via the CSSOM insertRule to go through
the parser.

I tested this across our layout tests that use insertRule. It
works fine, but does cause some filter tests to fail. This is
because the new parser does not generate WebKitCSSFilterValues,
but I think the CSSFunctionValue is good enough. I'll remove
WebKitCSSFilterValue separately.

* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseRule): Call CSSParserImpl::parseRule.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (208058 => 208059)


--- trunk/Source/WebCore/ChangeLog	2016-10-28 18:34:17 UTC (rev 208058)
+++ trunk/Source/WebCore/ChangeLog	2016-10-28 18:49:43 UTC (rev 208059)
@@ -1,3 +1,24 @@
+2016-10-28  Dean Jackson  <d...@apple.com>
+
+        Allow new CSS parser to handle insertRule, etc via parseRule
+        https://bugs.webkit.org/show_bug.cgi?id=164122
+        <rdar://problem/29000101>
+
+        Reviewed by Darin Adler.
+
+        Call the new CSS parser from CSSParser::parseRule if enabled. This
+        allows style added via the CSSOM insertRule to go through
+        the parser.
+
+        I tested this across our layout tests that use insertRule. It
+        works fine, but does cause some filter tests to fail. This is
+        because the new parser does not generate WebKitCSSFilterValues,
+        but I think the CSSFunctionValue is good enough. I'll remove
+        WebKitCSSFilterValue separately.
+
+        * css/parser/CSSParser.cpp:
+        (WebCore::CSSParser::parseRule): Call CSSParserImpl::parseRule.
+
 2016-10-28  Simon Fraser  <simon.fra...@apple.com>
 
         Wrong blur radius for filter: drop-shadow()

Modified: trunk/Source/WebCore/css/parser/CSSParser.cpp (208058 => 208059)


--- trunk/Source/WebCore/css/parser/CSSParser.cpp	2016-10-28 18:34:17 UTC (rev 208058)
+++ trunk/Source/WebCore/css/parser/CSSParser.cpp	2016-10-28 18:49:43 UTC (rev 208059)
@@ -394,6 +394,8 @@
 
 RefPtr<StyleRuleBase> CSSParser::parseRule(StyleSheetContents* sheet, const String& string)
 {
+    if (m_context.useNewParser && m_context.mode != UASheetMode)
+        return CSSParserImpl::parseRule(string, m_context, sheet, CSSParserImpl::AllowImportRules);
     setStyleSheet(sheet);
     m_allowNamespaceDeclarations = false;
     setupParser("@-webkit-rule{", string, "} ");
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to