mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
auto merge of #5226 : glennw/servo/fix-compositor-layers, r=larsbergstrom
This commit is contained in:
commit
0888a3a16d
3 changed files with 38 additions and 27 deletions
|
@ -15,7 +15,7 @@ use std::cmp;
|
|||
use std::mem;
|
||||
use geom::point::{Point2D, TypedPoint2D};
|
||||
use geom::rect::{Rect, TypedRect};
|
||||
use geom::size::TypedSize2D;
|
||||
use geom::size::{Size2D, TypedSize2D};
|
||||
use geom::scale_factor::ScaleFactor;
|
||||
use gfx::color;
|
||||
use gfx::paint_task::Msg as PaintMsg;
|
||||
|
@ -450,8 +450,18 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
return false;
|
||||
}
|
||||
return self.pipeline_details.values().all(|ref details| {
|
||||
details.paint_state == PaintState::Idle
|
||||
});
|
||||
// If a pipeline exists and has a root layer that has
|
||||
// zero size, it will never be painted. In this case,
|
||||
// consider it as idle to avoid hangs in reftests.
|
||||
if let Some(ref pipeline) = details.pipeline {
|
||||
if let Some(root_layer) = self.find_pipeline_root_layer(pipeline.id) {
|
||||
if root_layer.bounds.borrow().size == Size2D::zero() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
details.paint_state == PaintState::Idle
|
||||
});
|
||||
}
|
||||
|
||||
fn has_paint_msg_tracking(&self) -> bool {
|
||||
|
|
|
@ -588,7 +588,7 @@ impl<'a> FlowConstructor<'a> {
|
|||
if node.type_id() == Some(NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLTextAreaElement))) {
|
||||
for kid in node.children() {
|
||||
kid.set_flow_construction_result(ConstructionResult::None)
|
||||
self.set_flow_construction_result(&kid, ConstructionResult::None)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -744,7 +744,7 @@ impl<'a> FlowConstructor<'a> {
|
|||
fn build_fragments_for_replaced_inline_content(&mut self, node: &ThreadSafeLayoutNode)
|
||||
-> ConstructionResult {
|
||||
for kid in node.children() {
|
||||
kid.set_flow_construction_result(ConstructionResult::None)
|
||||
self.set_flow_construction_result(&kid, ConstructionResult::None)
|
||||
}
|
||||
|
||||
// If this node is ignorable whitespace, bail out now.
|
||||
|
@ -1095,7 +1095,7 @@ impl<'a> FlowConstructor<'a> {
|
|||
-> ConstructionResult {
|
||||
// CSS 2.1 § 17.2.1. Treat all child fragments of a `table-column` as `display: none`.
|
||||
for kid in node.children() {
|
||||
kid.set_flow_construction_result(ConstructionResult::None)
|
||||
self.set_flow_construction_result(&kid, ConstructionResult::None)
|
||||
}
|
||||
|
||||
let specific = SpecificFragmentInfo::TableColumn(TableColumnFragmentInfo::new(node));
|
||||
|
@ -1222,15 +1222,15 @@ impl<'a> PostorderNodeMutTraversal for FlowConstructor<'a> {
|
|||
// results of children.
|
||||
(display::T::none, _, _) => {
|
||||
for child in node.children() {
|
||||
child.set_flow_construction_result(ConstructionResult::None);
|
||||
self.set_flow_construction_result(&child, ConstructionResult::None);
|
||||
}
|
||||
node.set_flow_construction_result(ConstructionResult::None);
|
||||
self.set_flow_construction_result(node, ConstructionResult::None);
|
||||
}
|
||||
|
||||
// Table items contribute table flow construction results.
|
||||
(display::T::table, float_value, _) => {
|
||||
let construction_result = self.build_flow_for_table_wrapper(node, float_value);
|
||||
node.set_flow_construction_result(construction_result)
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
}
|
||||
|
||||
// Absolutely positioned elements will have computed value of
|
||||
|
@ -1241,13 +1241,14 @@ impl<'a> PostorderNodeMutTraversal for FlowConstructor<'a> {
|
|||
// below.
|
||||
(display::T::block, _, position::T::absolute) |
|
||||
(_, _, position::T::fixed) => {
|
||||
node.set_flow_construction_result(self.build_flow_for_nonfloated_block(node))
|
||||
let construction_result = self.build_flow_for_nonfloated_block(node);
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
}
|
||||
|
||||
// List items contribute their own special flows.
|
||||
(display::T::list_item, float_value, _) => {
|
||||
node.set_flow_construction_result(self.build_flow_for_list_item(node,
|
||||
float_value))
|
||||
let construction_result = self.build_flow_for_list_item(node, float_value);
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
}
|
||||
|
||||
// Inline items that are absolutely-positioned contribute inline fragment construction
|
||||
|
@ -1255,7 +1256,7 @@ impl<'a> PostorderNodeMutTraversal for FlowConstructor<'a> {
|
|||
(display::T::inline, _, position::T::absolute) => {
|
||||
let construction_result =
|
||||
self.build_fragment_for_absolutely_positioned_inline(node);
|
||||
node.set_flow_construction_result(construction_result)
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
}
|
||||
|
||||
// Inline items contribute inline fragment construction results.
|
||||
|
@ -1263,31 +1264,31 @@ impl<'a> PostorderNodeMutTraversal for FlowConstructor<'a> {
|
|||
// FIXME(pcwalton, #3307): This is not sufficient to handle floated generated content.
|
||||
(display::T::inline, float::T::none, _) => {
|
||||
let construction_result = self.build_fragments_for_inline(node);
|
||||
node.set_flow_construction_result(construction_result)
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
}
|
||||
|
||||
// Inline-block items contribute inline fragment construction results.
|
||||
(display::T::inline_block, float::T::none, _) => {
|
||||
let construction_result = self.build_fragment_for_inline_block(node);
|
||||
node.set_flow_construction_result(construction_result)
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
}
|
||||
|
||||
// Table items contribute table flow construction results.
|
||||
(display::T::table_caption, _, _) => {
|
||||
let construction_result = self.build_flow_for_table_caption(node);
|
||||
node.set_flow_construction_result(construction_result)
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
}
|
||||
|
||||
// Table items contribute table flow construction results.
|
||||
(display::T::table_column_group, _, _) => {
|
||||
let construction_result = self.build_flow_for_table_colgroup(node);
|
||||
node.set_flow_construction_result(construction_result)
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
}
|
||||
|
||||
// Table items contribute table flow construction results.
|
||||
(display::T::table_column, _, _) => {
|
||||
let construction_result = self.build_fragments_for_table_column(node);
|
||||
node.set_flow_construction_result(construction_result)
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
}
|
||||
|
||||
// Table items contribute table flow construction results.
|
||||
|
@ -1295,19 +1296,19 @@ impl<'a> PostorderNodeMutTraversal for FlowConstructor<'a> {
|
|||
(display::T::table_header_group, _, _) |
|
||||
(display::T::table_footer_group, _, _) => {
|
||||
let construction_result = self.build_flow_for_table_rowgroup(node);
|
||||
node.set_flow_construction_result(construction_result)
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
}
|
||||
|
||||
// Table items contribute table flow construction results.
|
||||
(display::T::table_row, _, _) => {
|
||||
let construction_result = self.build_flow_for_table_row(node);
|
||||
node.set_flow_construction_result(construction_result)
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
}
|
||||
|
||||
// Table items contribute table flow construction results.
|
||||
(display::T::table_cell, _, _) => {
|
||||
let construction_result = self.build_flow_for_table_cell(node);
|
||||
node.set_flow_construction_result(construction_result)
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
}
|
||||
|
||||
// Block flows that are not floated contribute block flow construction results.
|
||||
|
@ -1316,14 +1317,15 @@ impl<'a> PostorderNodeMutTraversal for FlowConstructor<'a> {
|
|||
// properties separately.
|
||||
|
||||
(_, float::T::none, _) => {
|
||||
node.set_flow_construction_result(self.build_flow_for_nonfloated_block(node))
|
||||
let construction_result = self.build_flow_for_nonfloated_block(node);
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
}
|
||||
|
||||
// Floated flows contribute float flow construction results.
|
||||
(_, float_value, _) => {
|
||||
let float_kind = FloatKind::from_property(float_value);
|
||||
node.set_flow_construction_result(
|
||||
self.build_flow_for_floated_block(node, float_kind))
|
||||
let construction_result = self.build_flow_for_floated_block(node, float_kind);
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -98,6 +98,8 @@ flaky_cpu == append_style_a.html append_style_b.html
|
|||
|
||||
== iframe/bg_color.html iframe/bg_color_ref.html
|
||||
== iframe/hide_and_show.html iframe/hide_and_show_ref.html
|
||||
== iframe/hide_layers1.html iframe/hide_layers_ref.html
|
||||
== iframe/hide_layers2.html iframe/hide_layers_ref.html
|
||||
== iframe/multiple_external.html iframe/multiple_external_ref.html
|
||||
== iframe/overflow.html iframe/overflow_ref.html
|
||||
== iframe/positioning_margin.html iframe/positioning_margin_ref.html
|
||||
|
@ -110,9 +112,6 @@ flaky_cpu == append_style_a.html append_style_b.html
|
|||
== iframe/simple_inline_width_height.html iframe/simple_inline_width_height_ref.html
|
||||
== iframe/simple_inline_width_percentage.html iframe/simple_inline_width_percentage_ref.html
|
||||
|
||||
# gw: race condition here caused by pipelines never painting when removed from document
|
||||
#== iframe/hide_layers1.html iframe/hide_layers_ref.html
|
||||
#== iframe/hide_layers2.html iframe/hide_layers_ref.html
|
||||
!= image_rendering_auto_a.html image_rendering_pixelated_a.html
|
||||
== image_rendering_pixelated_a.html image_rendering_pixelated_ref.html
|
||||
== img_block_display_a.html img_block_display_ref.html
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue