Skip to content

Integrate iframes into the display list#7950

Merged
bors-servo merged 1 commit intoservo:masterfrom
mrobinson:layerize-iframes
Oct 20, 2015
Merged

Integrate iframes into the display list#7950
bors-servo merged 1 commit intoservo:masterfrom
mrobinson:layerize-iframes

Conversation

@mrobinson
Copy link
Copy Markdown
Member

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.

Review on Reviewable

@mrobinson
Copy link
Copy Markdown
Member Author

@pcwalton r?

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 10, 2015
@nox nox closed this Oct 10, 2015
@nox nox reopened this Oct 10, 2015
@nox nox added A-gfx/displaylist S-fails-tidy `./mach test-tidy` reported errors. labels Oct 10, 2015
@nox
Copy link
Copy Markdown
Contributor

nox commented Oct 10, 2015

./components/gfx/paint_task.rs:22: use statement is not in alphabetical order
    expected: msg::compositor_msg::ScrollPolicy
    found: msg::compositor_msg::{Epoch, FrameTreeId, LayerId, LayerKind, LayerProperties, PaintListener}
./components/gfx/paint_task.rs:23: use statement is not in alphabetical order
    expected: msg::compositor_msg::{Epoch, FrameTreeId, LayerId, LayerKind, LayerProperties, PaintListener}
    found: msg::compositor_msg::ScrollPolicy
./components/gfx/display_list/mod.rs:102: extra space before :

@mrobinson mrobinson force-pushed the layerize-iframes branch 2 times, most recently from 7252c6a to 1b247e7 Compare October 12, 2015 16:30
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Could be if let

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This made the block quite a bit simpler.

@pcwalton
Copy link
Copy Markdown
Contributor

@bors-servo: r+

@bors-servo
Copy link
Copy Markdown
Contributor

📌 Commit 59ae167 has been approved by pcwalton

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 15, 2015
@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Testing commit 59ae167 with merge 2d443f8...

bors-servo pushed a commit that referenced this pull request Oct 15, 2015
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 -->
@bors-servo
Copy link
Copy Markdown
Contributor

💔 Test failed - mac-rel-css

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Oct 15, 2015
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Oct 15, 2015
@mrobinson
Copy link
Copy Markdown
Member Author

The latest version of this PR fixes the test failures by avoiding the creation of empty iframes. I tested things locally and the tests appear to be working.

@jdm jdm removed the S-fails-tidy `./mach test-tidy` reported errors. label Oct 16, 2015
@bors-servo
Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #8050) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added S-needs-rebase There are merge conflict errors. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Oct 16, 2015
@mrobinson
Copy link
Copy Markdown
Member Author

I have uploaded a new version of this patch which resolves the merge conflict.

@jdm jdm removed the S-needs-rebase There are merge conflict errors. label Oct 16, 2015
@paulrouget
Copy link
Copy Markdown
Contributor

I think with this PR, Servo crashes with this example:

<!DOCTYPE html>

<style>
  div, iframe {
    transform: scale(1);
  }
</style>

<iframe></iframe>
<div></div>

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.

Fixes servo#7566.
Fixes servo#7796.
@mrobinson
Copy link
Copy Markdown
Member Author

@paulrouget Thanks for the note. I've fixed the issue in the latest version of the patch.

@pcwalton
Copy link
Copy Markdown
Contributor

@bors-servo: r+

@bors-servo
Copy link
Copy Markdown
Contributor

📌 Commit ac5525a has been approved by pcwalton

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 20, 2015
@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Testing commit ac5525a with merge 11d23a4...

bors-servo pushed a commit that referenced this pull request Oct 20, 2015
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 -->
@bors-servo
Copy link
Copy Markdown
Contributor

☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt

@bors-servo bors-servo merged commit ac5525a into servo:master Oct 20, 2015
@mrobinson mrobinson deleted the layerize-iframes branch October 20, 2015 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-gfx/displaylist S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants