aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/css/matching.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/css/matching.rs')
-rw-r--r--components/layout/css/matching.rs26
1 files changed, 11 insertions, 15 deletions
diff --git a/components/layout/css/matching.rs b/components/layout/css/matching.rs
index e83899e2893..bffd6188344 100644
--- a/components/layout/css/matching.rs
+++ b/components/layout/css/matching.rs
@@ -236,24 +236,20 @@ impl<'le, ConcreteElement> PrivateElementMatchMethods<'le, ConcreteElement>
let parent_data: Option<&PrivateStyleData> = unsafe {
parent_node.borrow_data_unchecked().map(|d| &*d)
};
- match parent_data {
- Some(parent_data_ref) => {
- // Check parent style.
- let parent_style = (*parent_data_ref).style.as_ref().unwrap();
- if !arc_ptr_eq(parent_style, &candidate.parent_style) {
- return None
- }
-
- // Check tag names, classes, etc.
- if !candidate.can_share_style_with(self) {
- return None
- }
+ if let Some(parent_data_ref) = parent_data {
+ // Check parent style.
+ let parent_style = (*parent_data_ref).style.as_ref().unwrap();
+ if !arc_ptr_eq(parent_style, &candidate.parent_style) {
+ return None
+ }
- return Some(candidate.style.clone())
+ // Check tag names, classes, etc.
+ if !candidate.can_share_style_with(self) {
+ return None
}
- _ => {}
- }
+ return Some(candidate.style.clone())
+ }
None
}
}