Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r229505 - Turn off offset*/scroll* optimization for input eleme…
…nts with shadow content https://bugs.webkit.org/show_bug.cgi?id=182383 <rdar://problem/37114190> Reviewed by Antti Koivisto. Source/WebCore: We normally ensure clean tree before calling offsetHeight/Width, scrollHeight/Width. In certain cases (see updateLayoutIfDimensionsOutOfDate() for details), it's okay to return the previously computed values even when some part of the tree is dirty. In case of shadow content, updateLayoutIfDimensionsOutOfDate() might return false (no need to layout) for the root, while true (needs layout) for the shadow content. This could confuse the caller (Element::scrollWidth/Height etc) and lead to incorrect result. Test: fast/forms/scrollheight-with-mutation-crash.html * dom/Document.cpp: (WebCore::Document::updateLayoutIfDimensionsOutOfDate): LayoutTests: * fast/forms/scrollheight-with-mutation-crash-expected.txt: Added. * fast/forms/scrollheight-with-mutation-crash.html: Added.
- Loading branch information
1 parent
6d5b971
commit d1ad380
Showing
5 changed files
with
56 additions
and
0 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
1 change: 1 addition & 0 deletions
1
LayoutTests/fast/forms/scrollheight-with-mutation-crash-expected.txt
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 if no crash. |
20 changes: 20 additions & 0 deletions
20
LayoutTests/fast/forms/scrollheight-with-mutation-crash.html
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,20 @@ | ||
<style> | ||
input:enabled { | ||
content: url(#foo); | ||
width: 10vmin; | ||
} | ||
|
||
keygen { | ||
-webkit-transform: scale(12, 125); | ||
} | ||
</style> | ||
PASS if no crash. | ||
<keygen id=keygen> | ||
<input id=input type="search"> | ||
<script> | ||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
document.body.offsetHeight; | ||
keygen.remove(); | ||
input.scrollHeight; | ||
</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
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