mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Auto merge of #8140 - mrobinson:canvas, r=pcwalton
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. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8140) <!-- Reviewable:end -->
This commit is contained in:
commit
22a6884a67
5 changed files with 83 additions and 74 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue