Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
RenderBox::hasHorizontalLayoutOverflow/hasVerticalLayoutOverflow use …
…incorrect coordinate space https://bugs.webkit.org/show_bug.cgi?id=241796 Reviewed by Simon Fraser. RenderBox::x() and y() are in the coordinate space of the containing block while layoutOverflowRect is relative to the box's border box. These functions would compute overflow true if the box happens to have some offset (through margin or positioning) even without actual overflow. * LayoutTests/fast/overflow/horizontal-overflow-with-offset-expected.txt: Added. * LayoutTests/fast/overflow/horizontal-overflow-with-offset.html: Added. * LayoutTests/fast/overflow/vertical-overflow-with-offset-expected.txt: Added. * LayoutTests/fast/overflow/vertical-overflow-with-offset.html: Added. * Source/WebCore/rendering/RenderBox.h: (WebCore::RenderBox::hasHorizontalLayoutOverflow const): (WebCore::RenderBox::hasVerticalLayoutOverflow const): Canonical link: https://commits.webkit.org/251720@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
6d01e0a
commit d5e81d9
Showing
5 changed files
with
84 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PASS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<style> | ||
#container { | ||
position: absolute; | ||
top: 100px; | ||
left: 100px; | ||
|
||
width: 100px; | ||
height: 100px; | ||
overflow: hidden; | ||
|
||
background-color: green; | ||
} | ||
|
||
#child { | ||
width: 10px; | ||
height: 10px; | ||
background-color: blue; | ||
} | ||
</style> | ||
<div id=container><div id=child></div></div> | ||
<pre id=result></pre> | ||
<script> | ||
if (window.testRunner) { | ||
testRunner.dumpAsText(); | ||
testRunner.waitUntilDone(); | ||
} | ||
|
||
function overflowChanged(event) { | ||
result.innerText = !event.horizontalOverflow ? "PASS" : "FAIL"; | ||
if (window.testRunner) | ||
testRunner.notifyDone(); | ||
} | ||
container.addEventListener('overflowchanged', overflowChanged, false); | ||
|
||
document.body.offsetHeight; | ||
// This should not trigger horizontal overflow change. | ||
child.style.height = "120px"; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PASS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<style> | ||
#container { | ||
position: absolute; | ||
top: 100px; | ||
left: 100px; | ||
|
||
width: 100px; | ||
height: 100px; | ||
overflow: hidden; | ||
|
||
background-color: green; | ||
} | ||
|
||
#child { | ||
width: 10px; | ||
height: 10px; | ||
background-color: blue; | ||
} | ||
</style> | ||
<div id=container><div id=child></div></div> | ||
<pre id=result></pre> | ||
<script> | ||
if (window.testRunner) { | ||
testRunner.dumpAsText(); | ||
testRunner.waitUntilDone(); | ||
} | ||
|
||
function overflowChanged(event) { | ||
result.innerText = !event.verticalOverflow ? "PASS" : "FAIL"; | ||
if (window.testRunner) | ||
testRunner.notifyDone(); | ||
} | ||
container.addEventListener('overflowchanged', overflowChanged, false); | ||
|
||
document.body.offsetHeight; | ||
// This should not trigger vertical overflow change. | ||
child.style.width = "120px"; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters