Commit e4e2bb3a authored by Ian Kilpatrick's avatar Ian Kilpatrick Committed by Commit Bot

[css-layout-api] Move perform-child-layout tests to child-constraints

As above, move similar tests into subdirectory, and apply minor
documentation cleanups.

Adds two new tests checking that setting an invalid (negative) available
size, clamps it to zero.

Bug: 726125
Change-Id: Id5bdfa25970a4e4bfe359377b88176043ab1f6c3
Reviewed-on: https://chromium-review.googlesource.com/1236266
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: default avatarAleks Totic <atotic@chromium.org>
Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593236}
parent 2392d181
<!DOCTYPE html> <!DOCTYPE html>
<html class=reftest-wait> <html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-availableinlinesize"> <link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-availableblocksize">
<link rel="match" href="green-square-ref.html"> <link rel="match" href="../green-square-ref.html">
<meta name="assert" content="This test checks that setting the available inline size of children works as expected." /> <meta name="assert" content="This test checks that setting the available block-size of children works as expected." />
<style> <style>
.test { .test {
...@@ -61,5 +61,5 @@ ...@@ -61,5 +61,5 @@
</div> </div>
<script> <script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-sizes-worklet.js'}); importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: '../support/layout-child-sizes-worklet.js'});
</script> </script>
<!DOCTYPE html>
<html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-availableblocksize">
<link rel="match" href="../green-square-ref.html">
<meta name="assert" content="This test checks that setting an invalid available block-size works as expected." />
<style>
.test {
writing-mode: horizontal-tb;
background: red;
width: 100px;
}
.child {
writing-mode: vertical-rl;
visibility: hidden;
line-height: 0;
--available-block-size: -20;
}
.inline {
display: inline-block;
width: 8px;
}
.inline-size-10 { height: 10px; }
@supports (display: layout(test)) {
.test {
background: green;
display: layout(test);
}
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/worklet-reftest.js"></script>
<div class="test">
<!-- The invalid available block-size should be clamped to zero. -->
<div class="child" style="--block-size-expected: 10; --inline-size-expected: 16;">
<span class="inline inline-size-10"></span>
<span class="inline inline-size-10"></span>
</div>
</div>
<script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: '../support/layout-child-sizes-worklet.js'});
</script>
<!DOCTYPE html> <!DOCTYPE html>
<html class=reftest-wait> <html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-availableinlinesize"> <link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-availableblocksize">
<link rel="match" href="green-square-ref.html"> <link rel="match" href="../green-square-ref.html">
<meta name="assert" content="This test checks that setting the available inline size of children works as expected." /> <meta name="assert" content="This test checks that setting the available block-size of children works as expected." />
<style> <style>
.test { .test {
...@@ -61,5 +61,5 @@ ...@@ -61,5 +61,5 @@
</div> </div>
<script> <script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-sizes-worklet.js'}); importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: '../support/layout-child-sizes-worklet.js'});
</script> </script>
<!DOCTYPE html> <!DOCTYPE html>
<html class=reftest-wait> <html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-availableinlinesize"> <link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-availableinlinesize">
<link rel="match" href="green-square-ref.html"> <link rel="match" href="../green-square-ref.html">
<meta name="assert" content="This test checks that setting the available inline size of children works as expected." /> <meta name="assert" content="This test checks that setting the available inline-size of children works as expected." />
<style> <style>
.test { .test {
...@@ -61,5 +61,5 @@ ...@@ -61,5 +61,5 @@
</div> </div>
<script> <script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-sizes-worklet.js'}); importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: '../support/layout-child-sizes-worklet.js'});
</script> </script>
<!DOCTYPE html>
<html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-availableinlinesize">
<link rel="match" href="../green-square-ref.html">
<meta name="assert" content="This test checks that setting an invalid available inline-size works as expected." />
<style>
.test {
writing-mode: horizontal-tb;
background: red;
width: 100px;
}
.child {
writing-mode: horizontal-tb;
visibility: hidden;
line-height: 0;
--available-inline-size: -20;
}
.inline {
display: inline-block;
height: 8px;
}
.inline-size-10 { width: 10px; }
@supports (display: layout(test)) {
.test {
background: green;
display: layout(test);
}
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/worklet-reftest.js"></script>
<div class="test">
<!-- The invalid available inline-size should be clamped to zero. -->
<div class="child" style="--inline-size-expected: 10; --block-size-expected: 16;">
<span class="inline inline-size-10"></span>
<span class="inline inline-size-10"></span>
</div>
</div>
<script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: '../support/layout-child-sizes-worklet.js'});
</script>
<!DOCTYPE html> <!DOCTYPE html>
<html class=reftest-wait> <html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-availableinlinesize"> <link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-availableinlinesize">
<link rel="match" href="green-square-ref.html"> <link rel="match" href="../green-square-ref.html">
<meta name="assert" content="This test checks that setting the available inline size of children works as expected." /> <meta name="assert" content="This test checks that setting the available inline-size of children works as expected." />
<style> <style>
.test { .test {
...@@ -61,5 +61,5 @@ ...@@ -61,5 +61,5 @@
</div> </div>
<script> <script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-sizes-worklet.js'}); importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: '../support/layout-child-sizes-worklet.js'});
</script> </script>
<!DOCTYPE html> <!DOCTYPE html>
<html class=reftest-wait> <html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-fixedinlinesize"> <link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-fixedblocksize">
<link rel="match" href="green-square-ref.html"> <link rel="match" href="../green-square-ref.html">
<meta name="assert" content="This test checks that fixing the block size of children works as expected." /> <meta name="assert" content="This test checks that fixing the block size of children works as expected." />
<style> <style>
...@@ -56,5 +56,5 @@ ...@@ -56,5 +56,5 @@
</div> </div>
<script> <script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-sizes-worklet.js'}); importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: '../support/layout-child-sizes-worklet.js'});
</script> </script>
<!DOCTYPE html> <!DOCTYPE html>
<html class=reftest-wait> <html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-fixedblocksize"> <link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-fixedblocksize">
<link rel="match" href="green-square-ref.html"> <link rel="match" href="../green-square-ref.html">
<meta name="assert" content="This test checks that fixing the block size of children works as expected." /> <meta name="assert" content="This test checks that fixing the block size of children works as expected." />
<style> <style>
...@@ -55,5 +55,5 @@ ...@@ -55,5 +55,5 @@
</div> </div>
<script> <script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-sizes-worklet.js'}); importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: '../support/layout-child-sizes-worklet.js'});
</script> </script>
<!DOCTYPE html> <!DOCTYPE html>
<html class=reftest-wait> <html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-fixedinlinesize"> <link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-fixedinlinesize">
<link rel="match" href="green-square-ref.html"> <link rel="match" href="../green-square-ref.html">
<meta name="assert" content="This test checks that fixing the inline size of children works as expected." /> <meta name="assert" content="This test checks that fixing the inline size of children works as expected." />
<style> <style>
...@@ -56,5 +56,5 @@ ...@@ -56,5 +56,5 @@
</div> </div>
<script> <script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-sizes-worklet.js'}); importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: '../support/layout-child-sizes-worklet.js'});
</script> </script>
<!DOCTYPE html> <!DOCTYPE html>
<html class=reftest-wait> <html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-fixedinlinesize"> <link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-fixedinlinesize">
<link rel="match" href="green-square-ref.html"> <link rel="match" href="../green-square-ref.html">
<meta name="assert" content="This test checks that fixing the inline size of children works as expected." /> <meta name="assert" content="This test checks that fixing the inline size of children works as expected." />
<style> <style>
...@@ -55,5 +55,5 @@ ...@@ -55,5 +55,5 @@
</div> </div>
<script> <script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-sizes-worklet.js'}); importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: '../support/layout-child-sizes-worklet.js'});
</script> </script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment