Commit baef7337 authored by mitz@apple.com's avatar mitz@apple.com

Layout not updating in a subtree when a scrollbar is hidden in a flexbox descendant

https://bugs.webkit.org/show_bug.cgi?id=48154

Reviewed by Anders Carlsson.

WebCore: 

Test: scrollbars/hidden-scrollbar-prevents-layout.html

updateScrollInfoAfterLayout() calling setHasHorizontalScrollbar() caused updateScrollbarParts()
to call setChildNeedsLayout() on the overflow, because the RenderScrollbar was created with
the default thickness instead of the thickness specified in style. This led to the the overflow’s
parent to be re-marked for layout during its own parent’s finishDelayUpdateScrollInfo(), and
the result was that at the end of RenderView::layout(), there was a dirty renderer.

* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::RenderScrollbar): Set the frame size in the 'display: none' and
'visibility: hidden' cases as well.

LayoutTests: 

* scrollbars/hidden-scrollbar-prevents-layout-expected.txt: Added.
* scrollbars/hidden-scrollbar-prevents-layout.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70354 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 23071ae8
2010-10-22 Dan Bernstein <mitz@apple.com>
Reviewed by Anders Carlsson.
Layout not updating in a subtree when a scrollbar is hidden in a flexbox descendant
https://bugs.webkit.org/show_bug.cgi?id=48154
* scrollbars/hidden-scrollbar-prevents-layout-expected.txt: Added.
* scrollbars/hidden-scrollbar-prevents-layout.html: Added.
2010-10-22 Ojan Vafai <ojan@chromium.org>
fast/parser/block-nesting-cap.html is regularly on the cusp
Test for https://bugs.webkit.org/show_bug.cgi?id=48154 <rdar://problem/8251616> Layout not updating in a subtree when a scrollbar is hidden in a flexbox descendant.
There should be no red on this page.
PASS
<head>
<style>
#overflow::-webkit-scrollbar {
visibility: hidden;
}
</style>
</head>
<body style="height: 200%">
<p>
Test for <i><a href="https://bugs.webkit.org/show_bug.cgi?id=48154">https://bugs.webkit.org/show_bug.cgi?id=48154</a>
<a href="rdar://problem/8251616">&lt;rdar://problem/8251616></a> Layout not updating in a subtree when a scrollbar is hidden in a flexbox descendant</i>.
</p>
<p>
There should be no red on this page.
</p>
<p id="result">Test did not run.</p>
<div style="display: -webkit-box; -webkit-box-orient: vertical;">
<div> <!-- this is going to end up marked for layout after initial layout -->
<div id="target" style="width: 100px; height: 100px; background-color: red;"></div>
<div id="overflow" style="overflow: auto; height: 100px; width: 100px;">
<div style="height: 150px;"></div>
</div>
</div>
</div>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
function test()
{
var target = document.getElementById("target");
target.style.height = "0";
document.getElementById("result").innerText = target.offsetHeight == 0 ? "PASS" : "FAIL";
}
document.body.offsetTop;
test();
</script>
</body>
2010-10-22 Dan Bernstein <mitz@apple.com>
Reviewed by Anders Carlsson.
Layout not updating in a subtree when a scrollbar is hidden in a flexbox descendant
https://bugs.webkit.org/show_bug.cgi?id=48154
Test: scrollbars/hidden-scrollbar-prevents-layout.html
updateScrollInfoAfterLayout() calling setHasHorizontalScrollbar() caused updateScrollbarParts()
to call setChildNeedsLayout() on the overflow, because the RenderScrollbar was created with
the default thickness instead of the thickness specified in style. This led to the the overflow’s
parent to be re-marked for layout during its own parent’s finishDelayUpdateScrollInfo(), and
the result was that at the end of RenderView::layout(), there was a dirty renderer.
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::RenderScrollbar): Set the frame size in the 'display: none' and
'visibility: hidden' cases as well.
2010-10-22 Patrick Gansterer <paroga@webkit.org>
Unreviewed.
......@@ -47,13 +47,19 @@ RenderScrollbar::RenderScrollbar(ScrollbarClient* client, ScrollbarOrientation o
// FIXME: We need to do this because RenderScrollbar::styleChanged is called as soon as the scrollbar is created.
// Update the scrollbar size.
int width = 0;
int height = 0;
updateScrollbarPart(ScrollbarBGPart);
RenderScrollbarPart* part = m_parts.get(ScrollbarBGPart);
if (!part)
return;
part->layout();
setFrameRect(IntRect(0, 0, part->width(), part->height()));
if (RenderScrollbarPart* part = m_parts.get(ScrollbarBGPart)) {
part->layout();
width = part->width();
height = part->height();
} else if (this->orientation() == HorizontalScrollbar)
width = this->width();
else
height = this->height();
setFrameRect(IntRect(0, 0, width, height));
}
RenderScrollbar::~RenderScrollbar()
......
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