Skip to content

[css-position] Static position of abspos top layer elements inside fixed pos. #9939

Open
@emilio

Description

@emilio

This is the cyclic / ordering issue that I was concerned about in #8040.

Both Firefox and Blink get it wrong. WebKit gets it right, but I'm not sure what they're doing, maybe they're laying out the abspos twice?

<!DOCTYPE html>
<meta charset="utf-8">
<style>
#outer {
  position: fixed;
  width: 200px;
  height: 200px;
  border: 2px solid blue;
}
dialog {
  display: inline;
  position: absolute;
  inset: auto;
}
</style>
Some content.
<br>
<br>
<br>
<br>
<br>
Some more.
<br>
<div id=outer>
  Fixed-pos.
  <dialog>Absolute popover inside fixed element</dialog>
</div>
<script>
  document.querySelector("dialog").showModal();
</script>

The main issue here is that you have:

  • Viewport box
    • ICB
      • Abspos
    • Fixedpos

So you lay out the abspos before the fixedpos, and the static position isn't computed yet.

cc @rlbuis @bfgeek @chrishtr

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Tuesday afternoon

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions