<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[285318] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/285318">285318</a></dd>
<dt>Author</dt> <dd>mmaxfield@apple.com</dd>
<dt>Date</dt> <dd>2021-11-04 16:18:23 -0700 (Thu, 04 Nov 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Cocoa] Migrate from CTFontCopyVariationAxes() to CTFontCopyVariationAxesInternal() if possible
https://bugs.webkit.org/show_bug.cgi?id=232690

Reviewed by Simon Fraser and Cameron McCormack.

Source/WebCore:

CTFontCopyVariationAxesInternal() is faster than CTFontCopyVariationAxes(), but the strings
it provides are not localized. Luckily, we don't actually use the strings in the common case,
so we can migrate to CTFontCopyVariationAxesInternal() safely.

No new tests because there is no behavior change.

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::variationAxes):
(WebCore::defaultVariationValues):
(WebCore::preparePlatformFont):
* platform/graphics/cocoa/FontCacheCoreText.h:
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::variationAxes const):

Source/WebCore/PAL:

* pal/spi/cf/CoreTextSPI.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreHeaderscmake">trunk/Source/WebCore/Headers.cmake</a></li>
<li><a href="#trunkSourceWebCorePALChangeLog">trunk/Source/WebCore/PAL/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePALpalspicfCoreTextSPIh">trunk/Source/WebCore/PAL/pal/spi/cf/CoreTextSPI.h</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorCSSAgentcpp">trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontPlatformDatacpp">trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontPlatformDatah">trunk/Source/WebCore/platform/graphics/FontPlatformData.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaFontCacheCoreTextcpp">trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaFontCacheCoreTexth">trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaFontPlatformDataCocoamm">trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsShouldLocalizeAxisNamesh">trunk/Source/WebCore/platform/graphics/ShouldLocalizeAxisNames.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (285317 => 285318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-11-04 22:55:12 UTC (rev 285317)
+++ trunk/Source/WebCore/ChangeLog      2021-11-04 23:18:23 UTC (rev 285318)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2021-11-04  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [Cocoa] Migrate from CTFontCopyVariationAxes() to CTFontCopyVariationAxesInternal() if possible
+        https://bugs.webkit.org/show_bug.cgi?id=232690
+
+        Reviewed by Simon Fraser and Cameron McCormack.
+
+        CTFontCopyVariationAxesInternal() is faster than CTFontCopyVariationAxes(), but the strings
+        it provides are not localized. Luckily, we don't actually use the strings in the common case,
+        so we can migrate to CTFontCopyVariationAxesInternal() safely.
+
+        No new tests because there is no behavior change.
+
+        * platform/graphics/cocoa/FontCacheCoreText.cpp:
+        (WebCore::variationAxes):
+        (WebCore::defaultVariationValues):
+        (WebCore::preparePlatformFont):
+        * platform/graphics/cocoa/FontCacheCoreText.h:
+        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
+        (WebCore::FontPlatformData::variationAxes const):
+
</ins><span class="cx"> 2021-11-04  Nikolaos Mouchtaris  <nmouchtaris@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Make scrollbar orientation an enum class
</span></span></pre></div>
<a id="trunkSourceWebCoreHeaderscmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Headers.cmake (285317 => 285318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Headers.cmake       2021-11-04 22:55:12 UTC (rev 285317)
+++ trunk/Source/WebCore/Headers.cmake  2021-11-04 23:18:23 UTC (rev 285318)
</span><span class="lines">@@ -1373,6 +1373,7 @@
</span><span class="cx">     platform/graphics/RenderingResourceIdentifier.h
</span><span class="cx">     platform/graphics/RenderingMode.h
</span><span class="cx">     platform/graphics/RoundedRect.h
</span><ins>+    platform/graphics/ShouldLocalizeAxisNames.h
</ins><span class="cx">     platform/graphics/SourceBufferPrivate.h
</span><span class="cx">     platform/graphics/SourceBufferPrivateClient.h
</span><span class="cx">     platform/graphics/StringTruncator.h
</span></span></pre></div>
<a id="trunkSourceWebCorePALChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PAL/ChangeLog (285317 => 285318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PAL/ChangeLog       2021-11-04 22:55:12 UTC (rev 285317)
+++ trunk/Source/WebCore/PAL/ChangeLog  2021-11-04 23:18:23 UTC (rev 285318)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2021-11-04  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [Cocoa] Migrate from CTFontCopyVariationAxes() to CTFontCopyVariationAxesInternal() if possible
+        https://bugs.webkit.org/show_bug.cgi?id=232690
+
+        Reviewed by Simon Fraser and Cameron McCormack.
+
+        * pal/spi/cf/CoreTextSPI.h:
+
</ins><span class="cx"> 2021-11-04  Commit Queue  <commit-queue@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, reverting r285228.
</span></span></pre></div>
<a id="trunkSourceWebCorePALpalspicfCoreTextSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PAL/pal/spi/cf/CoreTextSPI.h (285317 => 285318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PAL/pal/spi/cf/CoreTextSPI.h        2021-11-04 22:55:12 UTC (rev 285317)
+++ trunk/Source/WebCore/PAL/pal/spi/cf/CoreTextSPI.h   2021-11-04 23:18:23 UTC (rev 285318)
</span><span class="lines">@@ -169,6 +169,7 @@
</span><span class="cx"> CTFontRef CTFontCreateForCharactersWithLanguageAndOption(CTFontRef currentFont, const UTF16Char *characters, CFIndex length, CFStringRef language, CTFontFallbackOption, CFIndex *coveredLength);
</span><span class="cx"> CTFontRef CTFontCopyPhysicalFont(CTFontRef);
</span><span class="cx"> CTFontSymbolicTraits CTFontGetPhysicalSymbolicTraits(CTFontRef);
</span><ins>+CFArrayRef CTFontCopyVariationAxesInternal(CTFontRef);
</ins><span class="cx"> 
</span><span class="cx"> extern const CFStringRef kCTUIFontTextStyleShortHeadline;
</span><span class="cx"> extern const CFStringRef kCTUIFontTextStyleShortBody;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (285317 => 285318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2021-11-04 22:55:12 UTC (rev 285317)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2021-11-04 23:18:23 UTC (rev 285318)
</span><span class="lines">@@ -629,6 +629,7 @@
</span><span class="cx">          1C26671B26FA932F00117073 /* FontCreationContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C26671926FA7F2E00117073 /* FontCreationContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          1C43DE6B22AB4B8A001527D9 /* LocalCurrentTraitCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C43DE6822AB4B8A001527D9 /* LocalCurrentTraitCollection.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          1C4D0DD324D9F10D003D7498 /* GlyphBufferMembers.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C4D0DD124D9F0DB003D7498 /* GlyphBufferMembers.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+               1C4DB02627339FE0007B0AD1 /* ShouldLocalizeAxisNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C4DB02427339E5E007B0AD1 /* ShouldLocalizeAxisNames.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">           1C5E1DA826F94B9000E07AF1 /* FontPaletteValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C5E1DA626F949B900E07AF1 /* FontPaletteValues.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          1C6626111C6E7CA600AB527C /* FontFace.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C66260F1C6E7CA600AB527C /* FontFace.h */; };
</span><span class="cx">          1C73A7132185757E004CCEA5 /* TextUnderlineOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CB6B4FB217B83940093B9CD /* TextUnderlineOffset.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -7037,6 +7038,7 @@
</span><span class="cx">          1C43DE6A22AB4B8A001527D9 /* LocalCurrentTraitCollection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalCurrentTraitCollection.mm; sourceTree = "<group>"; };
</span><span class="cx">          1C4674FD26F4843600B61273 /* FontPalette.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontPalette.h; sourceTree = "<group>"; };
</span><span class="cx">          1C4D0DD124D9F0DB003D7498 /* GlyphBufferMembers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GlyphBufferMembers.h; sourceTree = "<group>"; };
</span><ins>+               1C4DB02427339E5E007B0AD1 /* ShouldLocalizeAxisNames.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShouldLocalizeAxisNames.h; sourceTree = "<group>"; };
</ins><span class="cx">           1C50C49522C84F2400A6E4BE /* WHLSLStandardLibraryFunctionMap.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WHLSLStandardLibraryFunctionMap.cpp; sourceTree = "<group>"; };
</span><span class="cx">          1C5E1DA626F949B900E07AF1 /* FontPaletteValues.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontPaletteValues.h; sourceTree = "<group>"; };
</span><span class="cx">          1C66260E1C6E7CA600AB527C /* FontFace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFace.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -18609,11 +18611,11 @@
</span><span class="cx">          1A569CC40D7E2B60007C3983 /* bridge */ = {
</span><span class="cx">                  isa = PBXGroup;
</span><span class="cx">                  children = (
</span><del>-                               59B5977111086556007159E8 /* jsc */,
-                               1A569CE20D7E2B82007C3983 /* objc */,
</del><span class="cx">                           599E758F11055A1F00D904FA /* Bridge.h */,
</span><span class="cx">                          1A71D5790F33819000F9CE4E /* IdentifierRep.cpp */,
</span><span class="cx">                          1A71D57A0F33819000F9CE4E /* IdentifierRep.h */,
</span><ins>+                               59B5977111086556007159E8 /* jsc */,
+                               1A569CE20D7E2B82007C3983 /* objc */,
</ins><span class="cx">                           1A569CEF0D7E2B82007C3983 /* runtime_array.cpp */,
</span><span class="cx">                          1A569CF00D7E2B82007C3983 /* runtime_array.h */,
</span><span class="cx">                          1A569CF10D7E2B82007C3983 /* runtime_method.cpp */,
</span><span class="lines">@@ -27368,6 +27370,7 @@
</span><span class="cx">                          A73F95FD12C97BFE0031AAF9 /* RoundedRect.h */,
</span><span class="cx">                          0F3DD44D12F5EA1B000D9190 /* ShadowBlur.cpp */,
</span><span class="cx">                          0F3DD44E12F5EA1B000D9190 /* ShadowBlur.h */,
</span><ins>+                               1C4DB02427339E5E007B0AD1 /* ShouldLocalizeAxisNames.h */,
</ins><span class="cx">                           1DD127AC256E3A8700B227D7 /* SourceBufferPrivate.cpp */,
</span><span class="cx">                          CD641EB21818F5ED00EE4C41 /* SourceBufferPrivate.h */,
</span><span class="cx">                          CDC8B5AC1804AE5D0016E685 /* SourceBufferPrivateClient.h */,
</span><span class="lines">@@ -35393,6 +35396,7 @@
</span><span class="cx">                          CD36C16B260A65CC00C8C529 /* SharedRoutingArbitrator.h in Headers */,
</span><span class="cx">                          834DFAD01F7DAE5D00C2725B /* SharedStringHash.h in Headers */,
</span><span class="cx">                          93309EA3099EB78C0056E581 /* SharedTimer.h in Headers */,
</span><ins>+                               1C4DB02627339FE0007B0AD1 /* ShouldLocalizeAxisNames.h in Headers */,
</ins><span class="cx">                           DF19E2AC24772BC1007BDACB /* ShouldRelaxThirdPartyCookieBlocking.h in Headers */,
</span><span class="cx">                          8362E8C120CEF9CB00245886 /* ShouldTreatAsContinuingLoad.h in Headers */,
</span><span class="cx">                          9316DDFB240C64B4009340AA /* SimpleRange.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectoragentsInspectorCSSAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp (285317 => 285318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp      2021-11-04 22:55:12 UTC (rev 285317)
+++ trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp 2021-11-04 23:18:23 UTC (rev 285318)
</span><span class="lines">@@ -575,7 +575,7 @@
</span><span class="cx"> static Ref<Protocol::CSS::Font> buildObjectForFont(const Font& font)
</span><span class="cx"> {
</span><span class="cx">     auto resultVariationAxes = JSON::ArrayOf<Protocol::CSS::FontVariationAxis>::create();
</span><del>-    for (auto& variationAxis : font.platformData().variationAxes()) {
</del><ins>+    for (auto& variationAxis : font.platformData().variationAxes(ShouldLocalizeAxisNames::Yes)) {
</ins><span class="cx">         auto axis = Protocol::CSS::FontVariationAxis::create()
</span><span class="cx">             .setTag(variationAxis.tag())
</span><span class="cx">             .setMinimumValue(variationAxis.minimumValue())
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontPlatformDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp (285317 => 285318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp      2021-11-04 22:55:12 UTC (rev 285317)
+++ trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp 2021-11-04 23:18:23 UTC (rev 285318)
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(COCOA)
</span><del>-Vector<FontPlatformData::FontVariationAxis> FontPlatformData::variationAxes() const
</del><ins>+Vector<FontPlatformData::FontVariationAxis> FontPlatformData::variationAxes(ShouldLocalizeAxisNames) const
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: <webkit.org/b/219614> Not implemented yet.
</span><span class="cx">     return { };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontPlatformDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontPlatformData.h (285317 => 285318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontPlatformData.h        2021-11-04 22:55:12 UTC (rev 285317)
+++ trunk/Source/WebCore/platform/graphics/FontPlatformData.h   2021-11-04 23:18:23 UTC (rev 285318)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include "SharedBuffer.h"
</span><ins>+#include "ShouldLocalizeAxisNames.h"
</ins><span class="cx"> #include "TextFlags.h"
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/RetainPtr.h>
</span><span class="lines">@@ -179,7 +180,7 @@
</span><span class="cx">     bool isForTextCombine() const { return widthVariant() != FontWidthVariant::RegularWidth; } // Keep in sync with callers of FontDescription::setWidthVariant().
</span><span class="cx"> 
</span><span class="cx">     String familyName() const;
</span><del>-    Vector<FontVariationAxis> variationAxes() const;
</del><ins>+    Vector<FontVariationAxis> variationAxes(ShouldLocalizeAxisNames) const;
</ins><span class="cx"> 
</span><span class="cx"> #if USE(CAIRO)
</span><span class="cx">     cairo_scaled_font_t* scaledFont() const { return m_scaledFont.get(); }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsShouldLocalizeAxisNamesh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/ShouldLocalizeAxisNames.h (0 => 285318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ShouldLocalizeAxisNames.h                         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ShouldLocalizeAxisNames.h    2021-11-04 23:18:23 UTC (rev 285318)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <cstdint>
+
+namespace WebCore {
+
+enum class ShouldLocalizeAxisNames : uint8_t {
+    No,
+    Yes
+};
+
+}
</ins><span class="cx">Property changes on: trunk/Source/WebCore/platform/graphics/ShouldLocalizeAxisNames.h
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<ins>+Author Date Id Rev URL
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkSourceWebCoreplatformgraphicscocoaFontCacheCoreTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (285317 => 285318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp       2021-11-04 22:55:12 UTC (rev 285317)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp  2021-11-04 23:18:23 UTC (rev 285318)
</span><span class="lines">@@ -300,10 +300,22 @@
</span><span class="cx">     return CFStringGetLength(fontName) > 0 && CFStringGetCharacterAtIndex(fontName, 0) == '.';
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-VariationDefaultsMap defaultVariationValues(CTFontRef font)
</del><ins>+static RetainPtr<CFArrayRef> variationAxes(CTFontRef font, ShouldLocalizeAxisNames shouldLocalizeAxisNames)
</ins><span class="cx"> {
</span><ins>+#if defined(HAVE_CTFontCopyVariationAxesInternal) // This macro is defined inside CoreText, not WebKit.
+    if (shouldLocalizeAxisNames == ShouldLocalizeAxisNames::Yes)
+        return adoptCF(CTFontCopyVariationAxes(font));
+    return adoptCF(CTFontCopyVariationAxesInternal(font));
+#else
+    UNUSED_PARAM(shouldLocalizeAxisNames);
+    return adoptCF(CTFontCopyVariationAxes(font));
+#endif
+}
+
+VariationDefaultsMap defaultVariationValues(CTFontRef font, ShouldLocalizeAxisNames shouldLocalizeAxisNames)
+{
</ins><span class="cx">     VariationDefaultsMap result;
</span><del>-    auto axes = adoptCF(CTFontCopyVariationAxes(font));
</del><ins>+    auto axes = variationAxes(font, shouldLocalizeAxisNames);
</ins><span class="cx">     if (!axes)
</span><span class="cx">         return result;
</span><span class="cx">     auto size = CFArrayGetCount(axes.get());
</span><span class="lines">@@ -518,7 +530,7 @@
</span><span class="cx"> 
</span><span class="cx">     auto fontOpticalSizing = fontDescription.opticalSizing();
</span><span class="cx"> 
</span><del>-    auto defaultValues = defaultVariationValues(originalFont);
</del><ins>+    auto defaultValues = defaultVariationValues(originalFont, ShouldLocalizeAxisNames::No);
</ins><span class="cx"> 
</span><span class="cx">     auto fontSelectionRequest = fontDescription.fontSelectionRequest();
</span><span class="cx">     auto fontStyleAxis = fontDescription.fontStyleAxis();
</span><span class="lines">@@ -1021,7 +1033,7 @@
</span><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx">     auto font = adoptCF(CTFontCreateWithFontDescriptor(fontDescriptor, 0, nullptr));
</span><del>-    auto variations = adoptCF(CTFontCopyVariationAxes(font.get()));
</del><ins>+    auto variations = variationAxes(font.get(), ShouldLocalizeAxisNames::No);
</ins><span class="cx">     if (!variations)
</span><span class="cx">         return result;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaFontCacheCoreTexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h (285317 => 285318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h 2021-11-04 22:55:12 UTC (rev 285317)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h    2021-11-04 23:18:23 UTC (rev 285318)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include "FontDescription.h"
</span><ins>+#include "ShouldLocalizeAxisNames.h"
</ins><span class="cx"> 
</span><span class="cx"> #include <CoreText/CTFont.h>
</span><span class="cx"> 
</span><span class="lines">@@ -72,5 +73,5 @@
</span><span class="cx"> void addAttributesForWebFonts(CFMutableDictionaryRef attributes, AllowUserInstalledFonts);
</span><span class="cx"> RetainPtr<CFSetRef> installedFontMandatoryAttributes(AllowUserInstalledFonts);
</span><span class="cx"> 
</span><del>-VariationDefaultsMap defaultVariationValues(CTFontRef);
</del><ins>+VariationDefaultsMap defaultVariationValues(CTFontRef, ShouldLocalizeAxisNames);
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaFontPlatformDataCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm (285317 => 285318)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm    2021-11-04 22:55:12 UTC (rev 285317)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm       2021-11-04 23:18:23 UTC (rev 285318)
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Vector<FontPlatformData::FontVariationAxis> FontPlatformData::variationAxes() const
</del><ins>+Vector<FontPlatformData::FontVariationAxis> FontPlatformData::variationAxes(ShouldLocalizeAxisNames shouldLocalizeAxisNames) const
</ins><span class="cx"> {
</span><span class="cx">     auto platformFont = ctFont();
</span><span class="cx">     if (!platformFont)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">         return { };
</span><span class="cx">     
</span><span class="cx">     Vector<FontVariationAxis> results;
</span><del>-    for (auto& [tag, values] : defaultVariationValues(platformFont))
</del><ins>+    for (auto& [tag, values] : defaultVariationValues(platformFont, shouldLocalizeAxisNames))
</ins><span class="cx">         results.append(FontPlatformData::FontVariationAxis(values.axisName, String(tag.data(), tag.size()), values.defaultValue, values.minimumValue, values.maximumValue));
</span><span class="cx">     
</span><span class="cx">     return results;
</span></span></pre>
</div>
</div>

</body>
</html>