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

Side by Side Diff: Source/core/layout/LayoutCounter.cpp

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Blind fix for Mac. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /** 1 /**
2 * Copyright (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 2 * Copyright (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
3 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 static bool planCounter(RenderObject& object, const AtomicString& identifier, bo ol& isReset, int& value) 104 static bool planCounter(RenderObject& object, const AtomicString& identifier, bo ol& isReset, int& value)
105 { 105 {
106 // Real text nodes don't have their own style so they can't have counters. 106 // Real text nodes don't have their own style so they can't have counters.
107 // We can't even look at their styles or we'll see extra resets and incremen ts! 107 // We can't even look at their styles or we'll see extra resets and incremen ts!
108 if (object.isText() && !object.isBR()) 108 if (object.isText() && !object.isBR())
109 return false; 109 return false;
110 Node* generatingNode = object.generatingNode(); 110 Node* generatingNode = object.generatingNode();
111 // We must have a generating node or else we cannot have a counter. 111 // We must have a generating node or else we cannot have a counter.
112 if (!generatingNode) 112 if (!generatingNode)
113 return false; 113 return false;
114 RenderStyle* style = object.style(); 114 const RenderStyle* style = object.style();
115 ASSERT(style); 115 ASSERT(style);
116 116
117 switch (style->styleType()) { 117 switch (style->styleType()) {
118 case NOPSEUDO: 118 case NOPSEUDO:
119 // Sometimes nodes have more then one renderer. Only the first one gets the counter 119 // Sometimes nodes have more then one renderer. Only the first one gets the counter
120 // LayoutTests/http/tests/css/counter-crash.html 120 // LayoutTests/http/tests/css/counter-crash.html
121 if (generatingNode->renderer() != &object) 121 if (generatingNode->renderer() != &object)
122 return false; 122 return false;
123 break; 123 break;
124 case BEFORE: 124 case BEFORE:
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 fprintf(stderr, " "); 609 fprintf(stderr, " ");
610 fprintf(stderr, "%p N:%p P:%p PS:%p NS:%p C:%p\n", 610 fprintf(stderr, "%p N:%p P:%p PS:%p NS:%p C:%p\n",
611 current, current->node(), current->parent(), current->previousSiblin g(), 611 current, current->node(), current->parent(), current->previousSiblin g(),
612 current->nextSibling(), current->hasCounterNodeMap() ? 612 current->nextSibling(), current->hasCounterNodeMap() ?
613 counterName ? blink::counterMaps().get(current)->get(identifier) : ( blink::CounterNode*)1 : (blink::CounterNode*)0); 613 counterName ? blink::counterMaps().get(current)->get(identifier) : ( blink::CounterNode*)1 : (blink::CounterNode*)0);
614 } 614 }
615 fflush(stderr); 615 fflush(stderr);
616 } 616 }
617 617
618 #endif // NDEBUG 618 #endif // NDEBUG
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698