From e17052a343e8bd6b2d1f261b94b47d196a8843df Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Tue, 19 Aug 2025 15:11:43 +0100 Subject: [PATCH] LibWeb/CSS: Implement CSSMathSum --- Libraries/LibWeb/CMakeLists.txt | 1 + Libraries/LibWeb/CSS/CSSMathSum.cpp | 140 ++++++++++++++++++ Libraries/LibWeb/CSS/CSSMathSum.h | 36 +++++ Libraries/LibWeb/CSS/CSSMathSum.idl | 9 ++ Libraries/LibWeb/Forward.h | 1 + Libraries/LibWeb/idl_files.cmake | 1 + .../Text/expected/all-window-properties.txt | 1 + .../cssPerspective.tentative.txt | 31 +++- .../cssRotate.tentative.txt | 33 ++++- .../cssScale.tentative.txt | 28 +++- .../cssSkew.tentative.txt | 36 ++++- .../cssSkewX.tentative.txt | 25 +++- .../cssSkewY.tentative.txt | 25 +++- .../cssTranslate.tentative.txt | 28 +++- .../add-two-types.tentative.txt | 5 +- .../numeric-objects/toSum.tentative.txt | 6 +- 16 files changed, 387 insertions(+), 19 deletions(-) create mode 100644 Libraries/LibWeb/CSS/CSSMathSum.cpp create mode 100644 Libraries/LibWeb/CSS/CSSMathSum.h create mode 100644 Libraries/LibWeb/CSS/CSSMathSum.idl diff --git a/Libraries/LibWeb/CMakeLists.txt b/Libraries/LibWeb/CMakeLists.txt index 1066a0f34d8..d84eaa89f03 100644 --- a/Libraries/LibWeb/CMakeLists.txt +++ b/Libraries/LibWeb/CMakeLists.txt @@ -116,6 +116,7 @@ set(SOURCES CSS/CSSLayerBlockRule.cpp CSS/CSSLayerStatementRule.cpp CSS/CSSMarginRule.cpp + CSS/CSSMathSum.cpp CSS/CSSMathValue.cpp CSS/CSSMediaRule.cpp CSS/CSSNamespaceRule.cpp diff --git a/Libraries/LibWeb/CSS/CSSMathSum.cpp b/Libraries/LibWeb/CSS/CSSMathSum.cpp new file mode 100644 index 00000000000..acfcfdf8d21 --- /dev/null +++ b/Libraries/LibWeb/CSS/CSSMathSum.cpp @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2025, Sam Atkins + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include "CSSMathSum.h" +#include +#include +#include +#include +#include + +namespace Web::CSS { + +GC_DEFINE_ALLOCATOR(CSSMathSum); + +GC::Ref CSSMathSum::create(JS::Realm& realm, NumericType type, GC::Ref values) +{ + return realm.create(realm, move(type), move(values)); +} + +// https://drafts.css-houdini.org/css-typed-om-1/#dom-cssmathsum-cssmathsum +WebIDL::ExceptionOr> CSSMathSum::construct_impl(JS::Realm& realm, Vector values) +{ + // The CSSMathSum(...args) constructor must, when called, perform the following steps: + + // 1. Replace each item of args with the result of rectifying a numberish value for the item. + GC::RootVector> converted_values { realm.heap() }; + converted_values.ensure_capacity(values.size()); + for (auto const& value : values) { + converted_values.append(rectify_a_numberish_value(realm, value)); + } + + // 2. If args is empty, throw a SyntaxError. + if (converted_values.is_empty()) + return WebIDL::SyntaxError::create(realm, "Cannot create an empty CSSMathSum"_utf16); + + // 3. Let type be the result of adding the types of all the items of args. If type is failure, throw a TypeError. + auto type = converted_values.first()->type(); + bool first = true; + for (auto const& value : converted_values) { + if (first) { + first = false; + continue; + } + if (auto added_types = type.added_to(value->type()); added_types.has_value()) { + type = added_types.release_value(); + } else { + return WebIDL::SimpleException { WebIDL::SimpleExceptionType::TypeError, "Cannot create a CSSMathSum with values of incompatible types"sv }; + } + } + + // 4. Return a new CSSMathSum whose values internal slot is set to args. + auto values_array = CSSNumericArray::create(realm, { converted_values }); + return CSSMathSum::create(realm, move(type), move(values_array)); +} + +CSSMathSum::CSSMathSum(JS::Realm& realm, NumericType type, GC::Ref values) + : CSSMathValue(realm, Bindings::CSSMathOperator::Sum, move(type)) + , m_values(move(values)) +{ +} + +CSSMathSum::~CSSMathSum() = default; + +void CSSMathSum::initialize(JS::Realm& realm) +{ + WEB_SET_PROTOTYPE_FOR_INTERFACE(CSSMathSum); + Base::initialize(realm); +} + +void CSSMathSum::visit_edges(Visitor& visitor) +{ + Base::visit_edges(visitor); + visitor.visit(m_values); +} + +// https://drafts.css-houdini.org/css-typed-om-1/#serialize-a-cssmathvalue +String CSSMathSum::serialize_math_value(Nested nested, Parens parens) const +{ + // NB: Only steps 1 and 3 apply here. + // 1. Let s initially be the empty string. + StringBuilder s; + + // 3. Otherwise, if this is a CSSMathSum: + { + // 1. If paren-less is true, continue to the next step; otherwise, if nested is true, append "(" to s; + // otherwise, append "calc(" to s. + if (parens == Parens::With) { + if (nested == Nested::Yes) { + s.append("("sv); + } else { + s.append("calc("sv); + } + } + + // 2. Serialize the first item in this’s values internal slot with nested set to true, and append the result + // to s. + s.append(m_values->values().first()->to_string({ .nested = true })); + + // 3. For each arg in this’s values internal slot beyond the first: + bool first = true; + for (auto const& arg : m_values->values()) { + if (first) { + first = false; + continue; + } + + // 1. If arg is a CSSMathNegate, append " - " to s, then serialize arg’s value internal slot with nested + // set to true, and append the result to s. + // FIXME: Detect CSSMathNegate once that's implemented. + if (false) { + s.append(" - "sv); + s.append(arg->to_string({ .nested = true })); + } + + // 2. Otherwise, append " + " to s, then serialize arg with nested set to true, and append the result to s. + else { + s.append(" + "sv); + s.append(arg->to_string({ .nested = true })); + } + } + + // 4. If paren-less is false, append ")" to s, + if (parens == Parens::With) + s.append(")"sv); + + // 5. Return s. + return s.to_string_without_validation(); + } +} + +// https://drafts.css-houdini.org/css-typed-om-1/#dom-cssmathsum-values +GC::Ref CSSMathSum::values() const +{ + return m_values; +} + +} diff --git a/Libraries/LibWeb/CSS/CSSMathSum.h b/Libraries/LibWeb/CSS/CSSMathSum.h new file mode 100644 index 00000000000..c28ebee9b6b --- /dev/null +++ b/Libraries/LibWeb/CSS/CSSMathSum.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2025, Sam Atkins + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include + +namespace Web::CSS { + +// https://drafts.css-houdini.org/css-typed-om-1/#cssmathsum +class CSSMathSum : public CSSMathValue { + WEB_PLATFORM_OBJECT(CSSMathSum, CSSMathValue); + GC_DECLARE_ALLOCATOR(CSSMathSum); + +public: + [[nodiscard]] static GC::Ref create(JS::Realm&, NumericType, GC::Ref); + static WebIDL::ExceptionOr> construct_impl(JS::Realm&, Vector); + + virtual ~CSSMathSum() override; + + virtual void initialize(JS::Realm&) override; + virtual void visit_edges(Visitor&) override; + + GC::Ref values() const; + + virtual String serialize_math_value(Nested, Parens) const override; + +private: + CSSMathSum(JS::Realm&, NumericType, GC::Ref); + GC::Ref m_values; +}; + +} diff --git a/Libraries/LibWeb/CSS/CSSMathSum.idl b/Libraries/LibWeb/CSS/CSSMathSum.idl new file mode 100644 index 00000000000..bd5dd26d5c7 --- /dev/null +++ b/Libraries/LibWeb/CSS/CSSMathSum.idl @@ -0,0 +1,9 @@ +#import +#import + +// https://drafts.css-houdini.org/css-typed-om-1/#cssmathsum +[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)] +interface CSSMathSum : CSSMathValue { + constructor(CSSNumberish... args); + readonly attribute CSSNumericArray values; +}; diff --git a/Libraries/LibWeb/Forward.h b/Libraries/LibWeb/Forward.h index 29656a81b79..9211d7a8e24 100644 --- a/Libraries/LibWeb/Forward.h +++ b/Libraries/LibWeb/Forward.h @@ -242,6 +242,7 @@ class CSSKeywordValue; class CSSLayerBlockRule; class CSSLayerStatementRule; class CSSMarginRule; +class CSSMathSum; class CSSMathValue; class CSSMediaRule; class CSSNamespaceRule; diff --git a/Libraries/LibWeb/idl_files.cmake b/Libraries/LibWeb/idl_files.cmake index 64884926e17..74dd5694722 100644 --- a/Libraries/LibWeb/idl_files.cmake +++ b/Libraries/LibWeb/idl_files.cmake @@ -36,6 +36,7 @@ libweb_js_bindings(CSS/CSSKeywordValue) libweb_js_bindings(CSS/CSSLayerBlockRule) libweb_js_bindings(CSS/CSSLayerStatementRule) libweb_js_bindings(CSS/CSSMarginRule) +libweb_js_bindings(CSS/CSSMathSum) libweb_js_bindings(CSS/CSSMathValue) libweb_js_bindings(CSS/CSSMediaRule) libweb_js_bindings(CSS/CSS NAMESPACE) diff --git a/Tests/LibWeb/Text/expected/all-window-properties.txt b/Tests/LibWeb/Text/expected/all-window-properties.txt index 822e53595f6..f5a64cd1b17 100644 --- a/Tests/LibWeb/Text/expected/all-window-properties.txt +++ b/Tests/LibWeb/Text/expected/all-window-properties.txt @@ -49,6 +49,7 @@ CSSKeywordValue CSSLayerBlockRule CSSLayerStatementRule CSSMarginRule +CSSMathSum CSSMathValue CSSMediaRule CSSNamespaceRule diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssPerspective.tentative.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssPerspective.tentative.txt index 6055c864758..0a4e2ebff6d 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssPerspective.tentative.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssPerspective.tentative.txt @@ -1,3 +1,30 @@ -Harness status: Error +Harness status: OK -Found 0 tests +Found 25 tests + +25 Fail +Fail Constructing a CSSPerspective with a keyword other than none (string) throws a TypeError +Fail Constructing a CSSPerspective with a keyword other than none (CSSKeywordValue) throws a TypeError +Fail Constructing a CSSPerspective with a double throws a TypeError +Fail Constructing a CSSPerspective with a unitless zero throws a TypeError +Fail Constructing a CSSPerspective with a string length throws a TypeError +Fail Constructing a CSSPerspective with a number CSSUnitValue throws a TypeError +Fail Constructing a CSSPerspective with a time dimension CSSUnitValue throws a TypeError +Fail Constructing a CSSPerspective with a CSSMathValue of angle type throws a TypeError +Fail Updating CSSPerspective.length with a keyword other than none (string) throws a TypeError +Fail Updating CSSPerspective.length with a keyword other than none (CSSKeywordValue) throws a TypeError +Fail Updating CSSPerspective.length with a double throws a TypeError +Fail Updating CSSPerspective.length with a unitless zero throws a TypeError +Fail Updating CSSPerspective.length with a string length throws a TypeError +Fail Updating CSSPerspective.length with a number CSSUnitValue throws a TypeError +Fail Updating CSSPerspective.length with a time dimension CSSUnitValue throws a TypeError +Fail Updating CSSPerspective.length with a CSSMathValue of angle type throws a TypeError +Fail CSSPerspective can be constructed from a length CSSUnitValue +Fail CSSPerspective.length can be updated to a length CSSUnitValue +Fail CSSPerspective can be constructed from a CSSMathValue of length type +Fail CSSPerspective.length can be updated to a CSSMathValue of length type +Fail CSSPerspective can be constructed from none (CSSKeywordValue) +Fail CSSPerspective.length can be updated to none (CSSKeywordValue) +Fail CSSPerspective can be constructed from none (string) +Fail CSSPerspective.length can be updated to none (string) +Fail Modifying CSSPerspective.is2D is a no-op \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssRotate.tentative.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssRotate.tentative.txt index 6055c864758..71a9cbb44a0 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssRotate.tentative.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssRotate.tentative.txt @@ -1,3 +1,32 @@ -Harness status: Error +Harness status: OK -Found 0 tests +Found 27 tests + +27 Fail +Fail Constructing a CSSRotate with a CSSUnitValue with type other than angle for the angle throws a TypeError +Fail Constructing a CSSRotate with a CSSMathValue that doesn't match for the angle throws a TypeError +Fail Constructing a CSSRotate with a CSSUnitValue with type other than number for the coordinates throws a TypeError +Fail Constructing a CSSRotate with a CSSMathValue that doesn't match for the coordinates throws a TypeError +Fail Updating CSSRotate.x to a CSSUnitValue with type other than number throws a TypeError +Fail Updating CSSRotate.x to a CSSMathValue that doesn't match throws a TypeError +Fail Updating CSSRotate.y to a CSSUnitValue with type other than number throws a TypeError +Fail Updating CSSRotate.y to a CSSMathValue that doesn't match throws a TypeError +Fail Updating CSSRotate.z to a CSSUnitValue with type other than number throws a TypeError +Fail Updating CSSRotate.z to a CSSMathValue that doesn't match throws a TypeError +Fail Updating CSSRotate.angle to a CSSUnitValue with type other than angle throws a TypeError +Fail Updating CSSRotate.angle to a CSSMathValue that doesn't match throws a TypeError +Fail CSSRotate can be constructed from a single angle +Fail CSSRotate can be constructed from numberish coordinates +Fail CSSRotate can be constructed from CSSMathValues +Fail CSSRotate.x can be updated to a double +Fail CSSRotate.x can be updated to a number CSSUnitValue +Fail CSSRotate.x can be updated to a CSSMathValue matching +Fail CSSRotate.y can be updated to a double +Fail CSSRotate.y can be updated to a number CSSUnitValue +Fail CSSRotate.y can be updated to a CSSMathValue matching +Fail CSSRotate.z can be updated to a double +Fail CSSRotate.z can be updated to a number CSSUnitValue +Fail CSSRotate.z can be updated to a CSSMathValue matching +Fail CSSRotate.angle can be updated to a degree CSSUnitValue +Fail CSSRotate.angle can be updated to a CSSMathValue matching +Fail Modifying CSSRotate.is2D can be updated to true or false \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssScale.tentative.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssScale.tentative.txt index 6055c864758..6d58c973596 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssScale.tentative.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssScale.tentative.txt @@ -1,3 +1,27 @@ -Harness status: Error +Harness status: OK -Found 0 tests +Found 22 tests + +22 Fail +Fail Constructing a CSSScale with an angle CSSUnitValue for the coordinates throws a TypeError +Fail Constructing a CSSScale with a CSSMathValue that doesn't match for the coordinates throws a TypeError +Fail Updating CSSScale.x to an angle CSSUnitValue throws a TypeError +Fail Updating CSSScale.x to a CSSMathValue that doesn't match throws a TypeError +Fail Updating CSSScale.y to an angle CSSUnitValue throws a TypeError +Fail Updating CSSScale.y to a CSSMathValue that doesn't match throws a TypeError +Fail Updating CSSScale.z to an angle CSSUnitValue throws a TypeError +Fail Updating CSSScale.z to a CSSMathValue that doesn't match throws a TypeError +Fail CSSScale can be constructed from two number coordinates +Fail CSSScale can be constructed from three number coordinates +Fail CSSScale can be constructed from CSSMathValue coordinates +Fail CSSScale can be constructed from unit canceling length value coordinates +Fail CSSScale.x can be updated to a number +Fail CSSScale.x can be updated to a numberish +Fail CSSScale.x can be updated to a CSSMathValue +Fail CSSScale.y can be updated to a number +Fail CSSScale.y can be updated to a numberish +Fail CSSScale.y can be updated to a CSSMathValue +Fail CSSScale.z can be updated to a number +Fail CSSScale.z can be updated to a numberish +Fail CSSScale.z can be updated to a CSSMathValue +Fail Modifying CSSScale.is2D can be updated to true or false \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssSkew.tentative.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssSkew.tentative.txt index 6055c864758..f21e86e899c 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssSkew.tentative.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssSkew.tentative.txt @@ -1,3 +1,35 @@ -Harness status: Error +Harness status: OK -Found 0 tests +Found 30 tests + +30 Fail +Fail Constructing a CSSSkew with a keyword throws a TypeError +Fail Constructing a CSSSkew with a double throws a TypeError +Fail Constructing a CSSSkew with a unitless zero throws a TypeError +Fail Constructing a CSSSkew with a string angle throws a TypeError +Fail Constructing a CSSSkew with a number CSSUnitValue throws a TypeError +Fail Constructing a CSSSkew with a time dimension CSSUnitValue throws a TypeError +Fail Constructing a CSSSkew with a CSSMathValue of length type throws a TypeError +Fail Updating CSSSkew.ax with a keyword throws a TypeError +Fail Updating CSSSkew.ax with a double throws a TypeError +Fail Updating CSSSkew.ax with a unitless zero throws a TypeError +Fail Updating CSSSkew.ax with a string angle throws a TypeError +Fail Updating CSSSkew.ax with a number CSSUnitValue throws a TypeError +Fail Updating CSSSkew.ax with a time dimension CSSUnitValue throws a TypeError +Fail Updating CSSSkew.ax with a CSSMathValue of length type throws a TypeError +Fail Updating CSSSkew.ay with a keyword throws a TypeError +Fail Updating CSSSkew.ay with a double throws a TypeError +Fail Updating CSSSkew.ay with a unitless zero throws a TypeError +Fail Updating CSSSkew.ay with a string angle throws a TypeError +Fail Updating CSSSkew.ay with a number CSSUnitValue throws a TypeError +Fail Updating CSSSkew.ay with a time dimension CSSUnitValue throws a TypeError +Fail Updating CSSSkew.ay with a CSSMathValue of length type throws a TypeError +Fail CSSSkew can be constructed from an angle CSSUnitValue and an angle CSSUnitValue +Fail CSSSkew can be constructed from an angle CSSUnitValue and a CSSMathValue of angle type +Fail CSSSkew can be constructed from a CSSMathValue of angle type and an angle CSSUnitValue +Fail CSSSkew can be constructed from a CSSMathValue of angle type and a CSSMathValue of angle type +Fail CSSSkew.ax can be updated to an angle CSSUnitValue +Fail CSSSkew.ax can be updated to a CSSMathValue of angle type +Fail CSSSkew.ay can be updated to an angle CSSUnitValue +Fail CSSSkew.ay can be updated to a CSSMathValue of angle type +Fail Modifying CSSSkew.is2D is a no-op \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssSkewX.tentative.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssSkewX.tentative.txt index 6055c864758..cd0725102ae 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssSkewX.tentative.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssSkewX.tentative.txt @@ -1,3 +1,24 @@ -Harness status: Error +Harness status: OK -Found 0 tests +Found 19 tests + +19 Fail +Fail Constructing a CSSSkewX with a keyword throws a TypeError +Fail Constructing a CSSSkewX with a double throws a TypeError +Fail Constructing a CSSSkewX with a unitless zero throws a TypeError +Fail Constructing a CSSSkewX with a string angle throws a TypeError +Fail Constructing a CSSSkewX with a number CSSUnitValue throws a TypeError +Fail Constructing a CSSSkewX with a time dimension CSSUnitValue throws a TypeError +Fail Constructing a CSSSkewX with a CSSMathValue of length type throws a TypeError +Fail Updating CSSSkewX.ax with a keyword throws a TypeError +Fail Updating CSSSkewX.ax with a double throws a TypeError +Fail Updating CSSSkewX.ax with a unitless zero throws a TypeError +Fail Updating CSSSkewX.ax with a string angle throws a TypeError +Fail Updating CSSSkewX.ax with a number CSSUnitValue throws a TypeError +Fail Updating CSSSkewX.ax with a time dimension CSSUnitValue throws a TypeError +Fail Updating CSSSkewX.ax with a CSSMathValue of length type throws a TypeError +Fail CSSSkewX can be constructed from an angle CSSUnitValue +Fail CSSSkewX can be constructed from a CSSMathValue of angle type +Fail CSSSkew.ax can be updated to an angle CSSUnitValue +Fail CSSSkew.ax can be updated to a CSSMathValue of angle type +Fail Modifying skewX.is2D is a no-op \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssSkewY.tentative.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssSkewY.tentative.txt index 6055c864758..1c0b11716e6 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssSkewY.tentative.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssSkewY.tentative.txt @@ -1,3 +1,24 @@ -Harness status: Error +Harness status: OK -Found 0 tests +Found 19 tests + +19 Fail +Fail Constructing a CSSSkewY with a keyword throws a TypeError +Fail Constructing a CSSSkewY with a double throws a TypeError +Fail Constructing a CSSSkewY with a unitless zero throws a TypeError +Fail Constructing a CSSSkewY with a string angle throws a TypeError +Fail Constructing a CSSSkewY with a number CSSUnitValue throws a TypeError +Fail Constructing a CSSSkewY with a time dimension CSSUnitValue throws a TypeError +Fail Constructing a CSSSkewY with a CSSMathValue of length type throws a TypeError +Fail Updating CSSSkewY.ay with a keyword throws a TypeError +Fail Updating CSSSkewY.ay with a double throws a TypeError +Fail Updating CSSSkewY.ay with a unitless zero throws a TypeError +Fail Updating CSSSkewY.ay with a string angle throws a TypeError +Fail Updating CSSSkewY.ay with a number CSSUnitValue throws a TypeError +Fail Updating CSSSkewY.ay with a time dimension CSSUnitValue throws a TypeError +Fail Updating CSSSkewY.ay with a CSSMathValue of length type throws a TypeError +Fail CSSSkewY can be constructed from an angle CSSUnitValue +Fail CSSSkewY can be constructed from a CSSMathValue of angle type +Fail CSSSkewY.ay can be updated to an angle CSSUnitValue +Fail CSSSkewY.ay can be updated to a CSSMathValue of angle type +Fail Modifying skewY.is2D is a no-op \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssTranslate.tentative.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssTranslate.tentative.txt index 6055c864758..fd3815eb55e 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssTranslate.tentative.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/cssTranslate.tentative.txt @@ -1,3 +1,27 @@ -Harness status: Error +Harness status: OK -Found 0 tests +Found 22 tests + +22 Fail +Fail Constructing a CSSTranslate with a CSSUnitValue with type other than length or percent for the coordinates throws a TypeError +Fail Constructing a CSSTranslate with a CSSMathValue that doesn't match for the coordinates throws a TypeError +Fail Constructing a CSSTranslate with a percent for the Z coordinate throws a TypeError +Fail Updating CSSTranslate.x to a CSSUnitValue with type other than length or percent throws a TypeError +Fail Updating CSSTranslate.x to a CSSMathValue that doesn't match throws a TypeError +Fail Updating CSSTranslate.y to a CSSUnitValue with type other than length or percent throws a TypeError +Fail Updating CSSTranslate.y to a CSSMathValue that doesn't match throws a TypeError +Fail Updating CSSTranslate.z to a CSSUnitValue with type other than length or percent throws a TypeError +Fail Updating CSSTranslate.z to a CSSMathValue that doesn't match throws a TypeError +Fail Updating CSSTranslate.z to a percent throws a TypeError +Fail CSSTranslate can be constructed from two length or percent coordinates +Fail CSSTranslate can be constructed from three length or percent coordinates +Fail CSSTranslate can be constructed from CSSMathValues +Fail CSSTranslate.x can be updated to a length +Fail CSSTranslate.x can be updated to a percent +Fail CSSTranslate.x can be updated to a CSSMathValue +Fail CSSTranslate.y can be updated to a length +Fail CSSTranslate.y can be updated to a percent +Fail CSSTranslate.y can be updated to a CSSMathValue +Fail CSSTranslate.z can be updated to a length +Fail CSSTranslate.z can be updated to a CSSMathValue +Fail Modifying CSSTranslate.is2D can be updated to true or false \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/numeric-objects/add-two-types.tentative.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/numeric-objects/add-two-types.tentative.txt index 3dedb2fccac..119da19ff27 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/numeric-objects/add-two-types.tentative.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/numeric-objects/add-two-types.tentative.txt @@ -2,8 +2,9 @@ Harness status: OK Found 7 tests -7 Fail -Fail Adding two types with different non-null percent hints throws TypeError +1 Pass +6 Fail +Pass Adding two types with different non-null percent hints throws TypeError Fail Adding two types with the same nonzero values returns same type Fail Adding two types with empty maps with returns empty map Fail Adding a type with percent returns type with percent hint diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/numeric-objects/toSum.tentative.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/numeric-objects/toSum.tentative.txt index 0c3518be965..5e5a8387bcd 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/numeric-objects/toSum.tentative.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-subclasses/numeric-objects/toSum.tentative.txt @@ -2,14 +2,14 @@ Harness status: OK Found 11 tests -2 Pass -9 Fail +3 Pass +8 Fail Fail Converting a CSSNumericValue to a sum with invalid units throws SyntaxError Fail Converting a CSSNumericValue with an invalid sum value to a sum throws TypeError Fail Converting a CSSNumericValue with compound units to a sum throws TypeError Pass Converting a CSSNumericValue to a sum with an incompatible unit throws TypeError Pass Converting a CSSNumericValue to a sum with units that are not addable throws TypeError -Fail Converting a CSSNumericValue with leftover units to a sum throws TypeError +Pass Converting a CSSNumericValue with leftover units to a sum throws TypeError Fail Converting CSSNumericValue to a sum with its own unit returns itself Fail Converting CSSNumericValue to a sum with no arguments returns all the units in sorted order Fail Converting CSSNumericValue to a sum with a relative unit converts correctly