Automatic update from web-platform-tests Alignment for block statically positioned OOF elements Pass up the alignment block/inline edge within the static position of OOFs added in the block layout algorithm. This will result in statically positioned insets taking self-alignment into account [1]. A similar change for inline layout will soon follow. (This change also fixes a minor misalignment of HTML code in third_party/blink/web_tests/external/wpt/css/css-align/abspos/align-items-static-position.html and its ref file). [1] https://drafts.csswg.org/css-position-3/#staticpos-rect Bug: 409806799 Change-Id: I48137aa87ab453f49103f8b7e7013711a1a791a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6450252 Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: Alison Maher <almaher@microsoft.com> Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org> Auto-Submit: Alison Maher <almaher@microsoft.com> Cr-Commit-Position: refs/heads/main@{#1450362} -- wpt-commits: bfd9a7d7f09791ed514b4851d93407ade32197c2 wpt-pr: 52119
80 lines
1.9 KiB
HTML
80 lines
1.9 KiB
HTML
<!DOCTYPE html>
|
|
<link rel="author" title="David Shin" href="mailto:dshin@mozilla.com">
|
|
<link rel="help" href="https://drafts.csswg.org/css-align-3/#valdef-align-self-auto">
|
|
<link rel="help" href="https://drafts.csswg.org/css-align-3/#valdef-justify-self-auto">
|
|
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1930561">
|
|
<link rel="match" href="align-items-static-position-ref.html">
|
|
<meta name="assert" content="Ensures that absolutely positioned elements take (align|justify)-item into account only when being static-positioned.">
|
|
<style>
|
|
.flex {
|
|
display: flex;
|
|
align-items: center;
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
.grid {
|
|
display: grid;
|
|
justify-items: center;
|
|
align-items: center;
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
.container {
|
|
border: 1px solid;
|
|
position: relative;
|
|
width: 100px;
|
|
height: 100px;
|
|
display: inline-block;
|
|
margin-right: 5px;
|
|
}
|
|
|
|
.abs {
|
|
width: 50px;
|
|
height: 50px;
|
|
position: absolute;
|
|
background: purple;
|
|
}
|
|
|
|
.static-positioned-inline {
|
|
left: auto;
|
|
right: auto;
|
|
}
|
|
|
|
.static-positioned-block {
|
|
top: auto;
|
|
bottom: auto;
|
|
}
|
|
|
|
.positioned-inline {
|
|
left: 0;
|
|
right: 0;
|
|
}
|
|
|
|
.positioned-block {
|
|
top: 0;
|
|
bottom: 0;
|
|
}
|
|
</style>
|
|
<div class="container"><div class="flex">
|
|
<div class="abs static-positioned-inline static-positioned-block"></div>
|
|
</div></div>
|
|
<div class="container"><div class="flex">
|
|
<div class="abs static-positioned-inline positioned-block"></div>
|
|
</div></div>
|
|
<br>
|
|
<div class="container"><div class="grid">
|
|
<div class="abs static-positioned-inline static-positioned-block"></div>
|
|
</div></div>
|
|
<div class="container"><div class="grid">
|
|
<div class="abs static-positioned-inline positioned-block"></div>
|
|
</div></div>
|
|
<div class="container"><div class="grid">
|
|
<div class="abs positioned-inline static-positioned-block"></div>
|
|
</div></div>
|
|
<div class="container"><div class="grid">
|
|
<div class="abs positioned-inline positioned-block"></div>
|
|
</div></div>
|
|
<br>
|