[webkit-changes] [WebKit/WebKit] f59b6c: [Cocoa] Migrate OpticalSizingType from an enum to ...

Myles C. Maxfield noreply at github.com
Mon Apr 3 18:55:49 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f59b6cd00f1c4ab23bcc09cbe8bfbb6025e79d35
      https://github.com/WebKit/WebKit/commit/f59b6cd00f1c4ab23bcc09cbe8bfbb6025e79d35
  Author: Myles C. Maxfield <mmaxfield at apple.com>
  Date:   2023-04-03 (Mon, 03 Apr 2023)

  Changed paths:
    M Source/WebCore/platform/graphics/cocoa/UnrealizedCoreTextFont.cpp
    M Source/WebCore/platform/graphics/cocoa/UnrealizedCoreTextFont.h

  Log Message:
  -----------
  [Cocoa] Migrate OpticalSizingType from an enum to a variant
https://bugs.webkit.org/show_bug.cgi?id=254896
rdar://107538476

Reviewed by Alan Baradlay.

This is the first half of the fix to <rdar://problem/106814619>. For that bug, the
OpticalSizingType::Everything enum value needs an accompanying data field (to tell
Core Text which value to use for optical sizing). C++ enums can't store accompanying
data fields, so we need to use a variant instead.

This patch just migrates to the variant, so the actual fix (applied on top of this
patch) is easier to understand.

No test because there is no behavior change.

* Source/WebCore/platform/graphics/cocoa/UnrealizedCoreTextFont.cpp:
(WebCore::UnrealizedCoreTextFont::addAttributesForOpticalSizing):
(WebCore::UnrealizedCoreTextFont::modifyFromContext):
* Source/WebCore/platform/graphics/cocoa/UnrealizedCoreTextFont.h:

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




More information about the webkit-changes mailing list