Backed out changeset fc813bf68348 for failing reftest layout/reftests/bugs/272646-1.xul on OS X. r=backout

Backs out https://github.com/servo/servo/pull/19045
This commit is contained in:
Gecko Backout 2017-10-28 08:08:47 +00:00 committed by moz-servo-sync
parent 592c513c28
commit cda9d186c1
5 changed files with 47 additions and 148 deletions

View file

@ -6,6 +6,7 @@
//! quickly whether it's worth to share style, and whether two different
//! elements can indeed share the same style.
use Atom;
use bloom::StyleBloom;
use context::{SelectorFlagsMap, SharedStyleContext};
use dom::TElement;
@ -95,16 +96,14 @@ pub fn have_same_class<E>(target: &mut StyleSharingTarget<E>,
/// :first-child, etc, or on attributes that we don't check off-hand (pretty
/// much every attribute selector except `id` and `class`.
#[inline]
pub fn revalidate<E>(
target: &mut StyleSharingTarget<E>,
candidate: &mut StyleSharingCandidate<E>,
shared_context: &SharedStyleContext,
bloom: &StyleBloom<E>,
nth_index_cache: &mut NthIndexCache,
selector_flags_map: &mut SelectorFlagsMap<E>,
) -> bool
where
E: TElement,
pub fn revalidate<E>(target: &mut StyleSharingTarget<E>,
candidate: &mut StyleSharingCandidate<E>,
shared_context: &SharedStyleContext,
bloom: &StyleBloom<E>,
nth_index_cache: &mut NthIndexCache,
selector_flags_map: &mut SelectorFlagsMap<E>)
-> bool
where E: TElement,
{
let stylist = &shared_context.stylist;
@ -131,25 +130,16 @@ where
/// Checks whether we might have rules for either of the two ids.
#[inline]
pub fn may_match_different_id_rules<E>(
shared_context: &SharedStyleContext,
element: E,
candidate: E,
) -> bool
where
E: TElement,
pub fn may_have_rules_for_ids(shared_context: &SharedStyleContext,
element_id: Option<&Atom>,
candidate_id: Option<&Atom>) -> bool
{
let element_id = element.get_id();
let candidate_id = candidate.get_id();
if element_id == candidate_id {
return false;
}
// We shouldn't be called unless the ids are different.
debug_assert!(element_id.is_some() || candidate_id.is_some());
let stylist = &shared_context.stylist;
let may_have_rules_for_element = match element_id {
Some(ref id) => stylist.may_have_rules_for_id(id, element),
Some(id) => stylist.may_have_rules_for_id(id),
None => false
};
@ -158,7 +148,7 @@ where
}
match candidate_id {
Some(ref id) => stylist.may_have_rules_for_id(id, candidate),
Some(id) => stylist.may_have_rules_for_id(id),
None => false
}
}