Commit 6384fe21 authored by thatcher's avatar thatcher
Browse files

Test: fast/block/positioning/window-height-change.html

        Reviewed by Hyatt.
        
        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5813
          positioned blocks don't update when resizing the window vertically

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::layoutBlock): Always relayout positioned children of
        the root, since their positions may depend on the viewport's height which
        may have changed.
        * rendering/render_flexbox.cpp:
        (khtml::RenderFlexibleBox::layoutBlock): Ditto.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@12712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent abbf63a8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" style="display: -apple-box;">
<head>
<style type="text/css">
body {
background: red;
}
div {
background: green;
width: 100px;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
</style>
</head>
<body>
<div></div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<style type="text/css">
body {
background: red;
}
div {
background: green;
width: 100px;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
</style>
</head>
<body>
<div></div>
</body>
</html>
1394a391b1b8ad57af3b0a9b74788ec5
\ No newline at end of file
layer at (0,0) size 800x600
RenderCanvas 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 {P} at (0,0) size 784x36
RenderText {TEXT} at (0,0) size 212x18
text run at (0,0) width 212: "This tests for a regression against "
RenderInline {I} at (0,0) size 755x36
RenderInline {A} at (0,0) size 348x18 [color=#0000EE]
RenderText {TEXT} at (212,0) size 348x18
text run at (212,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5813"
RenderText {TEXT} at (560,0) size 755x36
text run at (560,0) width 4: " "
text run at (564,0) width 191: "positioned blocks don't update"
text run at (0,18) width 226: "when resizing the window vertically"
RenderText {TEXT} at (226,18) size 4x18
text run at (226,18) width 4: "."
RenderBlock {P} at (0,52) size 784x18
RenderText {TEXT} at (0,0) size 289x18
text run at (0,0) width 289: "The two squares below should be solid green."
RenderBlock {HR} at (0,86) size 784x2 [border: (1px inset #000000)]
RenderBlock (anonymous) at (0,96) size 784x104
RenderPartObject {IFRAME} at (0,0) size 100x100
layer at (0,0) size 100x100
RenderCanvas at (0,0) size 100x100
layer at (0,0) size 100x8
RenderBlock {HTML} at (0,0) size 100x8
RenderBody {BODY} at (8,8) size 84x0 [bgcolor=#FF0000]
layer at (0,0) size 100x100
RenderBlock (positioned) {DIV} at (0,0) size 100x100 [bgcolor=#008000]
RenderText {TEXT} at (100,86) size 4x18
text run at (100,86) width 4: " "
RenderPartObject {IFRAME} at (104,0) size 100x100
layer at (0,0) size 100x100
RenderCanvas at (0,0) size 100x100
layer at (0,0) size 100x16
RenderFlexibleBox {HTML} at (0,0) size 100x16
RenderBody {BODY} at (8,8) size 0x0 [bgcolor=#FF0000]
layer at (0,0) size 100x100
RenderBlock (positioned) {DIV} at (0,0) size 100x100 [bgcolor=#008000]
RenderText {TEXT} at (0,0) size 0x0
RenderText {TEXT} at (0,0) size 0x0
RenderText {TEXT} at (0,0) size 0x0
<html>
<head>
<script>
function test() {
document.body.offsetTop; // force layout
document.getElementById('i').style.height = '100px';
document.getElementById('j').style.height = '100px';
}
</script>
<head>
<body onload="test()">
<p>
This tests for a regression against
<i><a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=5813">http://bugzilla.opendarwin.org/show_bug.cgi?id=5813</a>
positioned blocks don't update when resizing the window vertically</i>.
</p>
<p>
The two squares below should be solid green.
</p>
<hr>
<iframe id="i" style="width: 100px; height: 50px;" src="resources/window-height-change-frame.html"></iframe>
<iframe id="j" style="width: 100px; height: 50px;" src="resources/window-height-change-frame-flex.html"></iframe>
</body>
</html>
2006-02-08 Mitz Pettel <opendarwin.org@mitzpettel.com>
Test: fast/block/positioning/window-height-change.html
Reviewed by Hyatt.
- fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5813
positioned blocks don't update when resizing the window vertically
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::layoutBlock): Always relayout positioned children of
the root, since their positions may depend on the viewport's height which
may have changed.
* rendering/render_flexbox.cpp:
(khtml::RenderFlexibleBox::layoutBlock): Ditto.
2006-02-08 Dave Hyatt <hyatt@apple.com>
 
Add support for tiling of backgrounds using Cairo.
......
......@@ -425,7 +425,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
if (!relayoutChildren && posChildNeedsLayout() && !normalChildNeedsLayout() && !selfNeedsLayout()) {
// All we have to is lay out our positioned objects.
layoutPositionedObjects(relayoutChildren);
layoutPositionedObjects(relayoutChildren || isRoot());
if (hasOverflowClip())
m_layer->updateScrollInfoAfterLayout();
setNeedsLayout(false);
......@@ -532,7 +532,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
m_height += borderBottom() + paddingBottom();
}
layoutPositionedObjects( relayoutChildren );
layoutPositionedObjects(relayoutChildren || isRoot());
// Always ensure our overflow width/height are at least as large as our width/height.
m_overflowWidth = kMax(m_overflowWidth, m_width);
......
......@@ -246,7 +246,7 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren)
if (!relayoutChildren && posChildNeedsLayout() && !normalChildNeedsLayout() && !selfNeedsLayout()) {
// All we have to is lay out our positioned objects.
layoutPositionedObjects(relayoutChildren);
layoutPositionedObjects(relayoutChildren || isRoot());
if (hasOverflowClip())
m_layer->updateScrollInfoAfterLayout();
setNeedsLayout(false);
......@@ -305,7 +305,7 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren)
if (previousHeight != m_height)
relayoutChildren = true;
layoutPositionedObjects( relayoutChildren );
layoutPositionedObjects(relayoutChildren || isRoot());
//kdDebug() << renderName() << " layout width=" << m_width << " height=" << m_height << endl;
......
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