-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Do not serialize shorthands when any longhands are missing #7770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not serialize shorthands when any longhands are missing #7770
Conversation
EWS run on current version of this PR (hash 9a4c19f)
|
if (!start.value() || !end.value()) | ||
return { }; | ||
auto start = propertyAt(findPropertyIndex(shorthand.properties()[0])); | ||
auto end = propertyAt(findPropertyIndex(shorthand.properties()[1])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
end
could just use getPropertyCSSValue
.
start
has an isImplicit
check which doesn't seem to make much sense, maybe it could use getPropertyCSSValue
too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The isImplicit
check is going away soon.
I think I‘ll take a pass through tightening up the code again once I finish removing implicit entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great cleanup!
Would be nice to clean up propertyAt(findPropertyIndex(X)
vs. getPropertyCSSValue(X)
.
Mostly done, will do more in follow-up. |
9a4c19f
to
d750def
Compare
https://bugs.webkit.org/show_bug.cgi?id=249440 rdar://problem/103423965 Reviewed by Tim Nguyen. * LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssom-getPropertyValue-common-checks-expected.txt: Expect one more test to pass. * Source/WebCore/css/StyleProperties.cpp: (WebCore::StyleProperties::commonShorthandChecks const): Return empty string when a longhand is missing. Also redid the logic for values that are set by the shorthand, since it no longer needs to compute a count. (WebCore::StyleProperties::getPropertyValue const): Removed unneeded checks since commonShorthandChecks handles missing longhands, and parsing makes sure things have correct types. (WebCore::StyleProperties::offsetValue const): Ditto. (WebCore::StyleProperties::fontVariantValue const): Ditto. (WebCore::StyleProperties::get2Values const): Ditto. (WebCore::StyleProperties::get4Values const): Ditto. (WebCore::StyleProperties::getLayeredShorthandValue const): Ditto. (WebCore::StyleProperties::getGridTemplateValue const): Ditto. (WebCore::StyleProperties::getGridValue const): Ditto. (WebCore::StyleProperties::getGridRowColumnShorthandValue const): Ditto. (WebCore::StyleProperties::getGridAreaShorthandValue const): Ditto. (WebCore::StyleProperties::getShorthandValue const): Ditto. (WebCore::StyleProperties::getCommonValue const): Ditto. (WebCore::StyleProperties::borderImagePropertyValue const): Ditto. (WebCore::StyleProperties::borderRadiusShorthandValue const): Ditto. (WebCore::StyleProperties::borderPropertyValue const): Ditto. * Source/WebCore/css/StyleProperties.h: Removed the unneeded argument from fontVariantValue. Canonical link: https://commits.webkit.org/258038@main
d750def
to
a7f14bf
Compare
Committed 258038@main (a7f14bf): https://commits.webkit.org/258038@main Reviewed commits have been landed. Closing PR #7770 and removing active labels. |
a7f14bf
d750def