Title: [204767] releases/WebKitGTK/webkit-2.12
- Revision
- 204767
- Author
- [email protected]
- Date
- 2016-08-22 23:52:44 -0700 (Mon, 22 Aug 2016)
Log Message
Merge r201984 - Remove positioned descendants when RenderBlock is no longer a containing block.
https://bugs.webkit.org/show_bug.cgi?id=158655
<rdar://problem/26510032>
Reviewed by Simon Fraser.
Normally the RenderView is the containing block for fixed positioned renderers.
However when a renderer acquires some transform related properties, it becomes the containing
block for all the fixed positioned renderers in its descendant tree.
When the last transform related property is removed, the renderer is no longer a containing block
and we need to remove all these positioned renderers from the descendant tracker map (gPositionedDescendantsMap).
They will be inserted back into the tracker map during the next layout (either under the RenderView or
under the next transformed renderer in the ancestor chain).
Source/WebCore:
Test: fast/block/fixed-position-reparent-when-transition-is-removed.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::removePositionedObjectsIfNeeded):
LayoutTests:
* fast/block/fixed-position-reparent-when-transition-is-removed-expected.txt: Added.
* fast/block/fixed-position-reparent-when-transition-is-removed.html: Added.
Modified Paths
Added Paths
Diff
Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog (204766 => 204767)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog 2016-08-23 06:51:24 UTC (rev 204766)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog 2016-08-23 06:52:44 UTC (rev 204767)
@@ -1,3 +1,22 @@
+2016-06-12 Zalan Bujtas <[email protected]>
+
+ Remove positioned descendants when RenderBlock is no longer a containing block.
+ https://bugs.webkit.org/show_bug.cgi?id=158655
+ <rdar://problem/26510032>
+
+ Reviewed by Simon Fraser.
+
+ Normally the RenderView is the containing block for fixed positioned renderers.
+ However when a renderer acquires some transform related properties, it becomes the containing
+ block for all the fixed positioned renderers in its descendant tree.
+ When the last transform related property is removed, the renderer is no longer a containing block
+ and we need to remove all these positioned renderers from the descendant tracker map (gPositionedDescendantsMap).
+ They will be inserted back into the tracker map during the next layout (either under the RenderView or
+ under the next transformed renderer in the ancestor chain).
+
+ * fast/block/fixed-position-reparent-when-transition-is-removed-expected.txt: Added.
+ * fast/block/fixed-position-reparent-when-transition-is-removed.html: Added.
+
2016-06-03 Zalan Bujtas <[email protected]>
Incorrect rendering on boostmobile FAQ page
Added: releases/WebKitGTK/webkit-2.12/LayoutTests/fast/block/fixed-position-reparent-when-transition-is-removed-expected.txt (0 => 204767)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/fast/block/fixed-position-reparent-when-transition-is-removed-expected.txt (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/fast/block/fixed-position-reparent-when-transition-is-removed-expected.txt 2016-08-23 06:52:44 UTC (rev 204767)
@@ -0,0 +1,2 @@
+PASS if no crash or assert.
+
Added: releases/WebKitGTK/webkit-2.12/LayoutTests/fast/block/fixed-position-reparent-when-transition-is-removed.html (0 => 204767)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/fast/block/fixed-position-reparent-when-transition-is-removed.html (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/fast/block/fixed-position-reparent-when-transition-is-removed.html 2016-08-23 06:52:44 UTC (rev 204767)
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests the case when fixed positioned elements has a new containing block.</title>
+<style>
+div {
+ width: 100px;
+ height: 100px;
+ background-color: green;
+}
+</style>
+</head>
+<body>
+PASS if no crash or assert.
+<div id=container style="position: absolute; transform: rotate(10deg);">
+ <div id=fixedChild style="position: fixed;"></div>
+</div>
+<script>
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+var container = document.getElementById("container");
+setTimeout(function() {
+ container.style.transform = "";
+ setTimeout(function() {
+ var removeThis = document.getElementById("fixedChild");
+ removeThis.parentNode.removeChild(removeThis);
+ setTimeout(function() {
+ var newChild = document.createElement("div");
+ newChild.style.positioned = "absolute";
+ container.appendChild(newChild);
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 0);
+ }, 0);
+}, 0);
+</script>
+</body>
+</html>
\ No newline at end of file
Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (204766 => 204767)
--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog 2016-08-23 06:51:24 UTC (rev 204766)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog 2016-08-23 06:52:44 UTC (rev 204767)
@@ -1,3 +1,24 @@
+2016-06-12 Zalan Bujtas <[email protected]>
+
+ Remove positioned descendants when RenderBlock is no longer a containing block.
+ https://bugs.webkit.org/show_bug.cgi?id=158655
+ <rdar://problem/26510032>
+
+ Reviewed by Simon Fraser.
+
+ Normally the RenderView is the containing block for fixed positioned renderers.
+ However when a renderer acquires some transform related properties, it becomes the containing
+ block for all the fixed positioned renderers in its descendant tree.
+ When the last transform related property is removed, the renderer is no longer a containing block
+ and we need to remove all these positioned renderers from the descendant tracker map (gPositionedDescendantsMap).
+ They will be inserted back into the tracker map during the next layout (either under the RenderView or
+ under the next transformed renderer in the ancestor chain).
+
+ Test: fast/block/fixed-position-reparent-when-transition-is-removed.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::removePositionedObjectsIfNeeded):
+
2016-06-03 Zalan Bujtas <[email protected]>
Incorrect rendering on boostmobile FAQ page
Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/RenderBlock.cpp (204766 => 204767)
--- releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/RenderBlock.cpp 2016-08-23 06:51:24 UTC (rev 204766)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/RenderBlock.cpp 2016-08-23 06:52:44 UTC (rev 204767)
@@ -244,14 +244,20 @@
if (oldStyle.position() == newStyle.position() && hadTransform == willHaveTransform)
return;
- // We are no longer a containing block.
+ // We are no longer the containing block for fixed descendants.
+ if (hadTransform && !willHaveTransform) {
+ // Our positioned descendants will be inserted into a new containing block's positioned objects list during the next layout.
+ removePositionedObjects(nullptr, NewContainingBlock);
+ return;
+ }
+
+ // We are no longer the containing block for absolute positioned descendants.
if (newStyle.position() == StaticPosition && !willHaveTransform) {
- // Clear our positioned objects list. Our absolutely positioned descendants will be
- // inserted into our containing block's positioned objects list during layout.
+ // Our positioned descendants will be inserted into a new containing block's positioned objects list during the next layout.
removePositionedObjects(nullptr, NewContainingBlock);
return;
}
-
+
// We are a new containing block.
if (oldStyle.position() == StaticPosition && !hadTransform) {
// Remove our absolutely positioned descendants from their current containing block.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes