mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 841363. Ensure padding-rect edges are included in scrollable area used to compute scrollWidth/scrollHeight for overflow:visible elements. r=matspal
This commit is contained in:
parent
68755dbc46
commit
1c8003fcdc
@ -589,11 +589,14 @@ static nsSize GetScrollRectSizeForOverflowVisibleFrame(nsIFrame* aFrame)
|
|||||||
return nsSize(0,0);
|
return nsSize(0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsRect paddingRect = aFrame->GetPaddingRectRelativeToSelf();
|
nsOverflowAreas overflowAreas;
|
||||||
nsOverflowAreas overflowAreas(paddingRect, paddingRect);
|
|
||||||
nsLayoutUtils::UnionChildOverflow(aFrame, overflowAreas);
|
nsLayoutUtils::UnionChildOverflow(aFrame, overflowAreas);
|
||||||
|
// Make sure that an empty padding-rect's edges are included
|
||||||
|
nsRect paddingRect = aFrame->GetPaddingRectRelativeToSelf();
|
||||||
|
nsRect overflowRect =
|
||||||
|
overflowAreas.ScrollableOverflow().UnionEdges(paddingRect);
|
||||||
return nsLayoutUtils::GetScrolledRect(aFrame,
|
return nsLayoutUtils::GetScrolledRect(aFrame,
|
||||||
overflowAreas.ScrollableOverflow(), paddingRect.Size(),
|
overflowRect, paddingRect.Size(),
|
||||||
aFrame->StyleVisibility()->mDirection).Size();
|
aFrame->StyleVisibility()->mDirection).Size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,6 +105,7 @@ MOCHITEST_FILES = \
|
|||||||
test_bug785324.html \
|
test_bug785324.html \
|
||||||
test_bug791616.html \
|
test_bug791616.html \
|
||||||
test_bug831780.html \
|
test_bug831780.html \
|
||||||
|
test_bug841361.html \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
MOCHITEST_CHROME_FILES = \
|
MOCHITEST_CHROME_FILES = \
|
||||||
|
56
layout/generic/test/test_bug841361.html
Normal file
56
layout/generic/test/test_bug841361.html
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<!--
|
||||||
|
https://bugzilla.mozilla.org/show_bug.cgi?id=841361
|
||||||
|
-->
|
||||||
|
<head>
|
||||||
|
<title>Test for Bug 841361</title>
|
||||||
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=841361">Mozilla Bug 841361</a>
|
||||||
|
<p id="display">
|
||||||
|
|
||||||
|
<div style="width:500px; height:0;" id="a"></div>
|
||||||
|
|
||||||
|
<div style="width:0; height:500px;" id="b"></div>
|
||||||
|
|
||||||
|
<div style="width:500px;" id="c">
|
||||||
|
<div style="width:50px; height:50px; float:left; background:yellow"></div>
|
||||||
|
<div style="width:200px; height:50px; float:left; background:green"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="width:500px; height:0; overflow:hidden" id="d"></div>
|
||||||
|
|
||||||
|
<div style="width:0; height:500px; overflow:hidden" id="e"></div>
|
||||||
|
|
||||||
|
<div style="width:500px; overflow:hidden" id="f">
|
||||||
|
<div style="width:50px; height:50px; float:left; background:yellow"></div>
|
||||||
|
<div style="width:200px; height:50px; float:left; background:green"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</p>
|
||||||
|
<div id="content" style="display: none">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<pre id="test">
|
||||||
|
<script class="testbody" type="text/javascript">
|
||||||
|
|
||||||
|
function doTest(id, w, h) {
|
||||||
|
var e = document.getElementById(id);
|
||||||
|
is(e.scrollWidth, w, "scrollWidth for element '" + id + "'");
|
||||||
|
is(e.scrollHeight, h, "scrollHeight for element '" + id + "'");
|
||||||
|
}
|
||||||
|
|
||||||
|
doTest("a", 500, 0);
|
||||||
|
doTest("b", 0, 500);
|
||||||
|
doTest("c", 500, 50);
|
||||||
|
doTest("d", 500, 0);
|
||||||
|
doTest("e", 0, 500);
|
||||||
|
doTest("f", 500, 50);
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</pre>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user