diff options
Diffstat (limited to 'components/layout')
-rw-r--r-- | components/layout/display_list_builder.rs | 9 | ||||
-rw-r--r-- | components/layout/fragment.rs | 9 | ||||
-rw-r--r-- | components/layout/layout_task.rs | 3 | ||||
-rw-r--r-- | components/layout/text.rs | 8 |
4 files changed, 21 insertions, 8 deletions
diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index c394edb4a51..70b8b409edb 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -371,7 +371,9 @@ impl FragmentDisplayListBuilding for Fragment { // Create the image display item. display_list.push(DisplayItem::ImageClass(box ImageDisplayItem { base: BaseDisplayItem::new(bounds, - DisplayItemMetadata::new(self.node, style, Cursor::DefaultCursor), + DisplayItemMetadata::new(self.node, + style, + Cursor::DefaultCursor), clip), image: image.clone(), stretch_size: Size2D(Au::from_px(image.width as int), @@ -481,7 +483,9 @@ impl FragmentDisplayListBuilding for Fragment { let gradient_display_item = DisplayItem::GradientClass(box GradientDisplayItem { base: BaseDisplayItem::new(*absolute_bounds, - DisplayItemMetadata::new(self.node, style, Cursor::DefaultCursor), + DisplayItemMetadata::new(self.node, + style, + Cursor::DefaultCursor), clip), start_point: center - delta, end_point: center + delta, @@ -1194,6 +1198,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow { &overflow, self.fragment.style().get_box().z_index.number_or_zero(), filters, + self.fragment.style().get_effects().mix_blend_mode, layer)) } } diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index 6217527bf6b..521b000dfcf 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -44,9 +44,9 @@ use std::sync::{Arc, Mutex}; use string_cache::Atom; use style::{ComputedValues, TElement, TNode, cascade_anonymous}; use style::computed_values::{LengthOrPercentage, LengthOrPercentageOrAuto}; -use style::computed_values::{LengthOrPercentageOrNone}; -use style::computed_values::{clear, overflow_wrap, position, text_align, text_decoration}; -use style::computed_values::{vertical_align, white_space, word_break}; +use style::computed_values::{LengthOrPercentageOrNone, clear, mix_blend_mode, overflow_wrap}; +use style::computed_values::{position, text_align, text_decoration, vertical_align, white_space}; +use style::computed_values::{word_break}; use url::Url; /// Fragments (`struct Fragment`) are the leaves of the layout tree. They cannot position @@ -1747,6 +1747,9 @@ impl Fragment { if !self.style().get_effects().filter.is_empty() { return true } + if self.style().get_effects().mix_blend_mode != mix_blend_mode::T::normal { + return true + } match self.style().get_box().position { position::T::absolute | position::T::fixed => { // FIXME(pcwalton): This should only establish a new stacking context when diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 167e1d4a846..b8c2385a557 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -63,7 +63,7 @@ use std::cell::Cell; use std::comm::{channel, Sender, Receiver, Select}; use std::mem; use std::ptr; -use style::computed_values::filter; +use style::computed_values::{filter, mix_blend_mode}; use style::{StylesheetOrigin, Stylesheet, Stylist, TNode, iter_font_face_rules}; use style::{MediaType, Device}; use std::sync::{Arc, Mutex, MutexGuard}; @@ -698,6 +698,7 @@ impl LayoutTask { &origin, 0, filter::T::new(Vec::new()), + mix_blend_mode::T::normal, Some(paint_layer))); rw_data.stacking_context = Some(stacking_context.clone()); diff --git a/components/layout/text.rs b/components/layout/text.rs index ae4ad5ec0de..f57aee50f7b 100644 --- a/components/layout/text.rs +++ b/components/layout/text.rs @@ -116,7 +116,9 @@ impl TextRunScanner { let inherited_text_style = in_fragment.style().get_inheritedtext(); fontgroup = font_context.get_layout_font_group_for_style(font_style); compression = match in_fragment.white_space() { - white_space::T::normal | white_space::T::nowrap => CompressionMode::CompressWhitespaceNewline, + white_space::T::normal | white_space::T::nowrap => { + CompressionMode::CompressWhitespaceNewline + } white_space::T::pre => CompressionMode::CompressNone, }; text_transform = inherited_text_style.text_transform; @@ -129,7 +131,9 @@ impl TextRunScanner { let mut run_text = String::new(); for in_fragment in self.clump.iter() { let in_fragment = match in_fragment.specific { - SpecificFragmentInfo::UnscannedText(ref text_fragment_info) => &text_fragment_info.text, + SpecificFragmentInfo::UnscannedText(ref text_fragment_info) => { + &text_fragment_info.text + } _ => panic!("Expected an unscanned text fragment!"), }; |