diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-10-15 09:53:26 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-15 09:53:26 -0400 |
commit | 2bc086762e53d3d0b91633474fb8a92fac0c355c (patch) | |
tree | c2c80e018c85e31698c07e2488e028d16a8102e2 /components/style/servo | |
parent | d22b10391d361fe673d70b60c838e459f4ac6f5a (diff) | |
parent | 6d7d1e56912786a2603613da445ac023c49ddc3f (diff) | |
download | servo-2bc086762e53d3d0b91633474fb8a92fac0c355c.tar.gz servo-2bc086762e53d3d0b91633474fb8a92fac0c355c.zip |
Auto merge of #21946 - emilio:remove-inherits-all, r=nox
style: Stop using PseudoElement::inherits_all.
This was done that way just because Servo didn't support the `all` property at
the time.
We should do it this way and optimize it if it's slow. Though I suspect that
most of stuff doesn't actually need to be inherited, my patch at bug 1498943
should make it much faster than what it would otherwise be.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21946)
<!-- Reviewable:end -->
Diffstat (limited to 'components/style/servo')
-rw-r--r-- | components/style/servo/selector_parser.rs | 38 |
1 files changed, 3 insertions, 35 deletions
diff --git a/components/style/servo/selector_parser.rs b/components/style/servo/selector_parser.rs index 7c1e082022d..7b2c06019a4 100644 --- a/components/style/servo/selector_parser.rs +++ b/components/style/servo/selector_parser.rs @@ -221,41 +221,9 @@ impl PseudoElement { } } - /// For most (but not all) anon-boxes, we inherit all values from the - /// parent, this is the hook in the style system to allow this. - /// - /// FIXME(emilio): It's likely that this is broken in a variety of - /// situations, and what it really wants is just inherit some reset - /// properties... Also, I guess it just could do all: inherit on the - /// stylesheet, though chances are that'd be kinda slow if we don't cache - /// them... + /// To be removed. pub fn inherits_all(&self) -> bool { - match *self { - PseudoElement::After | - PseudoElement::Before | - PseudoElement::Selection | - PseudoElement::DetailsContent | - PseudoElement::DetailsSummary | - // Anonymous table flows shouldn't inherit their parents properties in order - // to avoid doubling up styles such as transformations. - PseudoElement::ServoAnonymousTableCell | - PseudoElement::ServoAnonymousTableRow | - PseudoElement::ServoText | - PseudoElement::ServoInputText => false, - - // For tables, we do want style to inherit, because TableWrapper is - // responsible for handling clipping and scrolling, while Table is - // responsible for creating stacking contexts. - // - // StackingContextCollectionFlags makes sure this is processed - // properly. - PseudoElement::ServoAnonymousTable | - PseudoElement::ServoAnonymousTableWrapper | - PseudoElement::ServoTableWrapper | - PseudoElement::ServoAnonymousBlock | - PseudoElement::ServoInlineBlockWrapper | - PseudoElement::ServoInlineAbsolute => true, - } + false } /// Covert non-canonical pseudo-element to canonical one, and keep a @@ -585,7 +553,7 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> { } ServoInlineBlockWrapper }, - "-servo-input-absolute" => { + "-servo-inline-absolute" => { if !self.in_user_agent_stylesheet() { return Err(location.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(name.clone()))) } |