Skip to content

Commit

Permalink
Bug 1555686 [wpt PR 17099] - CSS: Test computed Logical Height/Width …
Browse files Browse the repository at this point in the history
…limits, a=testonly

Automatic update from web-platform-tests
CSS: Test computed Logical Height/Width limits

Web Platform Tests for the computed values of the
min-block-size/min-inline-size, and max-block-size/max-inline-size
properties.

https://drafts.csswg.org/css-logical/#dimension-properties

Change-Id: I8377da7f48575a64365af26ed6467411a63eac0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1637004
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Auto-Submit: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666610}

--

wp5At-commits: 1619024d955c79fd7bf4f1093a904297dba04752
wpt-pr: 17099
  • Loading branch information
ericwilligers authored and jgraham committed Jun 19, 2019
1 parent d075414 commit 8eef046
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: getComputedValue().maxBlockSize</title>
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-max-block-size">
<meta name="assert" content="Computed max-block-size is the specified keyword, or the length-percentage made absolute.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<style>
#target {
font-size: 40px;
}
</style>
</head>
<body>
<div id="target"></div>
<script>
test_computed_value("max-block-size", "none");

test_computed_value("max-block-size", "10px");
test_computed_value("max-block-size", "20%");
test_computed_value("max-block-size", "calc(10px + 0.5em)", "30px");
test_computed_value("max-block-size", "calc(10px - 0.5em)", "0px");
test_computed_value("max-block-size", "calc(20% + 10px)");

test_computed_value("max-block-size", "min-content");
test_computed_value("max-block-size", "max-content");
</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: getComputedValue().maxInlineSize</title>
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-max-inline-size">
<meta name="assert" content="Computed max-inline-size is the specified keyword, or the length-percentage made absolute.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<style>
#target {
font-size: 40px;
}
</style>
</head>
<body>
<div id="target"></div>
<script>
test_computed_value("max-inline-size", "none");

test_computed_value("max-inline-size", "10px");
test_computed_value("max-inline-size", "20%");
test_computed_value("max-inline-size", "calc(10px + 0.5em)", "30px");
test_computed_value("max-inline-size", "calc(10px - 0.5em)", "0px");
test_computed_value("max-inline-size", "calc(20% + 10px)");

test_computed_value("max-inline-size", "min-content");
test_computed_value("max-inline-size", "max-content");
</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: getComputedValue().minBlockSize</title>
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-min-block-size">
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#min-size-auto">
<meta name="assert" content="Computed min-block-size is the specified keyword, or the length-percentage made absolute.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<style>
#target {
font-size: 40px;
}
#container {
display: flex;
}
#box {
min-block-size: auto;
}
</style>
</head>
<body>
<div id="target"></div>
<div id="container">
<div id="box"></div>
</div>
<script>
test_computed_value("min-block-size", "auto", "0px");

test_computed_value("min-block-size", "10px");
test_computed_value("min-block-size", "20%");
test_computed_value("min-block-size", "calc(10px + 0.5em)", "30px");
test_computed_value("min-block-size", "calc(10px - 0.5em)", "0px");
test_computed_value("min-block-size", "calc(20% + 10px)");

test_computed_value("min-block-size", "min-content");
test_computed_value("min-block-size", "max-content");

test(() => {
const picture = document.getElementById('box');
assert_equals(getComputedStyle(picture).minBlockSize, 'auto');
}, 'min-block-size auto computes to auto with flex layout.');
</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: getComputedValue().minInlineSize</title>
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-min-inline-size">
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#min-size-auto">
<meta name="assert" content="Computed min-inline-size is the specified keyword, or the length-percentage made absolute.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<style>
#target {
font-size: 40px;
}
#container {
display: flex;
}
#box {
min-inline-size: auto;
}
</style>
</head>
<body>
<div id="target"></div>
<div id="container">
<div id="box"></div>
</div>
<script>
test_computed_value("min-inline-size", "auto", "0px");

test_computed_value("min-inline-size", "10px");
test_computed_value("min-inline-size", "20%");
test_computed_value("min-inline-size", "calc(10px + 0.5em)", "30px");
test_computed_value("min-inline-size", "calc(10px - 0.5em)", "0px");
test_computed_value("min-inline-size", "calc(20% + 10px)");

test_computed_value("min-inline-size", "min-content");
test_computed_value("min-inline-size", "max-content");

test(() => {
const picture = document.getElementById('box');
assert_equals(getComputedStyle(picture).minInlineSize, 'auto');
}, 'min-inline-size auto computes to auto with flex layout.');
</script>
</body>
</html>

0 comments on commit 8eef046

Please sign in to comment.