Diff
Modified: trunk/Source/WebCore/ChangeLog (233519 => 233520)
--- trunk/Source/WebCore/ChangeLog 2018-07-05 14:56:13 UTC (rev 233519)
+++ trunk/Source/WebCore/ChangeLog 2018-07-05 15:46:25 UTC (rev 233520)
@@ -1,3 +1,56 @@
+2018-07-05 Antti Koivisto <[email protected]>
+
+ Move CSSParserContext to a file of its own
+ https://bugs.webkit.org/show_bug.cgi?id=187342
+
+ Reviewed by Zalan Bujtas.
+
+ Move it out from CSSParserMode.h and CSSParser.cpp.
+
+ * Sources.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * contentextensions/ContentExtensionParser.cpp:
+ * css/PropertySetCSSStyleDeclaration.h:
+ * css/StyleProperties.h:
+ * css/StyleSheetContents.h:
+ * css/parser/CSSDeferredParser.h:
+ * css/parser/CSSParser.cpp:
+ (WebCore::strictCSSParserContext): Deleted.
+ (WebCore::CSSParserContext::CSSParserContext): Deleted.
+ (WebCore::operator==): Deleted.
+ * css/parser/CSSParser.h:
+ * css/parser/CSSParserContext.cpp: Added.
+ (WebCore::strictCSSParserContext):
+ (WebCore::CSSParserContext::CSSParserContext):
+ (WebCore::operator==):
+
+ Also add the missing textAutosizingEnabled bit.
+
+ * css/parser/CSSParserContext.h: Copied from Source/WebCore/css/parser/CSSParserMode.h.
+ (WebCore::CSSParserContextHash::hash):
+
+ Also add the missing bits to the hash function.
+
+ (WebCore::isQuirksModeBehavior): Deleted.
+ (WebCore::isUASheetBehavior): Deleted.
+ (WebCore::isUnitLessValueParsingEnabledForMode): Deleted.
+ (WebCore::isCSSViewportParsingEnabledForMode): Deleted.
+ (WebCore::strictToCSSParserMode): Deleted.
+ (WebCore::isStrictParserMode): Deleted.
+ * css/parser/CSSParserIdioms.h:
+ * css/parser/CSSParserImpl.h:
+ * css/parser/CSSParserMode.h:
+ (WebCore::CSSParserContext::completeURL const): Deleted.
+ (WebCore::operator!=): Deleted.
+ (WebCore::CSSParserContextHash::hash): Deleted.
+ (WebCore::CSSParserContextHash::equal): Deleted.
+ (WTF::HashTraits<WebCore::CSSParserContext>::constructDeletedValue): Deleted.
+ (WTF::HashTraits<WebCore::CSSParserContext>::isDeletedValue): Deleted.
+ (WTF::HashTraits<WebCore::CSSParserContext>::emptyValue): Deleted.
+ * css/parser/CSSPropertyParserHelpers.h:
+ * css/parser/CSSSelectorParser.cpp:
+ * css/parser/CSSVariableParser.cpp:
+
2018-07-05 Antoine Quint <[email protected]>
[Web Animations] The ready promise should initially be resolved
Modified: trunk/Source/WebCore/Sources.txt (233519 => 233520)
--- trunk/Source/WebCore/Sources.txt 2018-07-05 14:56:13 UTC (rev 233519)
+++ trunk/Source/WebCore/Sources.txt 2018-07-05 15:46:25 UTC (rev 233520)
@@ -663,6 +663,7 @@
css/parser/CSSAtRuleID.cpp
css/parser/CSSDeferredParser.cpp
css/parser/CSSParser.cpp
+css/parser/CSSParserContext.cpp
css/parser/CSSParserFastPaths.cpp
css/parser/CSSParserIdioms.cpp
css/parser/CSSParserImpl.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (233519 => 233520)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-07-05 14:56:13 UTC (rev 233519)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-07-05 15:46:25 UTC (rev 233520)
@@ -4745,6 +4745,7 @@
E4946EAF156E64DD00D3297F /* StyleRuleImport.h in Headers */ = {isa = PBXBuildFile; fileRef = E4946EAD156E64DD00D3297F /* StyleRuleImport.h */; settings = {ATTRIBUTES = (Private, ); }; };
E49BD9FA131FD2ED003C56F0 /* CSSValuePool.h in Headers */ = {isa = PBXBuildFile; fileRef = E49BD9F9131FD2ED003C56F0 /* CSSValuePool.h */; };
E4A007831B820EC8002C5A6E /* DataURLDecoder.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A007821B820EC8002C5A6E /* DataURLDecoder.h */; };
+ E4A7995220EE4B1400C19568 /* CSSParserContext.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A7994E20EE4AE100C19568 /* CSSParserContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
E4A814D41C6DEC4000BF85AC /* ClassChangeInvalidation.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A814D31C6DEC4000BF85AC /* ClassChangeInvalidation.h */; };
E4A814DA1C70E10D00BF85AC /* AttributeChangeInvalidation.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A814D91C70E10D00BF85AC /* AttributeChangeInvalidation.h */; };
E4A814E01C7338EB00BF85AC /* IdChangeInvalidation.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A814DF1C7338EB00BF85AC /* IdChangeInvalidation.h */; };
@@ -10844,7 +10845,7 @@
9B6C41521344949000085B62 /* StringWithDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringWithDirection.h; sourceTree = "<group>"; };
9B714E1E1C91166900AC0E92 /* EventPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventPath.cpp; sourceTree = "<group>"; };
9B714E1F1C91166900AC0E92 /* EventPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventPath.h; sourceTree = "<group>"; };
- 9B85530520E733B5009EEF4F /* EventTargetFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EventTargetFactory.cpp; path = EventTargetFactory.cpp; sourceTree = "<group>"; };
+ 9B85530520E733B5009EEF4F /* EventTargetFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventTargetFactory.cpp; sourceTree = "<group>"; };
9B9299B01F6796A4006723C2 /* WebContentReaderCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContentReaderCocoa.mm; sourceTree = "<group>"; };
9BA273F3172206BB0097CE47 /* LogicalSelectionOffsetCaches.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogicalSelectionOffsetCaches.h; sourceTree = "<group>"; };
9BA827781F06156500F71E75 /* NavigationDisabler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavigationDisabler.h; sourceTree = "<group>"; };
@@ -14402,6 +14403,8 @@
E4A007821B820EC8002C5A6E /* DataURLDecoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataURLDecoder.h; sourceTree = "<group>"; };
E4A007841B820ED3002C5A6E /* DataURLDecoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DataURLDecoder.cpp; sourceTree = "<group>"; };
E4A1822F1F13BE5800FEF698 /* StyleInvalidationFunctions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StyleInvalidationFunctions.h; sourceTree = "<group>"; };
+ E4A7994E20EE4AE100C19568 /* CSSParserContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSParserContext.h; path = parser/CSSParserContext.h; sourceTree = "<group>"; };
+ E4A7995020EE4AE200C19568 /* CSSParserContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSParserContext.cpp; path = parser/CSSParserContext.cpp; sourceTree = "<group>"; };
E4A814D31C6DEC4000BF85AC /* ClassChangeInvalidation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClassChangeInvalidation.h; sourceTree = "<group>"; };
E4A814D51C6DEE8D00BF85AC /* ClassChangeInvalidation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ClassChangeInvalidation.cpp; sourceTree = "<group>"; };
E4A814D71C70E10500BF85AC /* AttributeChangeInvalidation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AttributeChangeInvalidation.cpp; sourceTree = "<group>"; };
@@ -20804,6 +20807,8 @@
94476BD91DFCA4A700690E23 /* CSSDeferredParser.h */,
946D37281D6CB28B0077084F /* CSSParser.cpp */,
946D37291D6CB28B0077084F /* CSSParser.h */,
+ E4A7995020EE4AE200C19568 /* CSSParserContext.cpp */,
+ E4A7994E20EE4AE100C19568 /* CSSParserContext.h */,
949C76FE1D6E1D8C00C0DE4F /* CSSParserFastPaths.cpp */,
949C76FF1D6E1D8C00C0DE4F /* CSSParserFastPaths.h */,
94DE5C7D1D78CB2500164F2A /* CSSParserIdioms.cpp */,
@@ -28789,6 +28794,7 @@
75793EC90D0CE72D007FC0AC /* JSMessageEvent.h in Headers */,
E1ADEDDA0E76BD93004A1A5E /* JSMessagePort.h in Headers */,
A86629D109DA2B48009633A5 /* JSMouseEvent.h in Headers */,
+ E4A7995220EE4B1400C19568 /* CSSParserContext.h in Headers */,
830A36BD1DAC5FAD006D7D09 /* JSMouseEventInit.h in Headers */,
65DF31FC09D1CC60000BE325 /* JSMutationEvent.h in Headers */,
C6F0902D14327D4F00685849 /* JSMutationObserver.h in Headers */,
Modified: trunk/Source/WebCore/contentextensions/ContentExtensionParser.cpp (233519 => 233520)
--- trunk/Source/WebCore/contentextensions/ContentExtensionParser.cpp 2018-07-05 14:56:13 UTC (rev 233519)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionParser.cpp 2018-07-05 15:46:25 UTC (rev 233520)
@@ -29,7 +29,6 @@
#if ENABLE(CONTENT_EXTENSIONS)
#include "CSSParser.h"
-#include "CSSParserMode.h"
#include "CSSSelectorList.h"
#include "ContentExtensionError.h"
#include "ContentExtensionRule.h"
Modified: trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.h (233519 => 233520)
--- trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.h 2018-07-05 14:56:13 UTC (rev 233519)
+++ trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.h 2018-07-05 15:46:25 UTC (rev 233520)
@@ -25,7 +25,7 @@
#pragma once
-#include "CSSParserMode.h"
+#include "CSSParserContext.h"
#include "CSSStyleDeclaration.h"
#include "DeprecatedCSSOMValue.h"
#include <memory>
Modified: trunk/Source/WebCore/css/StyleProperties.h (233519 => 233520)
--- trunk/Source/WebCore/css/StyleProperties.h 2018-07-05 14:56:13 UTC (rev 233519)
+++ trunk/Source/WebCore/css/StyleProperties.h 2018-07-05 15:46:25 UTC (rev 233520)
@@ -21,7 +21,7 @@
#pragma once
-#include "CSSParserMode.h"
+#include "CSSParserContext.h"
#include "CSSParserTokenRange.h"
#include "CSSProperty.h"
#include "CSSValueKeywords.h"
Modified: trunk/Source/WebCore/css/StyleSheetContents.h (233519 => 233520)
--- trunk/Source/WebCore/css/StyleSheetContents.h 2018-07-05 14:56:13 UTC (rev 233519)
+++ trunk/Source/WebCore/css/StyleSheetContents.h 2018-07-05 15:46:25 UTC (rev 233520)
@@ -20,7 +20,7 @@
#pragma once
-#include "CSSParserMode.h"
+#include "CSSParserContext.h"
#include "CachePolicy.h"
#include "URL.h"
#include <wtf/Function.h>
Modified: trunk/Source/WebCore/css/parser/CSSDeferredParser.h (233519 => 233520)
--- trunk/Source/WebCore/css/parser/CSSDeferredParser.h 2018-07-05 14:56:13 UTC (rev 233519)
+++ trunk/Source/WebCore/css/parser/CSSDeferredParser.h 2018-07-05 15:46:25 UTC (rev 233520)
@@ -25,7 +25,7 @@
#pragma once
-#include "CSSParserMode.h"
+#include "CSSParserContext.h"
#include <wtf/RefCounted.h>
#include <wtf/WeakPtr.h>
Modified: trunk/Source/WebCore/css/parser/CSSParser.cpp (233519 => 233520)
--- trunk/Source/WebCore/css/parser/CSSParser.cpp 2018-07-05 14:56:13 UTC (rev 233519)
+++ trunk/Source/WebCore/css/parser/CSSParser.cpp 2018-07-05 15:46:25 UTC (rev 233520)
@@ -50,76 +50,9 @@
#include <wtf/NeverDestroyed.h>
#include <wtf/text/StringBuilder.h>
-
namespace WebCore {
using namespace WTF;
-const CSSParserContext& strictCSSParserContext()
-{
- static NeverDestroyed<CSSParserContext> strictContext(HTMLStandardMode);
- return strictContext;
-}
-
-CSSParserContext::CSSParserContext(CSSParserMode mode, const URL& baseURL)
- : baseURL(baseURL)
- , mode(mode)
-{
-#if PLATFORM(IOS)
- // FIXME: Force the site specific quirk below to work on iOS. Investigating other site specific quirks
- // to see if we can enable the preference all together is to be handled by:
- // <rdar://problem/8493309> Investigate Enabling Site Specific Quirks in MobileSafari and UIWebView
- needsSiteSpecificQuirks = true;
-#endif
-}
-
-CSSParserContext::CSSParserContext(Document& document, const URL& sheetBaseURL, const String& charset)
- : baseURL(sheetBaseURL.isNull() ? document.baseURL() : sheetBaseURL)
- , charset(charset)
- , mode(document.inQuirksMode() ? HTMLQuirksMode : HTMLStandardMode)
- , isHTMLDocument(document.isHTMLDocument())
- , hasDocumentSecurityOrigin(sheetBaseURL.isNull() || document.securityOrigin().canRequest(baseURL))
-{
-
- needsSiteSpecificQuirks = document.settings().needsSiteSpecificQuirks();
- enforcesCSSMIMETypeInNoQuirksMode = document.settings().enforceCSSMIMETypeInNoQuirksMode();
- useLegacyBackgroundSizeShorthandBehavior = document.settings().useLegacyBackgroundSizeShorthandBehavior();
-#if ENABLE(TEXT_AUTOSIZING)
- textAutosizingEnabled = document.settings().textAutosizingEnabled();
-#endif
- springTimingFunctionEnabled = document.settings().springTimingFunctionEnabled();
- constantPropertiesEnabled = document.settings().constantPropertiesEnabled();
- conicGradientsEnabled = document.settings().conicGradientsEnabled();
- colorFilterEnabled = document.settings().colorFilterEnabled();
- deferredCSSParserEnabled = document.settings().deferredCSSParserEnabled();
- allowNewLinesClamp = document.settings().appleMailLinesClampEnabled();
- useSystemAppearance = document.page() ? document.page()->useSystemAppearance() : false;
-
-#if PLATFORM(IOS)
- // FIXME: Force the site specific quirk below to work on iOS. Investigating other site specific quirks
- // to see if we can enable the preference all together is to be handled by:
- // <rdar://problem/8493309> Investigate Enabling Site Specific Quirks in MobileSafari and UIWebView
- needsSiteSpecificQuirks = true;
-#endif
-}
-
-bool operator==(const CSSParserContext& a, const CSSParserContext& b)
-{
- return a.baseURL == b.baseURL
- && a.charset == b.charset
- && a.mode == b.mode
- && a.isHTMLDocument == b.isHTMLDocument
- && a.needsSiteSpecificQuirks == b.needsSiteSpecificQuirks
- && a.enforcesCSSMIMETypeInNoQuirksMode == b.enforcesCSSMIMETypeInNoQuirksMode
- && a.useLegacyBackgroundSizeShorthandBehavior == b.useLegacyBackgroundSizeShorthandBehavior
- && a.springTimingFunctionEnabled == b.springTimingFunctionEnabled
- && a.constantPropertiesEnabled == b.constantPropertiesEnabled
- && a.conicGradientsEnabled == b.conicGradientsEnabled
- && a.colorFilterEnabled == b.colorFilterEnabled
- && a.deferredCSSParserEnabled == b.deferredCSSParserEnabled
- && a.hasDocumentSecurityOrigin == b.hasDocumentSecurityOrigin
- && a.useSystemAppearance == b.useSystemAppearance;
-}
-
CSSParser::CSSParser(const CSSParserContext& context)
: m_context(context)
{
Modified: trunk/Source/WebCore/css/parser/CSSParser.h (233519 => 233520)
--- trunk/Source/WebCore/css/parser/CSSParser.h 2018-07-05 14:56:13 UTC (rev 233519)
+++ trunk/Source/WebCore/css/parser/CSSParser.h 2018-07-05 15:46:25 UTC (rev 233520)
@@ -22,7 +22,7 @@
#pragma once
-#include "CSSParserMode.h"
+#include "CSSParserContext.h"
#include "CSSValue.h"
#include "WritingMode.h"
#include <wtf/text/WTFString.h>
Added: trunk/Source/WebCore/css/parser/CSSParserContext.cpp (0 => 233520)
--- trunk/Source/WebCore/css/parser/CSSParserContext.cpp (rev 0)
+++ trunk/Source/WebCore/css/parser/CSSParserContext.cpp 2018-07-05 15:46:25 UTC (rev 233520)
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CSSParserContext.h"
+
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+const CSSParserContext& strictCSSParserContext()
+{
+ static NeverDestroyed<CSSParserContext> strictContext(HTMLStandardMode);
+ return strictContext;
+}
+
+CSSParserContext::CSSParserContext(CSSParserMode mode, const URL& baseURL)
+ : baseURL(baseURL)
+ , mode(mode)
+{
+#if PLATFORM(IOS)
+ // FIXME: Force the site specific quirk below to work on iOS. Investigating other site specific quirks
+ // to see if we can enable the preference all together is to be handled by:
+ // <rdar://problem/8493309> Investigate Enabling Site Specific Quirks in MobileSafari and UIWebView
+ needsSiteSpecificQuirks = true;
+#endif
+}
+
+CSSParserContext::CSSParserContext(Document& document, const URL& sheetBaseURL, const String& charset)
+ : baseURL(sheetBaseURL.isNull() ? document.baseURL() : sheetBaseURL)
+ , charset(charset)
+ , mode(document.inQuirksMode() ? HTMLQuirksMode : HTMLStandardMode)
+ , isHTMLDocument(document.isHTMLDocument())
+ , hasDocumentSecurityOrigin(sheetBaseURL.isNull() || document.securityOrigin().canRequest(baseURL))
+{
+
+ needsSiteSpecificQuirks = document.settings().needsSiteSpecificQuirks();
+ enforcesCSSMIMETypeInNoQuirksMode = document.settings().enforceCSSMIMETypeInNoQuirksMode();
+ useLegacyBackgroundSizeShorthandBehavior = document.settings().useLegacyBackgroundSizeShorthandBehavior();
+#if ENABLE(TEXT_AUTOSIZING)
+ textAutosizingEnabled = document.settings().textAutosizingEnabled();
+#endif
+ springTimingFunctionEnabled = document.settings().springTimingFunctionEnabled();
+ constantPropertiesEnabled = document.settings().constantPropertiesEnabled();
+ conicGradientsEnabled = document.settings().conicGradientsEnabled();
+ colorFilterEnabled = document.settings().colorFilterEnabled();
+ deferredCSSParserEnabled = document.settings().deferredCSSParserEnabled();
+ allowNewLinesClamp = document.settings().appleMailLinesClampEnabled();
+ useSystemAppearance = document.page() ? document.page()->useSystemAppearance() : false;
+
+#if PLATFORM(IOS)
+ // FIXME: Force the site specific quirk below to work on iOS. Investigating other site specific quirks
+ // to see if we can enable the preference all together is to be handled by:
+ // <rdar://problem/8493309> Investigate Enabling Site Specific Quirks in MobileSafari and UIWebView
+ needsSiteSpecificQuirks = true;
+#endif
+}
+
+bool operator==(const CSSParserContext& a, const CSSParserContext& b)
+{
+ return a.baseURL == b.baseURL
+ && a.charset == b.charset
+ && a.mode == b.mode
+ && a.isHTMLDocument == b.isHTMLDocument
+#if ENABLE(TEXT_AUTOSIZING)
+ && a.textAutosizingEnabled == b.textAutosizingEnabled
+#endif
+ && a.needsSiteSpecificQuirks == b.needsSiteSpecificQuirks
+ && a.enforcesCSSMIMETypeInNoQuirksMode == b.enforcesCSSMIMETypeInNoQuirksMode
+ && a.useLegacyBackgroundSizeShorthandBehavior == b.useLegacyBackgroundSizeShorthandBehavior
+ && a.springTimingFunctionEnabled == b.springTimingFunctionEnabled
+ && a.constantPropertiesEnabled == b.constantPropertiesEnabled
+ && a.conicGradientsEnabled == b.conicGradientsEnabled
+ && a.colorFilterEnabled == b.colorFilterEnabled
+ && a.deferredCSSParserEnabled == b.deferredCSSParserEnabled
+ && a.hasDocumentSecurityOrigin == b.hasDocumentSecurityOrigin
+ && a.useSystemAppearance == b.useSystemAppearance;
+}
+
+}
Added: trunk/Source/WebCore/css/parser/CSSParserContext.h (0 => 233520)
--- trunk/Source/WebCore/css/parser/CSSParserContext.h (rev 0)
+++ trunk/Source/WebCore/css/parser/CSSParserContext.h 2018-07-05 15:46:25 UTC (rev 233520)
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "CSSParserMode.h"
+#include "TextEncoding.h"
+#include "URL.h"
+#include "URLHash.h"
+#include <wtf/HashFunctions.h>
+#include <wtf/text/StringHash.h>
+
+namespace WebCore {
+
+class Document;
+
+struct CSSParserContext {
+ WTF_MAKE_FAST_ALLOCATED;
+public:
+ CSSParserContext(CSSParserMode, const URL& baseURL = URL());
+ WEBCORE_EXPORT CSSParserContext(Document&, const URL& baseURL = URL(), const String& charset = emptyString());
+
+ URL baseURL;
+ String charset;
+ CSSParserMode mode { HTMLStandardMode };
+ bool isHTMLDocument { false };
+#if ENABLE(TEXT_AUTOSIZING)
+ bool textAutosizingEnabled { false };
+#endif
+ bool needsSiteSpecificQuirks { false };
+ bool enforcesCSSMIMETypeInNoQuirksMode { true };
+ bool useLegacyBackgroundSizeShorthandBehavior { false };
+ bool springTimingFunctionEnabled { false };
+ bool constantPropertiesEnabled { false };
+ bool conicGradientsEnabled { false };
+ bool colorFilterEnabled { false };
+ bool deferredCSSParserEnabled { false };
+ bool allowNewLinesClamp { false };
+
+ // This is only needed to support getMatchedCSSRules.
+ bool hasDocumentSecurityOrigin { false };
+
+ bool useSystemAppearance { false };
+
+ URL completeURL(const String& url) const
+ {
+ if (url.isNull())
+ return URL();
+ if (charset.isEmpty())
+ return URL(baseURL, url);
+ return URL(baseURL, url, TextEncoding(charset));
+ }
+};
+
+bool operator==(const CSSParserContext&, const CSSParserContext&);
+inline bool operator!=(const CSSParserContext& a, const CSSParserContext& b) { return !(a == b); }
+
+WEBCORE_EXPORT const CSSParserContext& strictCSSParserContext();
+
+struct CSSParserContextHash {
+ static unsigned hash(const CSSParserContext& key)
+ {
+ auto hash = URLHash::hash(key.baseURL);
+ if (!key.charset.isEmpty())
+ hash ^= StringHash::hash(key.charset);
+ unsigned bits = key.isHTMLDocument << 0
+#if ENABLE(TEXT_AUTOSIZING)
+ & key.textAutosizingEnabled << 1
+#endif
+ & key.needsSiteSpecificQuirks << 2
+ & key.enforcesCSSMIMETypeInNoQuirksMode << 3
+ & key.useLegacyBackgroundSizeShorthandBehavior << 4
+ & key.springTimingFunctionEnabled << 5
+ & key.constantPropertiesEnabled << 6
+ & key.conicGradientsEnabled << 7
+ & key.colorFilterEnabled << 8
+ & key.deferredCSSParserEnabled << 9
+ & key.allowNewLinesClamp << 10
+ & key.hasDocumentSecurityOrigin << 11
+ & key.useSystemAppearance << 12
+ & key.mode << 13; // Keep this last.
+ hash ^= WTF::intHash(bits);
+ return hash;
+ }
+ static bool equal(const CSSParserContext& a, const CSSParserContext& b)
+ {
+ return a == b;
+ }
+ static const bool safeToCompareToEmptyOrDeleted = false;
+};
+
+} // namespace WebCore
+
+namespace WTF {
+template<> struct HashTraits<WebCore::CSSParserContext> : GenericHashTraits<WebCore::CSSParserContext> {
+ static void constructDeletedValue(WebCore::CSSParserContext& slot) { new (NotNull, &slot.baseURL) WebCore::URL(WTF::HashTableDeletedValue); }
+ static bool isDeletedValue(const WebCore::CSSParserContext& value) { return value.baseURL.isHashTableDeletedValue(); }
+ static WebCore::CSSParserContext emptyValue() { return WebCore::CSSParserContext(WebCore::HTMLStandardMode); }
+};
+
+template<> struct DefaultHash<WebCore::CSSParserContext> {
+ typedef WebCore::CSSParserContextHash Hash;
+};
+} // namespace WTF
Modified: trunk/Source/WebCore/css/parser/CSSParserIdioms.h (233519 => 233520)
--- trunk/Source/WebCore/css/parser/CSSParserIdioms.h 2018-07-05 14:56:13 UTC (rev 233519)
+++ trunk/Source/WebCore/css/parser/CSSParserIdioms.h 2018-07-05 15:46:25 UTC (rev 233520)
@@ -31,7 +31,7 @@
#pragma once
-#include "CSSParserMode.h"
+#include "CSSParserContext.h"
#include <wtf/ASCIICType.h>
namespace WebCore {
Modified: trunk/Source/WebCore/css/parser/CSSParserImpl.h (233519 => 233520)
--- trunk/Source/WebCore/css/parser/CSSParserImpl.h 2018-07-05 14:56:13 UTC (rev 233519)
+++ trunk/Source/WebCore/css/parser/CSSParserImpl.h 2018-07-05 15:46:25 UTC (rev 233520)
@@ -31,7 +31,6 @@
#include "CSSDeferredParser.h"
#include "CSSParser.h"
-#include "CSSParserMode.h"
#include "CSSParserTokenRange.h"
#include "CSSPropertyNames.h"
#include "StyleRule.h"
Modified: trunk/Source/WebCore/css/parser/CSSParserMode.h (233519 => 233520)
--- trunk/Source/WebCore/css/parser/CSSParserMode.h 2018-07-05 14:56:13 UTC (rev 233519)
+++ trunk/Source/WebCore/css/parser/CSSParserMode.h 2018-07-05 15:46:25 UTC (rev 233520)
@@ -30,16 +30,8 @@
#pragma once
-#include "TextEncoding.h"
-#include "URL.h"
-#include "URLHash.h"
-#include <wtf/HashFunctions.h>
-#include <wtf/text/StringHash.h>
-
namespace WebCore {
-class Document;
-
// Must not grow beyond 3 bits, due to packing in StyleProperties.
enum CSSParserMode {
HTMLStandardMode,
@@ -86,89 +78,4 @@
return cssParserMode == UASheetMode || cssParserMode == HTMLStandardMode || cssParserMode == SVGAttributeMode;
}
-struct CSSParserContext {
- WTF_MAKE_FAST_ALLOCATED;
-public:
- CSSParserContext(CSSParserMode, const URL& baseURL = URL());
- WEBCORE_EXPORT CSSParserContext(Document&, const URL& baseURL = URL(), const String& charset = emptyString());
-
- URL baseURL;
- String charset;
- CSSParserMode mode { HTMLStandardMode };
- bool isHTMLDocument { false };
-#if ENABLE(TEXT_AUTOSIZING)
- bool textAutosizingEnabled { false };
-#endif
- bool needsSiteSpecificQuirks { false };
- bool enforcesCSSMIMETypeInNoQuirksMode { true };
- bool useLegacyBackgroundSizeShorthandBehavior { false };
- bool springTimingFunctionEnabled { false };
- bool constantPropertiesEnabled { false };
- bool conicGradientsEnabled { false };
- bool colorFilterEnabled { false };
- bool deferredCSSParserEnabled { false };
- bool allowNewLinesClamp { false };
-
- // This is only needed to support getMatchedCSSRules.
- bool hasDocumentSecurityOrigin { false };
-
- bool useSystemAppearance { false };
-
- URL completeURL(const String& url) const
- {
- if (url.isNull())
- return URL();
- if (charset.isEmpty())
- return URL(baseURL, url);
- return URL(baseURL, url, TextEncoding(charset));
- }
-};
-
-bool operator==(const CSSParserContext&, const CSSParserContext&);
-inline bool operator!=(const CSSParserContext& a, const CSSParserContext& b) { return !(a == b); }
-
-WEBCORE_EXPORT const CSSParserContext& strictCSSParserContext();
-
-struct CSSParserContextHash {
- static unsigned hash(const CSSParserContext& key)
- {
- auto hash = URLHash::hash(key.baseURL);
- if (!key.charset.isEmpty())
- hash ^= StringHash::hash(key.charset);
- unsigned bits = key.isHTMLDocument << 0
- & key.isHTMLDocument << 1
-#if ENABLE(TEXT_AUTOSIZING)
- & key.textAutosizingEnabled << 2
-#endif
- & key.needsSiteSpecificQuirks << 3
- & key.enforcesCSSMIMETypeInNoQuirksMode << 4
- & key.useLegacyBackgroundSizeShorthandBehavior << 5
- & key.springTimingFunctionEnabled << 6
- & key.conicGradientsEnabled << 7
- & key.deferredCSSParserEnabled << 8
- & key.hasDocumentSecurityOrigin << 9
- & key.mode << 10
- & key.allowNewLinesClamp << 11;
- hash ^= WTF::intHash(bits);
- return hash;
- }
- static bool equal(const CSSParserContext& a, const CSSParserContext& b)
- {
- return a == b;
- }
- static const bool safeToCompareToEmptyOrDeleted = false;
-};
-
} // namespace WebCore
-
-namespace WTF {
-template<> struct HashTraits<WebCore::CSSParserContext> : GenericHashTraits<WebCore::CSSParserContext> {
- static void constructDeletedValue(WebCore::CSSParserContext& slot) { new (NotNull, &slot.baseURL) WebCore::URL(WTF::HashTableDeletedValue); }
- static bool isDeletedValue(const WebCore::CSSParserContext& value) { return value.baseURL.isHashTableDeletedValue(); }
- static WebCore::CSSParserContext emptyValue() { return WebCore::CSSParserContext(WebCore::HTMLStandardMode); }
-};
-
-template<> struct DefaultHash<WebCore::CSSParserContext> {
- typedef WebCore::CSSParserContextHash Hash;
-};
-} // namespace WTF
Modified: trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.h (233519 => 233520)
--- trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.h 2018-07-05 14:56:13 UTC (rev 233519)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.h 2018-07-05 15:46:25 UTC (rev 233520)
@@ -30,7 +30,7 @@
#pragma once
#include "CSSFunctionValue.h"
-#include "CSSParserMode.h"
+#include "CSSParserContext.h"
#include "CSSParserTokenRange.h"
#include "CSSPrimitiveValue.h"
#include "CSSShadowValue.h"
Modified: trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp (233519 => 233520)
--- trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp 2018-07-05 14:56:13 UTC (rev 233519)
+++ trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp 2018-07-05 15:46:25 UTC (rev 233520)
@@ -30,7 +30,7 @@
#include "config.h"
#include "CSSSelectorParser.h"
-#include "CSSParserMode.h"
+#include "CSSParserContext.h"
#include "CSSSelectorList.h"
#include "StyleSheetContents.h"
#include <memory>
Modified: trunk/Source/WebCore/css/parser/CSSVariableParser.cpp (233519 => 233520)
--- trunk/Source/WebCore/css/parser/CSSVariableParser.cpp 2018-07-05 14:56:13 UTC (rev 233519)
+++ trunk/Source/WebCore/css/parser/CSSVariableParser.cpp 2018-07-05 15:46:25 UTC (rev 233520)
@@ -31,7 +31,7 @@
#include "CSSVariableParser.h"
#include "CSSCustomPropertyValue.h"
-#include "CSSParserMode.h"
+#include "CSSParserContext.h"
#include "CSSParserTokenRange.h"
namespace WebCore {