Title: [126659] branches/chromium/1229
Revision
126659
Author
[email protected]
Date
2012-08-24 17:15:19 -0700 (Fri, 24 Aug 2012)

Log Message

Merge 124888
BUG=132019
Review URL: https://chromiumcodereview.appspot.com/10879084

Modified Paths

Added Paths

Diff

Copied: branches/chromium/1229/LayoutTests/fullscreen/full-screen-line-boxes-crash-expected.txt (from rev 124888, trunk/LayoutTests/fullscreen/full-screen-line-boxes-crash-expected.txt) (0 => 126659)


--- branches/chromium/1229/LayoutTests/fullscreen/full-screen-line-boxes-crash-expected.txt	                        (rev 0)
+++ branches/chromium/1229/LayoutTests/fullscreen/full-screen-line-boxes-crash-expected.txt	2012-08-25 00:15:19 UTC (rev 126659)
@@ -0,0 +1,4 @@
+PASS. WebKit didn't crash.
+EVENT(webkitfullscreenchange)
+END OF TEST
+

Copied: branches/chromium/1229/LayoutTests/fullscreen/full-screen-line-boxes-crash.html (from rev 124888, trunk/LayoutTests/fullscreen/full-screen-line-boxes-crash.html) (0 => 126659)


--- branches/chromium/1229/LayoutTests/fullscreen/full-screen-line-boxes-crash.html	                        (rev 0)
+++ branches/chromium/1229/LayoutTests/fullscreen/full-screen-line-boxes-crash.html	2012-08-25 00:15:19 UTC (rev 126659)
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<body style="-webkit-columns: 30;">
+PASS.
+<bdi>
+<span style="margin-top: 1em;">WebKit didn't crash.
+<script src=""
+<script>
+    if (Element.prototype.webkitRequestFullScreen == undefined) {
+        logResult(false, "Element.prototype.webkitRequestFullScreen == undefined");
+        endTest();
+    } else {
+        var fullscreenChanged = function(event)
+        {
+            callback(event)
+        };
+        waitForEventOnce(document, "webkitfullscreenchange", fullscreenChanged);
+        var span = document.getElementsByTagName('span')[0];
+        var spanEnteredFullScreen = function() {
+            runWithKeyDown(function() { document.documentElement.webkitRequestFullScreen(); });
+            setTimeout("endTest()", 0);
+        };
+
+        callback = spanEnteredFullScreen;
+        runWithKeyDown(function() { span.webkitRequestFullScreen(); });
+    }
+</script>
+</body>
+</html>

Modified: branches/chromium/1229/Source/WebCore/rendering/RenderFullScreen.cpp (126658 => 126659)


--- branches/chromium/1229/Source/WebCore/rendering/RenderFullScreen.cpp	2012-08-25 00:13:19 UTC (rev 126658)
+++ branches/chromium/1229/Source/WebCore/rendering/RenderFullScreen.cpp	2012-08-25 00:15:19 UTC (rev 126659)
@@ -117,9 +117,20 @@
         // |object->parent()| can be null if the object is not yet attached
         // to |parent|.
         if (RenderObject* parent = object->parent()) {
+            RenderBlock* containingBlock = object->containingBlock();
+            ASSERT(containingBlock);
+            // Since we are moving the |object| to a new parent |fullscreenRenderer|,
+            // the line box tree underneath our |containingBlock| is not longer valid.
+            containingBlock->deleteLineBoxTree();
+
             parent->addChild(fullscreenRenderer, object);
             object->remove();
+            
+            // Always just do a full layout to ensure that line boxes get deleted properly.
+            // Because objects moved from |parent| to |fullscreenRenderer|, we want to
+            // make new line boxes instead of leaving the old ones around.
             parent->setNeedsLayoutAndPrefWidthsRecalc();
+            containingBlock->setNeedsLayoutAndPrefWidthsRecalc();
         }
         fullscreenRenderer->addChild(object);
         fullscreenRenderer->setNeedsLayoutAndPrefWidthsRecalc();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to