Bug 1606636 [wpt PR 20998] - [css-pseudo] Let non-replaced images be list items with markers, a=testonly

Automatic update from web-platform-tests
[css-pseudo] Let non-replaced images be list items with markers

<img> elements are usually replaced, so they can't originate a ::marker
pseudo-element even if they have 'display: list-item'.

However, if they point to an invalid image and have an alternative text,
then they are not replaced. Therefore they can have ::before and ::after
pseudo-elements, and also a ::marker if they have 'display: list-item'.

Before this patch, markers with 'content: normal' were never generated.
And non-normal ones worked fine in the inside case, but when outside
they triggerede a DCHECK failure because the marker was created but not
laid out.

BUG=1038644

TEST=external/wpt/css/css-pseudo/marker-content-017.html

The test fails in legacy because the 'content' property is not supported
yet in ::marker.

Change-Id: I4420bc2e9a0460f3a59fa030e5e3d249428aa6be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1985759
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Cr-Commit-Position: refs/heads/master@{#728012}

--

wpt-commits: cb0d9cacbbf30a4cae79faa2e711c26456249b8c
wpt-pr: 20998
This commit is contained in:
Oriol Brufau 2020-01-06 16:09:10 +00:00 коммит произвёл moz-wptsync-bot
Родитель 6b58430b9c
Коммит 6cc16aa449
2 изменённых файлов: 42 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,18 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Reference: ::marker pseudo elements styled with 'content' property</title>
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
<style>
img {
display: list-item;
list-style-type: "[marker]";
}
img.inside {
list-style-position: inside;
}
</style>
<ol>
<img src="about:invalid" alt="alt" class="inside" />
<img src="about:invalid" alt="alt" />
<li value="3">item</li>
</ol>

Просмотреть файл

@ -0,0 +1,24 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Test: ::marker pseudo elements styled with 'content' property</title>
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
<link rel="match" href="marker-content-017-ref.html">
<link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#marker-pseudo">
<link rel="help" href="https://drafts.csswg.org/css-lists/#declaring-a-list-item">
<meta name="assert" content="Checks that ::marker can be created inside a non-replaced <img>.">
<style>
img {
display: list-item;
}
img.inside {
list-style-position: inside;
}
img::marker {
content: '[marker]';
}
</style>
<ol>
<img src="about:invalid" alt="alt" class="inside" />
<img src="about:invalid" alt="alt" />
<li>item</li>
</ol>