diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-properties-values-api/register-property.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-properties-values-api/register-property.txt new file mode 100644 index 00000000000..69780d07f11 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-properties-values-api/register-property.txt @@ -0,0 +1,12 @@ +Harness status: OK + +Found 6 tests + +5 Pass +1 Fail +Pass registerProperty requires a Dictionary type +Pass registerProperty requires a name matching +Pass registerProperty only allows omitting initialValue if syntax is '*' +Pass registerProperty fails for an already registered property +Pass registerProperty requires inherits +Fail Registering a property should not cause a transition \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-properties-values-api/registered-properties-inheritance.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-properties-values-api/registered-properties-inheritance.txt new file mode 100644 index 00000000000..f70044cb3fa --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-properties-values-api/registered-properties-inheritance.txt @@ -0,0 +1,14 @@ +Harness status: OK + +Found 8 tests + +2 Pass +6 Fail +Fail Registered properties are correctly inherited (or not) depending on the inherits flag. +Fail Explicitly inheriting from a parent with an invalid value results in initial value. +Pass Explicitly inheriting from a parent with no value results in initial value. +Pass Explicitly inheriting from a parent with a value results in that value. +Fail Reference to undefined variable results in inherited value +Fail Reference to syntax-incompatible variable results in inherited value +Fail Font-relative units are absolutized before before inheritance +Fail Calc expressions are resolved before inheritance \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-properties-values-api/var-reference-registered-properties-cycles.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-properties-values-api/var-reference-registered-properties-cycles.txt new file mode 100644 index 00000000000..be6e21ce8ca --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-properties-values-api/var-reference-registered-properties-cycles.txt @@ -0,0 +1,11 @@ +Harness status: OK + +Found 5 tests + +2 Pass +3 Fail +Fail A var() cycle between two registered properties is handled correctly. +Fail A var() cycle between a registered properties and an unregistered property is handled correctly. +Fail A var() cycle between a two unregistered properties is handled correctly. +Pass A var() cycle between a syntax:'*' property and an unregistered property is handled correctly. +Pass Custom properties with universal syntax become guaranteed-invalid when invalid at computed-value time \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-properties-values-api/var-reference-registered-properties.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-properties-values-api/var-reference-registered-properties.txt new file mode 100644 index 00000000000..75525888187 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-properties-values-api/var-reference-registered-properties.txt @@ -0,0 +1,22 @@ +Harness status: OK + +Found 16 tests + +7 Pass +9 Fail +Fail var() references work with registered properties +Fail References to registered var()-properties work in registered lists +Fail References to mixed registered and unregistered var()-properties work in registered lists +Fail Registered lists may be concatenated +Fail Font-relative units are absolutized when substituting +Fail Calc expressions are resolved when substituting +Fail Lists with relative units are absolutized when substituting +Fail Values are absolutized when substituting into properties with universal syntax +Fail Invalid values for registered properties are serialized as the empty string +Pass Valid fallback does not invalidate var()-reference [, 10px] +Pass Valid fallback does not invalidate var()-reference [ | , red] +Pass Valid fallback does not invalidate var()-reference [ | none, none] +Pass Invalid fallback doesn't invalidate var()-reference [, red] +Pass Invalid fallback doesn't invalidate var()-reference [ | none, nolength] +Pass Invalid fallback doesn't invalidate var()-reference [, var(--novar)] +Pass Empty universal custom property can be substituted with var() \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-properties-values-api/register-property.html b/Tests/LibWeb/Text/input/wpt-import/css/css-properties-values-api/register-property.html new file mode 100644 index 00000000000..b734a2c4bea --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-properties-values-api/register-property.html @@ -0,0 +1,75 @@ + + + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-properties-values-api/registered-properties-inheritance.html b/Tests/LibWeb/Text/input/wpt-import/css/css-properties-values-api/registered-properties-inheritance.html new file mode 100644 index 00000000000..2b3a86941b7 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-properties-values-api/registered-properties-inheritance.html @@ -0,0 +1,96 @@ + + + + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-properties-values-api/resources/utils.js b/Tests/LibWeb/Text/input/wpt-import/css/css-properties-values-api/resources/utils.js new file mode 100644 index 00000000000..b850e61fc72 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-properties-values-api/resources/utils.js @@ -0,0 +1,261 @@ +let next_property_id = 1; + +// Generate a unique property name on the form --prop-N. +function generate_name() { + return `--prop-${next_property_id++}`; +} + +// Produce a compatible initial value for the specified syntax. +function any_initial_value(syntax) { + let components = syntax.split('|').map(x => x.trim()) + let first_component = components[0]; + + if (first_component.endsWith('+') || first_component.endsWith('#')) + first_component = first_component.slice(0, -1); + + switch (first_component) { + case '*': + case '': + return 'NULL'; + case '': + return '0deg'; + case '': + return 'rgb(0, 0, 0)'; + case '': + case '': + return 'url(0)'; + case '': + case '': + case '': + case '': + return '0'; + case '': + return '0%'; + case '': + return '0dpi'; + case '