[Webkit-unassigned] [Bug 245105] CSS properties set to 'initial' don't roundtrip from CSSOM correctly
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Sep 22 04:43:29 PDT 2022
https://bugs.webkit.org/show_bug.cgi?id=245105
Karl Dubost <karlcow at apple.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |karlcow at apple.com
--- Comment #2 from Karl Dubost <karlcow at apple.com> ---
<style>
.foo {
background: initial;
border: initial;
padding: initial;
position: initial;
opacity: initial;
}
</style>
with
document.querySelector('style').sheet.cssRules[0].cssText
> The cssText attribute must return a serialization of the CSS rule. On setting the cssText attribute must do nothing.
https://drafts.csswg.org/cssom/#serialize-a-css-rule
if I comment out this part
git diff
diff --git a/Source/WebCore/css/StyleProperties.cpp b/Source/WebCore/css/StyleProperties.cpp
index 1768f465451d..769da676ae45 100644
--- a/Source/WebCore/css/StyleProperties.cpp
+++ b/Source/WebCore/css/StyleProperties.cpp
@@ -1750,8 +1750,8 @@ StringBuilder StyleProperties::asTextInternal() const
} else
value = property.value()->cssText();
- if (propertyID != CSSPropertyCustom && value == "initial"_s && !CSSProperty::isInheritedProperty(propertyID))
- continue;
+ // if (propertyID != CSSPropertyCustom && value == "initial"_s && !CSSProperty::isInheritedProperty(propertyID))
+ // continue;
if (numDecls++)
result.append(' ');
I get for the test result:
.foo { background-image: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; border: initial; padding: initial; position: initial; opacity: initial; }
which almost fixes it except for background shorthand which gets expanded.
(that might break other things.)
Maybe it needs a function similar to
https://searchfox.org/wubkat/rev/abe3878de54ffed9a6eb6de74e246bee9739e209/Source/WebCore/css/StyleProperties.cpp#1135-1157
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220922/5d65de0f/attachment-0001.htm>
More information about the webkit-unassigned
mailing list