Commit 3fce1b33 authored by mitz@apple.com's avatar mitz@apple.com

WebCore:

        Reviewed by Dave Hyatt.

        - fix <rdar://problem/6059648> Some content not visible when the window is short at courtneyalbright.com

        Test: fast/overflow/float-in-relpositioned.html

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::lowestPosition): Add this block's relative offset
        to floats' and positioned objects' lowest position.
        (WebCore::RenderBlock::rightmostPosition): Ditto.
        (WebCore::RenderBlock::leftmostPosition): Ditto.
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::lowestPosition): Removed redundant test.
        (WebCore::RenderBox::rightmostPosition): Ditto.
        (WebCore::RenderBox::leftmostPosition): Ditto.

LayoutTests:

        Reviewed by Dave Hyatt.

        - test, updated test and results for <rdar://problem/6059648> Some content not visible when the window is short at courtneyalbright.com

        * fast/overflow/float-in-relpositioned.html: Added.
        * fast/repaint/containing-block-position-change.html: Changed to avoid
        a full repaint due to a scroll bar appearing.
        * platform/mac/fast/clip/015-expected.txt:
        * platform/mac/fast/overflow/float-in-relpositioned-expected.checksum: Added.
        * platform/mac/fast/overflow/float-in-relpositioned-expected.png: Added.
        * platform/mac/fast/overflow/float-in-relpositioned-expected.txt: Added.
        * platform/mac/fast/repaint/clipped-relative-expected.txt:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35427 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 72cc551d
2008-07-29 Dan Bernstein <mitz@apple.com>
Reviewed by Dave Hyatt.
- test, updated test and results for <rdar://problem/6059648> Some content not visible when the window is short at courtneyalbright.com
* fast/overflow/float-in-relpositioned.html: Added.
* fast/repaint/containing-block-position-change.html: Changed to avoid
a full repaint due to a scroll bar appearing.
* platform/mac/fast/clip/015-expected.txt:
* platform/mac/fast/overflow/float-in-relpositioned-expected.checksum: Added.
* platform/mac/fast/overflow/float-in-relpositioned-expected.png: Added.
* platform/mac/fast/overflow/float-in-relpositioned-expected.txt: Added.
* platform/mac/fast/repaint/clipped-relative-expected.txt:
2008-07-29 Dan Bernstein <mitz@apple.com>
Reviewed by Dave Hyatt.
<style>
.overflow {
width: 100px;
height: 100px;
overflow: auto;
border: 1px solid black;
margin: 10px;
}
.rel {
width: 25px;
height: 25px;
background-color: black;
position: relative;
}
.rel div {
width: 75px;
height: 75px;
background-color: rgba(0, 0, 255, 0.5);
}
.float { float: left; }
.abs { position: absolute; }
</style>
<p>
Test for <i><a href="rdar://problem/6059648">rdar://problem/6059648</a>
Some content not visible when the window is short at courtneyalbright.com</i>.
</p>
<p>
Each black box below should have a scroll bar allowing the blue square to
be scrolled fully into view.
</p>
<div class="overflow">
<div class="rel" style="left: 50px;">
<div class="float"></div>
</div>
</div>
<div class="overflow">
<div class="rel" style="top: 50px;">
<div class="float"></div>
</div>
</div>
<div class="overflow">
<div class="rel" style="left: 50px;">
<div class="abs"></div>
</div>
</div>
<div class="overflow">
<div class="rel" style="top: 50px;">
<div class="abs"></div>
</div>
</div>
<html>
<head>
<script src="repaint.js" type="text/javascript"></script>
<script type="text/javascript">
function repaintTest()
{
<script src="repaint.js" type="text/javascript"></script>
<script type="text/javascript">
function repaintTest()
{
document.getElementById('t').style.position = 'relative';
}
</script>
}
</script>
</head>
<body onload="runRepaintTest();">
<p>
......@@ -14,7 +14,7 @@
REGRESSION: [Incremental Repaint] DHTML movement test failures</i>.
</p>
<hr>
<div id="t" style="position: static; left: 50px;">
<div id="t" style="position: static; left: 50px; width: 500px;">
<div style="width: 50px; height: 50px; background: blue; position: absolute; left: 100px;"></div>
</div>
</body>
......
......@@ -7,5 +7,5 @@ layer at (0,0) size 800x134
RenderText {#text} at (0,0) size 736x18
text run at (0,0) width 304: "You should see a 100x100 green square below. "
text run at (304,0) width 432: "This test makes sure overflow uses containing blocks when clipping."
layer at (8,26) size 100x100 scrollWidth 200 scrollHeight 200
layer at (8,26) size 100x100 scrollWidth 300 scrollHeight 300
RenderBlock {DIV} at (0,18) size 100x100 [bgcolor=#008000]
768f36974d079b0ef89b91b9780a44f7
\ No newline at end of file
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 784x582
RenderBlock {P} at (0,0) size 784x18
RenderText {#text} at (0,0) size 53x18
text run at (0,0) width 53: "Test for "
RenderInline {I} at (0,0) size 632x18
RenderInline {A} at (0,0) size 154x18 [color=#0000EE]
RenderText {#text} at (53,0) size 154x18
text run at (53,0) width 154: "rdar://problem/6059648"
RenderText {#text} at (207,0) size 478x18
text run at (207,0) width 4: " "
text run at (211,0) width 474: "Some content not visible when the window is short at courtneyalbright.com"
RenderText {#text} at (685,0) size 4x18
text run at (685,0) width 4: "."
RenderBlock {P} at (0,34) size 784x18
RenderText {#text} at (0,0) size 640x18
text run at (0,0) width 472: "Each black box below should have a scroll bar allowing the blue square to "
text run at (472,0) width 168: "be scrolled fully into view."
layer at (18,76) size 102x102 clip at (19,77) size 100x85 scrollWidth 125
RenderBlock {DIV} at (10,68) size 102x102 [border: (1px solid #000000)]
layer at (18,188) size 102x102 clip at (19,189) size 85x100 scrollHeight 125
RenderBlock {DIV} at (10,180) size 102x102 [border: (1px solid #000000)]
layer at (18,300) size 102x102 clip at (19,301) size 100x85 scrollWidth 125
RenderBlock {DIV} at (10,292) size 102x102 [border: (1px solid #000000)]
layer at (18,412) size 102x102 clip at (19,413) size 85x100 scrollHeight 125
RenderBlock {DIV} at (10,404) size 102x102 [border: (1px solid #000000)]
layer at (69,77) size 75x75 backgroundClip at (19,77) size 100x85 clip at (19,77) size 100x85 outlineClip at (19,77) size 100x85
RenderBlock (relative positioned) {DIV} at (1,1) size 25x25 [bgcolor=#000000]
RenderBlock (floating) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF7F]
layer at (19,239) size 75x75 backgroundClip at (19,189) size 85x100 clip at (19,189) size 85x100 outlineClip at (19,189) size 85x100
RenderBlock (relative positioned) {DIV} at (1,1) size 25x25 [bgcolor=#000000]
RenderBlock (floating) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF7F]
layer at (69,301) size 25x25
RenderBlock (relative positioned) {DIV} at (1,1) size 25x25 [bgcolor=#000000]
layer at (69,301) size 75x75 backgroundClip at (19,301) size 100x85 clip at (19,301) size 100x85 outlineClip at (19,301) size 100x85
RenderBlock (positioned) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF7F]
layer at (19,463) size 25x25
RenderBlock (relative positioned) {DIV} at (1,1) size 25x25 [bgcolor=#000000]
layer at (19,463) size 75x75 backgroundClip at (19,413) size 85x100 clip at (19,413) size 85x100 outlineClip at (19,413) size 85x100
RenderBlock (positioned) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF7F]
......@@ -17,7 +17,7 @@ layer at (0,0) size 800x600
RenderText {#text} at (200,18) size 4x18
text run at (200,18) width 4: "."
RenderBlock {HR} at (0,52) size 784x2 [border: (1px inset #000000)]
layer at (8,70) size 214x232 scrollWidth 430
layer at (8,70) size 214x232 scrollWidth 644
RenderBlock (relative positioned) {DIV} at (0,62) size 214x232
layer at (-2,70) size 214x232 backgroundClip at (8,70) size 214x232 clip at (8,70) size 214x232 outlineClip at (8,70) size 214x232
RenderBlock (positioned) {DIV} at (-440,0) size 214x232
......
2008-07-29 Dan Bernstein <mitz@apple.com>
Reviewed by Dave Hyatt.
- fix <rdar://problem/6059648> Some content not visible when the window is short at courtneyalbright.com
Test: fast/overflow/float-in-relpositioned.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::lowestPosition): Add this block's relative offset
to floats' and positioned objects' lowest position.
(WebCore::RenderBlock::rightmostPosition): Ditto.
(WebCore::RenderBlock::leftmostPosition): Ditto.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::lowestPosition): Removed redundant test.
(WebCore::RenderBox::rightmostPosition): Ditto.
(WebCore::RenderBox::leftmostPosition): Ditto.
2008-07-29 Dan Bernstein <mitz@apple.com>
Reviewed by Dave Hyatt.
......@@ -2462,8 +2462,10 @@ int RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf)
if (!includeOverflowInterior && hasOverflowClip())
return bottom;
if (includeSelf && m_overflowHeight > bottom)
bottom = m_overflowHeight;
int relativeOffset = includeSelf && isRelPositioned() ? relativePositionOffsetY() : 0;
if (includeSelf)
bottom = max(bottom, m_overflowHeight + relativeOffset);
if (m_positionedObjects) {
RenderObject* r;
......@@ -2478,7 +2480,7 @@ int RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf)
// Therefore we should not allow it to contribute to the lowest position.
if (!isRenderView() || r->xPos() + r->width() > 0 || r->xPos() + r->rightmostPosition(false) > 0) {
int lp = r->yPos() + r->lowestPosition(false);
bottom = max(bottom, lp);
bottom = max(bottom, lp + relativeOffset);
}
}
}
......@@ -2487,7 +2489,7 @@ int RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf)
if (m_hasColumns) {
Vector<IntRect>* colRects = columnRects();
for (unsigned i = 0; i < colRects->size(); i++)
bottom = max(bottom, colRects->at(i).bottom());
bottom = max(bottom, colRects->at(i).bottom() + relativeOffset);
return bottom;
}
......@@ -2497,7 +2499,7 @@ int RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf)
for ( ; (r = it.current()); ++it ) {
if (r->m_shouldPaint || r->m_renderer->hasLayer()) {
int lp = r->m_top + r->m_renderer->marginTop() + r->m_renderer->lowestPosition(false);
bottom = max(bottom, lp);
bottom = max(bottom, lp + relativeOffset);
}
}
}
......@@ -2517,8 +2519,10 @@ int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSel
if (!includeOverflowInterior && hasOverflowClip())
return right;
if (includeSelf && m_overflowWidth > right)
right = m_overflowWidth;
int relativeOffset = includeSelf && isRelPositioned() ? relativePositionOffsetX() : 0;
if (includeSelf)
right = max(right, m_overflowWidth + relativeOffset);
if (m_positionedObjects) {
RenderObject* r;
......@@ -2533,7 +2537,7 @@ int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSel
// Therefore we should not allow it to contribute to the rightmost position.
if (!isRenderView() || r->yPos() + r->height() > 0 || r->yPos() + r->lowestPosition(false) > 0) {
int rp = r->xPos() + r->rightmostPosition(false);
right = max(right, rp);
right = max(right, rp + relativeOffset);
}
}
}
......@@ -2542,7 +2546,7 @@ int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSel
if (m_hasColumns) {
// This only matters for LTR
if (style()->direction() == LTR)
right = max(columnRects()->last().right(), right);
right = max(columnRects()->last().right() + relativeOffset, right);
return right;
}
......@@ -2552,7 +2556,7 @@ int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSel
for ( ; (r = it.current()); ++it ) {
if (r->m_shouldPaint || r->m_renderer->hasLayer()) {
int rp = r->m_left + r->m_renderer->marginLeft() + r->m_renderer->rightmostPosition(false);
right = max(right, rp);
right = max(right, rp + relativeOffset);
}
}
}
......@@ -2577,8 +2581,10 @@ int RenderBlock::leftmostPosition(bool includeOverflowInterior, bool includeSelf
if (!includeOverflowInterior && hasOverflowClip())
return left;
if (includeSelf && m_overflowLeft < left)
left = m_overflowLeft;
int relativeOffset = includeSelf && isRelPositioned() ? relativePositionOffsetX() : 0;
if (includeSelf)
left = min(left, m_overflowLeft + relativeOffset);
if (m_positionedObjects) {
RenderObject* r;
......@@ -2593,7 +2599,7 @@ int RenderBlock::leftmostPosition(bool includeOverflowInterior, bool includeSelf
// Therefore we should not allow it to contribute to the leftmost position.
if (!isRenderView() || r->yPos() + r->height() > 0 || r->yPos() + r->lowestPosition(false) > 0) {
int lp = r->xPos() + r->leftmostPosition(false);
left = min(left, lp);
left = min(left, lp + relativeOffset);
}
}
}
......@@ -2602,7 +2608,7 @@ int RenderBlock::leftmostPosition(bool includeOverflowInterior, bool includeSelf
if (m_hasColumns) {
// This only matters for RTL
if (style()->direction() == RTL)
left = min(columnRects()->last().x(), left);
left = min(columnRects()->last().x() + relativeOffset, left);
return left;
}
......@@ -2612,7 +2618,7 @@ int RenderBlock::leftmostPosition(bool includeOverflowInterior, bool includeSelf
for ( ; (r = it.current()); ++it ) {
if (r->m_shouldPaint || r->m_renderer->hasLayer()) {
int lp = r->m_left + r->m_renderer->marginLeft() + r->m_renderer->leftmostPosition(false);
left = min(left, lp);
left = min(left, lp + relativeOffset);
}
}
}
......
......@@ -2656,7 +2656,7 @@ int RenderBox::lowestPosition(bool includeOverflowInterior, bool includeSelf) co
if (!includeSelf || !m_width)
return 0;
int bottom = m_height;
if (includeSelf && isRelPositioned())
if (isRelPositioned())
bottom += relativePositionOffsetY();
return bottom;
}
......@@ -2666,7 +2666,7 @@ int RenderBox::rightmostPosition(bool includeOverflowInterior, bool includeSelf)
if (!includeSelf || !m_height)
return 0;
int right = m_width;
if (includeSelf && isRelPositioned())
if (isRelPositioned())
right += relativePositionOffsetX();
return right;
}
......@@ -2676,7 +2676,7 @@ int RenderBox::leftmostPosition(bool includeOverflowInterior, bool includeSelf)
if (!includeSelf || !m_height)
return m_width;
int left = 0;
if (includeSelf && isRelPositioned())
if (isRelPositioned())
left += relativePositionOffsetX();
return left;
}
......
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