mirror of
https://github.com/servo/servo.git
synced 2025-08-16 19:05:33 +01:00
style: Implement 'content: none' for ::marker
Differential Revision: https://phabricator.services.mozilla.com/D111707
This commit is contained in:
parent
c9d4f812e5
commit
183ec78be5
2 changed files with 10 additions and 8 deletions
|
@ -832,10 +832,11 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
|
||||||
fn adjust_for_marker_pseudo(&mut self) {
|
fn adjust_for_marker_pseudo(&mut self) {
|
||||||
use crate::values::computed::font::{FontFamily, FontSynthesis};
|
use crate::values::computed::font::{FontFamily, FontSynthesis};
|
||||||
use crate::values::computed::text::{LetterSpacing, WordSpacing};
|
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()) &&
|
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 {
|
if !is_legacy_marker {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,15 +27,16 @@ impl ToResolvedValue for computed::Content {
|
||||||
.style
|
.style
|
||||||
.pseudo()
|
.pseudo()
|
||||||
.map_or(false, |p| p.is_before_or_after());
|
.map_or(false, |p| p.is_before_or_after());
|
||||||
|
let is_marker = context
|
||||||
|
.style
|
||||||
|
.pseudo()
|
||||||
|
.map_or(false, |p| p.is_marker());
|
||||||
|
|
||||||
match self {
|
match self {
|
||||||
Self::Normal if is_before_or_after => Self::None,
|
Self::Normal if is_before_or_after => Self::None,
|
||||||
// For now, make `content: none` compute to `normal` on other
|
// For now, make `content: none` compute to `normal` for elements
|
||||||
// elements, as we don't respect it.
|
// other than ::before, ::after and ::marker, as we don't respect it.
|
||||||
//
|
Self::None if !is_before_or_after && !is_marker => Self::Normal,
|
||||||
// FIXME(emilio, bug 1605473): for marker this should be preserved
|
|
||||||
// and respected, probably.
|
|
||||||
Self::None if !is_before_or_after => Self::Normal,
|
|
||||||
other => other,
|
other => other,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue