From 1c1e2497557a4259ff65b9d6b6bdda0005c1664a Mon Sep 17 00:00:00 2001 From: Javier Fernandez Date: Tue, 29 Oct 2019 09:01:12 -0700 Subject: [PATCH] [css-text] Consider breaking opportunities of inline siblings First of all, bear in mind that this change affects only to intrinsic size computation in legacy layout. During the intrinsic size computation of blocks with inline children, we are determining the breaking opportunities for each child. When the word-break: break-word is used, each of this breaking opportunities should account for the min-content size. We only consider breakable locations for start and end if they are br elements or spaces, under auto-wrap, to compute the intrinsic size of a box. This is fine, since we are already using a break iterator to determine the min-size of each word. However, we were incorrectly summing the first_line_min_width for each inline sibling, even when they were part of the same text line. This change tries to avoid that problem by assuming that there is always a breaking opportunity after every character, since the spec now states that break-word should behave as normal and overflow-wrap: anywhere. Bug: 1013644 Change-Id: I04261b323cd029a624724363a566fccc826863af Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1856959 Reviewed-by: Koji Ishii Commit-Queue: Javier Fernandez Cr-Commit-Position: refs/heads/master@{#710359} --- .../word-break-break-all-inline-008.html | 33 +++++++++++++++ .../word-break-min-content-001.html | 42 +++++++++++++++++++ .../word-break-min-content-002.html | 34 +++++++++++++++ .../word-break-min-content-003.html | 30 +++++++++++++ .../word-break-min-content-004.html | 31 ++++++++++++++ .../word-break-min-content-005.html | 34 +++++++++++++++ 6 files changed, 204 insertions(+) create mode 100644 css/css-text/word-break/word-break-break-all-inline-008.html create mode 100644 css/css-text/word-break/word-break-min-content-001.html create mode 100644 css/css-text/word-break/word-break-min-content-002.html create mode 100644 css/css-text/word-break/word-break-min-content-003.html create mode 100644 css/css-text/word-break/word-break-min-content-004.html create mode 100644 css/css-text/word-break/word-break-min-content-005.html diff --git a/css/css-text/word-break/word-break-break-all-inline-008.html b/css/css-text/word-break/word-break-break-all-inline-008.html new file mode 100644 index 00000000000000..930ae436fe4f1c --- /dev/null +++ b/css/css-text/word-break/word-break-break-all-inline-008.html @@ -0,0 +1,33 @@ + + + +word-break: break-all on inline element + + + + + + + + + +

Test passes if there is a filled green square and no red.

+
XX
+
X.
diff --git a/css/css-text/word-break/word-break-min-content-001.html b/css/css-text/word-break/word-break-min-content-001.html new file mode 100644 index 00000000000000..20b610180b359b --- /dev/null +++ b/css/css-text/word-break/word-break-min-content-001.html @@ -0,0 +1,42 @@ + + +CSS Text Test: word-break: break-word and intrinsic sizing + + + + + + + + +

Test passes if there is a green box below and no red. +

X
X
X
X
+
XXXX
+ + diff --git a/css/css-text/word-break/word-break-min-content-002.html b/css/css-text/word-break/word-break-min-content-002.html new file mode 100644 index 00000000000000..0f5d18ff4b262a --- /dev/null +++ b/css/css-text/word-break/word-break-min-content-002.html @@ -0,0 +1,34 @@ + + +CSS Text Test: word-break: break-word and intrinsic sizing + + + + + + + + + +

Test passes if there is a vertical green bar below. +

+
+
XXXXXXXX
+
diff --git a/css/css-text/word-break/word-break-min-content-003.html b/css/css-text/word-break/word-break-min-content-003.html new file mode 100644 index 00000000000000..84e7cfe872f9af --- /dev/null +++ b/css/css-text/word-break/word-break-min-content-003.html @@ -0,0 +1,30 @@ + + +CSS Text Test: word-break: break-word and intrinsic sizing + + + + + + + + + +

Test passes if there is a filled green square and no red.

+

XX
+
X.
diff --git a/css/css-text/word-break/word-break-min-content-004.html b/css/css-text/word-break/word-break-min-content-004.html new file mode 100644 index 00000000000000..efa61b9cd8af65 --- /dev/null +++ b/css/css-text/word-break/word-break-min-content-004.html @@ -0,0 +1,31 @@ + + +CSS Text Test: word-break: break-word and intrinsic sizing + + + + + + + + + +

Test passes if there is a filled green square and no red.

+
X
X
+
X.
diff --git a/css/css-text/word-break/word-break-min-content-005.html b/css/css-text/word-break/word-break-min-content-005.html new file mode 100644 index 00000000000000..ccbf9887054c24 --- /dev/null +++ b/css/css-text/word-break/word-break-min-content-005.html @@ -0,0 +1,34 @@ + + +CSS Text Test: word-break: break-word and intrinsic sizing + + + + + + + + + +

Test passes if there is a vertical green bar below. +

+
+
XXXXXXXX
+