From a58b19e7d3d3b33cc7aea9e4eaa6b7e5d96b801d Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 31 Mar 2017 12:03:07 -0400 Subject: [PATCH] Presentation hints should not get applied to pseudo-elements. Servo side of https://bugzilla.mozilla.org/show_bug.cgi?id=1352464 --- components/style/stylist.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/components/style/stylist.rs b/components/style/stylist.rs index f93d76a5879..c02a5f197e6 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -622,19 +622,21 @@ impl Stylist { CascadeLevel::UANormal); debug!("UA normal: {:?}", relations); - // Step 2: Presentational hints. - let length_before_preshints = applicable_declarations.len(); - element.synthesize_presentational_hints_for_legacy_attributes(applicable_declarations); - if applicable_declarations.len() != length_before_preshints { - if cfg!(debug_assertions) { - for declaration in &applicable_declarations[length_before_preshints..] { - assert_eq!(declaration.level, CascadeLevel::PresHints); + if pseudo_element.is_none() { + // Step 2: Presentational hints. + let length_before_preshints = applicable_declarations.len(); + element.synthesize_presentational_hints_for_legacy_attributes(applicable_declarations); + if applicable_declarations.len() != length_before_preshints { + if cfg!(debug_assertions) { + 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 - relations |= AFFECTED_BY_PRESENTATIONAL_HINTS; + debug!("preshints: {:?}", relations); } - debug!("preshints: {:?}", relations); if element.matches_user_and_author_rules() { // Step 3: User and author normal rules.