Truly independent web browser
Tests/LibWeb: Import flexbox WPT tests for subpixel space distribution
Andreas Kling85aa37ba92ce
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/align-content-rounding.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/align-content-rounding.txtnew file mode 100644index 00000000000..2461ebe1d5a--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/align-content-rounding.txt@@ -0,0 +1,6 @@+Harness status: OK++Found 1 tests++1 Fail+Fail The last item should match the end edge.\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/flex-rounding.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/flex-rounding.txtnew file mode 100644index 00000000000..7d5e6569b24--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/flex-rounding.txt@@ -0,0 +1,6 @@+Harness status: OK++Found 1 tests++1 Fail+Fail The last item shouldn't overflow the flexbox.\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/justify-content-rounding.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/justify-content-rounding.txtnew file mode 100644index 00000000000..2461ebe1d5a--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/justify-content-rounding.txt@@ -0,0 +1,6 @@+Harness status: OK++Found 1 tests++1 Fail+Fail The last item should match the end edge.\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/main-axis-margin-rounding.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/main-axis-margin-rounding.txtnew file mode 100644index 00000000000..2461ebe1d5a--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/main-axis-margin-rounding.txt@@ -0,0 +1,6 @@+Harness status: OK++Found 1 tests++1 Fail+Fail The last item should match the end edge.\ No newline at end of filediff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-flexbox/align-content-rounding.html b/Tests/LibWeb/Text/input/wpt-import/css/css-flexbox/align-content-rounding.htmlnew file mode 100644index 00000000000..53d8cc3acee--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-flexbox/align-content-rounding.html@@ -0,0 +1,39 @@+<!DOCTYPE html>+<script src="../../resources/testharness.js"></script>+<script src="../../resources/testharnessreport.js"></script>+<link rel="help" href="https://crbug.com/40437604">+<style>+#flex {+ display: flex;+ flex-wrap: wrap;+ width: 10px;+ height: 40px;+ align-content: space-between;+ outline: solid 1px;+}+#flex > div {+ width: 10px;+ height: 5px;+ background: lime;+}+</style>+<div id="flex">+ <div></div>+ <div></div>+ <div></div>+ <div></div>+ <div></div>+ <div></div>+ <div></div>+ <div id="last"></div>+</div>+<script>+test(function() {+ /* Increase the flexbox by 0.1px increments. */+ for (let i = 0; i < 10; i++) {+ const height = (40 + i/10) + 'px';+ flex.style.height = height;+ assert_equals(last.getBoundingClientRect().bottom, flex.getBoundingClientRect().bottom, height);+ }+}, 'The last item should match the end edge.');+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-flexbox/flex-rounding.html b/Tests/LibWeb/Text/input/wpt-import/css/css-flexbox/flex-rounding.htmlnew file mode 100644index 00000000000..79f7ec2c0b3--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-flexbox/flex-rounding.html@@ -0,0 +1,28 @@+<!DOCTYPE html>+<link rel="help" href="https://issues.chromium.org/issues/40804774">+<script src="../../resources/testharness.js"></script>+<script src="../../resources/testharnessreport.js"></script>+<style>+body { margin: 0; }+#flex {+ display: flex;+ width: 55px;+}+#flex > div {+ flex-grow: 1;+}+</style>+<div id="flex">+ <div></div>+ <div></div>+ <div></div>+ <div></div>+ <div></div>+ <div></div>+ <div id="last"></div>+</div>+<script>+test(function() {+ assert_true(last.getBoundingClientRect().right <= flex.getBoundingClientRect().right);+}, 'The last item shouldn\'t overflow the flexbox.');+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-flexbox/justify-content-rounding.html b/Tests/LibWeb/Text/input/wpt-import/css/css-flexbox/justify-content-rounding.htmlnew file mode 100644index 00000000000..c30968aad71--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-flexbox/justify-content-rounding.html@@ -0,0 +1,37 @@+<!DOCTYPE html>+<script src="../../resources/testharness.js"></script>+<script src="../../resources/testharnessreport.js"></script>+<link rel="help" href="https://crbug.com/40437604">+<style>+#flex {+ display: flex;+ width: 40px;+ justify-content: space-between;+ outline: solid 1px;+}+#flex > div {+ width: 5px;+ height: 10px;+ background: lime;+}+</style>+<div id="flex">+ <div></div>+ <div></div>+ <div></div>+ <div></div>+ <div></div>+ <div></div>+ <div></div>+ <div id="last"></div>+</div>+<script>+test(function() {+ /* Increase the flexbox by 0.1px increments. */+ for (let i = 0; i < 10; i++) {+ const width = (40 + i/10) + 'px';+ flex.style.width = width;+ assert_equals(last.getBoundingClientRect().right, flex.getBoundingClientRect().right, width);+ }+}, 'The last item should match the end edge.');+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-flexbox/main-axis-margin-rounding.html b/Tests/LibWeb/Text/input/wpt-import/css/css-flexbox/main-axis-margin-rounding.htmlnew file mode 100644index 00000000000..73fc1901164--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-flexbox/main-axis-margin-rounding.html@@ -0,0 +1,38 @@+<!DOCTYPE html>+<script src="../../resources/testharness.js"></script>+<script src="../../resources/testharnessreport.js"></script>+<link rel="help" href="https://crbug.com/40437604">+<style>+#flex {+ display: flex;+ width: 40px;+ height: 10px;+ outline: solid 1px;+}+#flex > div {+ width: 5px;+ height: 10px;+ margin-left: auto;+ background: lime;+}+</style>+<div id="flex">+ <div></div>+ <div></div>+ <div></div>+ <div></div>+ <div></div>+ <div></div>+ <div></div>+ <div id="last"></div>+</div>+<script>+test(function() {+ /* Increase the flexbox by 0.1px increments. */+ for (let i = 0; i < 10; i++) {+ const width = (40 + i/10) + 'px';+ flex.style.width = width;+ assert_equals(last.getBoundingClientRect().right, flex.getBoundingClientRect().right, width);+ }+}, 'The last item should match the end edge.');+</script>