From 6426f714bd869aeae1bda8e30575a0ad747f2bca Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Thu, 1 Oct 2015 14:40:55 -0700 Subject: [PATCH] Incremental layout: Don't try to repair text fragment styles Fixes #7814. --- components/layout/construct.rs | 14 ++++++++++---- tests/ref/basic.list | 1 + tests/ref/incremental_text_color_a.html | 22 ++++++++++++++++++++++ tests/ref/incremental_text_color_ref.html | 15 +++++++++++++++ 4 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 tests/ref/incremental_text_color_a.html create mode 100644 tests/ref/incremental_text_color_ref.html diff --git a/components/layout/construct.rs b/components/layout/construct.rs index 2421a797b43..73c353980a2 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -1375,11 +1375,17 @@ impl<'a> FlowConstructor<'a> { // FIXME(pcwalton): Fragment restyle damage too? flow_ref.repair_style_and_bubble_inline_sizes(&style); } - SpecificFragmentInfo::ScannedText(_) | + SpecificFragmentInfo::ScannedText(_) => { + // Text fragments in ConstructionResult haven't been scanned yet + unreachable!() + } + SpecificFragmentInfo::GeneratedContent(_) | SpecificFragmentInfo::UnscannedText(_) => { - properties::modify_style_for_text(&mut style); - properties::modify_style_for_replaced_content(&mut style); - fragment.repair_style(&style); + // We can't repair this unscanned text; we need to update the + // scanned text fragments. + // + // TODO: Add code to find and repair the ScannedText fragments? + return false } _ => { if node.is_replaced_content() { diff --git a/tests/ref/basic.list b/tests/ref/basic.list index c823dd97d3d..c9067f5569d 100644 --- a/tests/ref/basic.list +++ b/tests/ref/basic.list @@ -165,6 +165,7 @@ prefs:"layout.writing-mode.enabled" == iframe/size_attributes_vertical_writing_m == incremental_float_a.html incremental_float_ref.html == incremental_inline_layout_a.html incremental_inline_layout_ref.html == incremental_letter_spacing_a.html incremental_letter_spacing_ref.html +== incremental_text_color_a.html incremental_text_color_ref.html == inline_absolute_hypothetical_clip_a.html inline_absolute_hypothetical_clip_ref.html == inline_absolute_out_of_flow_a.html inline_absolute_out_of_flow_ref.html != inline_background_a.html inline_background_ref.html diff --git a/tests/ref/incremental_text_color_a.html b/tests/ref/incremental_text_color_a.html new file mode 100644 index 00000000000..8ac15b01619 --- /dev/null +++ b/tests/ref/incremental_text_color_a.html @@ -0,0 +1,22 @@ + + + + + Incremental layout text color test + + + + A + + + diff --git a/tests/ref/incremental_text_color_ref.html b/tests/ref/incremental_text_color_ref.html new file mode 100644 index 00000000000..6e596100523 --- /dev/null +++ b/tests/ref/incremental_text_color_ref.html @@ -0,0 +1,15 @@ + + + + + Incremental layout text color reference + + + + A + +