Auto merge of #8702 - mrobinson:fragments, r=pcwalton

Build Fragments without the RECONSTRUCT_FLOW bit

The RECONSTRUCT_FLOW restyle damage bit shouldn't apply to newly
constructed flow tree elements. It is explicitly removed for Flows, but
not for Fragments. This causes RECONSTRUCT_FLOW to bubble up to Flows
that contain any Fragments at all. Instead explicitly remove the
RECONSTRUCT_FLOW bit when creating a new Fragment.

There isn't a good way to test this currently, but all tests should
continue to pass.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8702)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-11-28 10:04:28 +05:30
commit d50b87edec

View file

@ -17,7 +17,7 @@ use gfx;
use gfx::display_list::{BLUR_INFLATION_FACTOR, OpaqueNode};
use gfx::text::glyph::CharIndex;
use gfx::text::text_run::{TextRun, TextRunSlice};
use incremental::{self, RestyleDamage};
use incremental::{self, RECONSTRUCT_FLOW, RestyleDamage};
use inline::{FIRST_FRAGMENT_OF_ELEMENT, InlineFragmentContext, InlineFragmentNodeInfo};
use inline::{InlineMetrics, LAST_FRAGMENT_OF_ELEMENT};
use ipc_channel::ipc::IpcSender;
@ -774,10 +774,14 @@ impl Fragment {
pub fn new(node: &ServoThreadSafeLayoutNode, specific: SpecificFragmentInfo) -> Fragment {
let style = node.style().clone();
let writing_mode = style.writing_mode;
let mut restyle_damage = node.restyle_damage();
restyle_damage.remove(RECONSTRUCT_FLOW);
Fragment {
node: node.opaque(),
style: style,
restyle_damage: node.restyle_damage(),
restyle_damage: restyle_damage,
border_box: LogicalRect::zero(writing_mode),
border_padding: LogicalMargin::zero(writing_mode),
margin: LogicalMargin::zero(writing_mode),
@ -793,10 +797,13 @@ impl Fragment {
pub fn from_opaque_node_and_style(node: OpaqueNode,
pseudo: PseudoElementType<()>,
style: Arc<ComputedValues>,
restyle_damage: RestyleDamage,
mut restyle_damage: RestyleDamage,
specific: SpecificFragmentInfo)
-> Fragment {
let writing_mode = style.writing_mode;
restyle_damage.remove(RECONSTRUCT_FLOW);
Fragment {
node: node,
style: style,
@ -826,10 +833,13 @@ impl Fragment {
self.border_box.start,
size);
let mut restyle_damage = incremental::rebuild_and_reflow();
restyle_damage.remove(RECONSTRUCT_FLOW);
Fragment {
node: self.node,
style: self.style.clone(),
restyle_damage: incremental::rebuild_and_reflow(),
restyle_damage: restyle_damage,
border_box: new_border_box,
border_padding: self.border_padding,
margin: self.margin,