Commit cfd326fd authored by Blink WPT Bot's avatar Blink WPT Bot Committed by moz-wptsync-bot
Browse files

Bug 1734266 [wpt PR 30780] - [GridNG] Invalidate when alignment changes on OOF elements, a=testonly

Automatic update from web-platform-tests
[GridNG] Invalidate when alignment changes on OOF elements (#30780)

This change will trigger a full relayout when alignment
changes on out-of-flow grid items without a grid area in
order to properly layout with dynamic changes.

Bug: 1248940
Change-Id: If22f77dee0caaaf2fcd17a9b50d91ad9ea7e179f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3159264


Commit-Queue: Kurt Catti-Schmidt <kschmi@microsoft.com>
Reviewed-by: default avatarDaniel Libby <dlibby@microsoft.com>
Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: default avatarEthan Jimenez <ethavar@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#927440}

Co-authored-by: default avatarKurt Catti-Schmidt (SCHMIDT) <kschmi@microsoft.com>
--

wpt-commits: 902abc7794e012fc2dea5752d8af393e307cb4bc
wpt-pr: 30780
parent a9b57269
Loading
Loading
Loading
Loading
+54 −0
Original line number Diff line number Diff line
<!DOCTYPE html>
<html>
<head>
<title>CSS Grid Layout Test: dynamic content alignment with abspos elements.</title>
<link rel="author" title="Kurt Catti-Schmidt" href="mailto:kschmi@microsoft.com">
<link rel="help" href="https://drafts.csswg.org/css-grid/#alignment">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#content-distribution">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-content">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-justify-content">
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1248940">
<link rel="stylesheet" href="/css/support/grid.css">
<link rel="stylesheet" href="/css/support/alignment.css">
<meta name="assert" content="Test that dynamically changing alignment for abspos grid items works as expected." />

<style>
body {
  margin: 0px;
  width: 800px;
}

.grid {
  width: 100%;
  height: 600px;
}

.a {
    width: 140px;
    height: 60px;
    border: 1px solid purple;
    position: absolute;
}
</style>

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script>
  function updateAlignmentAndCheckLayout() {
    let item = document.getElementById("item");
    item.style.alignSelf = "center";
    item.style.justifySelf = "center";
    checkLayout('.grid');
  }
</script>
</head>

<body onload="updateAlignmentAndCheckLayout()">

  <div class="grid" data-expected-width="800" data-expected-height="600">
    <div class="a" id="item" data-offset-x="329" data-offset-y="269" data-expected-width="142" data-expected-height="62"></div>
  </div>

</body>
</html>