Skip to content

Truly independent web browser

Tests/LibWeb: Import WPT tests with fractional client and scroll sizes

Andreas Kling522b5a2b2265
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-overflow/scrollable-overflow-transform-008.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-overflow/scrollable-overflow-transform-008.txt
new file mode 100644
index 00000000000..2214f9b03ef
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-overflow/scrollable-overflow-transform-008.txt
@@ -0,0 +1,7 @@
+Harness status: OK
+
+Found 2 tests
+
+2 Fail
+Fail .container 1
+Fail .container 2
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-tables/fractional-percent-width.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-tables/fractional-percent-width.txt
new file mode 100644
index 00000000000..d5d8a7cb37d
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-tables/fractional-percent-width.txt
@@ -0,0 +1,9 @@
+Harness status: OK
+
+Found 3 tests
+
+1 Pass
+2 Fail
+Pass .cell 1
+Fail .cell 2
+Fail .cell 3
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-overflow/scrollable-overflow-transform-008.html b/Tests/LibWeb/Text/input/wpt-import/css/css-overflow/scrollable-overflow-transform-008.html
new file mode 100644
index 00000000000..d9ed46ec7c6
--- /dev/null
+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-overflow/scrollable-overflow-transform-008.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Overflow: Scrollable Overflow Transform Skew</title>
+<link rel="author" title="Jo Steven Novaryo" href="mailto:[email protected]">
+<link rel="help" href="https://drafts.csswg.org/css-overflow-3/#scrollable" />
+<meta name="assert" content="Checks that the bounding rectangle of skewed element is included correctly in scrollable overflow.">
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../../resources/check-layout-th.js"></script>
+<style>
+ .container {
+ width: 100px;
+ height: 100px;
+ overflow: scroll;
+ background: silver;
+ border: solid thick;
+ scrollbar-width: none;
+ }
+
+ .element {
+ width: 200px;
+ height: 200px;
+ background: lime;
+ }
+
+ .element-2 {
+ width: 200px;
+ height: 200px;
+ background: aqua;
+ }
+</style>
+<body onload="checkLayout('.container')">
+
+ <div class="container" data-expected-scroll-width="227" data-expected-scroll-height="227">
+ <div style="transform: skew(-15deg, -15deg);" class="element">
+ </div>
+ </div>
+
+ <div class="container" data-expected-scroll-width="227" data-expected-scroll-height="227">
+ <div style="transform: skew(15deg, 15deg);" class="element">
+ </div>
+ </div>
+
+</body>
diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-tables/fractional-percent-width.html b/Tests/LibWeb/Text/input/wpt-import/css/css-tables/fractional-percent-width.html
new file mode 100644
index 00000000000..e24938901d8
--- /dev/null
+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-tables/fractional-percent-width.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../../resources/check-layout-th.js"></script>
+<link rel="author" title="Jihwan Marc Kim" href="mailto:[email protected]" />
+<link rel="help" href="https://crbug.com/1283025" />
+<meta name="flags" content="" />
+<meta name="assert" content="percent lengths of fractional td width should rendered correctly" />
+<style>
+ main div {
+ position: relative;
+ border: 1px solid black;
+ width: 400px;
+ }
+ .cell {
+ background-color: skyblue;
+ height: 20px;
+ }
+</style>
+<p>
+ Tests that percent lengths of fractional td width should rendered correctly
+ even it is smaller than 1.
+</p>
+
+<hr />
+<output id="log"></output>
+<main>
+ <div>
+ <table width="100%">
+ <tbody>
+ <tr>
+ <td class="cell" width="0.5%" data-expected-client-width="2"></td>
+ <td>0.5%</td>
+ </tr>
+ </tbody>
+ </table>
+ <table width="100%">
+ <tbody>
+ <tr>
+ <td class="cell" width="1%" data-expected-client-width="4"></td>
+ <td>1%</td>
+ </tr>
+ </tbody>
+ </table>
+ <table width="100%">
+ <tbody>
+ <tr>
+ <td class="cell" width="5%" data-expected-client-width="20"></td>
+ <td>5%</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+</main>
+<script>
+ checkLayout(".cell");
+</script>
+