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

absolute iframe z-index is wrong #7796

Closed
paulrouget opened this issue Sep 30, 2015 · 10 comments
Closed

absolute iframe z-index is wrong #7796

paulrouget opened this issue Sep 30, 2015 · 10 comments
Assignees

Comments

@paulrouget
Copy link
Contributor

<style>

  div, iframe {
    position: absolute;
    width: 200px;
    height: 200px;
  }

  iframe {
    display: block;
    top: 0px;
    left: 0px;
    border-width: 0;
    background: green;
  }

  div {
    left: 100px;
    top: 100px;
    background: red;
  }

</style>

<body>

  <iframe src='data:,foo'></iframe>
  <div> </div>

</body>

screen shot 2015-09-30 at 09 22 24

@paulrouget paulrouget changed the title Iframe z-index is wrong absolute iframe z-index is wrong Sep 30, 2015
@paulrouget
Copy link
Contributor Author

/cc @pcwalton

@waddlesplash
Copy link

Looks like the mimetypeless data: is being interpreted as HTML not plaintext. Is this already tracked somewhere?

@jdm
Copy link
Member

jdm commented Sep 30, 2015

Nope; please file it.

@mrobinson
Copy link
Member

This could likely be caused by the fact that iframes always get layers. Currently only stacking contexts can have layers and they are always on the top of the display list. I confirmed that adding a z-index to the div (thus promoting it to a stacking context) fixes the ordering issue.

@pcwalton
Copy link
Contributor

Probably has to wait on @mrobinson's work for multiple layers per stacking context then (or WebRender).

@mrobinson
Copy link
Member

I think I'll try to fix this case first, since I think it is the most straight-forward.

@paulrouget
Copy link
Contributor Author

Probably has to wait on @mrobinson's work for multiple layers per stacking context then (or WebRender).

@pcwalton Is that gonna take a long time? Just to know if I should try to work around this bug or wait.

@mrobinson
Copy link
Member

@paulrouget The work is complete. I will have the next set of PRs posted for review tomorrow.

mrobinson added a commit to mrobinson/servo that referenced this issue Oct 12, 2015
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.
@paulrouget
Copy link
Contributor Author

@mrobinson any update on these PRs?

@mrobinson
Copy link
Member

The PR is #7950. @pcwalton gave a little feedback, for which I'll upload a patch quite soon. Hopefully it can land today.

mrobinson added a commit to mrobinson/servo that referenced this issue Oct 13, 2015
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 added a commit to mrobinson/servo that referenced this issue Oct 15, 2015
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 added a commit to mrobinson/servo that referenced this issue Oct 15, 2015
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 added a commit to mrobinson/servo that referenced this issue Oct 16, 2015
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants