diff options
Diffstat (limited to 'components/style')
-rw-r--r-- | components/style/gecko/snapshot.rs | 2 | ||||
-rw-r--r-- | components/style/gecko/snapshot_helpers.rs | 4 | ||||
-rw-r--r-- | components/style/gecko/wrapper.rs | 14 |
3 files changed, 16 insertions, 4 deletions
diff --git a/components/style/gecko/snapshot.rs b/components/style/gecko/snapshot.rs index d294939baeb..cffb78d3e9e 100644 --- a/components/style/gecko/snapshot.rs +++ b/components/style/gecko/snapshot.rs @@ -211,7 +211,7 @@ impl ElementSnapshot for GeckoElementSnapshot { return; } - snapshot_helpers::each_class(&self.mClass, callback) + snapshot_helpers::each_class_or_part(&self.mClass, callback) } #[inline] diff --git a/components/style/gecko/snapshot_helpers.rs b/components/style/gecko/snapshot_helpers.rs index aaa2254dbd7..b8b31bc87dd 100644 --- a/components/style/gecko/snapshot_helpers.rs +++ b/components/style/gecko/snapshot_helpers.rs @@ -107,9 +107,9 @@ pub fn has_class_or_part( } /// Given an item, a callback, and a getter, execute `callback` for each class -/// this `item` has. +/// or part name this `item` has. #[inline(always)] -pub fn each_class<F>(attr: &structs::nsAttrValue, mut callback: F) +pub fn each_class_or_part<F>(attr: &structs::nsAttrValue, mut callback: F) where F: FnMut(&Atom), { diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 17c1cfaf35d..ba2951f6f25 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -1372,7 +1372,19 @@ impl<'le> TElement for GeckoElement<'le> { None => return, }; - snapshot_helpers::each_class(attr, callback) + snapshot_helpers::each_class_or_part(attr, callback) + } + + fn each_part<F>(&self, callback: F) + where + F: FnMut(&Atom), + { + let attr = match self.get_part_attr() { + Some(c) => c, + None => return, + }; + + snapshot_helpers::each_class_or_part(attr, callback) } #[inline] |