Title: [205984] trunk/Source/WebCore
Revision
205984
Author
[email protected]
Date
2016-09-15 11:04:45 -0700 (Thu, 15 Sep 2016)

Log Message

[CSS Parser] Make stylesheets parse using the new parser if the setting is enabled
https://bugs.webkit.org/show_bug.cgi?id=162018

Reviewed by Zalan Bujtas.

* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::CSSParser::parseSheet):
* css/parser/CSSParserMode.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (205983 => 205984)


--- trunk/Source/WebCore/ChangeLog	2016-09-15 17:58:01 UTC (rev 205983)
+++ trunk/Source/WebCore/ChangeLog	2016-09-15 18:04:45 UTC (rev 205984)
@@ -1,3 +1,15 @@
+2016-09-15  Dave Hyatt  <[email protected]>
+
+        [CSS Parser] Make stylesheets parse using the new parser if the setting is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=162018
+
+        Reviewed by Zalan Bujtas.
+
+        * css/parser/CSSParser.cpp:
+        (WebCore::CSSParserContext::CSSParserContext):
+        (WebCore::CSSParser::parseSheet):
+        * css/parser/CSSParserMode.h:
+
 2016-09-15  Fujii Hironori  <[email protected]>
 
         [CMake] Refactor GENERATE_BINDINGS

Modified: trunk/Source/WebCore/css/parser/CSSParser.cpp (205983 => 205984)


--- trunk/Source/WebCore/css/parser/CSSParser.cpp	2016-09-15 17:58:01 UTC (rev 205983)
+++ trunk/Source/WebCore/css/parser/CSSParser.cpp	2016-09-15 18:04:45 UTC (rev 205984)
@@ -56,6 +56,7 @@
 #include "CSSNamedImageValue.h"
 #include "CSSPageRule.h"
 #include "CSSParserFastPaths.h"
+#include "CSSParserImpl.h"
 #include "CSSPrimitiveValue.h"
 #include "CSSPrimitiveValueMappings.h"
 #include "CSSPropertySourceData.h"
@@ -269,6 +270,7 @@
         textAutosizingEnabled = settings->textAutosizingEnabled();
 #endif
         springTimingFunctionEnabled = settings->springTimingFunctionEnabled();
+        useNewParser = settings->newCSSParserEnabled();
     }
 
 #if PLATFORM(IOS)
@@ -371,8 +373,16 @@
     m_lexFunc = &CSSParser::realLex<UChar>;
 }
 
+// FIXME-NEWPARSER: This API needs to change. It's polluted with Inspector stuff, and that should
+// use the new obverver model instead.
 void CSSParser::parseSheet(StyleSheetContents* sheet, const String& string, const TextPosition& textPosition, RuleSourceDataList* ruleSourceDataResult, bool logErrors)
 {
+    // FIXME-NEWPARSER: It's easier for testing to let the entire UA sheet parse with the old
+    // parser. That way we can still have the default styles look correct while we add in support for
+    // properties.
+    if (m_context.useNewParser && m_context.mode != UASheetMode)
+        return CSSParserImpl::parseStyleSheet(string, m_context, sheet);
+    
     setStyleSheet(sheet);
     m_defaultNamespace = starAtom; // Reset the default namespace.
     if (ruleSourceDataResult)

Modified: trunk/Source/WebCore/css/parser/CSSParserMode.h (205983 => 205984)


--- trunk/Source/WebCore/css/parser/CSSParserMode.h	2016-09-15 17:58:01 UTC (rev 205983)
+++ trunk/Source/WebCore/css/parser/CSSParserMode.h	2016-09-15 18:04:45 UTC (rev 205984)
@@ -103,6 +103,7 @@
     bool enforcesCSSMIMETypeInNoQuirksMode { true };
     bool useLegacyBackgroundSizeShorthandBehavior { false };
     bool springTimingFunctionEnabled { false };
+    bool useNewParser { false };
 };
 
 bool operator==(const CSSParserContext&, const CSSParserContext&);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to