Skip to content

Commit

Permalink
[css-flexbox] Move percentage-sizes.html to WPT
Browse files Browse the repository at this point in the history
This CL moves percentage-sizes.html test from
css3/css-flexbox to external/wpt/css/css-flexbox with WPT
styles, adding links to the relevant specs, and test description.

Additionally, this test is renamed to percentage-size.html
to be align with existing test names.

Bug: 1063749
Change-Id: I6a5fdb560759ad668977e773d0b528548f371fee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2141477
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Reviewed-by: Robert Ma <robertma@chromium.org>
Reviewed-by: David Grogan <dgrogan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757701}
  • Loading branch information
Gyuyoung authored and chromium-wpt-export-bot committed Apr 9, 2020
1 parent 2901957 commit a6b1cb6
Showing 1 changed file with 108 additions and 0 deletions.
108 changes: 108 additions & 0 deletions css/css-flexbox/percentage-size.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<!DOCTYPE html>
<title>CSS Flexbox: Percentage size in flexbox children</title>
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-containers">
<link rel="help" href="https://drafts.csswg.org/css-sizing-3/#percentage-sizing">
<link rel="help" href="https://bugs.webkit.org/show_bug.cgi?id=81809">
<meta name="assert" content="This test checks that percentage height/width values are correctly resolved in flexbox children.">
<style>
.flexbox {
display: flex;
}
.column, .column .fixed {
height: 50px;
}
.row, .row .fixed {
width: 50px;
}
.container > div {
outline: 2px solid blue;
}
.row > div > div {
height: 20px;
}
.flexbox > div {
flex: 0 0 auto;
}
.column > .flexbox {
flex-direction: column;
}
.container > div > :nth-child(1) {
background-color: orange;
}
.container > div > :nth-child(2) {
background-color: yellow;
}
.container > div > :nth-child(3) {
background-color: salmon;
}
.container > div > :nth-child(4) {
background-color: purple;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<body onload="checkLayout('.flexbox')">
<div id=log></div>

<div class="container row">
<div class="flexbox">
<div style='width: 10px; min-width: 50%;' data-expected-width=25></div>
<div style='width: 50%;' data-expected-width=25></div>
<div style='width: 10px; max-width: 50%;' data-expected-width=10></div>
<div style='min-width: 10px; width: 100px; max-width: 50%;' data-expected-width=25></div>
</div>
</div>

<div class="container row" style='width: 100px'>
<div class="flexbox fixed">
<div style='width: 10px; min-width: 50%;' data-expected-width=25></div>
<div style='width: 50%;' data-expected-width=25></div>
<div style='width: 10px; max-width: 50%;' data-expected-width=10></div>
<div style='min-width: 10px; width: 100px; max-width: 50%;' data-expected-width=25></div>
</div>
</div>

<div class="container column" style='margin-bottom: 100px'>
<div class="flexbox" style="height: auto">
<div style='height: 10px; min-height: 50%;' data-expected-height=10></div>
<div style='height: 50%;' data-expected-height=0></div>
<div style='height: 10px; max-height: 50%;' data-expected-height=10></div>
<div style='min-height: 10px; height: 100px; max-height: 50%;' data-expected-height=100></div>
</div>
</div>

<div class="container column">
<div class="flexbox fixed">
<div style='height: 10px; min-height: 50%;' data-expected-height=25></div>
<div style='height: 50%;' data-expected-height=25></div>
<div style='height: 10px; max-height: 50%;' data-expected-height=10></div>
<div style='min-height: 10px; height: 100px; max-height: 50%;' data-expected-height=25></div>
</div>
</div>

<div class="container row">
<div class="flexbox">
<div style="flex: 0 0 50%" data-expected-width=25></div>
</div>
</div>

<div class="container column">
<div class="flexbox">
<div style="flex: 0 0 50%" data-expected-height=0></div>
</div>
</div>

<div class="container row">
<div class="flexbox fixed">
<div style="flex: 0 0 50%" data-expected-width=25></div>
</div>
</div>

<div class="container column">
<div class="flexbox fixed">
<div style="flex: 0 0 50%" data-expected-height=25></div>
</div>
</div>

</body>

0 comments on commit a6b1cb6

Please sign in to comment.