Title: [94582] trunk
Revision
94582
Author
[email protected]
Date
2011-09-06 11:19:55 -0700 (Tue, 06 Sep 2011)

Log Message

Style not propagated to anonymous boxes and anonymous
inline-blocks.
https://bugs.webkit.org/show_bug.cgi?id=67364

Source/WebCore: 

Reviewed by James Robinson.

Share propagateStyleToAnonymousChildren with RenderBlock::styleDidChange.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::styleDidChange):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::propagateStyleToAnonymousChildren):
* rendering/RenderObject.h:

LayoutTests: 

Add comments explaining what the test does.

Reviewed by James Robinson.

* fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
* fast/ruby/ruby-block-style-not-updated.html:
* fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
* fast/ruby/ruby-inline-style-not-updated.html:
* fast/table/table-before-child-style-update.html:
* fast/table/table-row-before-child-style-update.html:
* fast/table/table-row-style-not-updated-with-after-content.html:
* fast/table/table-row-style-not-updated-with-before-content.html:
* fast/table/table-style-not-updated.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (94581 => 94582)


--- trunk/LayoutTests/ChangeLog	2011-09-06 18:13:20 UTC (rev 94581)
+++ trunk/LayoutTests/ChangeLog	2011-09-06 18:19:55 UTC (rev 94582)
@@ -1,3 +1,23 @@
+2011-09-06  Abhishek Arya  <[email protected]>
+
+        Style not propagated to anonymous boxes and anonymous
+        inline-blocks.
+        https://bugs.webkit.org/show_bug.cgi?id=67364
+
+        Add comments explaining what the test does.
+
+        Reviewed by James Robinson.
+
+        * fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
+        * fast/ruby/ruby-block-style-not-updated.html:
+        * fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
+        * fast/ruby/ruby-inline-style-not-updated.html:
+        * fast/table/table-before-child-style-update.html:
+        * fast/table/table-row-before-child-style-update.html:
+        * fast/table/table-row-style-not-updated-with-after-content.html:
+        * fast/table/table-row-style-not-updated-with-before-content.html:
+        * fast/table/table-style-not-updated.html:
+
 2011-09-06  Robin Cao  <[email protected]>
 
         [skia] States of GraphicsContext may never be restored after clipToImageBuffer

Modified: trunk/LayoutTests/fast/ruby/ruby-block-style-not-updated-with-before-after-content.html (94581 => 94582)


--- trunk/LayoutTests/fast/ruby/ruby-block-style-not-updated-with-before-after-content.html	2011-09-06 18:13:20 UTC (rev 94581)
+++ trunk/LayoutTests/fast/ruby/ruby-block-style-not-updated-with-before-after-content.html	2011-09-06 18:19:55 UTC (rev 94582)
@@ -1,3 +1,4 @@
+<!-- The orange, blue, yellow and green text boxes should not overlap -->
 <html>
 <body style="font: 1em/1 Ahem, sans-serif;">
 <style>

Modified: trunk/LayoutTests/fast/ruby/ruby-block-style-not-updated.html (94581 => 94582)


--- trunk/LayoutTests/fast/ruby/ruby-block-style-not-updated.html	2011-09-06 18:13:20 UTC (rev 94581)
+++ trunk/LayoutTests/fast/ruby/ruby-block-style-not-updated.html	2011-09-06 18:19:55 UTC (rev 94582)
@@ -1,3 +1,4 @@
+<!-- The blue and green text boxes should not overlap -->
 <html>
 <body style="font: 1em/1 Ahem, sans-serif;">
 <ruby id="test" style="display: block; color: blue">

Modified: trunk/LayoutTests/fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html (94581 => 94582)


--- trunk/LayoutTests/fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html	2011-09-06 18:13:20 UTC (rev 94581)
+++ trunk/LayoutTests/fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html	2011-09-06 18:19:55 UTC (rev 94582)
@@ -1,3 +1,4 @@
+<!-- The orange, blue, yellow and green text boxes should not overlap -->
 <html>
 <body style="font: 1em/1 Ahem, sans-serif;">
 <style>

Modified: trunk/LayoutTests/fast/ruby/ruby-inline-style-not-updated.html (94581 => 94582)


--- trunk/LayoutTests/fast/ruby/ruby-inline-style-not-updated.html	2011-09-06 18:13:20 UTC (rev 94581)
+++ trunk/LayoutTests/fast/ruby/ruby-inline-style-not-updated.html	2011-09-06 18:19:55 UTC (rev 94582)
@@ -1,3 +1,4 @@
+<!-- The blue and green text boxes should not overlap -->
 <html>
 <body style="font: 1em/1 Ahem, sans-serif;">
 <ruby id="test" style="color: blue">

Modified: trunk/LayoutTests/fast/table/table-before-child-style-update.html (94581 => 94582)


--- trunk/LayoutTests/fast/table/table-before-child-style-update.html	2011-09-06 18:13:20 UTC (rev 94581)
+++ trunk/LayoutTests/fast/table/table-before-child-style-update.html	2011-09-06 18:19:55 UTC (rev 94582)
@@ -1,3 +1,4 @@
+<!-- The blue and green text boxes should not overlap -->
 <html>
 <body style="font: 1em/1 Ahem, sans-serif;">
 <style>

Modified: trunk/LayoutTests/fast/table/table-row-before-child-style-update.html (94581 => 94582)


--- trunk/LayoutTests/fast/table/table-row-before-child-style-update.html	2011-09-06 18:13:20 UTC (rev 94581)
+++ trunk/LayoutTests/fast/table/table-row-before-child-style-update.html	2011-09-06 18:19:55 UTC (rev 94582)
@@ -1,3 +1,4 @@
+<!-- The blue and green text boxes should not overlap -->
 <html>
 <body style="font: 1em/1 Ahem, sans-serif;">
 <style>

Modified: trunk/LayoutTests/fast/table/table-row-style-not-updated-with-after-content.html (94581 => 94582)


--- trunk/LayoutTests/fast/table/table-row-style-not-updated-with-after-content.html	2011-09-06 18:13:20 UTC (rev 94581)
+++ trunk/LayoutTests/fast/table/table-row-style-not-updated-with-after-content.html	2011-09-06 18:19:55 UTC (rev 94582)
@@ -1,3 +1,4 @@
+<!-- The blue, yellow and green text boxes should not overlap -->
 <html>
 <body style="font: 1em/1 Ahem, sans-serif;">
 <style>    

Modified: trunk/LayoutTests/fast/table/table-row-style-not-updated-with-before-content.html (94581 => 94582)


--- trunk/LayoutTests/fast/table/table-row-style-not-updated-with-before-content.html	2011-09-06 18:13:20 UTC (rev 94581)
+++ trunk/LayoutTests/fast/table/table-row-style-not-updated-with-before-content.html	2011-09-06 18:19:55 UTC (rev 94582)
@@ -1,3 +1,4 @@
+<!-- The orange, blue and green text boxes should not overlap -->
 <html>
 <body style="font: 1em/1 Ahem, sans-serif;">
 <style>    

Modified: trunk/LayoutTests/fast/table/table-style-not-updated.html (94581 => 94582)


--- trunk/LayoutTests/fast/table/table-style-not-updated.html	2011-09-06 18:13:20 UTC (rev 94581)
+++ trunk/LayoutTests/fast/table/table-style-not-updated.html	2011-09-06 18:19:55 UTC (rev 94582)
@@ -1,3 +1,4 @@
+<!-- The blue and green text boxes should not overlap -->
 <html>
 <body style="font: 1em/1 Ahem, sans-serif;">
 <style>    

Modified: trunk/Source/WebCore/ChangeLog (94581 => 94582)


--- trunk/Source/WebCore/ChangeLog	2011-09-06 18:13:20 UTC (rev 94581)
+++ trunk/Source/WebCore/ChangeLog	2011-09-06 18:19:55 UTC (rev 94582)
@@ -1,3 +1,19 @@
+2011-09-06  Abhishek Arya  <[email protected]>
+
+        Style not propagated to anonymous boxes and anonymous
+        inline-blocks.
+        https://bugs.webkit.org/show_bug.cgi?id=67364
+
+        Reviewed by James Robinson.
+
+        Share propagateStyleToAnonymousChildren with RenderBlock::styleDidChange.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::styleDidChange):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::propagateStyleToAnonymousChildren):
+        * rendering/RenderObject.h:
+
 2011-09-06  Robin Cao  <[email protected]>
 
         [skia] States of GraphicsContext may never be restored after clipToImageBuffer

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (94581 => 94582)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-09-06 18:13:20 UTC (rev 94581)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-09-06 18:19:55 UTC (rev 94582)
@@ -246,21 +246,7 @@
         }
     }
 
-    // FIXME: We could save this call when the change only affected non-inherited properties
-    for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
-        if (child->isAnonymousBlock()) {
-            RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style());
-            if (style()->specifiesColumns()) {
-                if (child->style()->specifiesColumns())
-                    newStyle->inheritColumnPropertiesFrom(style());
-                if (child->style()->columnSpan())
-                    newStyle->setColumnSpan(true);
-            }
-            newStyle->setDisplay(BLOCK);
-            child->setStyle(newStyle.release());
-        }
-    }
-
+    propagateStyleToAnonymousChildren(true);    
     m_lineHeight = -1;
 
     // Update pseudos for :before and :after now.

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (94581 => 94582)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2011-09-06 18:13:20 UTC (rev 94581)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2011-09-06 18:19:55 UTC (rev 94582)
@@ -1810,10 +1810,11 @@
     }
 }
 
-void RenderObject::propagateStyleToAnonymousChildren()
+void RenderObject::propagateStyleToAnonymousChildren(bool blockChildrenOnly)
 {
+    // FIXME: We could save this call when the change only affected non-inherited properties.
     for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
-        if (child->isAnonymous() && !child->isBeforeOrAfterContent()) {
+        if (blockChildrenOnly ? child->isAnonymousBlock() : child->isAnonymous() && !child->isBeforeOrAfterContent()) {
             RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style());
             if (style()->specifiesColumns()) {
                 if (child->style()->specifiesColumns())
@@ -1821,7 +1822,7 @@
                 if (child->style()->columnSpan())
                     newStyle->setColumnSpan(true);
             }
-            newStyle->setDisplay(child->style()->display());
+            newStyle->setDisplay(blockChildrenOnly ? BLOCK : child->style()->display());
             child->setStyle(newStyle.release());
         }
     }

Modified: trunk/Source/WebCore/rendering/RenderObject.h (94581 => 94582)


--- trunk/Source/WebCore/rendering/RenderObject.h	2011-09-06 18:13:20 UTC (rev 94581)
+++ trunk/Source/WebCore/rendering/RenderObject.h	2011-09-06 18:19:55 UTC (rev 94582)
@@ -810,7 +810,7 @@
     virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
     // Overrides should call the superclass at the start
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
-    void propagateStyleToAnonymousChildren();
+    void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false);
 
     void drawLineForBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, BoxSide,
                             Color, EBorderStyle, int adjbw1, int adjbw2, bool antialias = false);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to