mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Treat align-self: normal
as stretch
on flex items (#33314)
According to https://drafts.csswg.org/css-align/#align-flex It was being treated as `auto` instead. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
8263fe5495
commit
37e1c3385e
3 changed files with 39 additions and 1 deletions
|
@ -247,7 +247,8 @@ impl FlexContainerConfig {
|
|||
fn align_for(&self, align_self: AlignSelf) -> AlignItems {
|
||||
let value = align_self.0 .0.value();
|
||||
let mapped_value = match value {
|
||||
AlignFlags::AUTO | AlignFlags::NORMAL => self.align_items.0,
|
||||
AlignFlags::AUTO => self.align_items.0,
|
||||
AlignFlags::NORMAL => AlignFlags::STRETCH,
|
||||
_ => value,
|
||||
};
|
||||
AlignItems(mapped_value)
|
||||
|
|
13
tests/wpt/meta/MANIFEST.json
vendored
13
tests/wpt/meta/MANIFEST.json
vendored
|
@ -122762,6 +122762,19 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"self-align-normal-flex.html": [
|
||||
"26a983dea028cb48617e905504bc456c489b3021",
|
||||
[
|
||||
null,
|
||||
[
|
||||
[
|
||||
"/css/reference/ref-filled-green-100px-square.xht",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
{}
|
||||
]
|
||||
],
|
||||
"self-align-safe-unsafe-flex-001.html": [
|
||||
"bb933b99d722d462b2b824d86fb15e825a598f5a",
|
||||
[
|
||||
|
|
24
tests/wpt/tests/css/css-align/self-alignment/self-align-normal-flex.html
vendored
Normal file
24
tests/wpt/tests/css/css-align/self-alignment/self-align-normal-flex.html
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<title>align-self:normal on flex items</title>
|
||||
<link rel="author" title="Oriol Brufau" href="obrufau@igalia.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-align/#align-flex">
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
|
||||
<meta name="assert" content="align-self:normal behaves as stretch on flex items." />
|
||||
<style>
|
||||
.flex {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background: red;
|
||||
}
|
||||
.item {
|
||||
flex: 1;
|
||||
align-self: normal;
|
||||
background: green;
|
||||
}
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
|
||||
<div class="flex">
|
||||
<div class="item"></div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue