Skip to content

Revert "Make a css-contain test less flaky." #52477

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bfgeek
Copy link
Contributor

@bfgeek bfgeek commented May 12, 2025

Reverts #52321

This breaks - contain-layout-stacking-context-001.html

@bfgeek
Copy link
Contributor Author

bfgeek commented May 12, 2025

@Psychpsyo @tabatkins PTAL

@Psychpsyo
Copy link
Contributor

Psychpsyo commented May 12, 2025

Ah, yes. Didn't notice that that one uses the same reference file, sorry!

Swapping contain-layout-stacking-context-001.html for this should fix it without having to revert the other ones:

<!DOCTYPE HTML>
<title>'contain: layout' establishes stacking context.</title>
<link rel="author" title="Psychpsyo" href="mailto:[email protected]">
<link rel="help" href="https://drafts.csswg.org/css2/visuren.html#x43">
<link rel="help" href="https://drafts.csswg.org/css-contain/#containment-layout">
<link rel="match" href="contain-paint-stacking-context-001-ref.html">
<style>
  div {
    width: 100px;
    height: 100px;
  }
  #front {
    background-color: green;
    /* makes a stacking context and puts this on top */
    position: absolute;
    z-index: 10;
  }
  #back {
    contain: layout;
  }
  #notOnTop {
    background-color: red;
    /* z-index is higher than on #front, but this should still be covered up because it is inside #back, which has 'contain: layout' */
    position: absolute;
    z-index: 1000;
  }
</style>
<div id="front"></div>
<div id="back">
  <div id="notOnTop"></div>
</div>
Test succeeds if there is no red.

(This is the new contain-paint-stacking-context-001a.html, just with paint replaced with layout)

If this sounds like a sensible resolution, would you want to amend this PR, should I open one that does this, or should we revert and then re-apply with this test also changed?
(not sure how this is usually done)

Duplicating the reference file or giving it a better name might also be good since right now it's called paint but is also the reference for a layout containment test.

@bfgeek
Copy link
Contributor Author

bfgeek commented May 13, 2025

@Psychpsyo - up to you - if you'd like to fix separately that's ok.

@Psychpsyo
Copy link
Contributor

@Psychpsyo - up to you - if you'd like to fix separately that's ok.

I've opened #52625 now, which should take care of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants