From 2d174ca55330ed02d3ea9b982985f5d072221ada Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Tue, 27 Oct 2020 07:40:48 -0700 Subject: [PATCH] [css-pseudo] Support 'line-height' property in ::marker The CSSWG resolved in https://github.com/w3c/csswg-drafts/issues/4568 that inherited properties that apply to text can be set on ::marker and should affect the marker text. And in https://github.com/w3c/csswg-drafts/issues/5303 it resolved that 'line-height' applies to text (as it already does in Chromium). Therefore, this patch allows 'line-height' in ::marker. Note it was already possibly to set it to the list item and the ::marker would inherit it. Just letting authors set it directly to the ::marker. Bug: 1031667 TEST=external/wpt/css/css-pseudo/marker-line-height.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties-in-animation.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties.html marker-line-height.html fails in legacy because ::markers with 'content: normal' are not implemented with actual text. Change-Id: If63095d046150a2b5f76c40fce93fce1c0e7741c --- css/css-pseudo/marker-line-height-ref.html | 42 ++++++++++++ css/css-pseudo/marker-line-height.html | 65 +++++++++++++++++++ ...ker-supported-properties-in-animation.html | 19 +++--- .../parsing/marker-supported-properties.html | 9 ++- 4 files changed, 120 insertions(+), 15 deletions(-) create mode 100644 css/css-pseudo/marker-line-height-ref.html create mode 100644 css/css-pseudo/marker-line-height.html diff --git a/css/css-pseudo/marker-line-height-ref.html b/css/css-pseudo/marker-line-height-ref.html new file mode 100644 index 000000000000000..64b0d41a3898873 --- /dev/null +++ b/css/css-pseudo/marker-line-height-ref.html @@ -0,0 +1,42 @@ + + +CSS Reftest Reference + + +
    +
  1. +
  2. +
  3. +
  4. +
+
    +
  1. +
  2. +
  3. +
  4. +
+
    +
  1. x
  2. +
  3. x
  4. +
  5. x
  6. +
  7. x
  8. +
+
    +
  1. x
  2. +
  3. x
  4. +
  5. x
  6. +
  7. x
  8. +
diff --git a/css/css-pseudo/marker-line-height.html b/css/css-pseudo/marker-line-height.html new file mode 100644 index 000000000000000..8d226e3feaa359f --- /dev/null +++ b/css/css-pseudo/marker-line-height.html @@ -0,0 +1,65 @@ + + +::marker supports 'line-height' + + + + + + +
    +
  1. +
  2. +
  3. +
  4. +
+
    +
  1. +
  2. +
  3. +
  4. +
+
    +
  1. x
  2. +
  3. x
  4. +
  5. x
  6. +
  7. x
  8. +
+
    +
  1. x
  2. +
  3. x
  4. +
  5. x
  6. +
  7. x
  8. +
diff --git a/css/css-pseudo/parsing/marker-supported-properties-in-animation.html b/css/css-pseudo/parsing/marker-supported-properties-in-animation.html index 5f7dab7a8bfb908..df0e9bc6d34b3e8 100644 --- a/css/css-pseudo/parsing/marker-supported-properties-in-animation.html +++ b/css/css-pseudo/parsing/marker-supported-properties-in-animation.html @@ -20,7 +20,7 @@ property: "font", from: "oblique normal 100 ultra-condensed 5px / 20px serif", to: "italic small-caps 900 ultra-expanded 25px / 50px Ahem", - midPoint: ["italic small-caps 500 expanded 15px Ahem", "italic small-caps 500 expanded 15px/normal Ahem"], + midPoint: ["italic small-caps 500 expanded 15px / 35px Ahem", "italic small-caps 500 expanded 15px/35px Ahem"], }, { property: "font-family", @@ -113,6 +113,14 @@ midPoint: "500", }, + // `line-height` is not a font property but is a longhand of `font`, and is also supported. + { + property: "line-height", + from: "20px", + to: "50px", + midPoint: "35px", + }, + // ::marker supports `white-space` { property: "white-space", @@ -292,15 +300,6 @@ to: "decimal", midPoint: "disc", }, - - // ::marker does NOT support `line-height` because, despite being a - // longhand of `font`, it's not a font property. - { - property: "line-height", - from: "20px", - to: "50px", - midPoint: "normal", - }, ]; const target = document.getElementById("target"); diff --git a/css/css-pseudo/parsing/marker-supported-properties.html b/css/css-pseudo/parsing/marker-supported-properties.html index 15a4e894ff3a46c..62a54a338b7c401 100644 --- a/css/css-pseudo/parsing/marker-supported-properties.html +++ b/css/css-pseudo/parsing/marker-supported-properties.html @@ -14,7 +14,7 @@