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

Unified Diff: Source/core/layout/LayoutCounter.cpp

Issue 910083002: Constify and use LayoutStyle reference in layout/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined again Created 5 years, 10 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/layout/LayoutCounter.h ('k') | Source/core/layout/LayoutLayerModelObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutCounter.cpp
diff --git a/Source/core/layout/LayoutCounter.cpp b/Source/core/layout/LayoutCounter.cpp
index b99852100ce2cf7621ead29bc37ec8d8fa8b0085..c54b7e123951d34d7dff32e48cf668875456bb3e 100644
--- a/Source/core/layout/LayoutCounter.cpp
+++ b/Source/core/layout/LayoutCounter.cpp
@@ -111,10 +111,9 @@ static bool planCounter(LayoutObject& object, const AtomicString& identifier, bo
// We must have a generating node or else we cannot have a counter.
if (!generatingNode)
return false;
- LayoutStyle* style = object.style();
- ASSERT(style);
+ const LayoutStyle& style = object.styleRef();
- switch (style->styleType()) {
+ switch (style.styleType()) {
case NOPSEUDO:
// Sometimes nodes have more then one renderer. Only the first one gets the counter
// LayoutTests/http/tests/css/counter-crash.html
@@ -128,7 +127,7 @@ static bool planCounter(LayoutObject& object, const AtomicString& identifier, bo
return false; // Counters are forbidden from all other pseudo elements.
}
- const CounterDirectives directives = style->getCounterDirectives(identifier);
+ const CounterDirectives directives = style.getCounterDirectives(identifier);
if (directives.isDefined()) {
value = directives.combinedValue();
isReset = directives.isReset();
@@ -547,13 +546,13 @@ void LayoutCounter::rendererSubtreeAttached(LayoutObject* renderer)
updateCounters(*descendant);
}
-void LayoutCounter::rendererStyleChanged(LayoutObject& renderer, const LayoutStyle* oldStyle, const LayoutStyle* newStyle)
+void LayoutCounter::rendererStyleChanged(LayoutObject& renderer, const LayoutStyle* oldStyle, const LayoutStyle& newStyle)
{
Node* node = renderer.generatingNode();
if (!node || node->needsAttach())
return; // cannot have generated content or if it can have, it will be handled during attaching
const CounterDirectiveMap* oldCounterDirectives = oldStyle ? oldStyle->counterDirectives() : 0;
- const CounterDirectiveMap* newCounterDirectives = newStyle ? newStyle->counterDirectives() : 0;
+ const CounterDirectiveMap* newCounterDirectives = newStyle.counterDirectives();
if (oldCounterDirectives) {
if (newCounterDirectives) {
CounterDirectiveMap::const_iterator newMapEnd = newCounterDirectives->end();
« no previous file with comments | « Source/core/layout/LayoutCounter.h ('k') | Source/core/layout/LayoutLayerModelObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698