Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit 32fc578

Browse files
kojiishichromium-wpt-export-bot
authored andcommitted
[LayoutNG] Fix PDI/PDF not to affect line breaking
This patch fixes PDI/PDF before spaces not to suppress the line breaking opportunity at the space. For example, before this fix, `<bdo dir=ltr>a</bdo> b` could not break between "a" and "b". PDI and PDF are injected by the `unicode-bidi` property, or elements that imply the `unicode-bidi` property such as `<bdi>`, `<bdo>`, or any elements with `dir` attributes. Bug: 989094 Change-Id: I2128774e2b062ecb86880812c54d46299a19a18a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1735146 Commit-Queue: Emil A Eklund <[email protected]> Reviewed-by: Emil A Eklund <[email protected]> Cr-Commit-Position: refs/heads/master@{#683881}
1 parent 2332a6b commit 32fc578

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!DOCTYPE html>
2+
<title>Test implicit bidi controls do not affect line breaking</title>
3+
<link rel="help" href="https://drafts.csswg.org/css-writing-modes-3/#unicode-bidi">
4+
<link rel="author" title="Koji Ishii" href="mailto:[email protected]">
5+
<style>
6+
html {
7+
font-size: 10px;
8+
line-height: 1;
9+
}
10+
.isolate {
11+
unicode-bidi: isolate;
12+
}
13+
.embed {
14+
unicode-bidi: embed;
15+
}
16+
</style>
17+
<script src="/resources/testharness.js"></script>
18+
<script src="/resources/testharnessreport.js"></script>
19+
<body>
20+
<div id=log></div>
21+
<div id="container">
22+
<div style="width: 4ch" data-expected-height="20">
23+
<span class="isolate" dir="ltr">00</span> <span class="isolate" dir="ltr">00</span>
24+
</div>
25+
<div style="width: 4ch" data-expected-height="20">
26+
<span class="embed" dir="ltr">00</span> <span class="embed" dir="ltr">00</span>
27+
</div>
28+
29+
<div style="width: 4ch" data-expected-height="20">
30+
<span dir="ltr">00</span> <span dir="ltr">00</span>
31+
</div>
32+
<div style="width: 4ch" data-expected-height="20">
33+
<bdi dir="ltr">00</bdi> <bdi dir="ltr">00</bdi>
34+
</div>
35+
<div style="width: 4ch" data-expected-height="20">
36+
<bdo dir="ltr">00</bdo> <bdo dir="ltr">00</bdo>
37+
</div>
38+
39+
<div style="width: 4ch" data-expected-height="20">
40+
<span class="isolate" dir="ltr">00 </span><span class="isolate" dir="ltr">00</span>
41+
</div>
42+
<div style="width: 4ch" data-expected-height="20">
43+
<span class="embed" dir="ltr">00 </span><span class="embed" dir="ltr">00</span>
44+
</div>
45+
</div>
46+
<script>
47+
run();
48+
function run() {
49+
for (let node of document.getElementById('container').children) {
50+
test(() => {
51+
assert_approx_equals(node.offsetHeight, 20, 1);
52+
}, node.innerHTML);
53+
}
54+
}
55+
</script>
56+
</body>

0 commit comments

Comments
 (0)