[webkit-changes] [WebKit/WebKit] a0e6d8: Move SVG conditional processing attributes to SVGE...

Cameron McCormack noreply at github.com
Thu Feb 2 12:04:57 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a0e6d8e81896cbb5cb78fdc8eccd67c598b8c459
      https://github.com/WebKit/WebKit/commit/a0e6d8e81896cbb5cb78fdc8eccd67c598b8c459
  Author: Cameron McCormack <heycam at apple.com>
  Date:   2023-02-02 (Thu, 02 Feb 2023)

  Changed paths:
    M Source/WebCore/svg/SVGElement.cpp
    M Source/WebCore/svg/SVGElement.h
    M Source/WebCore/svg/SVGElementRareData.h
    M Source/WebCore/svg/SVGTests.cpp
    M Source/WebCore/svg/SVGTests.h
    M Source/WebCore/svg/properties/SVGPropertyAccessorImpl.h
    M Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h

  Log Message:
  -----------
  Move SVG conditional processing attributes to SVGElementRareData
https://bugs.webkit.org/show_bug.cgi?id=251413
rdar://problem/104849618

Reviewed by Sam Weinig and Said Abou-Hallawa.

The SVG conditional processing attributes (requiredFeatures, requiredExtensions,
and systemLanguage) are rarely used. Currently nearly every SVG element creates
SVGStringList objects for these three attributes in WebCore::SVGTests, at a cost
of 48 bytes each SVGStringList plus the three pointers. We can move these to
SVGElementRareData to save 72 bytes per SVG element in this common case, which
for SVG documents with a large number of graphical elements can add up.

The existing SVG property registration mechanism expects members
corresponding to the attribute to exist on the owner element object. We adds a
new SVGConditionalProcessingAttributeAccessor for these three
attributes, which looks them up on the element's SVGElementRareData.

* Source/WebCore/svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::SVGAnimationElement):
* Source/WebCore/svg/SVGCursorElement.cpp:
(WebCore::SVGCursorElement::SVGCursorElement):
* Source/WebCore/svg/SVGElement.cpp:
(WebCore::SVGElement::conditionalProcessingAttributes):
(WebCore::SVGElement::conditionalProcessingAttributesIfExists const):
* Source/WebCore/svg/SVGElement.h:
* Source/WebCore/svg/SVGElementRareData.h:
(WebCore::SVGElementRareData::conditionalProcessingAttributesIfExists const):
(WebCore::SVGElementRareData::conditionalProcessingAttributes):
* Source/WebCore/svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::SVGGraphicsElement):
* Source/WebCore/svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::SVGMaskElement):
* Source/WebCore/svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::SVGPatternElement):
* Source/WebCore/svg/SVGTests.cpp:
(WebCore::SVGConditionalProcessingAttributes::SVGConditionalProcessingAttributes):
(WebCore::SVGTests::SVGTests):
(WebCore::SVGTests::isValid const):
(WebCore::SVGTests::parseAttribute):
(WebCore::SVGTests::conditionalProcessingAttributes):
(WebCore::SVGTests::conditionalProcessingAttributesIfExists const):
* Source/WebCore/svg/SVGTests.h:
(WebCore::SVGConditionalProcessingAttributes::requiredFeatures):
(WebCore::SVGConditionalProcessingAttributes::requiredExtensions):
(WebCore::SVGConditionalProcessingAttributes::systemLanguage):
(WebCore::SVGTests::requiredFeatures):
(WebCore::SVGTests::requiredExtensions):
(WebCore::SVGTests::systemLanguage):
* Source/WebCore/svg/properties/SVGPropertyAccessorImpl.h:
(WebCore::SVGConditionalProcessingAttributeAccessor<OwnerType>::singleton):
* Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h:
(WebCore::SVGPropertyOwnerRegistry::registerConditionalProcessingAttributeProperty):

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




More information about the webkit-changes mailing list