diff options
Diffstat (limited to 'components/style/sharing/checks.rs')
-rw-r--r-- | components/style/sharing/checks.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/components/style/sharing/checks.rs b/components/style/sharing/checks.rs index 19c1c52acdc..5e8350e78d3 100644 --- a/components/style/sharing/checks.rs +++ b/components/style/sharing/checks.rs @@ -81,7 +81,7 @@ where target.pres_hints() == candidate.pres_hints() } -/// Whether a given element has the same class attribute than a given candidate. +/// Whether a given element has the same class attribute as a given candidate. /// /// We don't try to share style across elements with different class attributes. pub fn have_same_class<E>( @@ -94,6 +94,19 @@ where target.class_list() == candidate.class_list() } +/// Whether a given element has the same part attribute as a given candidate. +/// +/// We don't try to share style across elements with different part attributes. +pub fn have_same_parts<E>( + target: &mut StyleSharingTarget<E>, + candidate: &mut StyleSharingCandidate<E>, +) -> bool +where + E: TElement, +{ + target.part_list() == candidate.part_list() +} + /// Whether a given element and a candidate match the same set of "revalidation" /// selectors. /// |