From 183ec78be5b927702744352659d7648ce54f6cfb Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Mon, 22 May 2023 09:51:42 +0200 Subject: [PATCH] style: Implement 'content: none' for ::marker Differential Revision: https://phabricator.services.mozilla.com/D111707 --- components/style/style_adjuster.rs | 5 +++-- components/style/values/resolved/counters.rs | 13 +++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/components/style/style_adjuster.rs b/components/style/style_adjuster.rs index 5fe28e5bc72..a0f1980d31c 100644 --- a/components/style/style_adjuster.rs +++ b/components/style/style_adjuster.rs @@ -832,10 +832,11 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { fn adjust_for_marker_pseudo(&mut self) { use crate::values::computed::font::{FontFamily, FontSynthesis}; use crate::values::computed::text::{LetterSpacing, WordSpacing}; + use crate::values::computed::counters::{Content}; let is_legacy_marker = self.style.pseudo.map_or(false, |p| p.is_marker()) && - self.style.get_counters().ineffective_content_property() && - self.style.get_list().clone_list_style_type().is_bullet(); + self.style.get_list().clone_list_style_type().is_bullet() && + self.style.get_counters().clone_content() == Content::Normal; if !is_legacy_marker { return; } diff --git a/components/style/values/resolved/counters.rs b/components/style/values/resolved/counters.rs index bf6490f7401..3bb439a104d 100644 --- a/components/style/values/resolved/counters.rs +++ b/components/style/values/resolved/counters.rs @@ -27,15 +27,16 @@ impl ToResolvedValue for computed::Content { .style .pseudo() .map_or(false, |p| p.is_before_or_after()); + let is_marker = context + .style + .pseudo() + .map_or(false, |p| p.is_marker()); match self { Self::Normal if is_before_or_after => Self::None, - // For now, make `content: none` compute to `normal` on other - // elements, as we don't respect it. - // - // FIXME(emilio, bug 1605473): for marker this should be preserved - // and respected, probably. - Self::None if !is_before_or_after => Self::Normal, + // For now, make `content: none` compute to `normal` for elements + // other than ::before, ::after and ::marker, as we don't respect it. + Self::None if !is_before_or_after && !is_marker => Self::Normal, other => other, } }