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

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

Issue 1303153003: Change Counter to be a CSSValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase & removed dependent patchsets 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 ff629ab79e437a58c16a05f4d9d724c6861f07c9..b14daca0eb8dfc95bba91c99f72014d4cf8ad14f 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -43,6 +43,7 @@
#include "core/StyleBuilderFunctions.h"
#include "core/StylePropertyShorthand.h"
#include "core/css/BasicShapeFunctions.h"
+#include "core/css/CSSCounterValue.h"
#include "core/css/CSSCursorImageValue.h"
#include "core/css/CSSGradientValue.h"
#include "core/css/CSSGridTemplateAreasValue.h"
@@ -52,7 +53,6 @@
#include "core/css/CSSPathValue.h"
#include "core/css/CSSPrimitiveValueMappings.h"
#include "core/css/CSSPropertyMetadata.h"
-#include "core/css/Counter.h"
#include "core/css/Pair.h"
#include "core/css/StylePropertySet.h"
#include "core/css/StyleRule.h"
@@ -709,6 +709,17 @@ void StyleBuilderFunctions::applyValueCSSPropertyContent(StyleResolverState& sta
continue;
}
+ if (item->isCounterValue()) {
+ CSSCounterValue* counterValue = toCSSCounterValue(item.get());
+ EListStyleType listStyleType = NoneListStyle;
+ CSSValueID listStyleIdent = counterValue->listStyleIdent();
+ if (listStyleIdent != CSSValueNone)
+ listStyleType = static_cast<EListStyleType>(listStyleIdent - CSSValueDisc);
+ OwnPtr<CounterContent> counter = adoptPtr(new CounterContent(AtomicString(counterValue->identifier()), listStyleType, AtomicString(counterValue->separator())));
+ state.style()->setContent(counter.release(), didSet);
+ didSet = true;
+ }
+
if (!item->isPrimitiveValue())
continue;
@@ -727,15 +738,6 @@ void StyleBuilderFunctions::applyValueCSSPropertyContent(StyleResolverState& sta
const AtomicString& value = state.element()->getAttribute(attr);
state.style()->setContent(value.isNull() ? emptyString() : value.string(), didSet);
didSet = true;
- } else if (contentValue->isCounter()) {
- Counter* counterValue = contentValue->getCounterValue();
- EListStyleType listStyleType = NoneListStyle;
- CSSValueID listStyleIdent = counterValue->listStyleIdent();
- if (listStyleIdent != CSSValueNone)
- listStyleType = static_cast<EListStyleType>(listStyleIdent - CSSValueDisc);
- OwnPtr<CounterContent> counter = adoptPtr(new CounterContent(AtomicString(counterValue->identifier()), listStyleType, AtomicString(counterValue->separator())));
- state.style()->setContent(counter.release(), 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