Skip to content

Truly independent web browser

LibWeb: Expose computed shorthand values through Typed OM

Andreas Kling5bb10a8c6b37
diff --git a/Libraries/LibWeb/CSS/CSSStyleValue.cpp b/Libraries/LibWeb/CSS/CSSStyleValue.cpp
index a2331439f90..cd7cad32bd8 100644
--- a/Libraries/LibWeb/CSS/CSSStyleValue.cpp
+++ b/Libraries/LibWeb/CSS/CSSStyleValue.cpp
@@ -16,9 +16,9 @@ namespace Web::CSS {
GC_DEFINE_ALLOCATOR(CSSStyleValue);
-GC::Ref<CSSStyleValue> CSSStyleValue::create(Utf16FlyString associated_property, StyleValue const& source_value)
+GC::Ref<CSSStyleValue> CSSStyleValue::create(Utf16FlyString associated_property, StyleValue const& source_value, SerializationMode serialization_mode)
{
- return GC::Heap::the().allocate<CSSStyleValue>(move(associated_property), source_value);
+ return GC::Heap::the().allocate<CSSStyleValue>(move(associated_property), source_value, serialization_mode);
}
CSSStyleValue::CSSStyleValue()
@@ -30,9 +30,10 @@ CSSStyleValue::CSSStyleValue(StyleValue const& source_value)
{
}
-CSSStyleValue::CSSStyleValue(Utf16FlyString associated_property, StyleValue const& source_value)
+CSSStyleValue::CSSStyleValue(Utf16FlyString associated_property, StyleValue const& source_value, SerializationMode serialization_mode)
: m_associated_property(move(associated_property))
, m_source_value(RustStyleValueHandle::retained(source_value.rust_style_value_data()))
+ , m_serialization_mode(serialization_mode)
{
}
@@ -117,7 +118,7 @@ WebIDL::ExceptionOr<Utf16String> CSSStyleValue::to_string() const
// FIXME: otherwise, if the value was extracted from the CSSOM
// NB: For CSSStyleValue itself, we use the source value we were created from.
if (auto source_value = source_style_value())
- return source_value->to_utf16_string(SerializationMode::Normal);
+ return source_value->to_utf16_string(m_serialization_mode);
{
// the serialization is specified in §6.7 Serialization from CSSOM Values below.
}
diff --git a/Libraries/LibWeb/CSS/CSSStyleValue.h b/Libraries/LibWeb/CSS/CSSStyleValue.h
index f9b996988c9..d91c47ac574 100644
--- a/Libraries/LibWeb/CSS/CSSStyleValue.h
+++ b/Libraries/LibWeb/CSS/CSSStyleValue.h
@@ -10,6 +10,7 @@
#include <AK/Utf16String.h>
#include <AK/Utf16View.h>
#include <LibWeb/Bindings/Wrappable.h>
+#include <LibWeb/CSS/SerializationMode.h>
#include <LibWeb/CSS/StyleValues/RustStyleValueHandle.h>
namespace Web::CSS {
@@ -20,7 +21,7 @@ class CSSStyleValue : public Bindings::GCAllocatedWrappable {
GC_DECLARE_ALLOCATOR(CSSStyleValue);
public:
- [[nodiscard]] static GC::Ref<CSSStyleValue> create(Utf16FlyString associated_property, StyleValue const&);
+ [[nodiscard]] static GC::Ref<CSSStyleValue> create(Utf16FlyString associated_property, StyleValue const&, SerializationMode = SerializationMode::Normal);
virtual ~CSSStyleValue() override;
@@ -53,13 +54,14 @@ protected:
RefPtr<StyleValue const> source_style_value() const;
private:
- explicit CSSStyleValue(Utf16FlyString associated_property, StyleValue const& source_value);
+ explicit CSSStyleValue(Utf16FlyString associated_property, StyleValue const& source_value, SerializationMode);
// https://drafts.css-houdini.org/css-typed-om-1/#dom-cssstylevalue-associatedproperty-slot
Optional<Utf16FlyString> m_associated_property;
// Shared handle to the Rust-owned value data this object was reified from.
RustStyleValueHandle m_source_value;
+ SerializationMode m_serialization_mode { SerializationMode::Normal };
};
}
diff --git a/Libraries/LibWeb/CSS/StylePropertyMapReadOnly.cpp b/Libraries/LibWeb/CSS/StylePropertyMapReadOnly.cpp
index 960cb20cd51..9a1d42681a5 100644
--- a/Libraries/LibWeb/CSS/StylePropertyMapReadOnly.cpp
+++ b/Libraries/LibWeb/CSS/StylePropertyMapReadOnly.cpp
@@ -16,6 +16,7 @@
#include <LibWeb/CSS/PropertyID.h>
#include <LibWeb/CSS/PropertyNameAndID.h>
#include <LibWeb/CSS/StyleSheetState.h>
+#include <LibWeb/CSS/StyleValues/ShorthandStyleValue.h>
#include <LibWeb/CSS/StyleValues/StyleValueList.h>
#include <LibWeb/CSS/Zoom.h>
#include <LibWeb/DOM/Document.h>
@@ -94,6 +95,8 @@ WebIDL::ExceptionOr<Variant<GC::Ref<CSSStyleValue>, Empty>> StylePropertyMapRead
// 4. If props[property] exists, subdivide into iterations props[property], then reify the first item of the result and return it.
if (auto property_value = get_style_value(props, property.value())) {
+ if (props.has<DOM::AbstractElement>() && property_is_shorthand(property->id()))
+ return CSSStyleValue::create(property->name(), *property_value, SerializationMode::ResolvedValue);
auto iterations = subdivide_property_value(*property_value, property.value(), props.get_pointer<DOM::AbstractElement>());
return reify_property_value(*iterations.first(), property.value(), props.has<DOM::AbstractElement>());
}
@@ -121,6 +124,10 @@ WebIDL::ExceptionOr<GC::RootVector<GC::Ref<CSSStyleValue>>> StylePropertyMapRead
// 4. If props[property] exists, subdivide into iterations props[property], then reify each item of the result, and return the list.
if (auto property_value = get_style_value(props, property.value())) {
+ if (props.has<DOM::AbstractElement>() && property_is_shorthand(property->id())) {
+ results.append(CSSStyleValue::create(property->name(), *property_value, SerializationMode::ResolvedValue));
+ return results;
+ }
auto iterations = subdivide_property_value(*property_value, property.value(), props.get_pointer<DOM::AbstractElement>());
for (auto const& style_value : iterations)
results.append(reify_property_value(*style_value, property.value(), props.has<DOM::AbstractElement>()));
@@ -313,10 +320,31 @@ RefPtr<StyleValue const> StylePropertyMapReadOnly::get_style_value(Source& sourc
return nullptr;
}
- if (property.id() >= first_longhand_property_id && property.id() <= last_longhand_property_id) {
- // FIXME: This will only ever be null for pseudo-elements. What should we do in that case?
- if (auto computed_values = element.computed_style()) {
- auto property_id = property.id();
+ if (auto computed_values = element.computed_style()) {
+ auto value_for_property = [&](auto& self, PropertyID property_id) -> RefPtr<StyleValue const> {
+ // NB: The computed longhands of all cannot be expressed as a value of all.
+ if (property_id == PropertyID::All)
+ return nullptr;
+ // FIXME: Expose overflow-clip-margin shorthands once their four-sided grammar is interoperable.
+ if (first_is_one_of(property_id, PropertyID::OverflowClipMargin, PropertyID::OverflowClipMarginBlock, PropertyID::OverflowClipMarginInline))
+ return nullptr;
+ if (property_is_shorthand(property_id)) {
+ Vector<PropertyID> longhands = longhands_for_shorthand(property_id);
+ StyleValueVector values;
+ values.ensure_capacity(longhands.size());
+ for (auto longhand : longhands) {
+ auto value = self(self, longhand);
+ if (!value)
+ return nullptr;
+ values.unchecked_append(value.release_nonnull());
+ }
+ auto shorthand = ShorthandStyleValue::create(property_id, move(longhands), move(values));
+ if (shorthand->to_utf16_string(SerializationMode::ResolvedValue).is_empty())
+ return nullptr;
+ return shorthand;
+ }
+ if (property_id < first_longhand_property_id || property_id > last_longhand_property_id)
+ return nullptr;
if (property_is_logical_alias(property_id))
property_id = map_logical_alias_to_physical_property(property_id, LogicalAliasMappingContext { computed_values->writing_mode(), computed_values->direction() });
if (property_id == PropertyID::BackgroundColor && computed_values->background_color_style_value())
@@ -325,7 +353,8 @@ RefPtr<StyleValue const> StylePropertyMapReadOnly::get_style_value(Source& sourc
if (!value)
return nullptr;
return unscaled_by_zoom(property_id, value.release_nonnull(), computed_values->effective_zoom());
- }
+ };
+ return value_for_property(value_for_property, property.id());
}
return nullptr;
diff --git a/Libraries/LibWeb/Rust/src/css/serialize/shorthand.rs b/Libraries/LibWeb/Rust/src/css/serialize/shorthand.rs
index 8833b39dd4b..80a56c15b7f 100644
--- a/Libraries/LibWeb/Rust/src/css/serialize/shorthand.rs
+++ b/Libraries/LibWeb/Rust/src/css/serialize/shorthand.rs
@@ -361,6 +361,22 @@ pub(super) fn serialize(
.iter()
.map(|value| text(if count == 1 { value } else { layer(value, entry) }, mode))
.collect::<Vec<_>>();
+ if background && mode.is_resolved() {
+ // NB: Computed backgrounds include every component, with the color on the last layer, in the
+ // order: color image repeat attachment position-x position-y / size origin clip.
+ let mut first = true;
+ for index in [0, 1, 5, 6, 2, 3, 4, 7, 8] {
+ if index == 0 && entry + 1 != count {
+ continue;
+ }
+ if !first {
+ sink.push_ascii(if index == 4 { " / " } else { " " });
+ }
+ sink.push_sink(&texts[index]);
+ first = false;
+ }
+ continue;
+ }
let initial_at = |index: usize| texts[index].content_equals(&initials[index]);
let mut first = true;
for index in 0..ids.len() {
diff --git a/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt b/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt
index 5ce289970be..19a6fcf02e4 100644
--- a/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt
+++ b/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt
@@ -231,7 +231,7 @@ All supported properties and their default values exposed from CSSStylePropertie
'backdrop-filter': 'none'
'backfaceVisibility': 'visible'
'backface-visibility': 'visible'
-'background': 'none'
+'background': 'rgba(0, 0, 0, 0) none repeat scroll 0% 0% / auto padding-box border-box'
'backgroundAttachment': 'scroll'
'background-attachment': 'scroll'
'backgroundBlendMode': 'normal'
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-serialization/cssStyleValue-cssom.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-serialization/cssStyleValue-cssom.txt
index bb21c0fea91..8b2bb6c3393 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-serialization/cssStyleValue-cssom.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/stylevalue-serialization/cssStyleValue-cssom.txt
@@ -2,9 +2,8 @@ Harness status: OK
Found 4 tests
-3 Pass
-1 Fail
+4 Pass
Pass CSSStyleValue from specified CSSOM serializes correctly
Pass CSSStyleValue from computed CSSOM serializes correctly
Pass Shorthand CSSStyleValue from inline CSSOM serializes correctly
-Fail Shorthand CSSStyleValue from computed CSSOM serializes correctly
\ No newline at end of file
+Pass Shorthand CSSStyleValue from computed CSSOM serializes correctly
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/computed/get-shorthand.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/computed/get-shorthand.txt
index 78e3703b4df..1338e8f882a 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/computed/get-shorthand.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/computed/get-shorthand.txt
@@ -2,6 +2,6 @@ Harness status: OK
Found 2 tests
-2 Fail
-Fail Getting an shorthand property set explicitly in computed style returns a base CSSStyleValue
-Fail Getting a shorthand property from initial computed style returns a base CSSStyleValue
\ No newline at end of file
+2 Pass
+Pass Getting an shorthand property set explicitly in computed style returns a base CSSStyleValue
+Pass Getting a shorthand property from initial computed style returns a base CSSStyleValue
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/computed/getAll-shorthand.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/computed/getAll-shorthand.txt
index b3d30833c47..bbe25ba446a 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/computed/getAll-shorthand.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/computed/getAll-shorthand.txt
@@ -2,6 +2,6 @@ Harness status: OK
Found 2 tests
-2 Fail
-Fail StylePropertyMap.getAll() with a shorthand property set explicitly in computed style returns a list containing a base CSSStyleValue
-Fail StylePropertyMap.getAll() with a shorthand property from initial computed style returns a list containing a base CSSStyleValue
\ No newline at end of file
+2 Pass
+Pass StylePropertyMap.getAll() with a shorthand property set explicitly in computed style returns a list containing a base CSSStyleValue
+Pass StylePropertyMap.getAll() with a shorthand property from initial computed style returns a list containing a base CSSStyleValue
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/logical.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/logical.txt
index 565cef3932e..a918c8afef3 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/logical.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/logical.txt
@@ -2,8 +2,8 @@ Harness status: OK
Found 1468 tests
-1300 Pass
-168 Fail
+1318 Pass
+150 Fail
Pass Can set 'margin-block-start' to CSS-wide keywords: initial
Pass Can set 'margin-block-start' to CSS-wide keywords: inherit
Pass Can set 'margin-block-start' to CSS-wide keywords: unset
@@ -132,7 +132,7 @@ Fail Can set 'margin-block' to CSS-wide keywords: initial
Fail Can set 'margin-block' to CSS-wide keywords: inherit
Fail Can set 'margin-block' to CSS-wide keywords: unset
Fail Can set 'margin-block' to CSS-wide keywords: revert
-Fail Can set 'margin-block' to var() references: var(--A)
+Pass Can set 'margin-block' to var() references: var(--A)
Fail Can set 'margin-block' to a percent: 0%
Fail Can set 'margin-block' to a percent: -3.14%
Fail Can set 'margin-block' to a percent: 3.14%
@@ -163,7 +163,7 @@ Fail Can set 'margin-inline' to CSS-wide keywords: initial
Fail Can set 'margin-inline' to CSS-wide keywords: inherit
Fail Can set 'margin-inline' to CSS-wide keywords: unset
Fail Can set 'margin-inline' to CSS-wide keywords: revert
-Fail Can set 'margin-inline' to var() references: var(--A)
+Pass Can set 'margin-inline' to var() references: var(--A)
Fail Can set 'margin-inline' to a percent: 0%
Fail Can set 'margin-inline' to a percent: -3.14%
Fail Can set 'margin-inline' to a percent: 3.14%
@@ -318,7 +318,7 @@ Fail Can set 'padding-block' to CSS-wide keywords: initial
Fail Can set 'padding-block' to CSS-wide keywords: inherit
Fail Can set 'padding-block' to CSS-wide keywords: unset
Fail Can set 'padding-block' to CSS-wide keywords: revert
-Fail Can set 'padding-block' to var() references: var(--A)
+Pass Can set 'padding-block' to var() references: var(--A)
Fail Can set 'padding-block' to a percent: 0%
Fail Can set 'padding-block' to a percent: -3.14%
Fail Can set 'padding-block' to a percent: 3.14%
@@ -349,7 +349,7 @@ Fail Can set 'padding-inline' to CSS-wide keywords: initial
Fail Can set 'padding-inline' to CSS-wide keywords: inherit
Fail Can set 'padding-inline' to CSS-wide keywords: unset
Fail Can set 'padding-inline' to CSS-wide keywords: revert
-Fail Can set 'padding-inline' to var() references: var(--A)
+Pass Can set 'padding-inline' to var() references: var(--A)
Fail Can set 'padding-inline' to a percent: 0%
Fail Can set 'padding-inline' to a percent: -3.14%
Fail Can set 'padding-inline' to a percent: 3.14%
@@ -504,7 +504,7 @@ Fail Can set 'inset-block' to CSS-wide keywords: initial
Fail Can set 'inset-block' to CSS-wide keywords: inherit
Fail Can set 'inset-block' to CSS-wide keywords: unset
Fail Can set 'inset-block' to CSS-wide keywords: revert
-Fail Can set 'inset-block' to var() references: var(--A)
+Pass Can set 'inset-block' to var() references: var(--A)
Fail Can set 'inset-block' to a percent: 0%
Fail Can set 'inset-block' to a percent: -3.14%
Fail Can set 'inset-block' to a percent: 3.14%
@@ -535,7 +535,7 @@ Fail Can set 'inset-inline' to CSS-wide keywords: initial
Fail Can set 'inset-inline' to CSS-wide keywords: inherit
Fail Can set 'inset-inline' to CSS-wide keywords: unset
Fail Can set 'inset-inline' to CSS-wide keywords: revert
-Fail Can set 'inset-inline' to var() references: var(--A)
+Pass Can set 'inset-inline' to var() references: var(--A)
Fail Can set 'inset-inline' to a percent: 0%
Fail Can set 'inset-inline' to a percent: -3.14%
Fail Can set 'inset-inline' to a percent: 3.14%
@@ -566,7 +566,7 @@ Fail Can set 'border-block-start' to CSS-wide keywords: initial
Fail Can set 'border-block-start' to CSS-wide keywords: inherit
Fail Can set 'border-block-start' to CSS-wide keywords: unset
Fail Can set 'border-block-start' to CSS-wide keywords: revert
-Fail Can set 'border-block-start' to var() references: var(--A)
+Pass Can set 'border-block-start' to var() references: var(--A)
Fail Can set 'border-block-start' to the 'none' keyword: none
Pass Setting 'border-block-start' to a length: 0px throws TypeError
Pass Setting 'border-block-start' to a length: -3.14em throws TypeError
@@ -697,7 +697,7 @@ Fail Can set 'border-block-end' to CSS-wide keywords: initial
Fail Can set 'border-block-end' to CSS-wide keywords: inherit
Fail Can set 'border-block-end' to CSS-wide keywords: unset
Fail Can set 'border-block-end' to CSS-wide keywords: revert
-Fail Can set 'border-block-end' to var() references: var(--A)
+Pass Can set 'border-block-end' to var() references: var(--A)
Fail Can set 'border-block-end' to the 'none' keyword: none
Pass Setting 'border-block-end' to a length: 0px throws TypeError
Pass Setting 'border-block-end' to a length: -3.14em throws TypeError
@@ -828,7 +828,7 @@ Fail Can set 'border-inline-start' to CSS-wide keywords: initial
Fail Can set 'border-inline-start' to CSS-wide keywords: inherit
Fail Can set 'border-inline-start' to CSS-wide keywords: unset
Fail Can set 'border-inline-start' to CSS-wide keywords: revert
-Fail Can set 'border-inline-start' to var() references: var(--A)
+Pass Can set 'border-inline-start' to var() references: var(--A)
Fail Can set 'border-inline-start' to the 'none' keyword: none
Pass Setting 'border-inline-start' to a length: 0px throws TypeError
Pass Setting 'border-inline-start' to a length: -3.14em throws TypeError
@@ -959,7 +959,7 @@ Fail Can set 'border-inline-end' to CSS-wide keywords: initial
Fail Can set 'border-inline-end' to CSS-wide keywords: inherit
Fail Can set 'border-inline-end' to CSS-wide keywords: unset
Fail Can set 'border-inline-end' to CSS-wide keywords: revert
-Fail Can set 'border-inline-end' to var() references: var(--A)
+Pass Can set 'border-inline-end' to var() references: var(--A)
Fail Can set 'border-inline-end' to the 'none' keyword: none
Pass Setting 'border-inline-end' to a length: 0px throws TypeError
Pass Setting 'border-inline-end' to a length: -3.14em throws TypeError
@@ -1090,7 +1090,7 @@ Fail Can set 'border-block' to CSS-wide keywords: initial
Fail Can set 'border-block' to CSS-wide keywords: inherit
Fail Can set 'border-block' to CSS-wide keywords: unset
Fail Can set 'border-block' to CSS-wide keywords: revert
-Fail Can set 'border-block' to var() references: var(--A)
+Pass Can set 'border-block' to var() references: var(--A)
Fail Can set 'border-block' to the 'none' keyword: none
Pass Setting 'border-block' to a length: 0px throws TypeError
Pass Setting 'border-block' to a length: -3.14em throws TypeError
@@ -1122,7 +1122,7 @@ Fail Can set 'border-block-width' to CSS-wide keywords: initial
Fail Can set 'border-block-width' to CSS-wide keywords: inherit
Fail Can set 'border-block-width' to CSS-wide keywords: unset
Fail Can set 'border-block-width' to CSS-wide keywords: revert
-Fail Can set 'border-block-width' to var() references: var(--A)
+Pass Can set 'border-block-width' to var() references: var(--A)
Fail Can set 'border-block-width' to the 'thin' keyword: thin
Fail Can set 'border-block-width' to the 'medium' keyword: medium
Fail Can set 'border-block-width' to the 'thick' keyword: thick
@@ -1156,7 +1156,7 @@ Fail Can set 'border-block-color' to CSS-wide keywords: initial
Fail Can set 'border-block-color' to CSS-wide keywords: inherit
Fail Can set 'border-block-color' to CSS-wide keywords: unset
Fail Can set 'border-block-color' to CSS-wide keywords: revert
-Fail Can set 'border-block-color' to var() references: var(--A)
+Pass Can set 'border-block-color' to var() references: var(--A)
Fail Can set 'border-block-color' to the 'currentcolor' keyword: currentcolor
Pass Setting 'border-block-color' to a length: 0px throws TypeError
Pass Setting 'border-block-color' to a length: -3.14em throws TypeError
@@ -1188,7 +1188,7 @@ Fail Can set 'border-block-style' to CSS-wide keywords: initial
Fail Can set 'border-block-style' to CSS-wide keywords: inherit
Fail Can set 'border-block-style' to CSS-wide keywords: unset
Fail Can set 'border-block-style' to CSS-wide keywords: revert
-Fail Can set 'border-block-style' to var() references: var(--A)
+Pass Can set 'border-block-style' to var() references: var(--A)
Fail Can set 'border-block-style' to the 'none' keyword: none
Fail Can set 'border-block-style' to the 'solid' keyword: solid
Pass Setting 'border-block-style' to a length: 0px throws TypeError
@@ -1221,7 +1221,7 @@ Fail Can set 'border-inline' to CSS-wide keywords: initial
Fail Can set 'border-inline' to CSS-wide keywords: inherit
Fail Can set 'border-inline' to CSS-wide keywords: unset
Fail Can set 'border-inline' to CSS-wide keywords: revert
-Fail Can set 'border-inline' to var() references: var(--A)
+Pass Can set 'border-inline' to var() references: var(--A)
Fail Can set 'border-inline' to the 'none' keyword: none
Pass Setting 'border-inline' to a length: 0px throws TypeError
Pass Setting 'border-inline' to a length: -3.14em throws TypeError
@@ -1253,7 +1253,7 @@ Fail Can set 'border-inline-width' to CSS-wide keywords: initial
Fail Can set 'border-inline-width' to CSS-wide keywords: inherit
Fail Can set 'border-inline-width' to CSS-wide keywords: unset
Fail Can set 'border-inline-width' to CSS-wide keywords: revert
-Fail Can set 'border-inline-width' to var() references: var(--A)
+Pass Can set 'border-inline-width' to var() references: var(--A)
Fail Can set 'border-inline-width' to the 'thin' keyword: thin
Fail Can set 'border-inline-width' to the 'medium' keyword: medium
Fail Can set 'border-inline-width' to the 'thick' keyword: thick
@@ -1287,7 +1287,7 @@ Fail Can set 'border-inline-color' to CSS-wide keywords: initial
Fail Can set 'border-inline-color' to CSS-wide keywords: inherit
Fail Can set 'border-inline-color' to CSS-wide keywords: unset
Fail Can set 'border-inline-color' to CSS-wide keywords: revert
-Fail Can set 'border-inline-color' to var() references: var(--A)
+Pass Can set 'border-inline-color' to var() references: var(--A)
Fail Can set 'border-inline-color' to the 'currentcolor' keyword: currentcolor
Pass Setting 'border-inline-color' to a length: 0px throws TypeError
Pass Setting 'border-inline-color' to a length: -3.14em throws TypeError
@@ -1319,7 +1319,7 @@ Fail Can set 'border-inline-style' to CSS-wide keywords: initial
Fail Can set 'border-inline-style' to CSS-wide keywords: inherit
Fail Can set 'border-inline-style' to CSS-wide keywords: unset
Fail Can set 'border-inline-style' to CSS-wide keywords: revert
-Fail Can set 'border-inline-style' to var() references: var(--A)
+Pass Can set 'border-inline-style' to var() references: var(--A)
Fail Can set 'border-inline-style' to the 'none' keyword: none
Fail Can set 'border-inline-style' to the 'solid' keyword: solid
Pass Setting 'border-inline-style' to a length: 0px throws TypeError
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/margin.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/margin.txt
index 492ba8fb8e1..ab6566231ce 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/margin.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/margin.txt
@@ -2,8 +2,8 @@ Harness status: OK
Found 161 tests
-156 Pass
-5 Fail
+157 Pass
+4 Fail
Pass Can set 'margin-top' to CSS-wide keywords: initial
Pass Can set 'margin-top' to CSS-wide keywords: inherit
Pass Can set 'margin-top' to CSS-wide keywords: unset
@@ -136,7 +136,7 @@ Fail Can set 'margin' to CSS-wide keywords: initial
Fail Can set 'margin' to CSS-wide keywords: inherit
Fail Can set 'margin' to CSS-wide keywords: unset
Fail Can set 'margin' to CSS-wide keywords: revert
-Fail Can set 'margin' to var() references: var(--A)
+Pass Can set 'margin' to var() references: var(--A)
Pass Setting 'margin' to a length: 0px throws TypeError
Pass Setting 'margin' to a length: -3.14em throws TypeError
Pass Setting 'margin' to a length: 3.14cm throws TypeError