diff options
author | Manish Goregaokar <manishsmail@gmail.com> | 2018-02-21 00:36:35 -0800 |
---|---|---|
committer | Manish Goregaokar <manishsmail@gmail.com> | 2018-02-21 00:36:35 -0800 |
commit | 285313f3c7a528bfde8df567262e3f9f4df61814 (patch) | |
tree | 0e6a476769d80e17765dead080568275a029f6c9 /components/layout/table.rs | |
parent | 7de29d0ac4dde6f002bc124884374c9aa0883c9b (diff) | |
download | servo-285313f3c7a528bfde8df567262e3f9f4df61814.tar.gz servo-285313f3c7a528bfde8df567262e3f9f4df61814.zip |
bail early for initial valued backgrounds
Diffstat (limited to 'components/layout/table.rs')
-rw-r--r-- | components/layout/table.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/components/layout/table.rs b/components/layout/table.rs index 42c759cee63..72916de36ed 100644 --- a/components/layout/table.rs +++ b/components/layout/table.rs @@ -19,11 +19,12 @@ use fragment::{Fragment, FragmentBorderBoxIterator, Overflow}; use gfx_traits::print_tree::PrintTree; use layout_debug; use model::{IntrinsicISizes, IntrinsicISizesContribution, MaybeAuto}; -use std::{cmp, fmt, ptr}; +use std::{cmp, fmt}; use style::computed_values::{border_collapse, border_spacing, table_layout}; use style::context::SharedStyleContext; use style::logical_geometry::LogicalSize; use style::properties::ComputedValues; +use style::properties::style_structs::Background; use style::servo::restyle_damage::ServoRestyleDamage; use style::values::CSSFloat; use style::values::computed::LengthOrPercentageOrAuto; @@ -1159,20 +1160,18 @@ impl<'table> TableCellStyleInfo<'table> { }; { let cell_flow = &self.cell.block_flow; - let mut sty_ptr = ptr::null(); + let initial = ComputedValues::initial_values(); - let mut build_dl = |sty: &ComputedValues, state: &mut &mut DisplayListBuildState| { + let build_dl = |sty: &ComputedValues, state: &mut &mut DisplayListBuildState| { + let background = sty.get_background(); // Don't redraw backgrounds that we've already drawn - if sty_ptr == sty as *const _ { + if background as *const Background == initial.get_background() as *const _ { return; } - let background = sty.get_background(); let background_color = sty.resolve_color(background.background_color); cell_flow.build_display_list_for_background_if_applicable_with_background( state, background, background_color ); - - sty_ptr = sty as *const _; }; if let Some(ref sty) = self.colgroup_style { |