Skip to content

Commit

Permalink
[css-pseudo] Fix marker-text-combine-upright.html
Browse files Browse the repository at this point in the history
This test was failing for 2 reasons:
 1. ::marker had `text-align: start` and `text-align-last: start` as
    important UA rules, while the style adjuster only enforces
    `text-align: center` in the presence of `text-combine-upright: all`.
    This resulted in `text-align: center; text-align-last: start`.

    Arguably the style adjuster should also set `text-align-last`,
    but a smaller fix is changing the important UA rule for ::marker
    to `text-align-last: auto`. Note `text-align-last: auto` behaves as
    `text-align-last: start` when `text-align: start`, so the change
    has no effect in the great majority of cases.

 2. The style adjuster enforces `white-space: pre` on outside markers,
    even if the test uses `all: unset`.

    So this changes the test reference to expect `white-space: pre`,
    and explicitly sets `white-space: pre` in the test for Firefox.

Bug: 1060007

TEST=external/wpt/css/css-pseudo/marker-text-combine-upright.html

Change-Id: I06e6ac4034abadf956b9d7194b945c9a2c338542
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6021669
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1386262}
  • Loading branch information
Loirooriol authored and chromium-wpt-export-bot committed Nov 21, 2024
1 parent a186b10 commit bf56e27
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions css/css-pseudo/marker-text-combine-upright-ref.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
text-align: end;
}
span {
white-space: pre;
text-combine-upright: all;
}
</style>
Expand Down
5 changes: 5 additions & 0 deletions css/css-pseudo/marker-text-combine-upright.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
content: "3. ";
}
::marker {
/* Try to undo whatever styles browsers might have set on ::marker. */
all: unset;
/* However, Blink still enforces `white-space: pre` on markers with outside position.
As a workaround, the reference expects `white-space: pre` too, but then we need
to set it here for Firefox. */
white-space: pre;
text-combine-upright: all;
}
</style>
Expand Down

0 comments on commit bf56e27

Please sign in to comment.