diff --git a/components/layout/css/matching.rs b/components/layout/css/matching.rs index 2484127fb28..4ff49518edd 100644 --- a/components/layout/css/matching.rs +++ b/components/layout/css/matching.rs @@ -8,7 +8,8 @@ use css::node_style::StyledNode; use construct::FlowConstructor; use context::LayoutContext; use util::{LayoutDataAccess, LayoutDataWrapper}; -use wrapper::{LayoutElement, LayoutNode, PostorderNodeMutTraversal, ThreadSafeLayoutNode, TLayoutNode}; +use wrapper::{LayoutElement, LayoutNode, PostorderNodeMutTraversal, ThreadSafeLayoutNode}; +use wrapper::{TLayoutNode}; use script::dom::node::{TextNodeTypeId}; use servo_util::bloom::BloomFilter; @@ -233,11 +234,13 @@ impl StyleSharingCandidate { } match (&self.class, element.get_attr(&ns!(""), "class")) { (&None, Some(_)) | (&Some(_), None) => return false, - (&Some(ref this_class), Some(element_class)) if element_class != this_class.as_slice() => { + (&Some(ref this_class), Some(element_class)) + if element_class != this_class.as_slice() => { return false } (&Some(_), Some(_)) | (&None, None) => {} } + true } } @@ -440,7 +443,9 @@ impl<'ln> MatchMethods for LayoutNode<'ln> { Some(After), &mut applicable_declarations.after); - *shareable = applicable_declarations.normal_shareable + *shareable = applicable_declarations.normal_shareable && + applicable_declarations.before.len() == 0 && + applicable_declarations.after.len() == 0 } unsafe fn share_style_if_possible(&self, @@ -537,7 +542,8 @@ impl<'ln> MatchMethods for LayoutNode<'ln> { // First, check to see whether we can share a style with someone. let sharing_result = unsafe { - self.share_style_if_possible(layout_context.style_sharing_candidate_cache(), parent.clone()) + self.share_style_if_possible(layout_context.style_sharing_candidate_cache(), + parent.clone()) }; // Otherwise, match and cascade selectors. diff --git a/components/layout/parallel.rs b/components/layout/parallel.rs index 0535998ee65..03d3b02af7d 100644 --- a/components/layout/parallel.rs +++ b/components/layout/parallel.rs @@ -16,8 +16,8 @@ use layout_task::{AssignBSizesAndStoreOverflowTraversal, AssignISizesTraversal}; use layout_task::{BubbleISizesTraversal}; use url::Url; use util::{LayoutDataAccess, LayoutDataWrapper, OpaqueNodeMethods}; -use wrapper::{layout_node_to_unsafe_layout_node, layout_node_from_unsafe_layout_node, LayoutNode, PostorderNodeMutTraversal}; -use wrapper::{ThreadSafeLayoutNode, UnsafeLayoutNode}; +use wrapper::{layout_node_to_unsafe_layout_node, layout_node_from_unsafe_layout_node, LayoutNode}; +use wrapper::{PostorderNodeMutTraversal, ThreadSafeLayoutNode, UnsafeLayoutNode}; use gfx::display_list::OpaqueNode; use servo_util::bloom::BloomFilter; diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index c9f9df91bec..579727617d0 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -633,7 +633,7 @@ impl<'ln> ThreadSafeLayoutNode<'ln> { } } - pub fn get_pseudo_element_type(&self) -> PseudoElementType { + pub fn get_pseudo_element_type(&self) -> PseudoElementType { self.pseudo } diff --git a/tests/ref/basic.list b/tests/ref/basic.list index 75eb1413189..247f4d38d81 100644 --- a/tests/ref/basic.list +++ b/tests/ref/basic.list @@ -167,3 +167,4 @@ fragment=top != ../html/acid2.html acid2_ref.html == box_sizing_border_box_a.html box_sizing_border_box_ref.html != input_height_a.html input_height_ref.html == pre_ignorable_whitespace_a.html pre_ignorable_whitespace_ref.html +== many_brs_a.html many_brs_ref.html diff --git a/tests/ref/many_brs_a.html b/tests/ref/many_brs_a.html new file mode 100644 index 00000000000..ea65cbe3390 --- /dev/null +++ b/tests/ref/many_brs_a.html @@ -0,0 +1,6 @@ + + + +Cupcakes
are
supremely
delicious. + + diff --git a/tests/ref/many_brs_ref.html b/tests/ref/many_brs_ref.html new file mode 100644 index 00000000000..05b6c9fc2fe --- /dev/null +++ b/tests/ref/many_brs_ref.html @@ -0,0 +1,9 @@ + + + +
Cupcakes
+
are
+
supremely
+
delicious.
+ +