Commit 9eea0335 authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

Exiting fullscreen shouldn't crash if the element that was fullscreened

had associated anonymous blocks.
https://bugs.webkit.org/show_bug.cgi?id=68503

Source/WebCore:

Patch by Jeremy Apthorp <jeremya@chromium.org> on 2011-10-10
Reviewed by Simon Fraser.

Test: fullscreen/full-screen-render-inline.html
Test: fullscreen/parent-flow-inline-with-block-child.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::moveChildTo):
(WebCore::RenderBlock::moveChildrenTo):
* rendering/RenderBlock.h:
(WebCore::RenderBlock::moveChildTo):
(WebCore::RenderBlock::moveAllChildrenTo):
(WebCore::RenderBlock::moveChildrenTo):
* rendering/RenderFullScreen.cpp:
(RenderFullScreen::unwrapRenderer):
Move all children back to the parent, not just the firstChild.

LayoutTests:

When exiting fullscreen, if the child of the RenderFullScreen is a
block and the parent has inline flow elements, the parent's children
should be made non-inline before adding the fullscreened element back
to the parent.

Patch by Jeremy Apthorp <jeremya@chromium.org> on 2011-10-10
Reviewed by Simon Fraser.

* fullscreen/full-screen-render-inline.html: Added.
* fullscreen/full-screen-render-inline-expected.png: Added.
* fullscreen/full-screen-render-inline-expected.txt: Added.
* fullscreen/parent-flow-inline-with-block-child.html: Added.
* fullscreen/parent-flow-inline-with-block-child-expected.png: Added.
* fullscreen/parent-flow-inline-with-block-child-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97088 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 82380d32
2011-10-10 Jeremy Apthorp <jeremya@chromium.org>
Exiting fullscreen shouldn't crash if the element that was fullscreened
had associated anonymous blocks.
https://bugs.webkit.org/show_bug.cgi?id=68503
When exiting fullscreen, if the child of the RenderFullScreen is a
block and the parent has inline flow elements, the parent's children
should be made non-inline before adding the fullscreened element back
to the parent.
Reviewed by Simon Fraser.
* fullscreen/full-screen-render-inline.html: Added.
* fullscreen/full-screen-render-inline-expected.png: Added.
* fullscreen/full-screen-render-inline-expected.txt: Added.
* fullscreen/parent-flow-inline-with-block-child.html: Added.
* fullscreen/parent-flow-inline-with-block-child-expected.png: Added.
* fullscreen/parent-flow-inline-with-block-child-expected.txt: Added.
2011-10-10 Sergey Glazunov <serg.glazunov@gmail.com>
 
ScriptController::executeIfJavaScriptURL gets confused by synchronous frame loads
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderSummary {SUMMARY} at (0,0) size 784x48
RenderBlock (anonymous) at (0,0) size 784x0
RenderBlock (anonymous) at (0,0) size 784x0
RenderBlock (anonymous) at (0,0) size 784x16
RenderText {#text} at (0,0) size 16x16
text run at (0,0) width 16: "a"
RenderInline {SPAN} at (0,0) size 16x16
RenderText {#text} at (16,0) size 16x16
text run at (16,0) width 16: "b"
RenderBlock (anonymous) at (0,16) size 784x16
RenderBlock {DIV} at (0,0) size 784x16
RenderText {#text} at (0,0) size 16x16
text run at (0,0) width 16: "c"
RenderBlock (anonymous) at (0,32) size 784x16
RenderInline {SPAN} at (0,0) size 16x16
RenderText {#text} at (0,0) size 16x16
text run at (0,0) width 16: "d"
RenderText {#text} at (16,0) size 16x16
text run at (16,0) width 16: "e"
<style>
body {
font-family: ahem;
-webkit-font-smoothing: none;
}
</style>
<summary>a<span>b<div>c</div>d</span>e</summary>
<script>
if ("webkitRequestFullScreen" in Element.prototype) {
if (window.layoutTestController)
layoutTestController.waitUntilDone();
document.body.offsetTop;
var span = document.getElementsByTagName('span')[0];
var fullscreenChangeEvent = function(event) {
if (document.webkitIsFullScreen) {
setTimeout(function () {
document.webkitCancelFullScreen();
}, 0)
} else {
if (window.layoutTestController)
layoutTestController.notifyDone();
}
};
document.addEventListener('webkitfullscreenchange', fullscreenChangeEvent);
document.addEventListener('keydown', function () {
span.webkitRequestFullScreen();
});
if (window.eventSender)
eventSender.keyDown('a');
}
</script>
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock {DIV} at (0,0) size 784x32
RenderBlock (anonymous) at (0,0) size 784x16
RenderInline {SPAN} at (0,0) size 16x16
RenderText {#text} at (0,0) size 16x16
text run at (0,0) width 16: "1"
RenderText {#text} at (0,0) size 0x0
RenderBlock (anonymous) at (0,16) size 784x16
RenderInline {SPAN} at (0,0) size 16x16
RenderText {#text} at (0,0) size 16x16
text run at (0,0) width 16: "2"
RenderBlock (anonymous) at (0,32) size 784x0
RenderBlock {DIV} at (0,0) size 784x0
RenderBlock (anonymous) at (0,32) size 784x0
RenderInline {SPAN} at (0,0) size 0x0
RenderBlock (anonymous) at (0,32) size 784x0
RenderText {#text} at (0,0) size 0x0
<style>
body {
font-family: ahem;
-webkit-font-smoothing: none;
}
</style>
<div>
<span>1</span>
<span id='c2'>2</span>
</div>
<script>
if ("webkitRequestFullScreen" in Element.prototype) {
if (window.layoutTestController)
layoutTestController.waitUntilDone();
document.body.offsetTop;
var span = document.getElementById('c2');
var div = span.parentNode;
var spanEnteredFullScreen = function(event) {
setTimeout(function () {
span.appendChild(document.createElement('div'));
document.webkitCancelFullScreen();
if (window.layoutTestController)
layoutTestController.notifyDone();
}, 0);
};
document.addEventListener('webkitfullscreenchange', spanEnteredFullScreen);
document.addEventListener('keydown', function () {
span.webkitRequestFullScreen();
});
if (window.eventSender)
eventSender.keyDown('a');
}
</script>
2011-10-10 Jeremy Apthorp <jeremya@chromium.org>
Exiting fullscreen shouldn't crash if the element that was fullscreened
had associated anonymous blocks.
https://bugs.webkit.org/show_bug.cgi?id=68503
Reviewed by Simon Fraser.
Test: fullscreen/full-screen-render-inline.html
Test: fullscreen/parent-flow-inline-with-block-child.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::moveChildTo):
(WebCore::RenderBlock::moveChildrenTo):
* rendering/RenderBlock.h:
(WebCore::RenderBlock::moveChildTo):
(WebCore::RenderBlock::moveAllChildrenTo):
(WebCore::RenderBlock::moveChildrenTo):
* rendering/RenderFullScreen.cpp:
(RenderFullScreen::unwrapRenderer):
Move all children back to the parent, not just the firstChild.
2011-10-10 Sergey Glazunov <serg.glazunov@gmail.com>
 
ScriptController::executeIfJavaScriptURL gets confused by synchronous frame loads
......@@ -124,13 +124,16 @@ RenderObject* RenderFullScreen::wrapRenderer(RenderObject* object, Document* doc
void RenderFullScreen::unwrapRenderer()
{
RenderObject* wrappedRenderer = firstChild();
if (wrappedRenderer) {
wrappedRenderer->remove();
RenderObject* holder = placeholder() ? placeholder() : this;
RenderObject* parent = holder->parent();
if (parent)
parent->addChild(wrappedRenderer, holder);
RenderObject* holder = placeholder() ? placeholder() : this;
RenderObject* parent = holder->parent();
if (parent) {
RenderObject* child = firstChild();
while (child) {
RenderObject* nextChild = child->nextSibling();
child->remove();
parent->addChild(child, holder);
child = nextChild;
}
}
remove();
document()->setFullScreenRenderer(0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment