[webkit-changes] [WebKit/WebKit] 6418ae: [WebCore] Shrink FontVariantAlternates

Tadeu Zagallo noreply at github.com
Fri Feb 17 13:16:13 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6418aea7fc71ec0fa418ba546de00c503cba4d18
      https://github.com/WebKit/WebKit/commit/6418aea7fc71ec0fa418ba546de00c503cba4d18
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-02-17 (Fri, 17 Feb 2023)

  Changed paths:
    M Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
    M Source/WebCore/platform/text/TextFlags.cpp
    M Source/WebCore/platform/text/TextFlags.h

  Log Message:
  -----------
  [WebCore] Shrink FontVariantAlternates
https://bugs.webkit.org/show_bug.cgi?id=252479
rdar://105594318

Reviewed by Tim Nguyen.

Reduce the size of `FontVariantAlternates` from 120 to 80 bytes by replacing all
the instance of `std::optional<String>` in `FontVariantAlternatesValues` with
`String`. `String` can already distinguish between an empty string and a null
string, so it seems redundant to wrap it in an optinal. Combined with #10722,
this further reduces the size of `StyleInheritedData` to 264 bytes.

* Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeFontVariantAlternates):
* Source/WebCore/platform/text/TextFlags.cpp:
(WebCore::operator<<):
* Source/WebCore/platform/text/TextFlags.h:

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




More information about the webkit-changes mailing list