commit bd20806ec8008b55bb159f6daa7a084dd7bef737
parent 1c2b83c1fdb8ba523831bcdb63947f5f7a4cfa5e
Author: Jonathan Kew <jkew@mozilla.com>
Date: Sun, 16 Nov 2025 09:01:38 +0000
Bug 2000404 - Allow counter and quotes properties in ::marker r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D272790
Diffstat:
6 files changed, 156 insertions(+), 0 deletions(-)
diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js
@@ -5438,6 +5438,7 @@ var gCSSProperties = {
domProp: "counterIncrement",
inherited: false,
type: CSS_TYPE_LONGHAND,
+ applies_to_marker: true,
initial_values: ["none"],
other_values: [
"foo 1",
@@ -5462,6 +5463,7 @@ var gCSSProperties = {
domProp: "counterReset",
inherited: false,
type: CSS_TYPE_LONGHAND,
+ applies_to_marker: true,
initial_values: ["none"],
other_values: [
"foo 1",
@@ -5485,6 +5487,7 @@ var gCSSProperties = {
domProp: "counterSet",
inherited: false,
type: CSS_TYPE_LONGHAND,
+ applies_to_marker: true,
initial_values: ["none"],
other_values: [
"foo 1",
@@ -7529,6 +7532,7 @@ var gCSSProperties = {
domProp: "quotes",
inherited: true,
type: CSS_TYPE_LONGHAND,
+ applies_to_marker: true,
initial_values: ["auto"],
other_values: [
"none",
diff --git a/servo/components/style/properties/data.py b/servo/components/style/properties/data.py
@@ -1076,10 +1076,14 @@ class PropertyRestrictions:
[
"color",
"content",
+ "counter-increment",
+ "counter-reset",
+ "counter-set",
"cursor",
"direction",
"hyphens",
"line-height",
+ "quotes",
"text-combine-upright",
"text-emphasis-color",
"text-emphasis-position",
diff --git a/testing/web-platform/tests/css/css-lists/marker-counter-ref.html b/testing/web-platform/tests/css/css-lists/marker-counter-ref.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+
+<title>CSS Lists reference: use of `counter-*` in ::marker</title>
+
+<link rel="author" href="mailto:jkew@mozilla.com">
+
+<style>
+ol {
+ padding-left: 5em;
+}
+li:nth-child(1)::marker {
+ content: "[1] ";
+}
+li:nth-child(2)::marker {
+ content: "[2] ";
+}
+li:nth-child(3)::marker {
+ content: "[10] ";
+}
+li:nth-child(4)::marker {
+ content: "[11] ";
+}
+li:nth-child(5)::marker {
+ content: "[12] ";
+}
+li:nth-child(6)::marker {
+ content: "[12:1] ";
+}
+li:nth-child(7)::marker {
+ content: "[13] ";
+}
+li:nth-child(8)::marker {
+ content: "[14] ";
+}
+</style>
+
+<ol>
+ <li>one
+ <li>two
+ <li class=set>set to 10
+ <li>next item
+ <li>next item
+ <li class=reset>reset (12:2)
+ <li>next item
+ <li>last item
+</ol>
diff --git a/testing/web-platform/tests/css/css-lists/marker-counter.html b/testing/web-platform/tests/css/css-lists/marker-counter.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+
+<title>CSS Lists test: use of `counter-*` in ::marker</title>
+
+<link rel="help" href="https://drafts.csswg.org/css-lists-3/#marker-properties">
+<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5265#issuecomment-3531669680">
+<meta name="assert" content="counter-* properties are supported in ::marker">
+
+<link rel="author" href="mailto:jkew@mozilla.com">
+
+<link rel="match" href="marker-counter-ref.html">
+
+<style>
+ol {
+ counter-reset: my-counter;
+ padding-left: 5em;
+}
+::marker {
+ counter-increment: my-counter;
+ content: "[" counters(my-counter, ":") "] ";
+}
+.set::marker {
+ counter-set: my-counter 10;
+}
+.reset::marker {
+ counter-reset: my-counter;
+}
+.reset::after {
+ counter-increment: my-counter;
+ content: " (" counters(my-counter, ":") ")";
+}
+</style>
+
+<ol>
+ <li>one
+ <li>two
+ <li class=set>set to 10
+ <li>next item
+ <li>next item
+ <li class=reset>reset <!-- instantiates a new counter on the current item -->
+ <li>next item
+ <li>last item
+</ol>
diff --git a/testing/web-platform/tests/css/css-lists/marker-quotes-ref.html b/testing/web-platform/tests/css/css-lists/marker-quotes-ref.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+
+<title>CSS Lists reference: use of `quotes` in ::marker</title>
+
+<link rel="author" href="mailto:jkew@mozilla.com">
+
+<style>
+li:nth-child(1)::marker {
+ content: "\2018" "1" "\2019" " ";
+}
+li:nth-child(2)::marker {
+ content: "«2»" " ";
+}
+li:nth-child(3)::marker {
+ content: "‹3›" " ";
+}
+</style>
+
+<ol>
+ <li>one
+ <li>two
+ <li>three
+</ol>
diff --git a/testing/web-platform/tests/css/css-lists/marker-quotes.html b/testing/web-platform/tests/css/css-lists/marker-quotes.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+
+<title>CSS Lists test: use of `quotes` in ::marker</title>
+
+<link rel="help" href="https://drafts.csswg.org/css-lists-3/#marker-properties">
+<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/5265#issuecomment-3531669680">
+<meta name="assert" content="the quotes property is supported in ::marker">
+
+<link rel="author" href="mailto:jkew@mozilla.com">
+
+<link rel="match" href="marker-quotes-ref.html">
+
+<style>
+ol {
+ quotes: "\2018" "\2019";
+}
+::marker {
+ content: open-quote counter(list-item) close-quote " ";
+}
+:nth-child(2)::marker {
+ quotes: "«" "»";
+}
+:nth-child(3)::marker {
+ quotes: "‹" "›";
+}
+</style>
+
+<ol>
+ <li>one
+ <li>two
+ <li>three
+</ol>