style: Implement 'content: none' for ::marker

Differential Revision: https://phabricator.services.mozilla.com/D111707
This commit is contained in:
Mats Palmgren 2023-05-22 09:51:42 +02:00 committed by Oriol Brufau
parent c9d4f812e5
commit 183ec78be5
2 changed files with 10 additions and 8 deletions

View file

@ -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;
}

View file

@ -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,
}
}