Title: [99731] trunk
Revision
99731
Author
[email protected]
Date
2011-11-09 10:02:50 -0800 (Wed, 09 Nov 2011)

Log Message

SVG foreignObject wrong container
https://bugs.webkit.org/show_bug.cgi?id=64780

Patch by Ken Buchanan <[email protected]> on 2011-11-09
Reviewed by Simon Fraser.

Source/WebCore:

Resubmitting a patch originally by [email protected].
In determining where to add to m_positionedObjects during a repaint,
containingBlock is used, which adds the absolute positioned object to
the containing foreignObject. But, when the contained object is
dirtied, container() was used to dirty up the tree, which skipped over
the foreignObject causing the wrong parent to needsLayout(). This fix
makes container() and containingBlock() handle svg foreignObject's in
the same way.

This patch will cause svg/overflow/overflow-on-foreignObject.svg to
require rebaselined results on qt and gtk ports.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::container):

LayoutTests:

Added layout test for 64780 fix, rebaselined a test that it broke.
This will cause gtk and qt ports to also need rebaseline.

* platform/mac/svg/overflow/overflow-on-foreignObject-expected.png: Rebaseline
* platform/mac/svg/overflow/overflow-on-foreignObject-expected.txt: Rebaseline
* svg/foreignObject/absolute-position-foreign-object-child-crash.html: Added
* svg/foreignObject/absolute-position-foreign-object-child-crash-expected.txt: Added

Modified Paths

Added Paths

Property Changed

Diff

Modified: trunk/LayoutTests/ChangeLog (99730 => 99731)


--- trunk/LayoutTests/ChangeLog	2011-11-09 18:01:04 UTC (rev 99730)
+++ trunk/LayoutTests/ChangeLog	2011-11-09 18:02:50 UTC (rev 99731)
@@ -1,3 +1,18 @@
+2011-11-09  Ken Buchanan <[email protected]>
+
+        SVG foreignObject wrong container
+        https://bugs.webkit.org/show_bug.cgi?id=64780
+
+        Reviewed by Simon Fraser.
+
+        Added layout test for 64780 fix, rebaselined a test that it broke.
+        This will cause gtk and qt ports to also need rebaseline.
+
+        * platform/mac/svg/overflow/overflow-on-foreignObject-expected.png: Rebaseline
+        * platform/mac/svg/overflow/overflow-on-foreignObject-expected.txt: Rebaseline
+        * svg/foreignObject/absolute-position-foreign-object-child-crash.html: Added
+        * svg/foreignObject/absolute-position-foreign-object-child-crash-expected.txt: Added
+
 2011-11-09  Pavel Feldman  <[email protected]>
 
         Not reviewed: make new inspector test pass on Qt.
Property changes on: trunk/LayoutTests/ChangeLog
___________________________________________________________________

Added: svn:executable

Modified: trunk/LayoutTests/platform/mac/svg/overflow/overflow-on-foreignObject-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/mac/svg/overflow/overflow-on-foreignObject-expected.txt (99730 => 99731)


--- trunk/LayoutTests/platform/mac/svg/overflow/overflow-on-foreignObject-expected.txt	2011-11-09 18:01:04 UTC (rev 99730)
+++ trunk/LayoutTests/platform/mac/svg/overflow/overflow-on-foreignObject-expected.txt	2011-11-09 18:02:50 UTC (rev 99731)
@@ -3,5 +3,5 @@
 layer at (0,0) size 500x500
   RenderSVGRoot {svg} at (200,200) size 300x300
     RenderSVGForeignObject {foreignObject} at (100,100) size 300x300
-layer at (100,100) size 6006x6006 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 outlineClip at (0,0) size 800x600
-  RenderBlock (positioned) {html:div} at (100,100) size 6006x6006 [bgcolor=#008000] [border: (3px solid #000000)]
+layer at (0,0) size 6006x6006 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 outlineClip at (0,0) size 800x600
+  RenderBlock (positioned) {html:div} at (0,0) size 6006x6006 [bgcolor=#008000] [border: (3px solid #000000)]

Added: trunk/LayoutTests/svg/foreignObject/absolute-position-foreign-object-child-crash-expected.txt (0 => 99731)


--- trunk/LayoutTests/svg/foreignObject/absolute-position-foreign-object-child-crash-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/svg/foreignObject/absolute-position-foreign-object-child-crash-expected.txt	2011-11-09 18:02:50 UTC (rev 99731)
@@ -0,0 +1 @@
+PASS
Property changes on: trunk/LayoutTests/svg/foreignObject/absolute-position-foreign-object-child-crash-expected.txt
___________________________________________________________________

Added: svn:executable

Added: trunk/LayoutTests/svg/foreignObject/absolute-position-foreign-object-child-crash.html (0 => 99731)


--- trunk/LayoutTests/svg/foreignObject/absolute-position-foreign-object-child-crash.html	                        (rev 0)
+++ trunk/LayoutTests/svg/foreignObject/absolute-position-foreign-object-child-crash.html	2011-11-09 18:02:50 UTC (rev 99731)
@@ -0,0 +1,25 @@
+<script src=""
+
+<svg>
+    <foreignObject>
+        <div style="position: absolute;">
+            <div id="div1"></div>
+            <div id="div2" style="overflow:hidden; width:100px; height:100px;">x</div>
+        </div>
+    </foreignObject>
+</svg>
+<script>
+function RemoveNode(n) { n.parentNode.removeChild(n) }
+    window._onload_ = function() {
+        document.body.offsetTop; // Force layout.
+        RemoveNode(document.getElementById('div1'));
+        document.body.offsetTop; // Force layout.
+        RemoveNode(document.getElementById('div2'));
+        if (window.layoutTestController)
+            layoutTestController.dumpAsText();
+}
+</script>
+<body>
+    PASS
+</body>
+
Property changes on: trunk/LayoutTests/svg/foreignObject/absolute-position-foreign-object-child-crash.html
___________________________________________________________________

Added: svn:executable

Modified: trunk/Source/WebCore/ChangeLog (99730 => 99731)


--- trunk/Source/WebCore/ChangeLog	2011-11-09 18:01:04 UTC (rev 99730)
+++ trunk/Source/WebCore/ChangeLog	2011-11-09 18:02:50 UTC (rev 99731)
@@ -1,3 +1,25 @@
+2011-11-09  Ken Buchanan  <[email protected]>
+
+        SVG foreignObject wrong container
+        https://bugs.webkit.org/show_bug.cgi?id=64780
+
+        Reviewed by Simon Fraser.
+
+        Resubmitting a patch originally by [email protected].
+        In determining where to add to m_positionedObjects during a repaint,
+        containingBlock is used, which adds the absolute positioned object to
+        the containing foreignObject. But, when the contained object is
+        dirtied, container() was used to dirty up the tree, which skipped over
+        the foreignObject causing the wrong parent to needsLayout(). This fix
+        makes container() and containingBlock() handle svg foreignObject's in
+        the same way.
+
+        This patch will cause svg/overflow/overflow-on-foreignObject.svg to
+        require rebaselined results on qt and gtk ports.
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::container):
+
 2011-11-09  Andreas Kling  <[email protected]>
 
         Shrink StyleSheet on 64-bit.
Property changes on: trunk/Source/WebCore/ChangeLog
___________________________________________________________________

Added: svn:executable

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (99730 => 99731)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2011-11-09 18:01:04 UTC (rev 99730)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2011-11-09 18:02:50 UTC (rev 99731)
@@ -2167,6 +2167,10 @@
         while (o && o->style()->position() == StaticPosition && !o->isRenderView() && !(o->hasTransform() && o->isRenderBlock())) {
             if (repaintContainerSkipped && o == repaintContainer)
                 *repaintContainerSkipped = true;
+#if ENABLE(SVG)
+                if (o->isSVGForeignObject()) // foreignObject is the containing block for contents inside it
+                    break;
+#endif
             o = o->parent();
         }
     }
Property changes on: trunk/Source/WebCore/rendering/RenderObject.cpp
___________________________________________________________________

Added: svn:executable

_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to