From 1f73c524bd240ece2db99ef39f5f4441742cb06b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 27 Mar 2019 15:03:20 +0000 Subject: [PATCH] style: Follow the list-item definition from the spec a bit more closely. The HTML restriction doesn't match any browser. This matches Edge, though I filed https://github.com/w3c/csswg-drafts/issues/3766 about the pseudo-element condition. Differential Revision: https://phabricator.services.mozilla.com/D24936 --- components/style/style_adjuster.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/components/style/style_adjuster.rs b/components/style/style_adjuster.rs index 070a2299969..91e4bba992b 100644 --- a/components/style/style_adjuster.rs +++ b/components/style/style_adjuster.rs @@ -728,10 +728,7 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { /// /// https://drafts.csswg.org/css-lists-3/#declaring-a-list-item #[cfg(feature = "gecko")] - fn adjust_for_list_item(&mut self, element: Option) - where - E: TElement, - { + 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; @@ -743,9 +740,6 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { if self.style.pseudo.is_some() { return; } - if !element.map_or(false, |e| e.is_html_element()) { - return; - } // Note that we map
  • to 'counter-set: list-item INTEGER; // counter-increment: list-item 0;' so we'll return here unless the author // explicitly specified something else. @@ -833,7 +827,7 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { #[cfg(feature = "gecko")] { self.adjust_for_appearance(element); - self.adjust_for_list_item(element); + self.adjust_for_list_item(); } self.set_bits(); }