Title: [109867] trunk
Revision
109867
Author
[email protected]
Date
2012-03-05 23:31:45 -0800 (Mon, 05 Mar 2012)

Log Message

Element not fully repainted after application and removal of transform
https://bugs.webkit.org/show_bug.cgi?id=61338

Source/WebCore:

Patch by Kishore Bolisetty <[email protected]> on 2012-03-05
Reviewed by Simon Fraser.
RenderLayer is created and removed when a transform is applied and removed to element.
To render the element properly after removal of transform on it, preferred widths and dimensions of
the element and its containing block needs to be recalculated.

Test: fast/repaint/transform-rotate-and-remove.html

* rendering/RenderBoxModelObject.cpp:
(WebCore):
(WebCore::RenderBoxModelObject::styleWillChange):
(WebCore::RenderBoxModelObject::styleDidChange):
* rendering/RenderBoxModelObject.h:
(RenderBoxModelObject):

LayoutTests:

Patch by Kishore Bolisetty <[email protected]> on 2012-03-05
Reviewed by Simon Fraser.
Test to remove the transform property of an element upon onload event.

* fast/repaint/transform-rotate-and-remove.html: Added.
* platform/chromium-linux/fast/repaint/transform-rotate-and-remove-expected.png: Added.
* platform/chromium-linux/fast/repaint/transform-rotate-and-remove-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (109866 => 109867)


--- trunk/LayoutTests/ChangeLog	2012-03-06 07:23:21 UTC (rev 109866)
+++ trunk/LayoutTests/ChangeLog	2012-03-06 07:31:45 UTC (rev 109867)
@@ -1,3 +1,15 @@
+2012-03-05  Kishore Bolisetty  <[email protected]>
+
+        Element not fully repainted after application and removal of transform
+        https://bugs.webkit.org/show_bug.cgi?id=61338
+
+        Reviewed by Simon Fraser.
+        Test to remove the transform property of an element upon onload event.
+
+        * fast/repaint/transform-rotate-and-remove.html: Added.
+        * platform/chromium-linux/fast/repaint/transform-rotate-and-remove-expected.png: Added.
+        * platform/chromium-linux/fast/repaint/transform-rotate-and-remove-expected.txt: Added.
+
 2012-03-05  Gavin Barraclough  <[email protected]>
 
         putByIndex should throw in strict mode

Added: trunk/LayoutTests/fast/repaint/transform-rotate-and-remove.html (0 => 109867)


--- trunk/LayoutTests/fast/repaint/transform-rotate-and-remove.html	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/transform-rotate-and-remove.html	2012-03-06 07:31:45 UTC (rev 109867)
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <title>
+            Test case for https://bugs.webkit.org/show_bug.cgi?id=61338 
+        </title>
+        <style>
+            .rotated {
+                -webkit-transform:rotate(50deg);
+            }
+        </style>
+        <script src="" type="text/_javascript_"></script>
+        <script>
+            function repaintTest() {
+                document.getElementById('rel').classList.remove('rotated');
+            }
+        </script>
+    </head>
+    <body _onload_="runRepaintTest()">
+        <!--
+        <p> Bug <a href="" Element not fully repainted after application and removal of transform </p>
+        <p> The test PASSES only if all the four borders of the box are displayed in green</p>
+        -->
+        <div id="rel" class="rotated" style="height:50px; width:200px; background-color:yellow ; border:10px solid green;">  </div>
+    </body>
+</html>
Property changes on: trunk/LayoutTests/fast/repaint/transform-rotate-and-remove.html
___________________________________________________________________

Added: svn:executable

Added: trunk/LayoutTests/platform/chromium-linux/fast/repaint/transform-rotate-and-remove-expected.png (0 => 109867)


--- trunk/LayoutTests/platform/chromium-linux/fast/repaint/transform-rotate-and-remove-expected.png	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-linux/fast/repaint/transform-rotate-and-remove-expected.png	2012-03-06 07:31:45 UTC (rev 109867)
@@ -0,0 +1,6 @@
+\x89PNG
+
+
+IHDR X')tEXtchecksum58669f212a7e1be6c12dca3985b1d0b6ƭR
+\xF8IDATx\x9C\xED\xDC\xC1\x89\x83PFQ\xD2㳛`7v\xE94\xA0\x93.q\x90s\x96	·\xBC\xFC\x8B7\x8F1\xA6#۶\xFEWY\x96\xE5\xEA	𖟫܍\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\xD8\xE3\xEC\x8Fy\x9D\xBF\xB9^\xD3\xF1\x9Bm\xF0߸`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4N_r\xFF\xDB\xFElg\xC04MӼ^\xBD
+.X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X\xB1\xC7g\x9F\xCDk;\xE0>\\xB0b &\xB0b &\xB0b &\xB0b &\xB0b\xA7/\xB9\xEF\xCF\xFD\x9B;\xE0\xA5eY\xAE\x9Eoq\xC1\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88	,\x80\x98\xC0\x88\xCDc\x8C\xAB7܊@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`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C4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@L`\xC4@\xEC\xF8\x93\xF9Y\xCFcIEND\xAEB`\x82
\ No newline at end of file

Added: trunk/LayoutTests/platform/chromium-linux/fast/repaint/transform-rotate-and-remove-expected.txt (0 => 109867)


--- trunk/LayoutTests/platform/chromium-linux/fast/repaint/transform-rotate-and-remove-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-linux/fast/repaint/transform-rotate-and-remove-expected.txt	2012-03-06 07:31:45 UTC (rev 109867)
@@ -0,0 +1,6 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x86
+  RenderBlock {HTML} at (0,0) size 800x86
+    RenderBody {BODY} at (8,8) size 784x70
+      RenderBlock {DIV} at (0,0) size 220x70 [bgcolor=#FFFF00] [border: (10px solid #008000)]

Modified: trunk/Source/WebCore/ChangeLog (109866 => 109867)


--- trunk/Source/WebCore/ChangeLog	2012-03-06 07:23:21 UTC (rev 109866)
+++ trunk/Source/WebCore/ChangeLog	2012-03-06 07:31:45 UTC (rev 109867)
@@ -1,3 +1,22 @@
+2012-03-05  Kishore Bolisetty  <[email protected]>
+
+        Element not fully repainted after application and removal of transform
+        https://bugs.webkit.org/show_bug.cgi?id=61338
+
+        Reviewed by Simon Fraser.
+        RenderLayer is created and removed when a transform is applied and removed to element.
+        To render the element properly after removal of transform on it, preferred widths and dimensions of
+        the element and its containing block needs to be recalculated.
+
+        Test: fast/repaint/transform-rotate-and-remove.html
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore):
+        (WebCore::RenderBoxModelObject::styleWillChange):
+        (WebCore::RenderBoxModelObject::styleDidChange):
+        * rendering/RenderBoxModelObject.h:
+        (RenderBoxModelObject):
+
 2012-03-05  Gavin Barraclough  <[email protected]>
 
         putByIndex should throw in strict mode

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (109866 => 109867)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2012-03-06 07:23:21 UTC (rev 109866)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2012-03-06 07:31:45 UTC (rev 109867)
@@ -48,6 +48,7 @@
 
 bool RenderBoxModelObject::s_wasFloating = false;
 bool RenderBoxModelObject::s_hadLayer = false;
+bool RenderBoxModelObject::s_hadTransform = false;
 bool RenderBoxModelObject::s_layerWasSelfPainting = false;
 
 static const double cInterpolationCutoff = 800. * 800.;
@@ -302,6 +303,7 @@
 {
     s_wasFloating = isFloating();
     s_hadLayer = hasLayer();
+    s_hadTransform = hasTransform();
     if (s_hadLayer)
         s_layerWasSelfPainting = layer()->isSelfPaintingLayer();
 
@@ -377,6 +379,8 @@
         m_layer->removeOnlyThisLayer(); // calls destroyLayer() which clears m_layer
         if (s_wasFloating && isFloating())
             setChildNeedsLayout(true);
+        if (s_hadTransform)
+            setNeedsLayoutAndPrefWidthsRecalc();
     }
 
     if (layer()) {

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.h (109866 => 109867)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.h	2012-03-06 07:23:21 UTC (rev 109866)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.h	2012-03-06 07:31:45 UTC (rev 109867)
@@ -240,6 +240,7 @@
     // Used to store state between styleWillChange and styleDidChange
     static bool s_wasFloating;
     static bool s_hadLayer;
+    static bool s_hadTransform;
     static bool s_layerWasSelfPainting;
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to