aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2019-04-11 15:21:17 +0000
committerEmilio Cobos Álvarez <emilio@crisal.io>2019-04-12 12:20:14 +0200
commit7c4f9bbf494387c2046d614f5d8769b7ce7eed67 (patch)
tree2125d24c916be90f7524a0b40a66a26ed4103b0a /components
parentcf7f64c9dcc511e93d9504054ebad193a5f83ff7 (diff)
downloadservo-7c4f9bbf494387c2046d614f5d8769b7ce7eed67.tar.gz
servo-7c4f9bbf494387c2046d614f5d8769b7ce7eed67.zip
style: Make the list-item increment not visible from the computed style.
This is per https://drafts.csswg.org/css-lists/#declaring-a-list-item. I intentionally kept <li value> defined using attribute mapping, I think that's saner than special-casing it in layout. Differential Revision: https://phabricator.services.mozilla.com/D24935
Diffstat (limited to 'components')
-rw-r--r--components/style/style_adjuster.rs39
1 files changed, 0 insertions, 39 deletions
diff --git a/components/style/style_adjuster.rs b/components/style/style_adjuster.rs
index e0efe35c86f..63af60e16ab 100644
--- a/components/style/style_adjuster.rs
+++ b/components/style/style_adjuster.rs
@@ -723,44 +723,6 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
}
}
- /// For HTML elements with 'display:list-item' we add a default 'counter-increment:list-item'
- /// unless 'counter-increment' already has a value for 'list-item'.
- ///
- /// https://drafts.csswg.org/css-lists-3/#declaring-a-list-item
- #[cfg(feature = "gecko")]
- fn adjust_for_list_item(&mut self) {
- use crate::properties::longhands::counter_increment::computed_value::T as ComputedIncrement;
- use crate::values::generics::counters::CounterPair;
- use crate::values::specified::list::MozListReversed;
- use crate::values::CustomIdent;
-
- if self.style.get_box().clone_display() != Display::ListItem {
- return;
- }
- if self.style.pseudo.is_some() {
- return;
- }
-
- let increments = self.style.get_counters().clone_counter_increment();
- if increments.iter().any(|i| i.name.0 == atom!("list-item")) {
- return;
- }
-
- let reversed = self.style.get_list().clone__moz_list_reversed() == MozListReversed::True;
- let increment = if reversed { -1 } else { 1 };
- let list_increment = CounterPair {
- name: CustomIdent(atom!("list-item")),
- value: increment,
- };
- let increments = increments
- .iter()
- .cloned()
- .chain(std::iter::once(list_increment));
- self.style
- .mutate_counters()
- .set_counter_increment(ComputedIncrement::new(increments.collect()));
- }
-
/// Adjusts the style to account for various fixups that don't fit naturally
/// into the cascade.
///
@@ -825,7 +787,6 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
#[cfg(feature = "gecko")]
{
self.adjust_for_appearance(element);
- self.adjust_for_list_item();
}
self.set_bits();
}