diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/color.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/color.txt new file mode 100644 index 00000000000..6055c864758 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/color.txt @@ -0,0 +1,3 @@ +Harness status: Error + +Found 0 tests diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/cursor.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/cursor.txt new file mode 100644 index 00000000000..6055c864758 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/cursor.txt @@ -0,0 +1,3 @@ +Harness status: Error + +Found 0 tests diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/display.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/display.txt new file mode 100644 index 00000000000..6055c864758 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/display.txt @@ -0,0 +1,3 @@ +Harness status: Error + +Found 0 tests diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/font.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/font.txt new file mode 100644 index 00000000000..6055c864758 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/font.txt @@ -0,0 +1,3 @@ +Harness status: Error + +Found 0 tests diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/padding.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/padding.txt new file mode 100644 index 00000000000..6055c864758 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/padding.txt @@ -0,0 +1,3 @@ +Harness status: Error + +Found 0 tests diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/transform.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/transform.txt new file mode 100644 index 00000000000..6055c864758 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/transform.txt @@ -0,0 +1,3 @@ +Harness status: Error + +Found 0 tests diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/width.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/width.txt new file mode 100644 index 00000000000..6055c864758 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/width.txt @@ -0,0 +1,3 @@ +Harness status: Error + +Found 0 tests diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-typed-om/the-stylepropertymap/properties/color.html b/Tests/LibWeb/Text/input/wpt-import/css/css-typed-om/the-stylepropertymap/properties/color.html new file mode 100644 index 00000000000..6bd119a61bb --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-typed-om/the-stylepropertymap/properties/color.html @@ -0,0 +1,30 @@ + + +'color' property + + + + + + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-typed-om/the-stylepropertymap/properties/cursor.html b/Tests/LibWeb/Text/input/wpt-import/css/css-typed-om/the-stylepropertymap/properties/cursor.html new file mode 100644 index 00000000000..43e826044c0 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-typed-om/the-stylepropertymap/properties/cursor.html @@ -0,0 +1,59 @@ + + +'cursor' property + + + + + + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-typed-om/the-stylepropertymap/properties/display.html b/Tests/LibWeb/Text/input/wpt-import/css/css-typed-om/the-stylepropertymap/properties/display.html new file mode 100644 index 00000000000..e9a6609c584 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-typed-om/the-stylepropertymap/properties/display.html @@ -0,0 +1,59 @@ + + +'display' property + + + + + + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-typed-om/the-stylepropertymap/properties/font.html b/Tests/LibWeb/Text/input/wpt-import/css/css-typed-om/the-stylepropertymap/properties/font.html new file mode 100644 index 00000000000..26b134e714d --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-typed-om/the-stylepropertymap/properties/font.html @@ -0,0 +1,24 @@ + + +'font' property + + + + + + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-typed-om/the-stylepropertymap/properties/padding.html b/Tests/LibWeb/Text/input/wpt-import/css/css-typed-om/the-stylepropertymap/properties/padding.html new file mode 100644 index 00000000000..3e57231e6e2 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-typed-om/the-stylepropertymap/properties/padding.html @@ -0,0 +1,39 @@ + + +padding properties + + + + + + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-typed-om/the-stylepropertymap/properties/resources/testsuite.js b/Tests/LibWeb/Text/input/wpt-import/css/css-typed-om/the-stylepropertymap/properties/resources/testsuite.js new file mode 100644 index 00000000000..cecd72ad927 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-typed-om/the-stylepropertymap/properties/resources/testsuite.js @@ -0,0 +1,485 @@ +function assert_is_unit(unit, result) { + assert_class_string(result, 'CSSUnitValue', + 'relative lengths must compute to a CSSUnitValue'); + assert_equals(result.unit, unit, 'unit'); +} + +function assert_is_calc_sum(result) { + assert_class_string(result, 'CSSMathSum', + 'specified calc must be a CSSMathSum'); +} + +function assert_is_equal_with_range_handling(input, result) { + if (input instanceof CSSUnitValue && input.value < 0) + assert_style_value_equals(result, new CSSMathSum(input)); + else + assert_style_value_equals(result, input); +} + +function assert_is_unsupported(result) { + assert_class_string(result, 'CSSStyleValue'); +} + +const gCssWideKeywordsExamples = [ + { + description: 'initial keyword', + input: new CSSKeywordValue('initial') + }, + { + description: 'inherit keyword', + input: new CSSKeywordValue('inherit') + }, + { + description: 'unset keyword', + input: new CSSKeywordValue('unset') + }, + { + description: 'revert keyword', + input: new CSSKeywordValue('revert') + }, +]; + +const gVarReferenceExamples = [ + { + description: 'a var() reference', + input: new CSSUnparsedValue([' ', new CSSVariableReferenceValue('--A')]) + }, +]; + +const gTestSyntaxExamples = { + '': { + description: 'a length', + examples: [ + { + description: "zero px", + input: new CSSUnitValue(0, 'px') + }, + { + description: "a negative em", + input: new CSSUnitValue(-3.14, 'em'), + // 'ems' are relative units, so just check that it computes to px + defaultComputed: (_, result) => assert_is_unit('px', result) + }, + { + description: "a positive cm", + input: new CSSUnitValue(3.14, 'cm'), + // 'cms' are relative units, so just check that it computes to px + defaultComputed: (_, result) => assert_is_unit('px', result) + }, + { + description: "a calc length", + input: new CSSMathSum(new CSSUnitValue(0, 'px'), new CSSUnitValue(0, 'em')), + // Specified/computed calcs are usually simplified. + // FIXME: Test this properly + defaultSpecified: (_, result) => assert_is_calc_sum(result), + defaultComputed: (_, result) => assert_is_unit('px', result) + } + ], + }, + '': { + description: 'a percent', + examples: [ + { + description: "zero percent", + input: new CSSUnitValue(0, 'percent') + }, + { + description: "a negative percent", + input: new CSSUnitValue(-3.14, 'percent') + }, + { + description: "a positive percent", + input: new CSSUnitValue(3.14, 'percent') + }, + { + description: "a calc percent", + input: new CSSMathSum(new CSSUnitValue(0, 'percent'), new CSSUnitValue(0, 'percent')), + // Specified/computed calcs are usually simplified. + // FIXME: Test this properly + defaultSpecified: (_, result) => assert_is_calc_sum(result), + defaultComputed: (_, result) => assert_is_unit('percent', result) + } + ], + }, + '