Closed Bug 1585391 Opened 6 years ago Closed 6 years ago

[wpt-sync] Sync PR 19447 - [LayoutNG] Include empty/space-only trailing spans

Categories

(Core :: CSS Parsing and Computation, task, P4)

task

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 19447 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/19447
Details from upstream follow.

Koji Ishii <kojii@chromium.org> wrote:

[LayoutNG] Include empty/space-only trailing spans

This patch changes |NGLineBreaker| to include empty or space-
only trailing spans into the line.

Such spans were thought not observable, but it turned out
that they are in a few cases; e.g.,:
a. The space is wrapped in an inline box with borders; e.g.,
text\<span style="border: 1px solid"> \</span>text
b. When it is not collapsed (e.g., pre-wrap) and is in an
inline box with background.

Open tags are in most cases not-trailable but sometimes they
are. Before this change, |NGLineBreaker| assumed open tags
are not-trailable, and handles exceptional cases separately.
This patch changes open tags to be trailable. Then non-
trailable open tags were removed after the line breaking was
determined. With this chagne, the rare logic runs only once
for each wrapped line.

This patch:

  1. Split over-loaded kTrailing state to kOverflow and
    kTrailing. This simplifies the conditions when each
    state can transit to other states.
  2. Re-implemented negative marginsr674177. The logic became
    simpler because open tags are now trailable by default.
  3. Re-implemented hanging trailing space fixr674430. In
    addition to the fix, this patch handles trailing spaces in
    a span. We do not handle multiple space nodes yet as in
    TODO(crbug.com/1009936) comment, but this change moves one
    step closer to support it.

Bug: 1001241, 1003184
Change-Id: Ife2f8470a510f6e006da9d2397df5c5153e3abd1
Reviewed-on: https://chromium-review.googlesource.com/1826063
WPT-Export-Revision: ba8506ecf67b10017556a0e37703a8c2ce90bfa5

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core
Ran 1 tests and 5 subtests OK : 1 FAIL : 5 New tests that have failures or other problems: /css/css-text/white-space/trailing-space-position-001.html CSS Test: Positions of trailing collapsible spaces: FAIL CSS Test: Positions of trailing collapsible spaces 1: FAIL CSS Test: Positions of trailing collapsible spaces 2: FAIL CSS Test: Positions of trailing collapsible spaces 3: FAIL CSS Test: Positions of trailing collapsible spaces 4: FAIL
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/b0aea144d2c1 [wpt PR 19447] - [LayoutNG] Include empty/space-only trailing spans, a=testonly https://hg.mozilla.org/integration/mozilla-inbound/rev/d030970f67ff [wpt PR 19447] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.