Title: [124524] branches/safari-536.26-branch

Diff

Modified: branches/safari-536.26-branch/LayoutTests/ChangeLog (124523 => 124524)


--- branches/safari-536.26-branch/LayoutTests/ChangeLog	2012-08-02 23:09:11 UTC (rev 124523)
+++ branches/safari-536.26-branch/LayoutTests/ChangeLog	2012-08-02 23:09:32 UTC (rev 124524)
@@ -1,5 +1,21 @@
 2012-08-02  Lucas Forschler  <[email protected]>
 
+    Merge 119914
+
+    2012-06-09  Florin Malita  <[email protected]>
+
+            Fixed-position foreignObject descendants should be relative to the foreignObject viewport
+            https://bugs.webkit.org/show_bug.cgi?id=88547
+
+            Reviewed by Abhishek Arya.
+
+            * svg/foreignObject/fO-fixed-position-crash-expected.txt: Added.
+            * svg/foreignObject/fO-fixed-position-crash.html: Added.
+            * svg/foreignObject/fixed-position-expected.svg: Added.
+            * svg/foreignObject/fixed-position.svg: Added.
+
+2012-08-02  Lucas Forschler  <[email protected]>
+
     Merge 119911
 
     2012-06-09  Pablo Flouret  <[email protected]>

Copied: branches/safari-536.26-branch/LayoutTests/svg/foreignObject/fO-fixed-position-crash-expected.txt (from rev 119914, trunk/LayoutTests/svg/foreignObject/fO-fixed-position-crash-expected.txt) (0 => 124524)


--- branches/safari-536.26-branch/LayoutTests/svg/foreignObject/fO-fixed-position-crash-expected.txt	                        (rev 0)
+++ branches/safari-536.26-branch/LayoutTests/svg/foreignObject/fO-fixed-position-crash-expected.txt	2012-08-02 23:09:32 UTC (rev 124524)
@@ -0,0 +1 @@
+PASS

Copied: branches/safari-536.26-branch/LayoutTests/svg/foreignObject/fO-fixed-position-crash.html (from rev 119914, trunk/LayoutTests/svg/foreignObject/fO-fixed-position-crash.html) (0 => 124524)


--- branches/safari-536.26-branch/LayoutTests/svg/foreignObject/fO-fixed-position-crash.html	                        (rev 0)
+++ branches/safari-536.26-branch/LayoutTests/svg/foreignObject/fO-fixed-position-crash.html	2012-08-02 23:09:32 UTC (rev 124524)
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<body>
+<!-- Test for https://bugs.webkit.org/show_bug.cgi?id=88547 -->
+<svg xmlns="http://www.w3.org/2000/svg">
+  <foreignObject>
+    <div id="div" style="position:fixed; height:50%; counter-increment:inherit;">Passes if replacing this text doesn't cause a crash.</div>
+  </foreignObject>
+
+  <script>
+    window._onload_=function() {
+      document.designMode="on";
+      document.execCommand("SelectAll");
+      document.getElementById('div').innerHTML = "PASS";
+    };
+
+    if (window.layoutTestController)
+      layoutTestController.dumpAsText();
+  </script>
+</svg>
+</body>
+</html>

Copied: branches/safari-536.26-branch/LayoutTests/svg/foreignObject/fixed-position-expected.svg (from rev 119914, trunk/LayoutTests/svg/foreignObject/fixed-position-expected.svg) (0 => 124524)


--- branches/safari-536.26-branch/LayoutTests/svg/foreignObject/fixed-position-expected.svg	                        (rev 0)
+++ branches/safari-536.26-branch/LayoutTests/svg/foreignObject/fixed-position-expected.svg	2012-08-02 23:09:32 UTC (rev 124524)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns="http://www.w3.org/2000/svg">
+  <rect width="100" height="100" fill="green"/>
+</svg>

Copied: branches/safari-536.26-branch/LayoutTests/svg/foreignObject/fixed-position.svg (from rev 119914, trunk/LayoutTests/svg/foreignObject/fixed-position.svg) (0 => 124524)


--- branches/safari-536.26-branch/LayoutTests/svg/foreignObject/fixed-position.svg	                        (rev 0)
+++ branches/safari-536.26-branch/LayoutTests/svg/foreignObject/fixed-position.svg	2012-08-02 23:09:32 UTC (rev 124524)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns="http://www.w3.org/2000/svg">
+  <rect width="98" height="98" fill="red"/>
+  <foreignObject width="200" height="200" transform="translate(-100, 0)">
+    <!-- Fixed-position content should be relative to the foreignObject viewport. -->
+    <div xmlns="http://www.w3.org/1999/xhtml" style="position: fixed; left: 100px; width: 100px; height: 50%; background-color: green;"></div>
+  </foreignObject>
+</svg>

Modified: branches/safari-536.26-branch/Source/WebCore/ChangeLog (124523 => 124524)


--- branches/safari-536.26-branch/Source/WebCore/ChangeLog	2012-08-02 23:09:11 UTC (rev 124523)
+++ branches/safari-536.26-branch/Source/WebCore/ChangeLog	2012-08-02 23:09:32 UTC (rev 124524)
@@ -1,5 +1,34 @@
 2012-08-02  Lucas Forschler  <[email protected]>
 
+    Merge 119914
+
+    2012-06-09  Florin Malita  <[email protected]>
+
+            Fixed-position foreignObject descendants should be relative to the foreignObject viewport
+            https://bugs.webkit.org/show_bug.cgi?id=88547
+
+            Reviewed by Abhishek Arya.
+
+            Tests: svg/foreignObject/fO-fixed-position-crash.html
+                   svg/foreignObject/fixed-position-expected.svg
+                   svg/foreignObject/fixed-position.svg
+
+            Fixed position elements are currently registered with the top level
+            RenderView even when embedded within an SVG foreignOject. This patch
+            changes containingBlock() & container() to return the containing
+            foreignObject renderer instead.
+
+            The new foreignObject fixed position behavior matches that of current
+            FireFox and Opera versions and is consistent with the spec:
+            http://www.w3.org/TR/CSS2/visuren.html#fixed-positioning
+            http://www.w3.org/TR/SVG/coords.html#EstablishingANewViewport
+
+            * rendering/RenderObject.cpp:
+            (WebCore::RenderObject::containingBlock):
+            (WebCore::RenderObject::container):
+
+2012-08-02  Lucas Forschler  <[email protected]>
+
     Merge 119911
 
     2012-06-09  Pablo Flouret  <[email protected]>

Modified: branches/safari-536.26-branch/Source/WebCore/rendering/RenderObject.cpp (124523 => 124524)


--- branches/safari-536.26-branch/Source/WebCore/rendering/RenderObject.cpp	2012-08-02 23:09:11 UTC (rev 124523)
+++ branches/safari-536.26-branch/Source/WebCore/rendering/RenderObject.cpp	2012-08-02 23:09:32 UTC (rev 124524)
@@ -715,8 +715,14 @@
     if (!o && isRenderScrollbarPart())
         o = toRenderScrollbarPart(this)->rendererOwningScrollbar();
     if (!isText() && m_style->position() == FixedPosition) {
-        while (o && !o->isRenderView() && !(o->hasTransform() && o->isRenderBlock()))
+        while (o && !o->isRenderView() && !(o->hasTransform() && o->isRenderBlock())) {
+#if ENABLE(SVG)
+            // foreignObject is the containing block for its contents.
+            if (o->isSVGForeignObject())
+                break;
+#endif
             o = o->parent();
+        }
     } else if (!isText() && m_style->position() == AbsolutePosition) {
         while (o && (o->style()->position() == StaticPosition || (o->isInline() && !o->isReplaced())) && !o->isRenderView() && !(o->hasTransform() && o->isRenderBlock())) {
             // For relpositioned inlines, we return the nearest non-anonymous enclosing block. We don't try
@@ -2249,6 +2255,11 @@
         while (o && o->parent() && !(o->hasTransform() && o->isRenderBlock())) {
             if (repaintContainerSkipped && o == repaintContainer)
                 *repaintContainerSkipped = true;
+#if ENABLE(SVG)
+            // foreignObject is the containing block for its contents.
+            if (o->isSVGForeignObject())
+                break;
+#endif
             o = o->parent();
         }
     } else if (pos == AbsolutePosition) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to