Skip to content

Commit 9f3f3dd

Browse files
coding-joedowservo-wpt-sync
authored andcommitted
layout: Correctly marking box damage when text-related style changed
Signed-off-by: sharpshooter_pt <[email protected]>
1 parent d6c4511 commit 9f3f3dd

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

css/css-text/white-space/pre-001.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<title>CSS-white-space test: restore collapsed whitespace</title>
3+
<link rel="author" title="JoeDow" href="[email protected]">
4+
<link rel="match" href="reference/pre-001-ref.html">
5+
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-property">
6+
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
7+
<style>
8+
html {
9+
font: 20px/1 Ahem;
10+
}
11+
.span {
12+
background-color: blueviolet;
13+
}
14+
#target {
15+
background-color: blue;
16+
}
17+
</style>
18+
<body>
19+
<div>
20+
<span class="span">aa bb </span><span id="target"> target </span><span class="span">bb aa</span>
21+
</div>
22+
23+
<script>
24+
window.onload = function() {
25+
const target = document.getElementById("target");
26+
// force layout
27+
target.offsetLeft;
28+
target.style.whiteSpace = "pre";
29+
}
30+
</script>
31+
</body>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
3+
<style>
4+
html {
5+
font: 20px/1 Ahem;
6+
}
7+
.span {
8+
background-color: blueviolet;
9+
}
10+
#target {
11+
background-color: blue;
12+
white-space: pre;
13+
}
14+
</style>
15+
<body>
16+
<div>
17+
<span class="span">aa bb </span><span id="target"> target </span><span class="span">bb aa</span>
18+
</div>
19+
</body>

0 commit comments

Comments
 (0)