Integrate Canvas into the DisplayList

Canvas is currently given a layer at the stacking context level.
Instead it's DisplayItem should be given a layer directly. This fixes
painting order issues where canvases are painted on top of other
positioned content that is later in tree order. It always simplifies
the code a bit.
This commit is contained in:
Martin Robinson 2015-10-21 14:00:20 -07:00
parent 11d23a41b3
commit 30ba65b360
5 changed files with 83 additions and 74 deletions

View file

@ -2106,16 +2106,6 @@ impl Fragment {
stacking_relative_border_box.size.height - border_padding.vertical()))
}
/// Returns true if this fragment unconditionally layerizes.
pub fn needs_layered_stacking_context(&self) -> bool {
// Canvas and iframes always layerize, as an special case
// FIXME(pcwalton): Don't unconditionally form stacking contexts for each canvas.
match self.specific {
SpecificFragmentInfo::Canvas(_) => true,
_ => false,
}
}
/// Returns true if this fragment establishes a new stacking context and false otherwise.
pub fn establishes_stacking_context(&self) -> bool {
if self.flags.contains(HAS_LAYER) {
@ -2140,10 +2130,6 @@ impl Fragment {
transform_style::T::auto => {}
}
if self.needs_layered_stacking_context() {
return true
}
// FIXME(pcwalton): Don't unconditionally form stacking contexts for `overflow_x: scroll`
// and `overflow_y: scroll`. This needs multiple layers per stacking context.
match (self.style().get_box().position,