Auto merge of #17982 - heycam:parent-fixup, r=emilio

style: Don't perform parent display-based style fixups on most pseudos.

Reviewed by Emilio in https://bugzilla.mozilla.org/show_bug.cgi?id=1379865.

<!-- 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/17982)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-08-05 05:52:59 -05:00 committed by GitHub
commit 586f84f5fe
3 changed files with 16 additions and 1 deletions

View file

@ -115,6 +115,13 @@ impl PseudoElement {
(self.flags() & structs::CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE) != 0
}
/// Whether this pseudo-element skips flex/grid container display-based
/// fixup.
#[inline]
pub fn skip_item_based_display_fixup(&self) -> bool {
(self.flags() & structs::CSS_PSEUDO_ELEMENT_IS_FLEX_OR_GRID_ITEM) == 0
}
/// Whether this pseudo-element is precomputed.
#[inline]
pub fn is_precomputed(&self) -> bool {

View file

@ -150,6 +150,13 @@ impl PseudoElement {
self.is_precomputed()
}
/// Whether this pseudo-element skips flex/grid container
/// display-based fixup.
#[inline]
pub fn skip_item_based_display_fixup(&self) -> bool {
!self.is_before_or_after()
}
/// Whether this pseudo-element is precomputed.
#[inline]
pub fn is_precomputed(&self) -> bool {

View file

@ -442,7 +442,8 @@ where
let mut cascade_info = CascadeInfo::new();
let mut cascade_flags = CascadeFlags::empty();
if self.element.skip_root_and_item_based_display_fixup() {
if self.element.skip_root_and_item_based_display_fixup() ||
pseudo.map_or(false, |p| p.skip_item_based_display_fixup()) {
cascade_flags.insert(SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP);
}