Truly independent web browser
LibWeb: Reify a single-item StyleValueList as its item
Andreas Klingf8a17251e156
diff --git a/Libraries/LibWeb/CSS/StyleValues/StyleValueList.cpp b/Libraries/LibWeb/CSS/StyleValues/StyleValueList.cppindex 12136efa807..6844c12db55 100644--- a/Libraries/LibWeb/CSS/StyleValues/StyleValueList.cpp+++ b/Libraries/LibWeb/CSS/StyleValues/StyleValueList.cpp@@ -49,6 +49,11 @@ GC::Ref<CSSStyleValue> StyleValueList::reify(Utf16FlyString const& associated_prreturn transform_list.as_nonnull();}+ // NB: A list with a single item, such as `text-decoration-line: underline`, is that item on its own. Reify the+ // item, so that a single keyword reifies as a CSSKeywordValue.+ if (values.size() == 1)+ return values.first()->reify(associated_property);+// NB: Otherwise, there isn't an equivalent CSSStyleValue for StyleValueList, so just use the default.return default_reify(associated_property);}diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/white-space.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/white-space.txtindex 8fb378834d1..e255abdaee1 100644--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/white-space.txt+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-typed-om/the-stylepropertymap/properties/white-space.txt@@ -2,8 +2,7 @@ Harness status: OKFound 144 tests-141 Pass-3 Fail+144 PassPass Can set 'white-space-collapse' to CSS-wide keywords: initialPass Can set 'white-space-collapse' to CSS-wide keywords: inheritPass Can set 'white-space-collapse' to CSS-wide keywords: unset@@ -115,9 +114,9 @@ Pass Can set 'white-space-trim' to CSS-wide keywords: unsetPass Can set 'white-space-trim' to CSS-wide keywords: revertPass Can set 'white-space-trim' to var() references: var(--A)Pass Can set 'white-space-trim' to the 'none' keyword: none-Fail Can set 'white-space-trim' to the 'discard-before' keyword: discard-before-Fail Can set 'white-space-trim' to the 'discard-after' keyword: discard-after-Fail Can set 'white-space-trim' to the 'discard-inner' keyword: discard-inner+Pass Can set 'white-space-trim' to the 'discard-before' keyword: discard-before+Pass Can set 'white-space-trim' to the 'discard-after' keyword: discard-after+Pass Can set 'white-space-trim' to the 'discard-inner' keyword: discard-innerPass Setting 'white-space-trim' to a length: 0px throws TypeErrorPass Setting 'white-space-trim' to a length: -3.14em throws TypeErrorPass Setting 'white-space-trim' to a length: 3.14cm throws TypeError