Auto merge of #7656 - mbrubeck:incremental-text-6501, r=pcwalton

Reconstruct flows when text/font styles change

These styles are used during text shaping.  When they change, we need to re-run shaping and construct new flows.

Fixes #6501. r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7656)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-09-18 01:32:40 -06:00
commit acde10f005
5 changed files with 46 additions and 7 deletions

View file

@ -1309,10 +1309,9 @@ impl<'a> FlowConstructor<'a> {
pub fn repair_if_possible(&mut self, node: &ThreadSafeLayoutNode) -> bool {
// We can skip reconstructing the flow if we don't have to reconstruct and none of our kids
// did either.
if node.restyle_damage().contains(RECONSTRUCT_FLOW) {
return false
}
//
// We visit the kids first and reset their HAS_NEWLY_CONSTRUCTED_FLOW flags after checking
// them. NOTE: Make sure not to bail out early before resetting all the flags!
let mut need_to_reconstruct = false;
for kid in node.children() {
if kid.flags().contains(HAS_NEWLY_CONSTRUCTED_FLOW) {
@ -1324,6 +1323,11 @@ impl<'a> FlowConstructor<'a> {
return false
}
if node.restyle_damage().contains(RECONSTRUCT_FLOW) {
return false
}
let mut style = node.style().clone();
let mut layout_data_ref = node.mutate_layout_data();
let layout_data = layout_data_ref.as_mut().expect("no layout data");