diff options
author | Bobby Holley <bobbyholley@gmail.com> | 2016-06-23 15:36:25 -0700 |
---|---|---|
committer | Bobby Holley <bobbyholley@gmail.com> | 2016-07-05 18:03:38 -0700 |
commit | 364c8e297607f131468c4def668c7ba9933984e5 (patch) | |
tree | e1da463af57a70182b1d01136237b4efca9aa8ff /components/script/layout_wrapper.rs | |
parent | 96af00fbb9270f1704b36bebbbc47493d3a8f813 (diff) | |
download | servo-364c8e297607f131468c4def668c7ba9933984e5.tar.gz servo-364c8e297607f131468c4def668c7ba9933984e5.zip |
Add attr_equals to TElement.
Same reasons as the previous patch.
Diffstat (limited to 'components/script/layout_wrapper.rs')
-rw-r--r-- | components/script/layout_wrapper.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/components/script/layout_wrapper.rs b/components/script/layout_wrapper.rs index 7c7c9cc3505..a916ee73512 100644 --- a/components/script/layout_wrapper.rs +++ b/components/script/layout_wrapper.rs @@ -392,6 +392,11 @@ impl<'le> TElement for ServoLayoutElement<'le> { } #[inline] + fn attr_equals(&self, namespace: &Namespace, attr: &Atom, val: &Atom) -> bool { + self.get_attr(namespace, attr).map_or(false, |x| x == val) + } + + #[inline] fn get_attr(&self, namespace: &Namespace, name: &Atom) -> Option<&str> { unsafe { (*self.element.unsafe_get()).get_attr_val_for_layout(namespace, name) |