wpt icon indicating copy to clipboard operation
wpt copied to clipboard

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

Open bfgeek opened this issue 7 months ago • 4 comments

Reverts web-platform-tests/wpt#52321

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

bfgeek avatar May 12 '25 17:05 bfgeek

@Psychpsyo @tabatkins PTAL

bfgeek avatar May 12 '25 17:05 bfgeek

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.

Psychpsyo avatar May 12 '25 20:05 Psychpsyo

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

bfgeek avatar May 13 '25 18:05 bfgeek

@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.

Psychpsyo avatar May 18 '25 11:05 Psychpsyo