Presentation hints should not get applied to pseudo-elements.

Servo side of https://bugzilla.mozilla.org/show_bug.cgi?id=1352464
This commit is contained in:
Boris Zbarsky 2017-03-31 12:03:07 -04:00
parent 3f83628fa9
commit a58b19e7d3

View file

@ -622,19 +622,21 @@ impl Stylist {
CascadeLevel::UANormal); CascadeLevel::UANormal);
debug!("UA normal: {:?}", relations); debug!("UA normal: {:?}", relations);
// Step 2: Presentational hints. if pseudo_element.is_none() {
let length_before_preshints = applicable_declarations.len(); // Step 2: Presentational hints.
element.synthesize_presentational_hints_for_legacy_attributes(applicable_declarations); let length_before_preshints = applicable_declarations.len();
if applicable_declarations.len() != length_before_preshints { element.synthesize_presentational_hints_for_legacy_attributes(applicable_declarations);
if cfg!(debug_assertions) { if applicable_declarations.len() != length_before_preshints {
for declaration in &applicable_declarations[length_before_preshints..] { if cfg!(debug_assertions) {
assert_eq!(declaration.level, CascadeLevel::PresHints); for declaration in &applicable_declarations[length_before_preshints..] {
assert_eq!(declaration.level, CascadeLevel::PresHints);
}
} }
// Never share style for elements with preshints
relations |= AFFECTED_BY_PRESENTATIONAL_HINTS;
} }
// Never share style for elements with preshints debug!("preshints: {:?}", relations);
relations |= AFFECTED_BY_PRESENTATIONAL_HINTS;
} }
debug!("preshints: {:?}", relations);
if element.matches_user_and_author_rules() { if element.matches_user_and_author_rules() {
// Step 3: User and author normal rules. // Step 3: User and author normal rules.