mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Auto merge of #7950 - mrobinson:layerize-iframes, r=pcwalton
Integrate iframes into the display list Instead of always promoting iframes to StackingContexts, integrate them into the display list. This prevents stacking bugs when non-stacking-context elements should be drawn on top of iframes. To accomplish this, we add another step to ordering layer creation, where LayeredItems in the DisplayList are added to layers described by the LayerInfo structures collected at the end of the DisplayList. Unlayered items that follow these layered items are added to synthesized layers. Another result of this change is that iframe layers can be positioned directly at the location of the iframe fragment, eliminating the need for the SubpageLayerInfo struct entirely. Iframes are the first type of content treated this way, but this change opens up the possibility to properly order canvas and all other layered content that does not create a stacking context. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7950) <!-- Reviewable:end -->
This commit is contained in:
commit
11d23a41b3
13 changed files with 271 additions and 91 deletions
|
@ -2107,11 +2107,11 @@ impl Fragment {
|
|||
}
|
||||
|
||||
/// Returns true if this fragment unconditionally layerizes.
|
||||
pub fn needs_layer(&self) -> bool {
|
||||
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(_) | SpecificFragmentInfo::Iframe(_) => true,
|
||||
SpecificFragmentInfo::Canvas(_) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
@ -2140,7 +2140,7 @@ impl Fragment {
|
|||
transform_style::T::auto => {}
|
||||
}
|
||||
|
||||
if self.needs_layer() {
|
||||
if self.needs_layered_stacking_context() {
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue