Bug 1513671 [wpt PR 14481] - [LayoutNG] Exclude trailing preserved spaces when avoiding floats, a=testonly
authorKoji Ishii <kojii@chromium.org>
Wed, 19 Dec 2018 11:05:29 +0000
changeset 454989 12dad58d97d78b38ce3d44268360ea9112e30c24
parent 454988 b9180576fd4f5e7e1dc20fd0ac638b4b83e575b3
child 454990 97b7940ad33797819927c4a30756e8d59db71ed8
push id35420
push userarchaeopteryx@coole-files.de
push dateWed, 23 Jan 2019 16:57:04 +0000
treeherdermozilla-central@4f1ff0e34dd5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1513671, 14481, 913995, 1374329, 616155
milestone66.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 1513671 [wpt PR 14481] - [LayoutNG] Exclude trailing preserved spaces when avoiding floats, a=testonly Automatic update from web-platform-tests [LayoutNG] Exclude trailing preserved spaces when avoiding floats This patch fixes an interoperability issue where trailing preserved spaces should be excluded when avoiding floats. All 4 implementations are interoperable on this regard. This patch adds NGLineInfo::HasOverflow(), because knowing whether the line has overflow or not is easy and fast, while knowing the exact inline size excluding trailing preserved spaces may involve reshaping. Other cases also have interoperability problems, such as `text-align` or `min-content`. I'll investigate them in following patches. Bug: 913995 Change-Id: Ibf13f1fcc28bbd99d44b56611141efa49d6d1c89 Reviewed-on: https://chromium-review.googlesource.com/c/1374329 Commit-Queue: Koji Ishii <kojii@chromium.org> Reviewed-by: Emil A Eklund <eae@chromium.org> Cr-Commit-Position: refs/heads/master@{#616155} -- wpt-commits: beeeae31ad5419adf95d5dcfca395af7955d768c wpt-pr: 14481
testing/web-platform/tests/css/css-text/white-space/pre-float-001.html
testing/web-platform/tests/css/css-text/white-space/pre-wrap-float-001.html
testing/web-platform/tests/css/css-text/white-space/reference/pre-float-001-ref.html
testing/web-platform/tests/css/css-text/white-space/reference/pre-wrap-float-001-ref.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/white-space/pre-float-001.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>CSS test preserved spaces and floats interaction</title>
+<link rel="author" title="Koji Ishii" href="kojii@chromium.org">
+<link rel="match" href="reference/pre-float-001-ref.html">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-property">
+<style>
+html {
+  font-family: Ahem;
+  font-size: 20px;
+  line-height: 1;
+}
+.container {
+  white-space: pre;
+  width: 10ch;
+  margin-bottom: 1em;
+}
+.float {
+  float: left;
+  width: 3ch;
+  height: 2em;
+  background: orange;
+}
+</style>
+<body>
+  <div class="float"></div>
+  <div class="container">123456 <br>123456</div>
+  <div class="float"></div>
+  <div class="container">1234567 <br>1234567</div>
+  <div class="float"></div>
+  <div class="container">1234567  <br>1234567</div>
+  <div class="float"></div>
+  <div class="container">1234567   <br>1234567</div>
+  <div class="float"></div>
+  <div class="container">12345678 <br>12345678</div>
+</body>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/white-space/pre-wrap-float-001.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>CSS test preserved spaces and floats interaction</title>
+<link rel="author" title="Koji Ishii" href="kojii@chromium.org">
+<link rel="match" href="reference/pre-wrap-float-001-ref.html">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-property">
+<style>
+html {
+  font-family: Ahem;
+  font-size: 20px;
+  line-height: 1;
+}
+.container {
+  white-space: pre-wrap;
+  width: 10ch;
+  margin-bottom: 1em;
+}
+.float {
+  float: left;
+  width: 3ch;
+  height: 2em;
+  background: orange;
+}
+</style>
+<body>
+  <div class="float"></div>
+  <div class="container">123456 123456</div>
+  <div class="float"></div>
+  <div class="container">1234567 1234567</div>
+  <div class="float"></div>
+  <div class="container">1234567  1234567</div>
+  <div class="float"></div>
+  <div class="container">1234567   1234567</div>
+  <div class="float"></div>
+  <div class="container">12345678 12345678</div>
+</body>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/white-space/reference/pre-float-001-ref.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<style>
+html {
+  font-family: Ahem;
+  font-size: 20px;
+  line-height: 1;
+}
+.container {
+  white-space: pre;
+  margin-bottom: 1em;
+}
+.float {
+  float: left;
+  width: 3ch;
+  height: 2em;
+  background: orange;
+}
+</style>
+<body>
+  <div class="float"></div>
+  <div class="container">123456<br>123456</div>
+  <div class="float"></div>
+  <div class="container">1234567<br>1234567</div>
+  <div class="float"></div>
+  <div class="container">1234567<br>1234567</div>
+  <div class="float"></div>
+  <div class="container">1234567<br>1234567</div>
+  <div class="float"></div>
+  <div class="container">12345678<br>12345678</div>
+</body>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/white-space/reference/pre-wrap-float-001-ref.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<style>
+html {
+  font-family: Ahem;
+  font-size: 20px;
+  line-height: 1;
+}
+.container {
+  white-space: pre;
+  margin-bottom: 1em;
+}
+.float {
+  float: left;
+  width: 3ch;
+  height: 2em;
+  background: orange;
+}
+</style>
+<body>
+  <div class="float"></div>
+  <div class="container">123456<br>123456</div>
+  <div class="float"></div>
+  <div class="container">1234567<br>1234567</div>
+  <div class="float"></div>
+  <div class="container">1234567<br>1234567</div>
+  <div class="float"></div>
+  <div class="container">1234567<br>1234567</div>
+  <div class="float"></div>
+  <div class="container"><br><br>12345678<br>12345678</div>
+</body>