[webkit-changes] [WebKit/WebKit] 70230d: Reuse the StylePropertyShorthand in StylePropertie...

Oriol Brufau noreply at github.com
Fri Nov 25 00:56:18 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 70230d10f272f17151f1e77d496553716b449cea
      https://github.com/WebKit/WebKit/commit/70230d10f272f17151f1e77d496553716b449cea
  Author: Oriol Brufau <obrufau at igalia.com>
  Date:   2022-11-25 (Fri, 25 Nov 2022)

  Changed paths:
    M Source/WebCore/css/StyleProperties.cpp
    M Source/WebCore/css/StyleProperties.h

  Log Message:
  -----------
  Reuse the StylePropertyShorthand in StyleProperties::getPropertyValue()
https://bugs.webkit.org/show_bug.cgi?id=248311

Reviewed by Tim Nguyen.

StyleProperties::getPropertyValue() calls commonShorthandChecks(), which
used shorthandForProperty(propertyID) to get the StylePropertyShorthand,
and later it would get the StylePropertyShorthand again in most cases.

So it's better to use shorthandForProperty() in getPropertyValue(), and
then pass it to commonShorthandChecks() and others.

Also adds some ASSERTs for the length of the StylePropertyShorthand.

No test since there should be no observable change in behavior.

* Source/WebCore/css/StyleProperties.cpp:
(WebCore::StyleProperties::commonShorthandChecks const):
(WebCore::StyleProperties::getPropertyValue const):
(WebCore::StyleProperties::borderSpacingValue const):
(WebCore::StyleProperties::fontValue const):
(WebCore::StyleProperties::offsetValue const):
(WebCore::StyleProperties::textDecorationSkipValue const):
(WebCore::StyleProperties::fontVariantValue const):
(WebCore::StyleProperties::fontSynthesisValue const):
(WebCore::StyleProperties::get2Values const):
(WebCore::StyleProperties::get4Values const):
(WebCore::StyleProperties::getGridTemplateValue const):
(WebCore::StyleProperties::getGridValue const):
(WebCore::StyleProperties::getGridRowColumnShorthandValue const):
(WebCore::StyleProperties::getGridAreaShorthandValue const):
(WebCore::StyleProperties::borderImagePropertyValue const):
(WebCore::StyleProperties::pageBreakPropertyValue const):
(WebCore::canUseShorthandForLonghand):
* Source/WebCore/css/StyleProperties.h:

Canonical link: https://commits.webkit.org/257011@main




More information about the webkit-changes mailing list