Title: [132503] trunk/Source/WebCore
Revision
132503
Author
commit-qu...@webkit.org
Date
2012-10-25 11:00:23 -0700 (Thu, 25 Oct 2012)

Log Message

Everything that sets RenderObject::m_style should go through setStyleInternal
https://bugs.webkit.org/show_bug.cgi?id=100338

Patch by Elliott Sprehn <espr...@chromium.org> on 2012-10-25
Reviewed by Ojan Vafai.

Whenever we set m_style in RenderObject go through setStyleInternal and make
it inline. This gives a common place to put printfs and makes the code cleaner.

No new tests, just a refactor.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::createObject):
(WebCore::RenderObject::setStyle):
* rendering/RenderObject.h:
(WebCore::RenderObject::setStyleInternal):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (132502 => 132503)


--- trunk/Source/WebCore/ChangeLog	2012-10-25 17:56:26 UTC (rev 132502)
+++ trunk/Source/WebCore/ChangeLog	2012-10-25 18:00:23 UTC (rev 132503)
@@ -1,3 +1,21 @@
+2012-10-25  Elliott Sprehn  <espr...@chromium.org>
+
+        Everything that sets RenderObject::m_style should go through setStyleInternal
+        https://bugs.webkit.org/show_bug.cgi?id=100338
+
+        Reviewed by Ojan Vafai.
+
+        Whenever we set m_style in RenderObject go through setStyleInternal and make
+        it inline. This gives a common place to put printfs and makes the code cleaner.
+
+        No new tests, just a refactor.
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::createObject):
+        (WebCore::RenderObject::setStyle):
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::setStyleInternal):
+
 2012-10-25  Brady Eidson  <beid...@apple.com>
 
         Allow LoaderStrategy to override the ResourceLoadScheduler

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (132502 => 132503)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2012-10-25 17:56:26 UTC (rev 132502)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2012-10-25 18:00:23 UTC (rev 132503)
@@ -147,13 +147,13 @@
         // RenderImageResourceStyleImage requires a style being present on the image but we don't want to
         // trigger a style change now as the node is not fully attached. Moving this code to style change
         // doesn't make sense as it should be run once at renderer creation.
-        image->m_style = style;
+        image->setStyleInternal(style);
         if (const StyleImage* styleImage = static_cast<const ImageContentData*>(contentData)->image()) {
             image->setImageResource(RenderImageResourceStyleImage::create(const_cast<StyleImage*>(styleImage)));
             image->setIsGeneratedContent();
         } else
             image->setImageResource(RenderImageResource::create());
-        image->m_style = 0;
+        image->setStyleInternal(0);
         return image;
     }
 
@@ -1768,7 +1768,7 @@
     styleWillChange(diff, style.get());
     
     RefPtr<RenderStyle> oldStyle = m_style.release();
-    m_style = style;
+    setStyleInternal(style);
 
     updateFillImages(oldStyle ? oldStyle->backgroundLayers() : 0, m_style ? m_style->backgroundLayers() : 0);
     updateFillImages(oldStyle ? oldStyle->maskLayers() : 0, m_style ? m_style->maskLayers() : 0);
@@ -1815,11 +1815,6 @@
     }
 }
 
-void RenderObject::setStyleInternal(PassRefPtr<RenderStyle> style)
-{
-    m_style = style;
-}
-
 void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
 {
     if (m_style) {

Modified: trunk/Source/WebCore/rendering/RenderObject.h (132502 => 132503)


--- trunk/Source/WebCore/rendering/RenderObject.h	2012-10-25 17:56:26 UTC (rev 132502)
+++ trunk/Source/WebCore/rendering/RenderObject.h	2012-10-25 18:00:23 UTC (rev 132503)
@@ -29,13 +29,14 @@
 #include "CachedImageClient.h"
 #include "DocumentStyleSheetCollection.h"
 #include "Element.h"
+#include "FloatQuad.h"
 #include "FractionalLayoutUnit.h"
-#include "FloatQuad.h"
 #include "LayoutTypes.h"
 #include "PaintPhase.h"
 #include "RenderObjectChildList.h"
 #include "RenderStyle.h"
 #include "ScrollBehavior.h"
+#include "StyleInheritedData.h"
 #include "TextAffinity.h"
 #include "TransformationMatrix.h"
 #include <wtf/HashSet.h>
@@ -712,7 +713,7 @@
 
     // Updates only the local style ptr of the object.  Does not update the state of the object,
     // and so only should be called when the style is known not to have changed (or from setStyle).
-    void setStyleInternal(PassRefPtr<RenderStyle>);
+    void setStyleInternal(PassRefPtr<RenderStyle> style) { m_style = style; }
 
     // returns the containing block level element for this element.
     RenderBlock* containingBlock() const;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to