Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #10246 - mbrubeck:strip-leading, r=pcwalton
Restore stripped whitespace before reflowing text fragments Fixes #10200. r? @pcwalton Note: The reftest uses a transition of non-zero duration, because I couldn't find any other way to reproduce the bug. Unfortunately this makes it unreliable in debug builds. I tried to fix this using reftest-wait with setTimeout and requestAnimationFrame, but it still wouldn't complete the animation consistently. To make the test work in debug builds we may need `transitionend` events (#10245) or a different way to reproduce the bug. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10246) <!-- Reviewable:end -->
- Loading branch information
Showing
5 changed files
with
121 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
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
27 changes: 27 additions & 0 deletions
27
tests/wpt/mozilla/tests/css/incremental_trailing_whitespace_a.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,27 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>incremental trailing whitespace test</title> | ||
<link rel="match" href="incremental_trailing_whitespace_ref.html"> | ||
<style> | ||
#a { | ||
border: 0 solid; | ||
} | ||
#a.go { | ||
border-bottom-width: 4px !important; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div style="display: inline-block; width: 33.3333%;"></div> | ||
<div style="display: inline-block; width: 66.66%;"> | ||
<div id="a" style="transition: all .1s ease-out;">Hello</div> | ||
</div> | ||
<script> | ||
document.body.offsetWidth; // force layout | ||
document.querySelector('#a').classList.add('go'); | ||
// FIXME (#10245): Wait for the "transitionend" event. | ||
</script> | ||
</body> | ||
</html> |
20 changes: 20 additions & 0 deletions
20
tests/wpt/mozilla/tests/css/incremental_trailing_whitespace_ref.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 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>incremental trailing whitespace reference</title> | ||
<link rel="match" href="incremental_trailing_whitespace_ref.html"> | ||
<style> | ||
#a { | ||
border: 0 solid; | ||
border-bottom-width: 4px !important; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div style="display: inline-block; width: 33.3333%;"></div> | ||
<div style="display: inline-block; width: 66.66%;"> | ||
<div id="a">Hello</div> | ||
</div> | ||
</body> | ||
</html> |