From b0940adf4ee308967038217904040d2ac807cfea Mon Sep 17 00:00:00 2001 From: "rob.buis@samsung.com" Date: Tue, 21 Apr 2015 02:56:41 +0000 Subject: [PATCH] Remove font-variant CSSValueList conversion code There does not seem to be any reason to convert the single CSSPrimitiveValue into a CSSValueList. This may have made sense when these types were still exposed to the bindings. Review URL: https://codereview.chromium.org/1100563002 git-svn-id: svn://svn.chromium.org/blink/trunk@194074 bbb929c8-8fbe-4397-9dbb-9b2b20218538 --- third_party/WebKit/Source/core/css/CSSProperty.cpp | 8 -------- third_party/WebKit/Source/core/css/CSSProperty.h | 2 -- third_party/WebKit/Source/core/css/parser/BisonCSSParser-in.cpp | 4 +--- third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp | 4 +--- 4 files changed, 2 insertions(+), 16 deletions(-) diff --git a/third_party/WebKit/Source/core/css/CSSProperty.cpp b/third_party/WebKit/Source/core/css/CSSProperty.cpp index 584b3dc21397..cf22182b09bc 100644 --- a/third_party/WebKit/Source/core/css/CSSProperty.cpp +++ b/third_party/WebKit/Source/core/css/CSSProperty.cpp @@ -22,7 +22,6 @@ #include "core/css/CSSProperty.h" #include "core/StylePropertyShorthand.h" -#include "core/css/CSSValueList.h" #include "core/style/ComputedStyleConstants.h" namespace blink { @@ -45,13 +44,6 @@ CSSPropertyID StylePropertyMetadata::shorthandID() const return shorthands.at(m_indexInShorthandsVector).id(); } -void CSSProperty::wrapValueInCommaSeparatedList() -{ - RefPtrWillBeRawPtr value = m_value.release(); - m_value = CSSValueList::createCommaSeparated(); - toCSSValueList(m_value.get())->append(value.release()); -} - enum LogicalBoxSide { BeforeSide, EndSide, AfterSide, StartSide }; enum PhysicalBoxSide { TopSide, RightSide, BottomSide, LeftSide }; diff --git a/third_party/WebKit/Source/core/css/CSSProperty.h b/third_party/WebKit/Source/core/css/CSSProperty.h index da80ac6533b5..d012bbcf3b4a 100644 --- a/third_party/WebKit/Source/core/css/CSSProperty.h +++ b/third_party/WebKit/Source/core/css/CSSProperty.h @@ -76,8 +76,6 @@ public: CSSValue* value() const { return m_value.get(); } - void wrapValueInCommaSeparatedList(); - static CSSPropertyID resolveDirectionAwareProperty(CSSPropertyID, TextDirection, WritingMode); static bool isAffectedByAllProperty(CSSPropertyID); diff --git a/third_party/WebKit/Source/core/css/parser/BisonCSSParser-in.cpp b/third_party/WebKit/Source/core/css/parser/BisonCSSParser-in.cpp index 4b8b5af403d9..a8d1d666440d 100644 --- a/third_party/WebKit/Source/core/css/parser/BisonCSSParser-in.cpp +++ b/third_party/WebKit/Source/core/css/parser/BisonCSSParser-in.cpp @@ -728,9 +728,7 @@ StyleRuleBase* BisonCSSParser::createFontFaceRule() m_allowImportRules = m_allowNamespaceDeclarations = false; for (unsigned i = 0; i < m_parsedProperties.size(); ++i) { CSSProperty& property = m_parsedProperties[i]; - if (property.id() == CSSPropertyFontVariant && property.value()->isPrimitiveValue()) - property.wrapValueInCommaSeparatedList(); - else if (property.id() == CSSPropertyFontFamily && (!property.value()->isValueList() || toCSSValueList(property.value())->length() != 1)) { + if (property.id() == CSSPropertyFontFamily && (!property.value()->isValueList() || toCSSValueList(property.value())->length() != 1)) { // Unlike font-family property, font-family descriptor in @font-face rule // has to be a value list with exactly one family name. It cannot have a // have 'initial' value and cannot 'inherit' from parent. diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp index 83449f591efe..80b7bc298935 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp @@ -471,9 +471,7 @@ PassRefPtrWillBeRawPtr CSSParserImpl::consumeFontFaceRule(CSS // FIXME: Shouldn't we fail if font-family or src aren't specified? for (unsigned i = 0; i < m_parsedProperties.size(); ++i) { CSSProperty& property = m_parsedProperties[i]; - if (property.id() == CSSPropertyFontVariant && property.value()->isPrimitiveValue()) { - property.wrapValueInCommaSeparatedList(); - } else if (property.id() == CSSPropertyFontFamily && (!property.value()->isValueList() || toCSSValueList(property.value())->length() != 1)) { + if (property.id() == CSSPropertyFontFamily && (!property.value()->isValueList() || toCSSValueList(property.value())->length() != 1)) { m_parsedProperties.clear(); return nullptr; } -- 2.11.4.GIT