Bug 1586651 [wpt PR 19541] - [LayoutNG] Fix line breaking when `font-size: 0`, a=testonly
authorKoji Ishii <kojii@chromium.org>
Mon, 14 Oct 2019 13:40:40 +0000
changeset 497989 c276749f30a6e5eb8eea53aa5e07a9c154331b03
parent 497988 083c63574c2bc83f84e1949eb9fdbf1fef2017fb
child 497990 83ed9216cc3bf6fa6eeff59a4eabcb775a5c07bd
push id114155
push userwptsync@mozilla.com
push dateThu, 17 Oct 2019 19:28:02 +0000
treeherdermozilla-inbound@e93a4498a36f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1586651, 19541, 1006127, 1843991, 703753
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1586651 [wpt PR 19541] - [LayoutNG] Fix line breaking when `font-size: 0`, a=testonly Automatic update from web-platform-tests [LayoutNG] Fix line breaking when `font-size: 0` This patch fixes line breaking when break opportunities have `font-size: 0`. `font-size: 0` makes all characters at position 0. This confuses when |NGLineBreaker| needs to rewind, and tries to find the break opportunity before the current one. This patch fixes it by using |PreviousBreakOpportunity| in such case. Bug: 1006127 Change-Id: I449d6f8aaba4deccd458c5e077920b1a8bf79305 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1843991 Reviewed-by: Yoshifumi Inoue <yosin@chromium.org> Reviewed-by: Emil A Eklund <eae@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/master@{#703753} -- wpt-commits: 7fbe6fe5fe834bf28d9171bf92d90287186020e8 wpt-pr: 19541
testing/web-platform/tests/css/CSS2/linebox/line-breaking-font-size-zero-001-ref.html
testing/web-platform/tests/css/CSS2/linebox/line-breaking-font-size-zero-001.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/linebox/line-breaking-font-size-zero-001-ref.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<style>
+div {
+  width: 100px;
+  background: blue;
+}
+
+inline-block {
+  display: inline-block;
+  width: 80px;
+  height: 1em;
+  background: orange;
+}
+</style>
+</head>
+<body>
+  <div>
+    <inline-block></inline-block><br>
+    <inline-block></inline-block><br>
+    <inline-block></inline-block><br>
+    <inline-block></inline-block><br>
+    <inline-block></inline-block>
+  </div>
+</body>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/linebox/line-breaking-font-size-zero-001.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<title>CSS Test: Check line breaks when break opportunities have font-size: 0</title>
+<link rel="match" href="line-breaking-font-size-zero-001-ref.html">
+<link rel="help" href="https://drafts.csswg.org/css2/text.html#propdef-white-space" />
+<link rel="author" href="mailto:kojii@chromium.org">
+<style>
+div {
+  width: 100px;
+  background: blue;
+}
+
+inline-block {
+  display: inline-block;
+  width: 80px;
+  height: 1em;
+  background: orange;
+}
+
+sep {
+  font-size: 0;
+}
+</style>
+</head>
+<body>
+  <div>
+    <inline-block></inline-block><sep> </sep>
+    <inline-block></inline-block><sep>, </sep>
+    <inline-block></inline-block><sep>) (</sep>
+    <inline-block></inline-block><sep>a</sep>
+    <inline-block></inline-block>
+  </div>
+</body>