Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layout: Make the compositor rather than layout determine the position of each iframe. #7423

Merged
merged 1 commit into from
Sep 30, 2015

Conversation

pcwalton
Copy link
Contributor

The old code that attempted to do this during layout wasn't able to work
for multiple reasons: it couldn't know where the iframe was going to be
on the page (because of nested iframes), and at the time it was building
the display list for a fragment it couldn't know where that fragment was
going to be in page coordinates.

This patch rewrites that code so that only the size of an iframe is
determined during layout, and the position is determined by the
compositor. Layout layerizes iframes and marks the iframe layers with
the appropriate subpage ID so that the compositor can place them
correctly.

Closes #7377.

Review on Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 28, 2015
@pcwalton
Copy link
Contributor Author

r? @glennw

@pcwalton pcwalton added A-gfx/rendering I-wrong An incorrect behaviour is observed. A-gfx/compositing A-constellation Involves the constellation labels Aug 28, 2015
if let Some(ref frame_size) = frame_size {
let frame_size = frame_size.to_untyped();
root_layer.bounds.borrow_mut().size = Size2D::from_untyped(&frame_size);
/*root_layer.bounds.borrow_mut().origin =
Copy link
Member

Choose a reason for hiding this comment

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

Can be removed

@glennw
Copy link
Member

glennw commented Aug 28, 2015

@pcwalton Just a few minor nits, looks good otherwise.

@pcwalton pcwalton force-pushed the iframe-stacking-context-position branch from d4d87ed to 791ec95 Compare August 28, 2015 02:34
@pcwalton
Copy link
Contributor Author

@bors-servo: r=glennw

@bors-servo
Copy link
Contributor

📌 Commit 791ec95 has been approved by glennw

@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 Aug 28, 2015
@bors-servo
Copy link
Contributor

⌛ Testing commit 791ec95 with merge 0356328...

bors-servo pushed a commit that referenced this pull request Aug 28, 2015
…ennw

layout: Make the compositor rather than layout determine the position of each iframe.

The old code that attempted to do this during layout wasn't able to work
for multiple reasons: it couldn't know where the iframe was going to be
on the page (because of nested iframes), and at the time it was building
the display list for a fragment it couldn't know where that fragment was
going to be in page coordinates.

This patch rewrites that code so that only the size of an iframe is
determined during layout, and the position is determined by the
compositor. Layout layerizes iframes and marks the iframe layers with
the appropriate subpage ID so that the compositor can place them
correctly.

Closes #7377.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7423)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

💔 Test failed - mac2

@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 Aug 28, 2015
@pcwalton pcwalton force-pushed the iframe-stacking-context-position branch from 791ec95 to a6737e4 Compare August 28, 2015 04:20
@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 Aug 28, 2015
@pcwalton
Copy link
Contributor Author

@bors-servo: r=glennw

@bors-servo
Copy link
Contributor

📌 Commit a6737e4 has been approved by glennw

@highfive highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Aug 28, 2015
@bors-servo
Copy link
Contributor

⌛ Testing commit a6737e4 with merge 8e5f862...

@highfive highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Aug 28, 2015
@highfive highfive added the S-needs-rebase There are merge conflict errors. label Sep 29, 2015
@pcwalton pcwalton force-pushed the iframe-stacking-context-position branch from 002e120 to c72d0c2 Compare September 29, 2015 16:46
@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 Sep 29, 2015
each iframe.

The old code that attempted to do this during layout wasn't able to work
for multiple reasons: it couldn't know where the iframe was going to be
on the page (because of nested iframes), and at the time it was building
the display list for a fragment it couldn't know where that fragment was
going to be in page coordinates.

This patch rewrites that code so that both the sizes and positions of
iframes are determined by the compositor. Layout layerizes all iframes
and marks the iframe layers with the appropriate pipeline and subpage
IDs so that the compositor can place them correctly. This approach is
similar in spirit to Gecko's `RefLayer` infrastructure. The logic that
determines when it is time to take the screenshot for reftests has been
significantly revamped to deal with this change in delegation of
responsibility.

Additionally, this code removes the infrastructure that sends layout
data back to the layout task to be destroyed, since it is now all
thread-safe and can be destroyed on the script task.

The failing tests now fail because of a pre-existing bug related to
intrinsic heights and borders on inline replaced elements. They happened
to pass before because we never rendered the iframes at all, which meant
they never had a chance to draw the red border the tests expect to not
render!

Closes servo#7377.
@pcwalton
Copy link
Contributor Author

OK, I believe I've fixed those tests. The failures came from a deadlock in the way the compositor blocked on the constellation, which could happen simultaneously with the constellation waiting on the compositor. Fixing this by introducing a new message pair (PrepareForSubpageLayerCreation and CreateLayerForSubpage) exposed another race in detecting whether screenshots were safe to take, which I fixed by modifying the constellation; see the comment above if let Some(size) = pipeline.size in constellation.rs.

I also effectively redid #7771 with an alternate approach in order to fix the rebase conflict.

r? @glennw

@glennw
Copy link
Member

glennw commented Sep 30, 2015

Reviewed 3 of 21 files at r2, 12 of 12 files at r3.
Review status: all files reviewed at latest revision, 5 unresolved discussions, all commit checks successful.


Comments from the review on Reviewable.io

@glennw
Copy link
Member

glennw commented Sep 30, 2015

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit c72d0c2 has been approved by glennw

@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. S-needs-rebase There are merge conflict errors. labels Sep 30, 2015
@bors-servo
Copy link
Contributor

⌛ Testing commit c72d0c2 with merge 29c061e...

bors-servo pushed a commit that referenced this pull request Sep 30, 2015
…ennw

layout: Make the compositor rather than layout determine the position of each iframe.

The old code that attempted to do this during layout wasn't able to work
for multiple reasons: it couldn't know where the iframe was going to be
on the page (because of nested iframes), and at the time it was building
the display list for a fragment it couldn't know where that fragment was
going to be in page coordinates.

This patch rewrites that code so that only the size of an iframe is
determined during layout, and the position is determined by the
compositor. Layout layerizes iframes and marks the iframe layers with
the appropriate subpage ID so that the compositor can place them
correctly.

Closes #7377.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7423)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

💔 Test failed - mac-rel-wpt

@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 Sep 30, 2015
@mbrubeck
Copy link
Contributor

@bors-servo retry

#7787

@bors-servo
Copy link
Contributor

⌛ Testing commit c72d0c2 with merge a0cb657...

bors-servo pushed a commit that referenced this pull request Sep 30, 2015
…ennw

layout: Make the compositor rather than layout determine the position of each iframe.

The old code that attempted to do this during layout wasn't able to work
for multiple reasons: it couldn't know where the iframe was going to be
on the page (because of nested iframes), and at the time it was building
the display list for a fragment it couldn't know where that fragment was
going to be in page coordinates.

This patch rewrites that code so that only the size of an iframe is
determined during layout, and the position is determined by the
compositor. Layout layerizes iframes and marks the iframe layers with
the appropriate subpage ID so that the compositor can place them
correctly.

Closes #7377.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7423)
<!-- Reviewable:end -->
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Sep 30, 2015
@bors-servo
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-constellation Involves the constellation A-gfx/compositing A-gfx/rendering I-wrong An incorrect behaviour is observed. 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.

None yet

6 participants