Diff
Modified: trunk/Source/WebCore/CMakeLists.txt (207902 => 207903)
--- trunk/Source/WebCore/CMakeLists.txt 2016-10-26 17:43:47 UTC (rev 207902)
+++ trunk/Source/WebCore/CMakeLists.txt 2016-10-26 17:44:12 UTC (rev 207903)
@@ -1269,7 +1269,6 @@
css/CSSCrossfadeValue.cpp
css/CSSCursorImageValue.cpp
css/CSSCustomIdentValue.cpp
- css/CSSCustomPropertyDeclaration.cpp
css/CSSDefaultStyleSheets.cpp
css/CSSFilterImageValue.cpp
css/FontFaceSet.cpp
Modified: trunk/Source/WebCore/ChangeLog (207902 => 207903)
--- trunk/Source/WebCore/ChangeLog 2016-10-26 17:43:47 UTC (rev 207902)
+++ trunk/Source/WebCore/ChangeLog 2016-10-26 17:44:12 UTC (rev 207903)
@@ -1,3 +1,43 @@
+2016-10-26 Dave Hyatt <[email protected]>
+
+ [CSS Parser] Unify CSSCustomPropertyValue and CSSCustomPropertyDeclaration
+ https://bugs.webkit.org/show_bug.cgi?id=164019
+
+ Reviewed by Zalan Bujtas.
+
+ * CMakeLists.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * css/CSSCustomPropertyDeclaration.cpp: Removed.
+ * css/CSSCustomPropertyDeclaration.h: Removed.
+ Get rid of CSSCustomPropertyDeclaration.
+
+ * css/CSSCustomPropertyValue.h:
+ Add new constructors to handle the new variable data format (either a CSSValueId or a
+ CSSVariableData object that holds parser tokens).
+
+ * css/CSSValue.cpp:
+ (WebCore::CSSValue::cssText):
+ (WebCore::CSSValue::destroy):
+ * css/CSSValue.h:
+ (WebCore::CSSValue::isCustomPropertyDeclaration): Deleted.
+ Get rid of CSSCustomPropertyDeclaration cases.
+
+ * css/CSSVariableData.h:
+ Switch to CSSCustomPropertyValue.
+
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::applyProperty):
+ We've renamed the old parser variable data to deprecatedValue to make it clear it's going
+ to be removed eventually.
+
+ * css/parser/CSSParserImpl.cpp:
+ (WebCore::filterProperties):
+ (WebCore::CSSParserImpl::consumeVariableValue):
+ * css/parser/CSSVariableParser.cpp:
+ (WebCore::CSSVariableParser::parseDeclarationValue):
+ * css/parser/CSSVariableParser.h:
+ Switch to CSSCustomPropertyValue.
+
2016-10-26 Youenn Fablet <[email protected]>
Enable SDPProcessor for Mac bots
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (207902 => 207903)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-10-26 17:43:47 UTC (rev 207902)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-10-26 17:44:12 UTC (rev 207903)
@@ -3421,8 +3421,6 @@
9444CBDA1D88483A0073A074 /* CSSVariableParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 9444CBD71D88482A0073A074 /* CSSVariableParser.h */; };
9444CBE31D8861980073A074 /* CSSCustomIdentValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9444CBE21D8861580073A074 /* CSSCustomIdentValue.cpp */; };
9444CBE41D8861990073A074 /* CSSCustomIdentValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9444CBE11D8861580073A074 /* CSSCustomIdentValue.h */; };
- 9444CBE51D8861990073A074 /* CSSCustomPropertyDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9444CBE01D8861580073A074 /* CSSCustomPropertyDeclaration.cpp */; };
- 9444CBE61D8861990073A074 /* CSSCustomPropertyDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = 9444CBDF1D8861580073A074 /* CSSCustomPropertyDeclaration.h */; };
9444CBE71D8861C20073A074 /* CSSVariableData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9444CBDE1D8861580073A074 /* CSSVariableData.cpp */; };
9444CBE81D8861C20073A074 /* CSSVariableData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9444CBDD1D8861580073A074 /* CSSVariableData.h */; };
9444CBE91D8861CA0073A074 /* CSSVariableReferenceValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9444CBDC1D8861580073A074 /* CSSVariableReferenceValue.cpp */; };
@@ -9436,8 +9434,8 @@
5739E1301DAC7FD100E14383 /* JSCryptoAlgorithmParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCryptoAlgorithmParameters.cpp; sourceTree = "<group>"; };
574AC7531DAC367D00E9744C /* CryptoAlgorithmParameters.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CryptoAlgorithmParameters.idl; sourceTree = "<group>"; };
574D42791D594FF6002CF50E /* GlobalCrypto.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GlobalCrypto.idl; sourceTree = "<group>"; };
- 5768E4331DB7524500D0A4F7 /* JSRsaHashedKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSRsaHashedKeyGenParams.h; path = JSRsaHashedKeyGenParams.h; sourceTree = "<group>"; };
- 5768E4351DB7527300D0A4F7 /* JSRsaHashedKeyGenParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSRsaHashedKeyGenParams.cpp; path = JSRsaHashedKeyGenParams.cpp; sourceTree = "<group>"; };
+ 5768E4331DB7524500D0A4F7 /* JSRsaHashedKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRsaHashedKeyGenParams.h; sourceTree = "<group>"; };
+ 5768E4351DB7527300D0A4F7 /* JSRsaHashedKeyGenParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRsaHashedKeyGenParams.cpp; sourceTree = "<group>"; };
577483101DADC49900716EF9 /* AesKeyGenParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = AesKeyGenParams.idl; sourceTree = "<group>"; };
577483111DADC55D00716EF9 /* CryptoAlgorithmAesKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmAesKeyGenParams.h; sourceTree = "<group>"; };
577483131DAEC2EA00716EF9 /* JSAesKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAesKeyGenParams.h; sourceTree = "<group>"; };
@@ -10814,8 +10812,6 @@
9444CBDC1D8861580073A074 /* CSSVariableReferenceValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSVariableReferenceValue.cpp; sourceTree = "<group>"; };
9444CBDD1D8861580073A074 /* CSSVariableData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSVariableData.h; sourceTree = "<group>"; };
9444CBDE1D8861580073A074 /* CSSVariableData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSVariableData.cpp; sourceTree = "<group>"; };
- 9444CBDF1D8861580073A074 /* CSSCustomPropertyDeclaration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSCustomPropertyDeclaration.h; sourceTree = "<group>"; };
- 9444CBE01D8861580073A074 /* CSSCustomPropertyDeclaration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSCustomPropertyDeclaration.cpp; sourceTree = "<group>"; };
9444CBE11D8861580073A074 /* CSSCustomIdentValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSCustomIdentValue.h; sourceTree = "<group>"; };
9444CBE21D8861580073A074 /* CSSCustomIdentValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSCustomIdentValue.cpp; sourceTree = "<group>"; };
946D37281D6CB28B0077084F /* CSSParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSParser.cpp; path = parser/CSSParser.cpp; sourceTree = "<group>"; };
@@ -22863,8 +22859,6 @@
AA0978EE0ABAA6E100874480 /* CSSCursorImageValue.h */,
9444CBE21D8861580073A074 /* CSSCustomIdentValue.cpp */,
9444CBE11D8861580073A074 /* CSSCustomIdentValue.h */,
- 9444CBE01D8861580073A074 /* CSSCustomPropertyDeclaration.cpp */,
- 9444CBDF1D8861580073A074 /* CSSCustomPropertyDeclaration.h */,
BC779E131BB215BB00CAA8BF /* CSSCustomPropertyValue.h */,
4A9CC81516BB9AC600EC645A /* CSSDefaultStyleSheets.cpp */,
4A9CC81616BB9AC600EC645A /* CSSDefaultStyleSheets.h */,
@@ -24706,7 +24700,6 @@
2D8FEBDD143E3EF70072502B /* CSSCrossfadeValue.h in Headers */,
AA21ECCD0ABF0FC6002B834C /* CSSCursorImageValue.h in Headers */,
9444CBE41D8861990073A074 /* CSSCustomIdentValue.h in Headers */,
- 9444CBE61D8861990073A074 /* CSSCustomPropertyDeclaration.h in Headers */,
BC779E141BB215BB00CAA8BF /* CSSCustomPropertyValue.h in Headers */,
4A9CC81816BB9AC600EC645A /* CSSDefaultStyleSheets.h in Headers */,
FBB0C5B817BBD629003D3677 /* CSSFilterImageValue.h in Headers */,
@@ -28481,7 +28474,6 @@
2D8FEBDC143E3EF70072502B /* CSSCrossfadeValue.cpp in Sources */,
AA21ECCA0ABF0FBA002B834C /* CSSCursorImageValue.cpp in Sources */,
9444CBE31D8861980073A074 /* CSSCustomIdentValue.cpp in Sources */,
- 9444CBE51D8861990073A074 /* CSSCustomPropertyDeclaration.cpp in Sources */,
4A9CC81716BB9AC600EC645A /* CSSDefaultStyleSheets.cpp in Sources */,
FBB0C5B717BBD626003D3677 /* CSSFilterImageValue.cpp in Sources */,
BC64B4D50CB4298A005F2B62 /* CSSFontFace.cpp in Sources */,
Deleted: trunk/Source/WebCore/css/CSSCustomPropertyDeclaration.cpp (207902 => 207903)
--- trunk/Source/WebCore/css/CSSCustomPropertyDeclaration.cpp 2016-10-26 17:43:47 UTC (rev 207902)
+++ trunk/Source/WebCore/css/CSSCustomPropertyDeclaration.cpp 2016-10-26 17:44:12 UTC (rev 207903)
@@ -1,45 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Copyright (C) 2016 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:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
-// OWNER OR 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 "CSSCustomPropertyDeclaration.h"
-
-#include "CSSParserTokenRange.h"
-
-namespace WebCore {
-
-String CSSCustomPropertyDeclaration::customCSSText() const
-{
- if (m_value)
- return m_value->tokenRange().serialize();
- ASSERT(m_valueId != CSSValueInternalVariableValue);
- return getValueName(m_valueId);
-}
-
-} // namespace WebCore
Deleted: trunk/Source/WebCore/css/CSSCustomPropertyDeclaration.h (207902 => 207903)
--- trunk/Source/WebCore/css/CSSCustomPropertyDeclaration.h 2016-10-26 17:43:47 UTC (rev 207902)
+++ trunk/Source/WebCore/css/CSSCustomPropertyDeclaration.h 2016-10-26 17:44:12 UTC (rev 207903)
@@ -1,83 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Copyright (C) 2016 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:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
-// OWNER OR 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 "CSSValue.h"
-#include "CSSVariableData.h"
-#include <wtf/RefPtr.h>
-#include <wtf/text/AtomicString.h>
-
-namespace WebCore {
-
-class CSSCustomPropertyDeclaration : public CSSValue {
-public:
- static Ref<CSSCustomPropertyDeclaration> create(const AtomicString& name, Ref<CSSVariableData>&& value)
- {
- return adoptRef(*new CSSCustomPropertyDeclaration(name, WTFMove(value)));
- }
-
- static Ref<CSSCustomPropertyDeclaration> create(const AtomicString& name, CSSValueID id)
- {
- return adoptRef(*new CSSCustomPropertyDeclaration(name, id));
- }
-
- const AtomicString& name() const { return m_name; }
- CSSVariableData* value() const { return m_value.get(); }
- CSSValueID id() const { return m_valueId; }
- String customCSSText() const;
-
- bool equals(const CSSCustomPropertyDeclaration& other) const { return this == &other; }
-
-private:
- CSSCustomPropertyDeclaration(const AtomicString& name, CSSValueID id)
- : CSSValue(CustomPropertyDeclarationClass)
- , m_name(name)
- , m_value(nullptr)
- , m_valueId(id)
- {
- ASSERT(id == CSSValueInherit || id == CSSValueInitial || id == CSSValueUnset || id == CSSValueRevert);
- }
-
- CSSCustomPropertyDeclaration(const AtomicString& name, Ref<CSSVariableData>&& value)
- : CSSValue(CustomPropertyDeclarationClass)
- , m_name(name)
- , m_value(WTFMove(value))
- , m_valueId(CSSValueInternalVariableValue)
- {
- }
-
- const AtomicString m_name;
- RefPtr<CSSVariableData> m_value;
- CSSValueID m_valueId;
-};
-
-} // namespace WebCore
-
-SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSCustomPropertyDeclaration, isCustomPropertyDeclaration())
Modified: trunk/Source/WebCore/css/CSSCustomPropertyValue.h (207902 => 207903)
--- trunk/Source/WebCore/css/CSSCustomPropertyValue.h 2016-10-26 17:43:47 UTC (rev 207902)
+++ trunk/Source/WebCore/css/CSSCustomPropertyValue.h 2016-10-26 17:44:12 UTC (rev 207903)
@@ -27,10 +27,10 @@
#define CSSCustomPropertyValue_h
#include "CSSValue.h"
+#include "CSSVariableData.h"
#include <wtf/RefPtr.h>
#include <wtf/text/WTFString.h>
-// FIXME-NEWPARSER: This will be removed in favor of CSSCustomPropertyDeclaration
namespace WebCore {
class CSSCustomPropertyValue final : public CSSValue {
@@ -40,6 +40,16 @@
return adoptRef(*new CSSCustomPropertyValue(name, WTFMove(value)));
}
+ static Ref<CSSCustomPropertyValue> createWithVariableData(const AtomicString& name, Ref<CSSVariableData>&& value)
+ {
+ return adoptRef(*new CSSCustomPropertyValue(name, WTFMove(value)));
+ }
+
+ static Ref<CSSCustomPropertyValue> createWithID(const AtomicString& name, CSSValueID value)
+ {
+ return adoptRef(*new CSSCustomPropertyValue(name, value));
+ }
+
static Ref<CSSCustomPropertyValue> createInvalid()
{
return adoptRef(*new CSSCustomPropertyValue(emptyString(), emptyString()));
@@ -49,7 +59,14 @@
{
if (!m_serialized) {
m_serialized = true;
- m_stringValue = m_value ? m_value->cssText() : emptyString();
+ if (m_deprecatedValue)
+ m_stringValue = m_deprecatedValue->cssText();
+ else if (m_value)
+ m_stringValue = m_value->tokenRange().serialize();
+ else if (m_valueId != CSSValueInvalid)
+ m_stringValue = getValueName(m_valueId);
+ else
+ m_stringValue = emptyString();
}
return m_stringValue;
}
@@ -56,21 +73,20 @@
const AtomicString& name() const { return m_name; }
- // FIXME: Should arguably implement equals on all of the CSSParserValues, but CSSValue equivalence
- // is rarely used, so serialization to compare is probably fine.
+ // FIXME: Should arguably implement equals on our internal values, but serialization to compare is probably fine.
bool equals(const CSSCustomPropertyValue& other) const { return m_name == other.m_name && customCSSText() == other.customCSSText(); }
bool isInvalid() const { return !m_value; }
bool containsVariables() const { return m_containsVariables; }
- const RefPtr<CSSValue> value() const { return m_value.get(); }
+ const RefPtr<CSSValue> deprecatedValue() const { return m_deprecatedValue.get(); }
private:
CSSCustomPropertyValue(const AtomicString& name, Ref<CSSValue>&& value)
: CSSValue(CustomPropertyClass)
, m_name(name)
- , m_value(WTFMove(value))
- , m_containsVariables(m_value->isVariableDependentValue())
+ , m_deprecatedValue(WTFMove(value))
+ , m_containsVariables(m_deprecatedValue->isVariableDependentValue())
, m_serialized(false)
{
}
@@ -83,8 +99,29 @@
{
}
+ CSSCustomPropertyValue(const AtomicString& name, CSSValueID id)
+ : CSSValue(CustomPropertyClass)
+ , m_name(name)
+ , m_valueId(id)
+ {
+ ASSERT(id == CSSValueInherit || id == CSSValueInitial || id == CSSValueUnset || id == CSSValueRevert);
+ }
+
+ CSSCustomPropertyValue(const AtomicString& name, Ref<CSSVariableData>&& value)
+ : CSSValue(CustomPropertyClass)
+ , m_name(name)
+ , m_value(WTFMove(value))
+ , m_valueId(CSSValueInternalVariableValue)
+ , m_containsVariables(m_value->needsVariableResolution())
+ {
+ }
+
const AtomicString m_name;
- RefPtr<CSSValue> m_value;
+
+ RefPtr<CSSValue> m_deprecatedValue; // Used by old parser
+ RefPtr<CSSVariableData> m_value; // Used by new parser.
+ CSSValueID m_valueId { CSSValueInvalid }; // Used by new parser.
+
mutable String m_stringValue;
bool m_containsVariables { false };
mutable bool m_serialized;
Modified: trunk/Source/WebCore/css/CSSValue.cpp (207902 => 207903)
--- trunk/Source/WebCore/css/CSSValue.cpp 2016-10-26 17:43:47 UTC (rev 207902)
+++ trunk/Source/WebCore/css/CSSValue.cpp 2016-10-26 17:44:12 UTC (rev 207903)
@@ -37,7 +37,6 @@
#include "CSSCrossfadeValue.h"
#include "CSSCursorImageValue.h"
#include "CSSCustomIdentValue.h"
-#include "CSSCustomPropertyDeclaration.h"
#include "CSSCustomPropertyValue.h"
#include "CSSFilterImageValue.h"
#include "CSSFontFaceSrcValue.h"
@@ -360,8 +359,6 @@
return downcast<CSSVariableDependentValue>(*this).customCSSText();
case VariableClass:
return downcast<CSSVariableValue>(*this).customCSSText();
- case CustomPropertyDeclarationClass:
- return downcast<CSSCustomPropertyDeclaration>(*this).customCSSText();
case CustomIdentClass:
return downcast<CSSCustomIdentValue>(*this).customCSSText();
case VariableReferenceClass:
@@ -516,9 +513,6 @@
case VariableClass:
delete downcast<CSSVariableValue>(this);
return;
- case CustomPropertyDeclarationClass:
- delete downcast<CSSCustomPropertyDeclaration>(this);
- return;
case CustomIdentClass:
delete downcast<CSSCustomIdentValue>(this);
return;
Modified: trunk/Source/WebCore/css/CSSValue.h (207902 => 207903)
--- trunk/Source/WebCore/css/CSSValue.h 2016-10-26 17:43:47 UTC (rev 207902)
+++ trunk/Source/WebCore/css/CSSValue.h 2016-10-26 17:44:12 UTC (rev 207903)
@@ -126,7 +126,6 @@
bool isAnimationTriggerScrollValue() const { return m_classType == AnimationTriggerScrollClass; }
#endif
- bool isCustomPropertyDeclaration() const { return m_classType == CustomPropertyDeclarationClass; }
bool isCustomIdentValue() const { return m_classType == CustomIdentClass; }
bool isVariableReferenceValue() const { return m_classType == VariableReferenceClass; }
bool isPendingSubstitutionValue() const { return m_classType == PendingSubstitutionValueClass; }
@@ -202,14 +201,14 @@
CSSContentDistributionClass,
- // FIXME-NEWPARSER: Remove in favor of new variables implementation.
+ CustomIdentClass,
+
+ // FIXME-NEWPARSER: Unify variables implementation.
CustomPropertyClass,
VariableDependentClass,
VariableClass,
// New variables implementation.
- CustomPropertyDeclarationClass,
- CustomIdentClass,
VariableReferenceClass,
PendingSubstitutionValueClass,
Modified: trunk/Source/WebCore/css/CSSVariableData.h (207902 => 207903)
--- trunk/Source/WebCore/css/CSSVariableData.h 2016-10-26 17:43:47 UTC (rev 207902)
+++ trunk/Source/WebCore/css/CSSVariableData.h 2016-10-26 17:44:12 UTC (rev 207903)
@@ -63,7 +63,7 @@
CSSVariableData(const CSSParserTokenRange&, bool needsVariableResolution);
// We can safely copy the tokens (which have raw pointers to substrings) because
- // StylePropertySets contain references to CSSCustomPropertyDeclarations, which
+ // StylePropertySets contain references to CSSCustomPropertyValues, which
// point to the unresolved CSSVariableData values that own the backing strings
// this will potentially reference.
CSSVariableData(const Vector<CSSParserToken>& resolvedTokens, String backingString)
Modified: trunk/Source/WebCore/css/StyleResolver.cpp (207902 => 207903)
--- trunk/Source/WebCore/css/StyleResolver.cpp 2016-10-26 17:43:47 UTC (rev 207902)
+++ trunk/Source/WebCore/css/StyleResolver.cpp 2016-10-26 17:44:12 UTC (rev 207903)
@@ -1607,7 +1607,7 @@
if (id == CSSPropertyCustom) {
customPropertyValue = &downcast<CSSCustomPropertyValue>(*valueToApply);
- valueToCheckForInheritInitial = customPropertyValue->value().get();
+ valueToCheckForInheritInitial = customPropertyValue->deprecatedValue().get();
}
bool isInherit = state.parentStyle() && valueToCheckForInheritInitial->isInheritedValue();
@@ -1673,7 +1673,7 @@
} else if (isInitial)
state.style()->setCustomPropertyValue(customProperty->name(), CSSCustomPropertyValue::createInvalid());
else
- state.style()->setCustomPropertyValue(customProperty->name(), customProperty->value());
+ state.style()->setCustomPropertyValue(customProperty->name(), customProperty->deprecatedValue());
return;
}
Modified: trunk/Source/WebCore/css/parser/CSSParserImpl.cpp (207902 => 207903)
--- trunk/Source/WebCore/css/parser/CSSParserImpl.cpp 2016-10-26 17:43:47 UTC (rev 207902)
+++ trunk/Source/WebCore/css/parser/CSSParserImpl.cpp 2016-10-26 17:44:12 UTC (rev 207903)
@@ -31,7 +31,7 @@
#include "CSSParserImpl.h"
#include "CSSAtRuleID.h"
-#include "CSSCustomPropertyDeclaration.h"
+#include "CSSCustomPropertyValue.h"
#include "CSSKeyframeRule.h"
#include "CSSKeyframesRule.h"
#include "CSSParserObserver.h"
@@ -97,7 +97,7 @@
const unsigned propertyIDIndex = property.id() - firstCSSProperty;
if (property.id() == CSSPropertyCustom) {
- CSSCustomPropertyDeclaration* customValue = downcast<CSSCustomPropertyDeclaration>(property.value());
+ CSSCustomPropertyValue* customValue = downcast<CSSCustomPropertyValue>(property.value());
const AtomicString& name = customValue->name();
if (seenCustomProperties.contains(name))
continue;
@@ -827,7 +827,7 @@
void CSSParserImpl::consumeVariableValue(CSSParserTokenRange range, const AtomicString& variableName, bool important)
{
- if (RefPtr<CSSCustomPropertyDeclaration> value = CSSVariableParser::parseDeclarationValue(variableName, range))
+ if (RefPtr<CSSCustomPropertyValue> value = CSSVariableParser::parseDeclarationValue(variableName, range))
m_parsedProperties.append(CSSProperty(CSSPropertyCustom, WTFMove(value), important));
}
Modified: trunk/Source/WebCore/css/parser/CSSVariableParser.cpp (207902 => 207903)
--- trunk/Source/WebCore/css/parser/CSSVariableParser.cpp 2016-10-26 17:43:47 UTC (rev 207902)
+++ trunk/Source/WebCore/css/parser/CSSVariableParser.cpp 2016-10-26 17:44:12 UTC (rev 207903)
@@ -30,7 +30,7 @@
#include "config.h"
#include "CSSVariableParser.h"
-#include "CSSCustomPropertyDeclaration.h"
+#include "CSSCustomPropertyValue.h"
#include "CSSParserTokenRange.h"
namespace WebCore {
@@ -147,7 +147,7 @@
return type == CSSValueInternalVariableValue && hasReferences && !hasAtApplyRule;
}
-RefPtr<CSSCustomPropertyDeclaration> CSSVariableParser::parseDeclarationValue(const AtomicString& variableName, CSSParserTokenRange range)
+RefPtr<CSSCustomPropertyValue> CSSVariableParser::parseDeclarationValue(const AtomicString& variableName, CSSParserTokenRange range)
{
if (range.atEnd())
return nullptr;
@@ -159,8 +159,8 @@
if (type == CSSValueInvalid)
return nullptr;
if (type == CSSValueInternalVariableValue)
- return CSSCustomPropertyDeclaration::create(variableName, CSSVariableData::create(range, hasReferences || hasAtApplyRule));
- return CSSCustomPropertyDeclaration::create(variableName, type);
+ return CSSCustomPropertyValue::createWithVariableData(variableName, CSSVariableData::create(range, hasReferences || hasAtApplyRule));
+ return CSSCustomPropertyValue::createWithID(variableName, type);
}
} // namespace WebCore
Modified: trunk/Source/WebCore/css/parser/CSSVariableParser.h (207902 => 207903)
--- trunk/Source/WebCore/css/parser/CSSVariableParser.h 2016-10-26 17:43:47 UTC (rev 207902)
+++ trunk/Source/WebCore/css/parser/CSSVariableParser.h 2016-10-26 17:44:12 UTC (rev 207903)
@@ -35,13 +35,13 @@
namespace WebCore {
-class CSSCustomPropertyDeclaration;
+class CSSCustomPropertyValue;
class CSSVariableParser {
public:
static bool containsValidVariableReferences(CSSParserTokenRange);
- static RefPtr<CSSCustomPropertyDeclaration> parseDeclarationValue(const AtomicString&, CSSParserTokenRange);
+ static RefPtr<CSSCustomPropertyValue> parseDeclarationValue(const AtomicString&, CSSParserTokenRange);
static bool isValidVariableName(const CSSParserToken&);
static bool isValidVariableName(const String&);
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (207902 => 207903)
--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2016-10-26 17:43:47 UTC (rev 207902)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2016-10-26 17:44:12 UTC (rev 207903)
@@ -2066,7 +2066,7 @@
// With all results computed, we can now mutate our table to eliminate the variables and
// hold the final values. This way when we inherit, we don't end up resubstituting variables, etc.
for (auto& resolvedValue : resolvedValues)
- customProperties.set(resolvedValue->name(), resolvedValue->value());
+ customProperties.set(resolvedValue->name(), resolvedValue->deprecatedValue());
rareInheritedData.access()->m_customProperties.access()->setContainsVariables(false);
}