Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(593)

Unified Diff: Source/core/css/resolver/StyleBuilderCustom.cpp

Issue 1312543003: Split out Attribute from CSSPrimitiveValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@clean_up_get_string_value
Patch Set: Rebase Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleBuilderCustom.cpp
diff --git a/Source/core/css/resolver/StyleBuilderCustom.cpp b/Source/core/css/resolver/StyleBuilderCustom.cpp
index 59465222d3ab3257e3930fe23ece5124d9f979b7..922826ed2c6eed75892595fedf080cc4f4c4ea14 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -45,6 +45,7 @@
#include "core/css/BasicShapeFunctions.h"
#include "core/css/CSSCounterValue.h"
#include "core/css/CSSCursorImageValue.h"
+#include "core/css/CSSFunctionValue.h"
#include "core/css/CSSGradientValue.h"
#include "core/css/CSSGridTemplateAreasValue.h"
#include "core/css/CSSHelper.h"
@@ -728,24 +729,28 @@ void StyleBuilderFunctions::applyValueCSSPropertyContent(StyleResolverState& sta
didSet = true;
}
- if (!item->isPrimitiveValue())
- continue;
-
- CSSPrimitiveValue* contentValue = toCSSPrimitiveValue(item.get());
-
- if (contentValue->isString()) {
- state.style()->setContent(contentValue->getStringValue().impl(), didSet);
- didSet = true;
- } else if (contentValue->isAttr()) {
+ if (item->isFunctionValue()) {
+ CSSFunctionValue* functionValue = toCSSFunctionValue(item.get());
+ ASSERT(functionValue->functionType() == CSSValueAttr);
// FIXME: Can a namespace be specified for an attr(foo)?
if (state.style()->styleType() == NOPSEUDO)
state.style()->setUnique();
else
state.parentStyle()->setUnique();
- QualifiedName attr(nullAtom, AtomicString(contentValue->getStringValue()), nullAtom);
+ QualifiedName attr(nullAtom, AtomicString(toCSSPrimitiveValue(functionValue->item(0))->getStringValue()), nullAtom);
const AtomicString& value = state.element()->getAttribute(attr);
state.style()->setContent(value.isNull() ? emptyString() : value.string(), didSet);
didSet = true;
+ }
+
+ if (!item->isPrimitiveValue())
+ continue;
+
+ CSSPrimitiveValue* contentValue = toCSSPrimitiveValue(item.get());
+
+ if (contentValue->isString()) {
+ state.style()->setContent(contentValue->getStringValue().impl(), didSet);
+ didSet = true;
} else {
switch (contentValue->getValueID()) {
case CSSValueOpenQuote:
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698