diff --git a/Tests/LibWeb/Text/input/wpt-import/common/gc.js b/Tests/LibWeb/Crash/wpt-import/common/gc.js similarity index 100% rename from Tests/LibWeb/Text/input/wpt-import/common/gc.js rename to Tests/LibWeb/Crash/wpt-import/common/gc.js diff --git a/Tests/LibWeb/Text/input/wpt-import/css/selectors/has-sibling-chrome-crash.html b/Tests/LibWeb/Crash/wpt-import/css/selectors/has-sibling-chrome-crash.html similarity index 77% rename from Tests/LibWeb/Text/input/wpt-import/css/selectors/has-sibling-chrome-crash.html rename to Tests/LibWeb/Crash/wpt-import/css/selectors/has-sibling-chrome-crash.html index 1ea6481a3a1..0306e3e3927 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/selectors/has-sibling-chrome-crash.html +++ b/Tests/LibWeb/Crash/wpt-import/css/selectors/has-sibling-chrome-crash.html @@ -8,7 +8,3 @@ }

PASS if this tests does not crash

- diff --git a/Tests/LibWeb/Text/input/wpt-import/css/selectors/invalidation/nth-of-namespace-class-invalidation-crash.html b/Tests/LibWeb/Crash/wpt-import/css/selectors/invalidation/nth-of-namespace-class-invalidation-crash.html similarity index 87% rename from Tests/LibWeb/Text/input/wpt-import/css/selectors/invalidation/nth-of-namespace-class-invalidation-crash.html rename to Tests/LibWeb/Crash/wpt-import/css/selectors/invalidation/nth-of-namespace-class-invalidation-crash.html index 36ebe907bcf..4ad1cfe1c69 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/selectors/invalidation/nth-of-namespace-class-invalidation-crash.html +++ b/Tests/LibWeb/Crash/wpt-import/css/selectors/invalidation/nth-of-namespace-class-invalidation-crash.html @@ -11,7 +11,5 @@ document.addEventListener("DOMContentLoaded", () => { document.documentElement.appendChild(a) b.offsetTop; b.setAttributeNS("h", "class", "") - if (window.internals) - window.internals.signalTestIsDone("PASS"); }) diff --git a/Tests/LibWeb/Text/input/wpt-import/html/dom/elements/the-innertext-and-outertext-properties/innertext-domnoderemoved-crash.html b/Tests/LibWeb/Crash/wpt-import/html/dom/elements/the-innertext-and-outertext-properties/innertext-domnoderemoved-crash.html similarity index 87% rename from Tests/LibWeb/Text/input/wpt-import/html/dom/elements/the-innertext-and-outertext-properties/innertext-domnoderemoved-crash.html rename to Tests/LibWeb/Crash/wpt-import/html/dom/elements/the-innertext-and-outertext-properties/innertext-domnoderemoved-crash.html index fea0cb6a4e6..94043caf69c 100644 --- a/Tests/LibWeb/Text/input/wpt-import/html/dom/elements/the-innertext-and-outertext-properties/innertext-domnoderemoved-crash.html +++ b/Tests/LibWeb/Crash/wpt-import/html/dom/elements/the-innertext-and-outertext-properties/innertext-domnoderemoved-crash.html @@ -13,7 +13,4 @@ } }); parentelement.innerText = 'hello world'; - - if (window.internals) - internals.signalTestIsDone("PASS"); diff --git a/Tests/LibWeb/Crash/wpt-import/html/semantics/interactive-elements/the-dialog-element/dialog-requestclose-crash.html b/Tests/LibWeb/Crash/wpt-import/html/semantics/interactive-elements/the-dialog-element/dialog-requestclose-crash.html index bfa400a7524..c4c4850a2d3 100644 --- a/Tests/LibWeb/Crash/wpt-import/html/semantics/interactive-elements/the-dialog-element/dialog-requestclose-crash.html +++ b/Tests/LibWeb/Crash/wpt-import/html/semantics/interactive-elements/the-dialog-element/dialog-requestclose-crash.html @@ -1,11 +1,12 @@ + + + Dialog diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/CSS2/floats/overhanging-float-paint-order-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/CSS2/floats/overhanging-float-paint-order-ref.html index d3bacec1155..608e009ff5c 100644 --- a/Tests/LibWeb/Ref/expected/wpt-import/css/CSS2/floats/overhanging-float-paint-order-ref.html +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/CSS2/floats/overhanging-float-paint-order-ref.html @@ -1,3 +1,4 @@
+ diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/CSS2/reference/ref-filled-green-100px-square.xht b/Tests/LibWeb/Ref/expected/wpt-import/css/CSS2/reference/ref-filled-green-100px-square.xht index 239200d067d..05a13794482 100644 --- a/Tests/LibWeb/Ref/expected/wpt-import/css/CSS2/reference/ref-filled-green-100px-square.xht +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/CSS2/reference/ref-filled-green-100px-square.xht @@ -3,13 +3,14 @@ CSS Reftest Reference - + } + ]]>

Test passes if there is a filled green square and no red.

diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-color/009900-image-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-color/009900-image-ref.html index 095a850a6de..cf1ba5c48f7 100644 --- a/Tests/LibWeb/Ref/expected/wpt-import/css/css-color/009900-image-ref.html +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-color/009900-image-ref.html @@ -8,4 +8,4 @@

Test passes if you see a green square, and no red.

should be green

- + \ No newline at end of file diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-color/009900-tagged-image-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-color/009900-tagged-image-ref.html index 8ee51ff8361..21086fc6218 100644 --- a/Tests/LibWeb/Ref/expected/wpt-import/css/css-color/009900-tagged-image-ref.html +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-color/009900-tagged-image-ref.html @@ -11,4 +11,4 @@ red-green swapped to be sure the profile is actually applied -->

should be green

- + \ No newline at end of file diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-002-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-002-ref.html index 1911bdaca0c..44cd7c109e0 100644 --- a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-002-ref.html +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-002-ref.html @@ -30,4 +30,4 @@ - + \ No newline at end of file diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-stacking-context-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-stacking-context-001-ref.html index c7553716ab6..e2516f3d378 100644 --- a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-stacking-context-001-ref.html +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-stacking-context-001-ref.html @@ -1,62 +1,13 @@ - - - - CSS Reftest Reference - - - - -
-

-
- -
-
-

-
- -
-
-
- -
-

-
- - + +Paint Containment Stacking Context Reference + + +
+Test succeeds if there is no red. diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-size-064-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-size-064-ref.html index f8826e5c95c..6d2876ae9bc 100644 --- a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-size-064-ref.html +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-size-064-ref.html @@ -23,3 +23,6 @@ div { font-size: 50px; }
 
+ + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-values/reference/all-green.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-values/reference/all-green.html index 454b71944ee..c70532129ad 100644 --- a/Tests/LibWeb/Ref/expected/wpt-import/css/css-values/reference/all-green.html +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-values/reference/all-green.html @@ -1 +1 @@ - + \ No newline at end of file diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/reference/ref-filled-green-100px-square.xht b/Tests/LibWeb/Ref/expected/wpt-import/css/reference/ref-filled-green-100px-square.xht index 670b01f18af..05a13794482 100644 --- a/Tests/LibWeb/Ref/expected/wpt-import/css/reference/ref-filled-green-100px-square.xht +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/reference/ref-filled-green-100px-square.xht @@ -3,13 +3,14 @@ CSS Reftest Reference - + ]]>

Test passes if there is a filled green square and no red.

diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-attr-largedom-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-attr-largedom-ref.html index 7e42dd156b3..07617c53ad1 100644 --- a/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-attr-largedom-ref.html +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-attr-largedom-ref.html @@ -449,4 +449,4 @@ 146 - + \ No newline at end of file diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-001.html index e0a5f1dc1f4..48f71786591 100644 --- a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-001.html +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-001.html @@ -14,4 +14,4 @@

Test passes if you see a green square, and no red.

- + \ No newline at end of file diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-002.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-002.html index 521ad00ae0c..8be1226f21a 100644 --- a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-002.html +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-002.html @@ -14,4 +14,4 @@

Test passes if you see a green square, and no red.

- + \ No newline at end of file diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-005.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-005.html index 1031a7b5039..886f3d48204 100644 --- a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-005.html +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-005.html @@ -14,4 +14,4 @@

Test passes if you see a green square, and no red.

- + \ No newline at end of file diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-006.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-006.html index 726d5a32348..bebbc3715ea 100644 --- a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-006.html +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-006.html @@ -14,4 +14,4 @@

Test passes if you see a green square, and no red.

- + \ No newline at end of file diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-007.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-007.html index 74e43428d6a..3fa81551afb 100644 --- a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-007.html +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-007.html @@ -14,4 +14,4 @@

Test passes if you see a green square, and no red.

- + \ No newline at end of file diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-008.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-008.html index e3dbf307bda..cc4dfabfd48 100644 --- a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-008.html +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-008.html @@ -14,4 +14,4 @@

Test passes if you see a green square, and no red.

- + \ No newline at end of file diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-009.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-009.html index 7cad0578ad7..98141c3c10e 100644 --- a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-009.html +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-009.html @@ -14,4 +14,4 @@

Test passes if you see a green square, and no red.

- + \ No newline at end of file diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-010.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-010.html index f0c18b204f2..c1dacd6ff27 100644 --- a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-010.html +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-010.html @@ -14,4 +14,4 @@

Test passes if you see a green square, and no red.

- + \ No newline at end of file diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-011.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-011.html index ea33d294845..4c754ee5e5b 100644 --- a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-011.html +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-011.html @@ -14,4 +14,4 @@

Test passes if you see a green square, and no red.

- + \ No newline at end of file diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-012.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-012.html index a74f82e115f..8ba01b93f52 100644 --- a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-012.html +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/predefined-012.html @@ -14,4 +14,4 @@

Test passes if you see a green square, and no red.

- + \ No newline at end of file diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/tagged-images-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/tagged-images-001.html index 450895c2b46..8cbd8614eb2 100644 --- a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/tagged-images-001.html +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/tagged-images-001.html @@ -11,4 +11,4 @@

Test passes if you see a green square, and no red.

should be green

- + \ No newline at end of file diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/tagged-images-002.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/tagged-images-002.html index 4b541a95f4e..c316aa5282d 100644 --- a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/tagged-images-002.html +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/tagged-images-002.html @@ -11,4 +11,4 @@

Test passes if you see a green square, and no red.

should be green

- + \ No newline at end of file diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/untagged-images-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/untagged-images-001.html index b6ace50769e..04995388276 100644 --- a/Tests/LibWeb/Ref/input/wpt-import/css/css-color/untagged-images-001.html +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-color/untagged-images-001.html @@ -10,4 +10,4 @@

Test passes if you see a green square, and no red.

should be green

- + \ No newline at end of file diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-020.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-020.html index 3bab564ba56..ee2b8281dff 100644 --- a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-020.html +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-020.html @@ -40,3 +40,4 @@ document.documentElement.removeAttribute("class"); }); + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-stacking-context-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-stacking-context-001.html index e007d9b510b..db109cd26c0 100644 --- a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-stacking-context-001.html +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-stacking-context-001.html @@ -1,66 +1,32 @@ - - - - CSS Test: 'contain: layout' with stacking contents. Z-index is defined only for siblings and children. - - - - - - - - -
-

-
- -
-
-

-
- -
-
-
- -
-

-
- - +'contain: layout' establishes stacking context. + + + + + +
+
+
+
+Test succeeds if there is no red. diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-064.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-064.html index 7b144954a45..7abe6f2ed76 100644 --- a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-064.html +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-064.html @@ -34,3 +34,6 @@ div { font-size: 50px; }
+ + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/support/60x60-green.png b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/support/60x60-green.png index 3fdd0b8138c..b3c8cf3eb4c 100644 Binary files a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/support/60x60-green.png and b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/support/60x60-green.png differ diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-images/gradient/gradient-single-stop-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/gradient/gradient-single-stop-001.html index 17962699a0f..b7e21445d97 100644 --- a/Tests/LibWeb/Ref/input/wpt-import/css/css-images/gradient/gradient-single-stop-001.html +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-images/gradient/gradient-single-stop-001.html @@ -8,7 +8,7 @@ - + +
+
+
diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-style-computed.html b/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-style-computed.html index 2b1b3de4cef..a79bd165ae7 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-style-computed.html +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-style-computed.html @@ -33,6 +33,8 @@ test_computed_value('font-style', 'oblique calc(10deg - 10deg)', 'normal'); test_computed_value('font-style', 'oblique 10deg'); test_computed_value('font-style', 'oblique -10deg'); +test_computed_value('font-style', 'oblique 14deg', 'oblique'); +test_computed_value('font-style', 'oblique -14deg'); test_computed_value('font-style', 'oblique -90deg'); test_computed_value('font-style', 'oblique 90deg'); test_computed_value('font-style', 'oblique 10grad', 'oblique 9deg'); diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-style-valid.html b/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-style-valid.html index ba7b4b352c3..2589da75606 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-style-valid.html +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-style-valid.html @@ -20,6 +20,8 @@ test_valid_value('font-style', 'oblique calc(10deg - 10deg)', 'oblique calc(0deg test_valid_value('font-style', 'oblique 10deg'); test_valid_value('font-style', 'oblique -10deg'); +test_valid_value('font-style', 'oblique 14deg', 'oblique'); +test_valid_value('font-style', 'oblique -14deg'); test_valid_value('font-style', 'oblique -90deg'); test_valid_value('font-style', 'oblique 90deg'); test_valid_value('font-style', 'oblique 10grad'); diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-computed.html b/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-computed.html index 74ebfdb60e1..6853ef3ea54 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-computed.html +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-computed.html @@ -4,6 +4,7 @@ CSS Fonts Module: getComputedStyle().fontSynthesis + @@ -15,17 +16,24 @@ test_computed_value('font-synthesis', 'none'); test_computed_value('font-synthesis', 'weight'); test_computed_value('font-synthesis', 'style'); +test_computed_value('font-synthesis', 'oblique-only'); test_computed_value('font-synthesis', 'small-caps'); test_computed_value('font-synthesis', 'position'); test_computed_value('font-synthesis', 'small-caps position'); test_computed_value('font-synthesis', 'style small-caps'); test_computed_value('font-synthesis', 'style position'); test_computed_value('font-synthesis', 'style small-caps position'); +test_computed_value('font-synthesis', 'oblique-only small-caps'); +test_computed_value('font-synthesis', 'oblique-only position'); +test_computed_value('font-synthesis', 'oblique-only small-caps position'); test_computed_value('font-synthesis', 'weight small-caps'); test_computed_value('font-synthesis', 'weight style'); +test_computed_value('font-synthesis', 'weight oblique-only'); test_computed_value('font-synthesis', 'weight position'); test_computed_value('font-synthesis', 'weight style small-caps'); test_computed_value('font-synthesis', 'weight style small-caps position'); +test_computed_value('font-synthesis', 'weight oblique-only small-caps'); +test_computed_value('font-synthesis', 'weight oblique-only small-caps position'); diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-invalid.html b/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-invalid.html index efe421228ea..c52f3460e76 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-invalid.html +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-invalid.html @@ -4,7 +4,8 @@ CSS Fonts Module: parsing font-synthesis with invalid values - + + @@ -14,8 +15,12 @@ test_invalid_value('font-synthesis', 'auto'); test_invalid_value('font-synthesis', 'none weight'); test_invalid_value('font-synthesis', 'none style'); +test_invalid_value('font-synthesis', 'none oblique-only'); test_invalid_value('font-synthesis', 'none position'); test_invalid_value('font-synthesis', 'style none'); +test_invalid_value('font-synthesis', 'style oblique-only'); +test_invalid_value('font-synthesis', 'oblique-only style'); +test_invalid_value('font-synthesis', 'oblique-only none'); test_invalid_value('font-synthesis', 'none small-caps'); test_invalid_value('font-synthesis', 'small-caps none'); test_invalid_value('font-synthesis', 'position none'); diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-style-invalid.html b/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-style-invalid.html index 76efc685b8d..218c8c4b55b 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-style-invalid.html +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-style-invalid.html @@ -3,8 +3,9 @@ CSS Fonts Module Level 4: parsing font-synthesis-style with invalid values - - + + + @@ -13,6 +14,8 @@ diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-style-valid.html b/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-style-valid.html index d0f3dc384b6..40157b637fb 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-style-valid.html +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-style-valid.html @@ -3,8 +3,9 @@ CSS Fonts Module Level 4: parsing font-synthesis-style with valid values - - + + + @@ -13,6 +14,7 @@ diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-valid.html b/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-valid.html index e546349aae0..2df2ce7b420 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-valid.html +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/parsing/font-synthesis-valid.html @@ -4,7 +4,7 @@ CSS Fonts Module: parsing font-synthesis with valid values - + @@ -14,17 +14,26 @@ test_valid_value('font-synthesis', 'none'); test_valid_value('font-synthesis', 'weight'); test_valid_value('font-synthesis', 'style'); +test_valid_value('font-synthesis', 'oblique-only'); test_valid_value('font-synthesis', 'small-caps'); test_valid_value('font-synthesis', 'position'); test_valid_value('font-synthesis', 'style weight', 'weight style'); +test_valid_value('font-synthesis', 'oblique-only weight', 'weight oblique-only'); test_valid_value('font-synthesis', 'small-caps weight', 'weight small-caps'); test_valid_value('font-synthesis', 'small-caps style', 'style small-caps'); +test_valid_value('font-synthesis', 'small-caps oblique-only', 'oblique-only small-caps'); test_valid_value('font-synthesis', 'style weight small-caps', 'weight style small-caps'); test_valid_value('font-synthesis', 'style small-caps weight ', 'weight style small-caps'); test_valid_value('font-synthesis', 'small-caps style weight ', 'weight style small-caps'); +test_valid_value('font-synthesis', 'oblique-only weight small-caps', 'weight oblique-only small-caps'); +test_valid_value('font-synthesis', 'oblique-only small-caps weight ', 'weight oblique-only small-caps'); +test_valid_value('font-synthesis', 'small-caps oblique-only weight ', 'weight oblique-only small-caps'); test_valid_value('font-synthesis', 'position style', 'style position'); +test_valid_value('font-synthesis', 'position oblique-only', 'oblique-only position'); test_valid_value('font-synthesis', 'position weight style', 'weight style position'); +test_valid_value('font-synthesis', 'position weight oblique-only', 'weight oblique-only position'); test_valid_value('font-synthesis', 'position weight small-caps style', 'weight style small-caps position'); +test_valid_value('font-synthesis', 'position weight small-caps oblique-only', 'weight oblique-only small-caps position'); diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/support/font-family-keywords.js b/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/support/font-family-keywords.js index 09bcf85c9fa..db30af84109 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/support/font-family-keywords.js +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-fonts/support/font-family-keywords.js @@ -7,9 +7,11 @@ var kGenericFontFamilyKeywords = [ "fantasy", "monospace", "system-ui", - "emoji", "math", - "fangsong", + "generic(fangsong)", + "generic(kai)", + "generic(khmer-mul)", + "generic(nastaliq)", "ui-serif", "ui-sans-serif", "ui-monospace", @@ -17,11 +19,13 @@ var kGenericFontFamilyKeywords = [ ]; // values that had/have web-exposed behavior in some browsers, but -// are not defined in the specification. +// are not defined in the specification. They must be treated as s. var kNonGenericFontFamilyKeywords = [ "NonGenericFontFamilyName", "-webkit-body", "-webkit-standard", "-webkit-pictograph", + "emoji", + "fangsong", "BlinkMacSystemFont", ]; diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-grid/parsing/grid-area-computed.html b/Tests/LibWeb/Text/input/wpt-import/css/css-grid/parsing/grid-area-computed.html index d5fb9b0f301..e84e69be390 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/css-grid/parsing/grid-area-computed.html +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-grid/parsing/grid-area-computed.html @@ -7,9 +7,17 @@ + -
+
+
+
diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-nesting/cssom.html b/Tests/LibWeb/Text/input/wpt-import/css/css-nesting/cssom.html index e3bf26d2d53..b4b8d79baec 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/css-nesting/cssom.html +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-nesting/cssom.html @@ -185,4 +185,41 @@ assert_equals(getComputedStyle(inner1).zIndex, '1'); assert_equals(getComputedStyle(inner2).zIndex, '1'); }, 'Mutating the selectorText of outer rule invalidates inner rules'); + + // CSSNestedDeclarations + test((t) => { + const main = document.createElement('main'); + main.innerHTML = ` + +
+
+ `; + document.documentElement.append(main); + t.add_cleanup(() => main.remove()); + assert_equals(getComputedStyle(outer).zIndex, '1'); + const main_ss = document.getElementById("main_ss").sheet; + const rule = main_ss.cssRules[0]; + assert_equals(rule.cssRules.length, 1); + rule.insertRule('z-index: 3;'); + assert_equals(rule.cssRules.length, 2); + assert_equals(getComputedStyle(outer).zIndex, '3'); + + // Throw only when no valid declaration https://github.com/w3c/csswg-drafts/issues/10520 + assert_throws_dom('SyntaxError', () => { rule.insertRule('nothing-to-insert-because-invalid-property-should-throw: 2;'); }); + assert_equals(rule.cssRules.length, 2); + + // Test the insertion of nested declarations inside grouping rule + rule.insertRule('@media screen { a { color: blue; }}',2); + assert_equals(rule.cssRules.length, 3); + const mediaRule = rule.cssRules[2]; + mediaRule.insertRule('z-index: 3;'); + assert_equals(mediaRule.cssRules.length, 2); + assert_throws_dom('SyntaxError', () => { mediaRule.insertRule('nothing-to-insert-because-invalid-property-should-throw: 2;'); }); + }, 'Manipulation of nested declarations through CSSOM'); + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-transitions/support/helper.js b/Tests/LibWeb/Text/input/wpt-import/css/css-transitions/support/helper.js index a37aae91830..0ccfe2648ea 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/css-transitions/support/helper.js +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-transitions/support/helper.js @@ -323,4 +323,17 @@ root.supportsStartingStyle = () => { return sheet.cssRules.length == 1; }; +/** + * Waits for a 'transitionend' event to fire on the given element. + * + * @param element The DOM element to listen for the transitionend event on. + * @returns {Promise} A promise that resolves when the transitionend event is fired. + */ +root.waitForTransitionEnd = function(element) { + return new Promise(resolve => { + element.addEventListener('transitionend', resolve, { once: true }); + }); +}; + + })(window); diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-values/calc-serialization.html b/Tests/LibWeb/Text/input/wpt-import/css/css-values/calc-serialization.html index ca2ae2aacb7..766db94b6a7 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/css-values/calc-serialization.html +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-values/calc-serialization.html @@ -22,7 +22,6 @@ test(function() { var content = document.getElementById("content"); for (var prop in values) { - content.style.width = ''; content.style.width = prop; assert_equals(content.style.width, values[prop], "Serialization of " + prop); } diff --git a/Tests/LibWeb/Text/input/wpt-import/css/cssom/serialize-values.html b/Tests/LibWeb/Text/input/wpt-import/css/cssom/serialize-values.html index f6b05ed5c22..0f977a402c2 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/cssom/serialize-values.html +++ b/Tests/LibWeb/Text/input/wpt-import/css/cssom/serialize-values.html @@ -106,7 +106,7 @@ function attr_fallback() { var values = ['attr(foo-bar, "fallback")', 'attr(foo_bar, "fallback")', {actual: 'attr(|bar, "fallback")', serialized: 'attr(bar, "fallback")'}, - {actual: 'attr(foo, "")', serialized: 'attr(foo)'}, + {actual: 'attr(foo, "")', serialized: 'attr(foo, "")'}, {actual: 'attr( |foo , "" )', serialized: 'attr(foo)'}]; return iterable(values); } diff --git a/Tests/LibWeb/Text/input/wpt-import/css/filter-effects/css-filters-opacity-hit-testing.html b/Tests/LibWeb/Text/input/wpt-import/css/filter-effects/css-filters-opacity-hit-testing.html index add6959ba97..c2e9038e530 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/filter-effects/css-filters-opacity-hit-testing.html +++ b/Tests/LibWeb/Text/input/wpt-import/css/filter-effects/css-filters-opacity-hit-testing.html @@ -1,7 +1,7 @@ Elements with 'opacity: 0' should respond to hit testing. - + dialog +

details
+

+

diff --git a/Tests/LibWeb/Text/input/wpt-import/css/support/interpolation-testcommon.js b/Tests/LibWeb/Text/input/wpt-import/css/support/interpolation-testcommon.js index 211018ca053..bcd8b2ffca9 100644 --- a/Tests/LibWeb/Text/input/wpt-import/css/support/interpolation-testcommon.js +++ b/Tests/LibWeb/Text/input/wpt-import/css/support/interpolation-testcommon.js @@ -314,6 +314,7 @@ var property = interpolationTest.options.property; var from = interpolationTest.options.from; var to = interpolationTest.options.to; + let underlying = interpolationTest.options.underlying; var comparisonFunction = interpolationTest.options.comparisonFunction; var behavior = interpolationTest.options.behavior; @@ -354,9 +355,7 @@ } var target = actualTargetContainer.target; if (applyUnderlying) { - let underlying = interpolationTest.options.underlying; assert_true(typeof underlying !== 'undefined', '\'underlying\' value must be provided'); - assert_true(CSS.supports(property, underlying), '\'underlying\' value must be supported'); target.style.setProperty(property, underlying); } interpolationMethod.setup(property, from, target); diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/nodes/Node-normalize.html b/Tests/LibWeb/Text/input/wpt-import/dom/nodes/Node-normalize.html index cf2fc2ccd1d..2c2d8c0043c 100644 --- a/Tests/LibWeb/Text/input/wpt-import/dom/nodes/Node-normalize.html +++ b/Tests/LibWeb/Text/input/wpt-import/dom/nodes/Node-normalize.html @@ -77,7 +77,7 @@ test(function() { var t9 = div.appendChild(doc.createTextNode("e")) var expected = [t1, t2, t3, t4, t5, t6, t7, t8, t9] assert_array_equals(div.childNodes, expected) - div.normalize(); + div.normalize() assert_array_equals(div.childNodes, expected) }, "Non-text nodes with empty textContent values.") diff --git a/Tests/LibWeb/Text/input/wpt-import/html-aam/roles-contextual.html b/Tests/LibWeb/Text/input/wpt-import/html-aam/roles-contextual.html index 5fd897c1e62..cdd1127bcda 100644 --- a/Tests/LibWeb/Text/input/wpt-import/html-aam/roles-contextual.html +++ b/Tests/LibWeb/Text/input/wpt-import/html-aam/roles-contextual.html @@ -12,7 +12,7 @@ -

Tests contextual computedrole mappings defined in HTML-AAM, where the returned computed role is expected to change based on the context. Most test names correspond to a unique ID defined in the spec.

+

Tests contextual computed role mappings defined in HTML-AAM, where the returned computed role is expected to change based on the context. Most test names correspond to a unique ID defined in the spec.

These should remain in alphabetical order.

@@ -50,6 +50,15 @@
+ + + + + + + + +
@@ -62,10 +71,38 @@
x
+ + + + + + + + + + + + + + +
x
x
+
x
+
x
+
x
+
x
+
x
+
x
+
x
+
x
+
x
+ +
labelledby
+
+
- \ No newline at end of file + diff --git a/Tests/LibWeb/Text/input/wpt-import/html-aam/roles-contextual.tentative.html b/Tests/LibWeb/Text/input/wpt-import/html-aam/roles-contextual.tentative.html index 6119efa40a9..7a7d1039ccf 100644 --- a/Tests/LibWeb/Text/input/wpt-import/html-aam/roles-contextual.tentative.html +++ b/Tests/LibWeb/Text/input/wpt-import/html-aam/roles-contextual.tentative.html @@ -16,7 +16,7 @@ See https://github.com/w3c/aria/pull/1931 -->
x
@@ -33,4 +33,4 @@ AriaUtils.verifyRolesBySelector(".ex"); - \ No newline at end of file + diff --git a/Tests/LibWeb/Text/input/wpt-import/html-aam/roles.html b/Tests/LibWeb/Text/input/wpt-import/html-aam/roles.html index e6dcc1a6495..447b4c9fa01 100644 --- a/Tests/LibWeb/Text/input/wpt-import/html-aam/roles.html +++ b/Tests/LibWeb/Text/input/wpt-import/html-aam/roles.html @@ -94,6 +94,8 @@ + + @@ -113,6 +115,8 @@ + + diff --git a/Tests/LibWeb/Text/input/wpt-import/html/dom/aria-attribute-reflection.html b/Tests/LibWeb/Text/input/wpt-import/html/dom/aria-attribute-reflection.html index 342d9cf0d6f..077a6444b95 100644 --- a/Tests/LibWeb/Text/input/wpt-import/html/dom/aria-attribute-reflection.html +++ b/Tests/LibWeb/Text/input/wpt-import/html/dom/aria-attribute-reflection.html @@ -1,11 +1,11 @@ - - + Element Reflection for ARIA properties - - + + + +
-
+ +
-
+ +
-
+ +
-
+ +
-
+ +
-
+ +
-
+ +
-
+ +
+ -
+ +
-
+ +
+ -
+ +
-
+ +
-
+ +
- + + -
+ +
-
+ +
-
+ +
-
+ +
-
+ +
- + + -
+ +
-
+ +
-
+ +
-
+ +
-
+ +
- + + -
+ +
-
+ +
-
+ +
-
+ +
-
+ +
-
+ +
+ -
+ +
-
+ +
-
+ +
-
+ +
-
+ +
-
+ +
-
+ +
-
+ +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/html/dom/aria-element-reflection.html b/Tests/LibWeb/Text/input/wpt-import/html/dom/aria-element-reflection.html index 7dc5ded0670..9c784f3f29f 100644 --- a/Tests/LibWeb/Text/input/wpt-import/html/dom/aria-element-reflection.html +++ b/Tests/LibWeb/Text/input/wpt-import/html/dom/aria-element-reflection.html @@ -69,7 +69,7 @@ assert_equals(option2, option2Duplicate); assert_equals(parentListbox2.ariaActiveDescendantElement, option2); - }, "aria-activedescendant If the content attribute is set directly, the IDL attribute getter always returns the first element whose ID matches the content attribute."); + }, "If the content attribute is set directly, the IDL attribute getter always returns the first element whose ID matches the content attribute.");
@@ -86,7 +86,7 @@ assert_true(blankIdParent.hasAttribute("aria-activedescendant")); assert_equals(blankIdParent.getAttribute("aria-activedescendant"), ""); assert_equals(blankIdParent.ariaActiveDescendantElement, blankIdParent.children[1]); - }, "aria-activedescendant Setting the IDL attribute to an element which is not the first element in DOM order with its ID causes the content attribute to be an empty string"); + }, "Setting the IDL attribute to an element which is not the first element in DOM order with its ID causes the content attribute to be an empty string");
@@ -114,7 +114,7 @@ link.ariaActiveDescendantElement = lightParagraph; assert_equals(link.ariaActiveDescendantElement, lightParagraph); assert_equals(link.getAttribute("aria-activedescendant"), ""); - }, "aria-activedescendant Setting an element reference that crosses into a shadow tree is disallowed, but setting one that is in a shadow inclusive ancestor is allowed."); + }, "Setting an element reference that crosses into a shadow tree is disallowed, but setting one that is in a shadow inclusive ancestor is allowed."); @@ -196,7 +196,7 @@ // The content attribute is still empty. assert_equals(deletionParent.getAttribute("aria-activedescendant"), ""); - }, "aria-activedescendant Deleting a reflected element should return null for the IDL attribute and the content attribute will be empty."); + }, "Deleting a reflected element should return null for the IDL attribute and the content attribute will be empty.");
@@ -227,7 +227,7 @@ changingIdElement.setAttribute("id", "newer-id"); assert_equals(parentNode.ariaActiveDescendantElement, changingIdElement, "explicitly set element is still present even after the id has been changed"); assert_equals(parentNode.getAttribute("aria-activedescendant"), "", "content attribute is empty."); - }, "aria-activedescendant Changing the ID of an element doesn't lose the reference."); + }, "Changing the ID of an element doesn't lose the reference."); @@ -265,7 +265,7 @@ lightParent.appendChild(lightElement); assert_equals(lightParent.ariaActiveDescendantElement, lightElement, "computed attr-assoc element should be restored as referenced element is back in a valid scope"); assert_equals(lightParent.getAttribute("aria-activedescendant"), ""); - }, "aria-activedescendant Reparenting an element into a descendant shadow scope hides the element reference."); + }, "Reparenting an element into a descendant shadow scope hides the element reference.");
@@ -306,7 +306,7 @@ fruitbowl.ariaActiveDescendantElement = null; assert_equals(fruitbowl.ariaActiveDescendantElement, null); assert_equals(fruitbowl.getAttribute("aria-activedescendant"), null); - }, "aria-activedescendant Reparenting referenced element cannot cause retargeting of reference."); + }, "Reparenting referenced element cannot cause retargeting of reference.");
@@ -331,7 +331,7 @@ assert_equals(toaster.ariaActiveDescendantElement, toast); // Current spec behaviour: assert_equals(toaster.getAttribute("aria-activedescendant"), ""); - }, "aria-activedescendant Element reference set in invalid scope remains intact throughout move to valid scope."); + }, "Element reference set in invalid scope remains intact throughout move to valid scope.");
@@ -681,7 +681,7 @@ first.parentElement.appendChild(first); assert_equals(input.ariaActiveDescendantElement, first); - }, "aria-activedescendant Reparenting."); + }, "Reparenting.");
@@ -699,7 +699,7 @@ assert_equals(fromDiv.ariaActiveDescendantElement, toSpan, "Referenced element now inserted into the document."); assert_equals(fromDiv.getAttribute("aria-activedescendant"), "", "Content attribute remains empty, as it is only updated at set time."); - }, "aria-activedescendant Attaching element reference before it's inserted into the DOM."); + }, "Attaching element reference before it's inserted into the DOM.");
@@ -722,7 +722,7 @@ // Implementation defined: moving object into same document from other document may cause reference to become visible. assert_equals(originalDocumentDiv.ariaActiveDescendantElement, newDocSpan, "Implementation defined: moving object back *may* make reference visible."); assert_equals(fromDiv.getAttribute("aria-activedescendant"), "", "Invalid scope when set, so content attribute not set."); - }, "aria-activedescendant Cross-document references and moves."); + }, "Cross-document references and moves."); @@ -740,7 +740,7 @@ // Adopt element from other oducment. document.body.appendChild(document.adoptNode(otherDocDiv)); assert_equals(otherDocDiv.ariaActiveDescendantElement, otherDocSpan, "Reference should be kept on the new document too."); - }, "aria-activedescendant Adopting element keeps references."); + }, "Adopting element keeps references.");
diff --git a/Tests/LibWeb/Text/input/wpt-import/html/dom/elements/the-innertext-and-outertext-properties/getter-tests.js b/Tests/LibWeb/Text/input/wpt-import/html/dom/elements/the-innertext-and-outertext-properties/getter-tests.js index d3eca406fd8..d9b5b063732 100644 --- a/Tests/LibWeb/Text/input/wpt-import/html/dom/elements/the-innertext-and-outertext-properties/getter-tests.js +++ b/Tests/LibWeb/Text/input/wpt-import/html/dom/elements/the-innertext-and-outertext-properties/getter-tests.js @@ -100,6 +100,7 @@ testText("
Hello
K /**** first-line/first-letter ****/ +testText("
abc", "ABC", "::first-line styles applied"); testText("
abc def", "ABC def", "::first-line styles applied"); testText("
abc def", "Abc def", "::first-letter styles applied"); testText("
abc def", "abc def", "::first-letter float ignored"); diff --git a/Tests/LibWeb/Text/input/wpt-import/html/dom/elements/the-innertext-and-outertext-properties/innertext-whitespace-pre-line.html b/Tests/LibWeb/Text/input/wpt-import/html/dom/elements/the-innertext-and-outertext-properties/innertext-whitespace-pre-line.html index e9976f199aa..2552b55c607 100644 --- a/Tests/LibWeb/Text/input/wpt-import/html/dom/elements/the-innertext-and-outertext-properties/innertext-whitespace-pre-line.html +++ b/Tests/LibWeb/Text/input/wpt-import/html/dom/elements/the-innertext-and-outertext-properties/innertext-whitespace-pre-line.html @@ -31,11 +31,9 @@ test(() => { test(() => { function collapseWhitespace(s) { - return s.replace(/ +/g, ' ') // collapse runs of spaces - .replace(/ $/mg, '') // strip trailing spaces - .replace(/^ /mg, '') // strip leading spaces - .replace(/\n\n+/g, '\n') // collapse runs of newlines - .replace(/^\n/, ''); // remove any initial newline + return s.replace(/ +/g, ' ') // collapse runs of spaces + .replace(/ $/mg, '') // strip trailing spaces + .replace(/^ /mg, ''); // strip leading spaces } assert_equals(c.innerText, collapseWhitespace(d.innerText)); }, "innerText has collapsed whitespace but preserved newlines with pre-line"); diff --git a/Tests/LibWeb/Text/input/wpt-import/html/rendering/replaced-elements/svg-inline-sizing/svg-inline.js b/Tests/LibWeb/Text/input/wpt-import/html/rendering/replaced-elements/svg-inline-sizing/svg-inline.js index fb3949f54e5..9b7fca0502c 100644 --- a/Tests/LibWeb/Text/input/wpt-import/html/rendering/replaced-elements/svg-inline-sizing/svg-inline.js +++ b/Tests/LibWeb/Text/input/wpt-import/html/rendering/replaced-elements/svg-inline-sizing/svg-inline.js @@ -34,6 +34,8 @@ var testContainerHeight = testContainer.getBoundingClientRect().height; SVGSizing.doCombinationTest( [["placeholder", [ null ]], + ["containerWidthStyle", [null, "400px"]], + ["containerHeightStyle", [null, "400px"]], ["svgViewBoxAttr", [ null, "0 0 100 200" ]], ["svgWidthStyle", [ null, "100px", "50%" ]], ["svgHeightStyle", [ null, "100px", "50%" ]], diff --git a/Tests/LibWeb/Text/input/wpt-import/html/semantics/embedded-content/the-canvas-element/toBlob-cross-realm-callback-report-exception.html b/Tests/LibWeb/Text/input/wpt-import/html/semantics/embedded-content/the-canvas-element/toBlob-cross-realm-callback-report-exception.html index 9e7faad6ff9..f657027eff5 100644 --- a/Tests/LibWeb/Text/input/wpt-import/html/semantics/embedded-content/the-canvas-element/toBlob-cross-realm-callback-report-exception.html +++ b/Tests/LibWeb/Text/input/wpt-import/html/semantics/embedded-content/the-canvas-element/toBlob-cross-realm-callback-report-exception.html @@ -20,6 +20,11 @@ async_test(t => { const canvas = frames[0].document.querySelector("canvas"); canvas.toBlob(new frames[1].Function(`throw new parent.frames[2].Error("PASS");`)); + // Wait until at least one `onerror` fires. + t.step_wait_func(() => onerrorCalls.length != 0); + + // Wait for 25ms more in case one other `onerror` fires. This is inherently + // flaky... t.step_timeout(() => { assert_array_equals(onerrorCalls, ["frame1"]); t.done(); diff --git a/Tests/LibWeb/Text/input/wpt-import/html/semantics/forms/constraints/form-validation-checkValidity.html b/Tests/LibWeb/Text/input/wpt-import/html/semantics/forms/constraints/form-validation-checkValidity.html index f7013e21642..b312614b094 100644 --- a/Tests/LibWeb/Text/input/wpt-import/html/semantics/forms/constraints/form-validation-checkValidity.html +++ b/Tests/LibWeb/Text/input/wpt-import/html/semantics/forms/constraints/form-validation-checkValidity.html @@ -104,7 +104,6 @@ {conditions: {max: "5", value: "6"}, expected: false, name: "[target] suffering from an overflow"}, {conditions: {min: "5", value: "4"}, expected: false, name: "[target] suffering from an underflow"}, {conditions: {step: 2 * 1 * 1, value: "3"}, expected: false, name: "[target] suffering from a step mismatch"}, - {conditions: {step: 10, value: "20", content_value: "9"}, expected: false, name: "[target] (with 'value' content attribute) suffering from a step mismatch"}, {conditions: {required: true, value: ""}, expected: false, name: "[target] suffering from being missing"} ] }, diff --git a/Tests/LibWeb/Text/input/wpt-import/html/semantics/forms/constraints/support/validator.js b/Tests/LibWeb/Text/input/wpt-import/html/semantics/forms/constraints/support/validator.js index 9cc9e684d5f..aa43b3a2f6a 100644 --- a/Tests/LibWeb/Text/input/wpt-import/html/semantics/forms/constraints/support/validator.js +++ b/Tests/LibWeb/Text/input/wpt-import/html/semantics/forms/constraints/support/validator.js @@ -340,8 +340,6 @@ var validator = { for (var attr in obj) { if (attr === "message") ctl.setCustomValidity(obj[attr]); - else if (attr === "content_value") - ctl.setAttribute("value", obj["content_value"]) else if (attr === "checked" || obj[attr] || obj[attr] === "") ctl[attr] = obj[attr]; } diff --git a/Tests/LibWeb/Text/input/wpt-import/html/semantics/forms/the-input-element/input-type-checkbox-switch.tentative.window.js b/Tests/LibWeb/Text/input/wpt-import/html/semantics/forms/the-input-element/input-type-checkbox-switch.tentative.window.js index 6128a62a0fb..1f91d096ec8 100644 --- a/Tests/LibWeb/Text/input/wpt-import/html/semantics/forms/the-input-element/input-type-checkbox-switch.tentative.window.js +++ b/Tests/LibWeb/Text/input/wpt-import/html/semantics/forms/the-input-element/input-type-checkbox-switch.tentative.window.js @@ -17,3 +17,20 @@ test(t => { assert_equals(input.type, "checkbox"); assert_true(input.switch); }, "switch IDL attribute, getter"); + +test(t => { + const input = document.createElement("input"); + input.type = "checkbox"; + input.switch = true; + + const clone = input.cloneNode(); + assert_equals(clone.getAttribute("switch"), ""); + assert_equals(clone.type, "checkbox"); + assert_true(clone.switch); + + t.add_cleanup(() => clone.remove()); + document.body.appendChild(clone); + assert_equals(clone.getAttribute("switch"), ""); + assert_equals(clone.type, "checkbox"); + assert_true(clone.switch); +}, "Cloning a switch control"); diff --git a/Tests/LibWeb/Text/input/wpt-import/html/semantics/forms/the-select-element/select-value.html b/Tests/LibWeb/Text/input/wpt-import/html/semantics/forms/the-select-element/select-value.html index 3fca6b81bae..8d44f4894a8 100644 --- a/Tests/LibWeb/Text/input/wpt-import/html/semantics/forms/the-select-element/select-value.html +++ b/Tests/LibWeb/Text/input/wpt-import/html/semantics/forms/the-select-element/select-value.html @@ -46,7 +46,7 @@ test(function() { var div = document.createElement('div'); select.appendChild(div); div.appendChild(option); - assert_equals(select.value, ''); + assert_equals(select.value, '1'); }, 'option is child of div'); test(function() { diff --git a/Tests/LibWeb/Text/input/wpt-import/html/semantics/the-button-element/command-and-commandfor/button-type-reflection.html b/Tests/LibWeb/Text/input/wpt-import/html/semantics/the-button-element/command-and-commandfor/button-type-reflection.html index 042bb7ef9e5..b2a0dd792e3 100644 --- a/Tests/LibWeb/Text/input/wpt-import/html/semantics/the-button-element/command-and-commandfor/button-type-reflection.html +++ b/Tests/LibWeb/Text/input/wpt-import/html/semantics/the-button-element/command-and-commandfor/button-type-reflection.html @@ -9,6 +9,8 @@ + + @@ -18,6 +20,8 @@ + + @@ -26,6 +30,8 @@ + + @@ -35,21 +41,27 @@ const data = { 'reset-in-form': 'reset', 'submit-in-form': 'submit', 'button-in-form': 'button', - 'invalid-in-form': 'submit', + 'invalid-in-form': 'button', + 'invalid-in-form-command-only': 'button', + 'invalid-in-form-commandfor-only': 'button', 'missing-in-form': 'button', 'missing-in-form-command-only': 'button', 'missing-in-form-commandfor-only': 'button', 'reset-attr-form': 'reset', 'submit-attr-form': 'submit', 'button-attr-form': 'button', - 'invalid-attr-form': 'submit', + 'invalid-attr-form': 'button', + 'invalid-attr-form-command-only': 'button', + 'invalid-attr-form-commandfor-only': 'button', 'missing-attr-form': 'button', 'missing-attr-form-command-only': 'button', 'missing-attr-form-commandfor-only': 'button', 'reset-outside-form': 'reset', 'submit-outside-form': 'submit', 'button-outside-form': 'button', - 'invalid-outside-form': 'submit', + 'invalid-outside-form': 'button', + 'invalid-outside-form-command-only': 'button', + 'invalid-outside-form-commandfor-only': 'button', 'missing-outside-form': 'button', 'missing-outside-form-command-only': 'button', 'missing-outside-form-commandfor-only': 'button', diff --git a/Tests/LibWeb/Text/input/wpt-import/html/semantics/the-button-element/command-and-commandfor/on-popover-behavior.html b/Tests/LibWeb/Text/input/wpt-import/html/semantics/the-button-element/command-and-commandfor/on-popover-behavior.html index 7fcceea2c7f..31ee6c5c0a4 100644 --- a/Tests/LibWeb/Text/input/wpt-import/html/semantics/the-button-element/command-and-commandfor/on-popover-behavior.html +++ b/Tests/LibWeb/Text/input/wpt-import/html/semantics/the-button-element/command-and-commandfor/on-popover-behavior.html @@ -12,6 +12,13 @@
+ + diff --git a/Tests/LibWeb/Text/input/wpt-import/html/syntax/parsing/test.js b/Tests/LibWeb/Text/input/wpt-import/html/syntax/parsing/test.js index 57867f534d8..e725107b80d 100644 --- a/Tests/LibWeb/Text/input/wpt-import/html/syntax/parsing/test.js +++ b/Tests/LibWeb/Text/input/wpt-import/html/syntax/parsing/test.js @@ -131,10 +131,6 @@ function parse_query() { function get_type() { var run_type = "uri"; - if (location.href.includes("-write.html")) - run_type = "write"; - if (location.href.includes("-write_single.html")) - run_type = "write_single"; var fields = parse_query(); fields.forEach(function(x) { if(x[0] == "run_type") { diff --git a/Tests/LibWeb/Text/input/wpt-import/media-capabilities/decodingInfo.any.js b/Tests/LibWeb/Text/input/wpt-import/media-capabilities/decodingInfo.any.js index 2fd3743b442..510a59d9d78 100644 --- a/Tests/LibWeb/Text/input/wpt-import/media-capabilities/decodingInfo.any.js +++ b/Tests/LibWeb/Text/input/wpt-import/media-capabilities/decodingInfo.any.js @@ -141,7 +141,7 @@ promise_test(t => { return promise_rejects_js(t, TypeError, navigator.mediaCapabilities.decodingInfo({ type: 'file', video: { - contentType: 'application/ogg; codec=vorbis', + contentType: 'application/ogg; codecs=vorbis', width: 800, height: 600, bitrate: 3000, @@ -154,7 +154,7 @@ promise_test(t => { return promise_rejects_js(t, TypeError, navigator.mediaCapabilities.decodingInfo({ type: 'file', audio: { - contentType: 'application/ogg; codec=theora', + contentType: 'application/ogg; codecs=theora', channels: 2, }, })); @@ -225,97 +225,6 @@ promise_test(t => { })); }, "Test that decodingInfo rejects if the video configuration contentType has a codecs parameter that indicates both an audio and a video codec"); -promise_test(t => { - return promise_rejects_js(t, TypeError, navigator.mediaCapabilities.decodingInfo({ - type: 'file', - video: { - contentType: 'video/webm; codecs="vp09.00.10.08"', - width: 800, - height: 600, - bitrate: 3000, - framerate: '24000/1001', - } - })); -}, "Test that decodingInfo rejects framerate in the form of x/y"); - -promise_test(t => { - return promise_rejects_js(t, TypeError, navigator.mediaCapabilities.decodingInfo({ - type: 'file', - video: { - contentType: 'video/webm; codecs="vp09.00.10.08"', - width: 800, - height: 600, - bitrate: 3000, - framerate: '24000/0', - } - })); -}, "Test that decodingInfo rejects framerate in the form of x/0"); - -promise_test(t => { - return promise_rejects_js(t, TypeError, navigator.mediaCapabilities.decodingInfo({ - type: 'file', - video: { - contentType: 'video/webm; codecs="vp09.00.10.08"', - width: 800, - height: 600, - bitrate: 3000, - framerate: '0/10001', - } - })); -}, "Test that decodingInfo rejects framerate in the form of 0/y"); - -promise_test(t => { - return promise_rejects_js(t, TypeError, navigator.mediaCapabilities.decodingInfo({ - type: 'file', - video: { - contentType: 'video/webm; codecs="vp09.00.10.08"', - width: 800, - height: 600, - bitrate: 3000, - framerate: '-24000/10001', - } - })); -}, "Test that decodingInfo rejects framerate in the form of -x/y"); - -promise_test(t => { - return promise_rejects_js(t, TypeError, navigator.mediaCapabilities.decodingInfo({ - type: 'file', - video: { - contentType: 'video/webm; codecs="vp09.00.10.08"', - width: 800, - height: 600, - bitrate: 3000, - framerate: '24000/-10001', - } - })); -}, "Test that decodingInfo rejects framerate in the form of x/-y"); - -promise_test(t => { - return promise_rejects_js(t, TypeError, navigator.mediaCapabilities.decodingInfo({ - type: 'file', - video: { - contentType: 'video/webm; codecs="vp09.00.10.08"', - width: 800, - height: 600, - bitrate: 3000, - framerate: '24000/', - } - })); -}, "Test that decodingInfo rejects framerate in the form of x/"); - -promise_test(t => { - return promise_rejects_js(t, TypeError, navigator.mediaCapabilities.decodingInfo({ - type: 'file', - video: { - contentType: 'video/webm; codecs="vp09.00.10.08"', - width: 800, - height: 600, - bitrate: 3000, - framerate: '1/3x', - } - })); -}, "Test that decodingInfo rejects framerate with trailing unallowed characters"); - promise_test(t => { return promise_rejects_js(t, TypeError, navigator.mediaCapabilities.decodingInfo({ type: 'file', diff --git a/Tests/LibWeb/Text/input/wpt-import/resources/testdriver-actions.js b/Tests/LibWeb/Text/input/wpt-import/resources/testdriver-actions.js index 3e5ba74b4ca..edb4759954d 100644 --- a/Tests/LibWeb/Text/input/wpt-import/resources/testdriver-actions.js +++ b/Tests/LibWeb/Text/input/wpt-import/resources/testdriver-actions.js @@ -290,7 +290,7 @@ }, /** - * Create a keyDown event for the current default key source + * Create a keyUp event for the current default key source * * @param {String} key - Key to release * @param {String?} sourceName - Named key source to use or null for the default key source diff --git a/Tests/LibWeb/Text/input/wpt-import/shadow-dom/reference-target/tentative/resources/property-reflection-helper.js b/Tests/LibWeb/Text/input/wpt-import/shadow-dom/reference-target/tentative/resources/property-reflection-helper.js index 79f1bd7f748..88b7f743831 100644 --- a/Tests/LibWeb/Text/input/wpt-import/shadow-dom/reference-target/tentative/resources/property-reflection-helper.js +++ b/Tests/LibWeb/Text/input/wpt-import/shadow-dom/reference-target/tentative/resources/property-reflection-helper.js @@ -1,5 +1,6 @@ const Behavior = Object.freeze({ ReflectsHost: 'ReflectsHost', + ReflectsHostReadOnly: 'ReflectsHostReadOnly', ReflectsHostInArray: 'ReflectsHostInArray', IsNull: 'IsNull', ReflectsHostID: 'ReflectsHostID', @@ -30,7 +31,7 @@ function test_property_reflection(element_creation_method, test_name_suffix, ref referencing_element.setAttribute(attribute, "host-id"); const host_container = document.querySelector("#host-container"); const host = element_creation_method(host_container, referenced_element_type); - if (expected_behavior === Behavior.ReflectsHost) { + if (expected_behavior === Behavior.ReflectsHost || expected_behavior === Behavior.ReflectsHostReadOnly) { assert_equals(referencing_element[reflected_property], host); } else if (expected_behavior === Behavior.ReflectsHostInArray) { assert_array_equals(referencing_element[reflected_property], [host]); @@ -47,6 +48,82 @@ function test_property_reflection(element_creation_method, test_name_suffix, ref }, `${referencing_element_type}.${reflected_property} has reflection behavior ${expected_behavior} when pointing to ${referenced_element_type} with reference target${test_name_suffix}`); } +function test_idl_setter(element_creation_method, test_name_suffix, referencing_element_type, referenced_element_type, attribute, reflected_property, expected_behavior) { + // There's nothing to test if the referencing element type doesn't have the reflecting + // property. + if (!(reflected_property in document.createElement(referencing_element_type))) { + return; + } + + test(function () { + const referencing_element = document.createElement(referencing_element_type); + document.body.appendChild(referencing_element); + const host_container = document.querySelector("#host-container"); + const host = element_creation_method(host_container, referenced_element_type); + + if (reflected_property === "ariaOwnsElements") { + // It's undetermined whether reference target should work with aria-owns or not; see + // https://github.com/WICG/webcomponents/issues/1091 and + // https://github.com/w3c/aria/issues/2266 + return; + } + + if (expected_behavior === Behavior.ReflectsHost) { + referencing_element[reflected_property] = host; + // For element reflecting properties, the IDL getter should return null when the explicitly + // set element has an invalid reference target. + assert_equals(referencing_element[reflected_property], null); + } else if (expected_behavior === Behavior.ReflectsHostReadOnly) { + referencing_element[reflected_property] = host; + // Setting a read-only property has no effect. + assert_equals(referencing_element[reflected_property], null); + } else if (expected_behavior === Behavior.ReflectsHostInArray) { + referencing_element[reflected_property] = [ host ]; + // For element reflecting properties, the IDL getter should not return explicitly set elements + // if they have an invalid reference target. + assert_array_equals(referencing_element[reflected_property], []); + } else if (expected_behavior === Behavior.IsNull) { + referencing_element[reflected_property] = host; + assert_equals(referencing_element[reflected_property], null); + } else if (expected_behavior === Behavior.ReflectsHostID) { + referencing_element[reflected_property] = "host-id"; + // Properties reflecting the host ID return the ID even if it points to an element with + // an invalid reference target. + assert_equals(referencing_element[reflected_property], "host-id"); + } else if (expected_behavior === Behavior.ReflectsHostIDInDOMTokenList) { + // Properties reflecting a DOMTokenList of IDs returns the IDs even if they point to an + // element with an invalid reference target. + referencing_element[reflected_property] = [ "host-id" ]; + assert_true(referencing_element[reflected_property] instanceof DOMTokenList); + assert_array_equals(Array.from(referencing_element[reflected_property]), [ "host-id" ]); + } + + // Set the reference target to a valid value. + host.shadowRoot.referenceTarget = host.shadowRoot.querySelector(referenced_element_type).id; + + if (expected_behavior === Behavior.ReflectsHost) { + // For element reflecting properties, if the reference target becomes valid for the explicitly + // set element, we should start returning that element. + assert_equals(referencing_element[reflected_property], host); + } else if (expected_behavior === Behavior.ReflectsHostReadOnly) { + assert_equals(referencing_element[reflected_property], null); + } else if (expected_behavior === Behavior.ReflectsHostInArray) { + // For element reflecting properties, if the reference target becomes valid for any of the + // explicitly set elements, we should start returning that element. + assert_array_equals(referencing_element[reflected_property], [host]); + } else if (expected_behavior === Behavior.IsNull) { + assert_equals(referencing_element[reflected_property], null); + } else if (expected_behavior === Behavior.ReflectsHostID) { + assert_equals(referencing_element[reflected_property], "host-id"); + } else if (expected_behavior === Behavior.ReflectsHostIDInDOMTokenList) { + assert_array_equals(Array.from(referencing_element[reflected_property]), [ "host-id" ]); + } + + referencing_element.remove(); + host_container.setHTMLUnsafe(""); + }, `${referencing_element_type}.${reflected_property} has IDL setter behavior ${expected_behavior} when pointing to ${referenced_element_type} with reference target${test_name_suffix}`); +} + function run_test_for_all_reflecting_properties(setup_function, test_function, test_name_suffix) { for(let referencing_element_type of element_types) { for(let referenced_element_type of element_types) { @@ -73,13 +150,13 @@ function run_test_for_all_reflecting_properties(setup_function, test_function, t const expected_form_property_behavior = (referenced_element_type == 'form' && referencing_element_type != "label" && referencing_element_type != "legend" && - referencing_element_type != "option") ? Behavior.ReflectsHost : Behavior.IsNull; - test_function(setup_function, test_name_suffix, referencing_element_type, referenced_element_type, "form", "form", expected_form_property_behavior); + referencing_element_type != "option") ? Behavior.ReflectsHostReadOnly : Behavior.IsNull; + test_function(setup_function, test_name_suffix, referencing_element_type, referenced_element_type, "form", "form", expected_form_property_behavior); - const expected_list_property_behavior = (referenced_element_type == 'datalist') ? Behavior.ReflectsHost : Behavior.IsNull; + const expected_list_property_behavior = (referenced_element_type == 'datalist') ? Behavior.ReflectsHostReadOnly : Behavior.IsNull; test_function(setup_function, test_name_suffix, referencing_element_type, referenced_element_type, "list", "list", expected_list_property_behavior); - const expected_control_property_behavior = HTML5_LABELABLE_ELEMENTS.includes(referenced_element_type) ? Behavior.ReflectsHost : Behavior.IsNull; + const expected_control_property_behavior = HTML5_LABELABLE_ELEMENTS.includes(referenced_element_type) ? Behavior.ReflectsHostReadOnly : Behavior.IsNull; test_function(setup_function, test_name_suffix, referencing_element_type, referenced_element_type, "for", "control", expected_control_property_behavior); } } diff --git a/Tests/LibWeb/Text/input/wpt-import/streams/resources/rs-test-templates.js b/Tests/LibWeb/Text/input/wpt-import/streams/resources/rs-test-templates.js index 25751c477f5..73ef0463768 100644 --- a/Tests/LibWeb/Text/input/wpt-import/streams/resources/rs-test-templates.js +++ b/Tests/LibWeb/Text/input/wpt-import/streams/resources/rs-test-templates.js @@ -200,7 +200,7 @@ self.templatedRSEmptyReader = (label, factory) => { test(() => { - const stream = factory().stream; + const { stream } = factory(); assert_true(stream.locked, 'locked getter should return true'); @@ -208,9 +208,9 @@ self.templatedRSEmptyReader = (label, factory) => { promise_test(t => { - const reader = factory().reader; + const { read } = factory(); - reader.read().then( + read().then( t.unreached_func('read() should not fulfill'), t.unreached_func('read() should not reject') ); @@ -221,14 +221,14 @@ self.templatedRSEmptyReader = (label, factory) => { promise_test(t => { - const reader = factory().reader; + const { read } = factory(); - reader.read().then( + read().then( t.unreached_func('read() should not fulfill'), t.unreached_func('read() should not reject') ); - reader.read().then( + read().then( t.unreached_func('read() should not fulfill'), t.unreached_func('read() should not reject') ); @@ -239,26 +239,24 @@ self.templatedRSEmptyReader = (label, factory) => { test(() => { - const reader = factory().reader; - assert_not_equals(reader.read(), reader.read(), 'the promises returned should be distinct'); + const { read } = factory(); + assert_not_equals(read(), read(), 'the promises returned should be distinct'); }, label + ': read() should return distinct promises each time'); test(() => { - const stream = factory().stream; + const { stream } = factory(); assert_throws_js(TypeError, () => stream.getReader(), 'stream.getReader() should throw a TypeError'); }, label + ': getReader() again on the stream should fail'); promise_test(async t => { - const streamAndReader = factory(); - const stream = streamAndReader.stream; - const reader = streamAndReader.reader; + const { stream, reader, read } = factory(); - const read1 = reader.read(); - const read2 = reader.read(); + const read1 = read(); + const read2 = read(); const closed = reader.closed; reader.releaseLock(); @@ -275,19 +273,19 @@ self.templatedRSEmptyReader = (label, factory) => { promise_test(t => { - const reader = factory().reader; + const { reader, read } = factory(); reader.releaseLock(); return Promise.all([ - promise_rejects_js(t, TypeError, reader.read()), - promise_rejects_js(t, TypeError, reader.read()) + promise_rejects_js(t, TypeError, read()), + promise_rejects_js(t, TypeError, read()) ]); }, label + ': releasing the lock should cause further read() calls to reject with a TypeError'); promise_test(t => { - const reader = factory().reader; + const { reader } = factory(); const closedBefore = reader.closed; reader.releaseLock(); @@ -301,9 +299,7 @@ self.templatedRSEmptyReader = (label, factory) => { test(() => { - const streamAndReader = factory(); - const stream = streamAndReader.stream; - const reader = streamAndReader.reader; + const { stream, reader } = factory(); reader.releaseLock(); assert_false(stream.locked, 'locked getter should return false'); @@ -312,10 +308,10 @@ self.templatedRSEmptyReader = (label, factory) => { promise_test(() => { - const reader = factory().reader; + const { reader, read } = factory(); reader.cancel(); - return reader.read().then(r => { + return read().then(r => { assert_object_equals(r, { value: undefined, done: true }, 'read()ing from the reader should give a done result'); }); @@ -323,7 +319,7 @@ self.templatedRSEmptyReader = (label, factory) => { promise_test(t => { - const stream = factory().stream; + const { stream } = factory(); return promise_rejects_js(t, TypeError, stream.cancel()); }, label + ': canceling via the stream should fail'); @@ -719,3 +715,62 @@ self.templatedRSTeeCancel = (label, factory) => { }, `${label}: erroring a teed stream should properly handle canceled branches`); }; + +self.templatedRSThrowAfterCloseOrError = (label, factory) => { + test(() => {}, 'Running templatedRSThrowAfterCloseOrError with ' + label); + + const theError = new Error('a unique string'); + + promise_test(async t => { + let controller; + const stream = factory({ + start: t.step_func((c) => { + controller = c; + }) + }); + + controller.close(); + + assert_throws_js(TypeError, () => controller.enqueue(new Uint8Array([1]))); + }, `${label}: enqueue() throws after close()`); + + promise_test(async t => { + let controller; + const stream = factory({ + start: t.step_func((c) => { + controller = c; + }) + }); + + controller.enqueue(new Uint8Array([1])); + controller.close(); + + assert_throws_js(TypeError, () => controller.enqueue(new Uint8Array([2]))); + }, `${label}: enqueue() throws after enqueue() and close()`); + + promise_test(async t => { + let controller; + const stream = factory({ + start: t.step_func((c) => { + controller = c; + }) + }); + + controller.error(theError); + + assert_throws_js(TypeError, () => controller.enqueue(new Uint8Array([1]))); + }, `${label}: enqueue() throws after error()`); + + promise_test(async t => { + let controller; + const stream = factory({ + start: t.step_func((c) => { + controller = c; + }) + }); + + controller.error(theError); + + assert_throws_js(TypeError, () => controller.close()); + }, `${label}: close() throws after error()`); +}; diff --git a/Tests/LibWeb/Text/input/wpt-import/streams/writable-streams/aborting.any.js b/Tests/LibWeb/Text/input/wpt-import/streams/writable-streams/aborting.any.js index 9171dbe158f..9d8e80b1de6 100644 --- a/Tests/LibWeb/Text/input/wpt-import/streams/writable-streams/aborting.any.js +++ b/Tests/LibWeb/Text/input/wpt-import/streams/writable-streams/aborting.any.js @@ -1472,6 +1472,8 @@ promise_test(async t => { promise_test(async t => { let ctrl; + let abortPromise; + let abortPromiseFromSignal; const e1 = SyntaxError(); const e2 = TypeError(); const ws = new WritableStream({ @@ -1479,9 +1481,87 @@ promise_test(async t => { }); const writer = ws.getWriter(); - ctrl.signal.addEventListener('abort', () => writer.abort(e2)); - writer.abort(e1); + ctrl.signal.addEventListener('abort', () => { + abortPromiseFromSignal = writer.abort(e2); + }); + abortPromise = writer.abort(e1); assert_true(ctrl.signal.aborted); - await promise_rejects_exactly(t, e2, writer.closed, 'closed'); -}, 'recursive abort() call'); + await Promise.all([ + abortPromise, + abortPromiseFromSignal, + promise_rejects_exactly(t, e2, writer.closed, 'closed') + ]); +}, 'recursive abort() call from abort() aborting signal (not started)'); + +promise_test(async t => { + let ctrl; + let abortPromise; + let abortPromiseFromSignal; + const e1 = SyntaxError(); + const e2 = TypeError(); + const ws = new WritableStream({ + start(c) { ctrl = c; }, + }); + await flushAsyncEvents(); // ensure stream is started + + const writer = ws.getWriter(); + ctrl.signal.addEventListener('abort', () => { + abortPromiseFromSignal = writer.abort(e2); + }); + abortPromise = writer.abort(e1); + assert_true(ctrl.signal.aborted); + + await Promise.all([ + abortPromise, + abortPromiseFromSignal, + promise_rejects_exactly(t, e2, writer.closed, 'closed') + ]); +}, 'recursive abort() call from abort() aborting signal'); + +promise_test(async t => { + let ctrl; + let abortPromise; + let closePromiseFromSignal; + const theError = SyntaxError(); + const ws = new WritableStream({ + start(c) { ctrl = c; }, + }); + + const writer = ws.getWriter(); + ctrl.signal.addEventListener('abort', () => { + closePromiseFromSignal = writer.close(); + }); + abortPromise = writer.abort(theError); + assert_true(ctrl.signal.aborted); + + await Promise.all([ + abortPromise, + promise_rejects_exactly(t, theError, closePromiseFromSignal, 'closed'), + promise_rejects_exactly(t, theError, writer.closed, 'closed') + ]); +}, 'recursive close() call from abort() aborting signal (not started)'); + +promise_test(async t => { + let ctrl; + let abortPromise; + let closePromiseFromSignal; + const theError = SyntaxError(); + const ws = new WritableStream({ + start(c) { ctrl = c; }, + }); + await flushAsyncEvents(); // ensure stream is started + + const writer = ws.getWriter(); + ctrl.signal.addEventListener('abort', () => { + closePromiseFromSignal = writer.close(); + }); + abortPromise = writer.abort(theError); + assert_true(ctrl.signal.aborted); + + await Promise.all([ + abortPromise, + closePromiseFromSignal, + writer.closed + ]); +}, 'recursive close() call from abort() aborting signal'); diff --git a/Tests/LibWeb/Text/input/wpt-import/url/url-setters-a-area.window.js b/Tests/LibWeb/Text/input/wpt-import/url/url-setters-a-area.window.js index 6a5e762cd42..0012595cc46 100644 --- a/Tests/LibWeb/Text/input/wpt-import/url/url-setters-a-area.window.js +++ b/Tests/LibWeb/Text/input/wpt-import/url/url-setters-a-area.window.js @@ -8,36 +8,37 @@ promise_test(() => fetch("resources/setters_tests.json").then(res => res.json()).then(runURLSettersTests), "Loading data…"); -function runURLSettersTests(all_test_cases) { - for (var attribute_to_be_set in all_test_cases) { - if (attribute_to_be_set == "comment") { +function runURLSettersTests(allTestCases) { + for (const [propertyToBeSet, testCases] of Object.entries(allTestCases)) { + if (propertyToBeSet === "comment") { continue; } - var test_cases = all_test_cases[attribute_to_be_set]; - for(var i = 0, l = test_cases.length; i < l; i++) { - var test_case = test_cases[i]; - var name = "Setting <" + test_case.href + ">." + attribute_to_be_set + - " = '" + test_case.new_value + "'"; - if ("comment" in test_case) { - name += " " + test_case.comment; - } - const key = test_case.href.split(":")[0]; - subsetTestByKey(key, test, function() { - var url = document.createElement("a"); - url.href = test_case.href; - url[attribute_to_be_set] = test_case.new_value; - for (var attribute in test_case.expected) { - assert_equals(url[attribute], test_case.expected[attribute]) + + for (const testCase of testCases) { + const name = `Setting <${testCase.href}>.${propertyToBeSet} = '${testCase.new_value}'${ + testCase.comment ? ` ${testCase.comment}` : '' + }`; + + const key = testCase.href.split(":")[0]; + subsetTestByKey(key, test, () => { + const url = document.createElement("a"); + url.href = testCase.href; + url[propertyToBeSet] = testCase.new_value; + + for (const [property, expectedValue] of Object.entries(testCase.expected)) { + assert_equals(url[property], expectedValue); } - }, ": " + name) - subsetTestByKey(key, test, function() { - var url = document.createElement("area"); - url.href = test_case.href; - url[attribute_to_be_set] = test_case.new_value; - for (var attribute in test_case.expected) { - assert_equals(url[attribute], test_case.expected[attribute]) + }, `: ${name}`); + + subsetTestByKey(key, test, () => { + const url = document.createElement("area"); + url.href = testCase.href; + url[propertyToBeSet] = testCase.new_value; + + for (const [property, expectedValue] of Object.entries(testCase.expected)) { + assert_equals(url[property], expectedValue); } - }, ": " + name) + }, `: ${name}`); } } } diff --git a/Tests/LibWeb/Text/input/wpt-import/url/url-setters.any.js b/Tests/LibWeb/Text/input/wpt-import/url/url-setters.any.js index fe88175ac63..66b3d9b4f9d 100644 --- a/Tests/LibWeb/Text/input/wpt-import/url/url-setters.any.js +++ b/Tests/LibWeb/Text/input/wpt-import/url/url-setters.any.js @@ -8,27 +8,26 @@ promise_test(() => fetch("resources/setters_tests.json").then(res => res.json()).then(runURLSettersTests), "Loading data…"); -function runURLSettersTests(all_test_cases) { - for (var attribute_to_be_set in all_test_cases) { - if (attribute_to_be_set == "comment") { +function runURLSettersTests(allTestCases) { + for (const [propertyToBeSet, testCases] of Object.entries(allTestCases)) { + if (propertyToBeSet === "comment") { continue; } - var test_cases = all_test_cases[attribute_to_be_set]; - for(var i = 0, l = test_cases.length; i < l; i++) { - var test_case = test_cases[i]; - var name = "Setting <" + test_case.href + ">." + attribute_to_be_set + - " = '" + test_case.new_value + "'"; - if ("comment" in test_case) { - name += " " + test_case.comment; - } + + for (const test_case of testCases) { + const name = `Setting <${test_case.href}>.${propertyToBeSet} = '${test_case.new_value}'${ + test_case.comment ? ` ${test_case.comment}` : '' + }`; + const key = test_case.href.split(":")[0]; - subsetTestByKey(key, test, function() { - var url = new URL(test_case.href); - url[attribute_to_be_set] = test_case.new_value; - for (var attribute in test_case.expected) { - assert_equals(url[attribute], test_case.expected[attribute]) + subsetTestByKey(key, test, () => { + const url = new URL(test_case.href); + url[propertyToBeSet] = test_case.new_value; + + for (const [property, expectedValue] of Object.entries(test_case.expected)) { + assert_equals(url[property], expectedValue); } - }, "URL: " + name) + }, `URL: ${name}`); } } } diff --git a/Tests/LibWeb/Text/input/wpt-import/webstorage/storage_local_setitem_quotaexceedederr.window.html b/Tests/LibWeb/Text/input/wpt-import/webstorage/storage_local_setitem_quotaexceedederr.window.html index f8050e7da1e..56e664eebd9 100644 --- a/Tests/LibWeb/Text/input/wpt-import/webstorage/storage_local_setitem_quotaexceedederr.window.html +++ b/Tests/LibWeb/Text/input/wpt-import/webstorage/storage_local_setitem_quotaexceedederr.window.html @@ -1,22 +1,8 @@ - - + - try { - while (true) { - index++; - localStorage.setItem("" + key + index, "" + val + index); - } - } catch (e) { - println(e); - } - - localStorage.clear(); - }); - +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/webstorage/storage_local_setitem_quotaexceedederr.window.js b/Tests/LibWeb/Text/input/wpt-import/webstorage/storage_local_setitem_quotaexceedederr.window.js new file mode 100644 index 00000000000..fff7d6444a0 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/webstorage/storage_local_setitem_quotaexceedederr.window.js @@ -0,0 +1,16 @@ +test(function() { + localStorage.clear(); + + var index = 0; + var key = "name"; + var val = "x".repeat(1024); + + assert_throws_dom("QUOTA_EXCEEDED_ERR", function() { + while (true) { + index++; + localStorage.setItem("" + key + index, "" + val + index); + } + }); + + localStorage.clear(); +}, "Throws QuotaExceededError when the quota has been exceeded"); diff --git a/Tests/LibWeb/Text/input/wpt-import/webstorage/storage_session_setitem_quotaexceedederr.window.html b/Tests/LibWeb/Text/input/wpt-import/webstorage/storage_session_setitem_quotaexceedederr.window.html index d220c9b99b5..ef2218d87f4 100644 --- a/Tests/LibWeb/Text/input/wpt-import/webstorage/storage_session_setitem_quotaexceedederr.window.html +++ b/Tests/LibWeb/Text/input/wpt-import/webstorage/storage_session_setitem_quotaexceedederr.window.html @@ -1,22 +1,8 @@ - - + - try { - while (true) { - index++; - sessionStorage.setItem("" + key + index, "" + val + index); - } - } catch (e) { - println(e); - } - - sessionStorage.clear(); - }); - +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/webstorage/storage_session_setitem_quotaexceedederr.window.js b/Tests/LibWeb/Text/input/wpt-import/webstorage/storage_session_setitem_quotaexceedederr.window.js new file mode 100644 index 00000000000..42a895470ef --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/webstorage/storage_session_setitem_quotaexceedederr.window.js @@ -0,0 +1,16 @@ +test(function() { + sessionStorage.clear(); + + var index = 0; + var key = "name"; + var val = "x".repeat(1024); + + assert_throws_dom("QUOTA_EXCEEDED_ERR", function() { + while (true) { + index++; + sessionStorage.setItem("" + key + index, "" + val + index); + } + }); + + sessionStorage.clear(); +}, "Throws QuotaExceededError when the quota has been exceeded");