m_hasCounterNodeMap and m_everHadLayout should be private to RenderObject
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Dec 2011 21:30:21 +0000 (21:30 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Dec 2011 21:30:21 +0000 (21:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=74645

Reviewed by Eric Seidel.

Made them private and added getters and setters as needed.

* rendering/RenderCounter.cpp:
(WebCore::makeCounterNode):
(WebCore::RenderCounter::destroyCounterNodes):
(WebCore::updateCounters):
(WebCore::RenderCounter::rendererStyleChanged):
(showCounterRendererTree):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::layout):
* rendering/RenderObject.h:
(WebCore::RenderObject::hasCounterNodeMap):
(WebCore::RenderObject::setHasCounterNodeMap):
(WebCore::RenderObject::everHadLayout):
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::layout):
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::layout):
* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::layout):
* rendering/svg/RenderSVGResourceMarker.cpp:
(WebCore::RenderSVGResourceMarker::layout):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::layout):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::layout):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::layout):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@102979 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderCounter.cpp
Source/WebCore/rendering/RenderFlowThread.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
Source/WebCore/rendering/svg/RenderSVGImage.cpp
Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp
Source/WebCore/rendering/svg/RenderSVGResourceMarker.cpp
Source/WebCore/rendering/svg/RenderSVGRoot.cpp
Source/WebCore/rendering/svg/RenderSVGShape.cpp
Source/WebCore/rendering/svg/RenderSVGText.cpp

index 59d8617..c1821ad 100644 (file)
@@ -1,3 +1,39 @@
+2011-12-15  Ryosuke Niwa  <rniwa@webkit.org>
+
+        m_hasCounterNodeMap and m_everHadLayout should be private to RenderObject
+        https://bugs.webkit.org/show_bug.cgi?id=74645
+
+        Reviewed by Eric Seidel.
+
+        Made them private and added getters and setters as needed.
+
+        * rendering/RenderCounter.cpp:
+        (WebCore::makeCounterNode):
+        (WebCore::RenderCounter::destroyCounterNodes):
+        (WebCore::updateCounters):
+        (WebCore::RenderCounter::rendererStyleChanged):
+        (showCounterRendererTree):
+        * rendering/RenderFlowThread.cpp:
+        (WebCore::RenderFlowThread::layout):
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::hasCounterNodeMap):
+        (WebCore::RenderObject::setHasCounterNodeMap):
+        (WebCore::RenderObject::everHadLayout):
+        * rendering/svg/RenderSVGForeignObject.cpp:
+        (WebCore::RenderSVGForeignObject::layout):
+        * rendering/svg/RenderSVGImage.cpp:
+        (WebCore::RenderSVGImage::layout):
+        * rendering/svg/RenderSVGResourceContainer.cpp:
+        (WebCore::RenderSVGResourceContainer::layout):
+        * rendering/svg/RenderSVGResourceMarker.cpp:
+        (WebCore::RenderSVGResourceMarker::layout):
+        * rendering/svg/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::layout):
+        * rendering/svg/RenderSVGShape.cpp:
+        (WebCore::RenderSVGShape::layout):
+        * rendering/svg/RenderSVGText.cpp:
+        (WebCore::RenderSVGText::layout):
+
 2011-12-15  Vsevolod Vlasov  <vsevik@chromium.org>
 
         Not able to navigate the Resource tab options properly with arrow keys after adding the sticky-notes.
index e9ea615..399da93 100644 (file)
@@ -416,7 +416,7 @@ static CounterNode* makeCounterNode(RenderObject* object, const AtomicString& id
 {
     ASSERT(object);
 
-    if (object->m_hasCounterNodeMap) {
+    if (object->hasCounterNodeMap()) {
         if (CounterMap* nodeMap = counterMaps().get(object)) {
             if (CounterNode* node = nodeMap->get(identifier.impl()).get())
                 return node;
@@ -434,12 +434,12 @@ static CounterNode* makeCounterNode(RenderObject* object, const AtomicString& id
     if (findPlaceForCounter(object, identifier, isReset, newParent, newPreviousSibling))
         newParent->insertAfter(newNode.get(), newPreviousSibling, identifier);
     CounterMap* nodeMap;
-    if (object->m_hasCounterNodeMap)
+    if (object->hasCounterNodeMap())
         nodeMap = counterMaps().get(object);
     else {
         nodeMap = new CounterMap;
         counterMaps().set(object, nodeMap);
-        object->m_hasCounterNodeMap = true;
+        object->setHasCounterNodeMap(true);
     }
     nodeMap->set(identifier.impl(), newNode);
     if (newNode->parent())
@@ -451,7 +451,7 @@ static CounterNode* makeCounterNode(RenderObject* object, const AtomicString& id
     bool skipDescendants;
     for (RenderObject* currentRenderer = nextInPreOrder(object, stayWithin); currentRenderer; currentRenderer = nextInPreOrder(currentRenderer, stayWithin, skipDescendants)) {
         skipDescendants = false;
-        if (!currentRenderer->m_hasCounterNodeMap)
+        if (!currentRenderer->hasCounterNodeMap())
             continue;
         CounterNode* currentCounter = maps.get(currentRenderer)->get(identifier.impl()).get();
         if (!currentCounter)
@@ -569,7 +569,7 @@ void RenderCounter::destroyCounterNodes(RenderObject* owner)
     }
     maps.remove(mapsIterator);
     delete map;
-    owner->m_hasCounterNodeMap = false;
+    owner->setHasCounterNodeMap(false);
 }
 
 void RenderCounter::destroyCounterNode(RenderObject* owner, const AtomicString& identifier)
@@ -615,7 +615,7 @@ static void updateCounters(RenderObject* renderer)
     if (!directiveMap)
         return;
     CounterDirectiveMap::const_iterator end = directiveMap->end();
-    if (!renderer->m_hasCounterNodeMap) {
+    if (!renderer->hasCounterNodeMap()) {
         for (CounterDirectiveMap::const_iterator it = directiveMap->begin(); it != end; ++it)
             makeCounterNode(renderer, AtomicString(it->first.get()), false);
         return;
@@ -686,7 +686,7 @@ void RenderCounter::rendererStyleChanged(RenderObject* renderer, const RenderSty
                     RenderCounter::destroyCounterNode(renderer, it->first.get());
             }
         } else {
-            if (renderer->m_hasCounterNodeMap)
+            if (renderer->hasCounterNodeMap())
                 RenderCounter::destroyCounterNodes(renderer);
         }
     } else if (newStyle && (newCounterDirectives = newStyle->counterDirectives())) {
@@ -719,7 +719,7 @@ void showCounterRendererTree(const WebCore::RenderObject* renderer, const char*
             fprintf(stderr, "    ");
         fprintf(stderr, "%p N:%p P:%p PS:%p NS:%p C:%p\n",
             current, current->node(), current->parent(), current->previousSibling(),
-            current->nextSibling(), current->m_hasCounterNodeMap?
+            current->nextSibling(), current->hasCounterNodeMap() ?
             counterName ? WebCore::counterMaps().get(current)->get(identifier.impl()).get() : (WebCore::CounterNode*)1 : (WebCore::CounterNode*)0);
     }
     fflush(stderr);
index 90d903e..1bc39b4 100644 (file)
@@ -310,7 +310,7 @@ private:
 
 void RenderFlowThread::layout()
 {
-    bool regionsChanged = m_regionsInvalidated && m_everHadLayout;
+    bool regionsChanged = m_regionsInvalidated && everHadLayout();
     if (m_regionsInvalidated) {
         m_regionsInvalidated = false;
         m_hasValidRegions = false;
index f49f4b3..540a1d8 100644 (file)
@@ -369,6 +369,9 @@ public:
          return container;
     }
 
+    bool hasCounterNodeMap() const { return m_hasCounterNodeMap; }
+    void setHasCounterNodeMap(bool hasCounterNodeMap) { m_hasCounterNodeMap = hasCounterNodeMap; }
+
     bool childrenInline() const { return m_childrenInline; }
     void setChildrenInline(bool b) { m_childrenInline = b; }
     bool hasColumns() const { return m_hasColumns; }
@@ -844,6 +847,8 @@ public:
     }
 
 protected:
+    bool everHadLayout() const { return m_everHadLayout; }
+
     // Overrides should call the superclass at the end
     virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
     // Overrides should call the superclass at the start
@@ -912,12 +917,10 @@ private:
     bool m_hasOverflowClip           : 1; // Set in the case of overflow:auto/scroll/hidden
     bool m_hasTransform              : 1;
     bool m_hasReflection             : 1;
-    
-public:
+
     bool m_hasCounterNodeMap         : 1;
     bool m_everHadLayout             : 1;
 
-private:
     // These bitfields are moved here from subclasses to pack them together
     // from RenderBlock
     bool m_childrenInline : 1;
index a4691ec..dadcaed 100644 (file)
@@ -148,7 +148,7 @@ void RenderSVGForeignObject::layout()
     // FIXME: Investigate in location rounding issues - only affects RenderSVGForeignObject & RenderSVGText
     setLocation(roundedIntPoint(viewportLocation));
 
-    bool layoutChanged = m_everHadLayout && selfNeedsLayout();
+    bool layoutChanged = everHadLayout() && selfNeedsLayout();
     RenderBlock::layout();
     ASSERT(!needsLayout());
 
index fb2359b..7720339 100644 (file)
@@ -82,7 +82,7 @@ void RenderSVGImage::layout()
     }
 
     // Invalidate all resources of this client if our layout changed.
-    if (m_everHadLayout && selfNeedsLayout())
+    if (everHadLayout() && selfNeedsLayout())
         SVGResourcesCache::clientLayoutChanged(this);
 
     // If our bounds changed, notify the parents.
index 0403bb6..85fcfaf 100644 (file)
@@ -53,7 +53,7 @@ RenderSVGResourceContainer::~RenderSVGResourceContainer()
 void RenderSVGResourceContainer::layout()
 {
     // Invalidate all resources if our layout changed.
-    if (m_everHadLayout && selfNeedsLayout())
+    if (everHadLayout() && selfNeedsLayout())
         removeAllClientsFromCache();
 
     RenderSVGHiddenContainer::layout();
index 50173e4..dc0755d 100644 (file)
@@ -48,7 +48,7 @@ RenderSVGResourceMarker::~RenderSVGResourceMarker()
 void RenderSVGResourceMarker::layout()
 {
     // Invalidate all resources if our layout changed.
-    if (m_everHadLayout && selfNeedsLayout())
+    if (everHadLayout() && selfNeedsLayout())
         removeAllClientsFromCache();
 
     // RenderSVGHiddenContainer overwrites layout(). We need the
index 5b71c7f..6994654 100644 (file)
@@ -251,7 +251,7 @@ void RenderSVGRoot::layout()
 
     if (view() && view()->frameView() && view()->frameView()->embeddedContentBox()) {
         if (!m_needsSizeNegotiationWithHostDocument)
-            m_needsSizeNegotiationWithHostDocument = !m_everHadLayout || oldSize != size();
+            m_needsSizeNegotiationWithHostDocument = !everHadLayout() || oldSize != size();
     } else
         ASSERT(!m_needsSizeNegotiationWithHostDocument);
 
index ef2d3f4..02a05cc 100755 (executable)
@@ -177,7 +177,7 @@ void RenderSVGShape::layout()
     }
 
     // Invalidate all resources of this client if our layout changed.
-    if (m_everHadLayout && selfNeedsLayout()) {
+    if (everHadLayout() && selfNeedsLayout()) {
         SVGResourcesCache::clientLayoutChanged(this);
         m_markerLayoutInfo.clear();
     }
index 4e7e465..6602bff 100644 (file)
@@ -173,7 +173,7 @@ void RenderSVGText::layout()
         updateCachedBoundariesInParents = oldBoundaries != objectBoundingBox();
 
     // Invalidate all resources of this client if our layout changed.
-    if (m_everHadLayout && selfNeedsLayout())
+    if (everHadLayout() && selfNeedsLayout())
         SVGResourcesCache::clientLayoutChanged(this);
 
     // If our bounds changed, notify the parents.