WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
197528
font-optical-sizing applies the wrong variation value
https://bugs.webkit.org/show_bug.cgi?id=197528
Summary
font-optical-sizing applies the wrong variation value
Myles C. Maxfield
Reported
2019-05-02 13:35:17 PDT
font-optical-sizing applies the wrong variation value
Attachments
Needs version check
(10.58 KB, patch)
2019-05-02 13:38 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews100 for mac-highsierra
(3.71 MB, application/zip)
2019-05-02 14:21 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews105 for mac-highsierra-wk2
(3.36 MB, application/zip)
2019-05-02 14:34 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews117 for mac-highsierra
(3.41 MB, application/zip)
2019-05-02 15:09 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews126 for ios-simulator-wk2
(3.25 MB, application/zip)
2019-05-02 15:23 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews213 for win-future
(13.72 MB, application/zip)
2019-05-02 16:46 PDT
,
EWS Watchlist
no flags
Details
WIP
(23.43 KB, patch)
2019-05-17 15:09 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(316.57 KB, patch)
2019-05-17 18:17 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews103 for mac-highsierra
(3.67 MB, application/zip)
2019-05-17 19:23 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews104 for mac-highsierra-wk2
(3.21 MB, application/zip)
2019-05-17 19:36 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews115 for mac-highsierra
(3.57 MB, application/zip)
2019-05-17 20:09 PDT
,
EWS Watchlist
no flags
Details
Patch
(317.34 KB, patch)
2019-05-20 09:33 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews215 for win-future
(13.30 MB, application/zip)
2019-05-20 10:48 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews105 for mac-highsierra-wk2
(3.12 MB, application/zip)
2019-05-20 10:51 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews117 for mac-highsierra
(3.44 MB, application/zip)
2019-05-20 11:24 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews101 for mac-highsierra
(3.53 MB, application/zip)
2019-05-20 13:12 PDT
,
EWS Watchlist
no flags
Details
Patch
(322.28 KB, patch)
2019-05-20 16:54 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(322.35 KB, patch)
2019-05-20 16:55 PDT
,
Myles C. Maxfield
koivisto
: review+
Details
Formatted Diff
Diff
Archive of layout-test-results from ews114 for mac-highsierra
(2.96 MB, application/zip)
2019-05-20 19:04 PDT
,
EWS Watchlist
no flags
Details
Patch for committing
(323.74 KB, patch)
2019-05-22 17:15 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Show Obsolete
(18)
View All
Add attachment
proposed patch, testcase, etc.
Myles C. Maxfield
Comment 1
2019-05-02 13:38:38 PDT
Created
attachment 368815
[details]
Needs version check
EWS Watchlist
Comment 2
2019-05-02 13:40:07 PDT
Attachment 368815
[details]
did not pass style-queue: ERROR: Source/WebCore/ChangeLog:17: You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible. [changelog/nonewtests] [5] Total errors found: 1 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Myles C. Maxfield
Comment 3
2019-05-02 13:45:34 PDT
<
rdar://problem/50152854
>
Myles C. Maxfield
Comment 4
2019-05-02 13:47:29 PDT
I probably need to make a font to test this
Myles C. Maxfield
Comment 5
2019-05-02 14:01:59 PDT
We also might want to consider whether the font is system ui or not
EWS Watchlist
Comment 6
2019-05-02 14:21:15 PDT
Comment on
attachment 368815
[details]
Needs version check
Attachment 368815
[details]
did not pass mac-ews (mac): Output:
https://webkit-queues.webkit.org/results/12064977
New failing tests: fast/text/justify-ideograph-complex.html
EWS Watchlist
Comment 7
2019-05-02 14:21:17 PDT
Created
attachment 368820
[details]
Archive of layout-test-results from ews100 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-highsierra Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 8
2019-05-02 14:34:42 PDT
Comment on
attachment 368815
[details]
Needs version check
Attachment 368815
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
https://webkit-queues.webkit.org/results/12065111
New failing tests: fast/text/justify-ideograph-complex.html
EWS Watchlist
Comment 9
2019-05-02 14:34:43 PDT
Created
attachment 368823
[details]
Archive of layout-test-results from ews105 for mac-highsierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-highsierra-wk2 Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 10
2019-05-02 15:09:55 PDT
Comment on
attachment 368815
[details]
Needs version check
Attachment 368815
[details]
did not pass mac-debug-ews (mac): Output:
https://webkit-queues.webkit.org/results/12065220
New failing tests: fast/text/justify-ideograph-complex.html
EWS Watchlist
Comment 11
2019-05-02 15:09:57 PDT
Created
attachment 368826
[details]
Archive of layout-test-results from ews117 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews117 Port: mac-highsierra Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 12
2019-05-02 15:23:23 PDT
Comment on
attachment 368815
[details]
Needs version check
Attachment 368815
[details]
did not pass ios-sim-ews (ios-simulator-wk2): Output:
https://webkit-queues.webkit.org/results/12065267
New failing tests: platform/ios/ios/fast/text/opticalFontWithWeight.html platform/ios/ios/fast/text/opticalFontWithTextStyle.html fast/forms/auto-fill-button/input-strong-password-auto-fill-button.html
EWS Watchlist
Comment 13
2019-05-02 15:23:25 PDT
Created
attachment 368827
[details]
Archive of layout-test-results from ews126 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews126 Port: ios-simulator-wk2 Platform: Mac OS X 10.14.4
EWS Watchlist
Comment 14
2019-05-02 16:46:06 PDT
Comment on
attachment 368815
[details]
Needs version check
Attachment 368815
[details]
did not pass win-ews (win): Output:
https://webkit-queues.webkit.org/results/12067490
New failing tests: security/contentSecurityPolicy/video-with-file-url-allowed-by-media-src-star.html legacy-animation-engine/fast/layers/no-clipping-overflow-hidden-hardware-acceleration.html
EWS Watchlist
Comment 15
2019-05-02 16:46:09 PDT
Created
attachment 368845
[details]
Archive of layout-test-results from ews213 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews213 Port: win-future Platform: CYGWIN_NT-10.0-17763-3.0.5-338.x86_64-x86_64-64bit
Myles C. Maxfield
Comment 16
2019-05-17 15:09:19 PDT
Created
attachment 370156
[details]
WIP
Myles C. Maxfield
Comment 17
2019-05-17 18:17:47 PDT
Created
attachment 370173
[details]
Patch
EWS Watchlist
Comment 18
2019-05-17 19:23:40 PDT
Comment on
attachment 370173
[details]
Patch
Attachment 370173
[details]
did not pass mac-ews (mac): Output:
https://webkit-queues.webkit.org/results/12221141
New failing tests: fast/text/variations/case-axis-names.html fast/text/variations/font-selection-properties.html fast/text/variations/gx-width.html fast/text/variations/font-face-clamp.html fast/text/justify-ideograph-complex.html fast/text/optical-sizing-trak-2.html
EWS Watchlist
Comment 19
2019-05-17 19:23:42 PDT
Created
attachment 370176
[details]
Archive of layout-test-results from ews103 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews103 Port: mac-highsierra Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 20
2019-05-17 19:36:39 PDT
Comment on
attachment 370173
[details]
Patch
Attachment 370173
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
https://webkit-queues.webkit.org/results/12221189
New failing tests: fast/text/variations/case-axis-names.html fast/text/variations/font-selection-properties.html fast/text/variations/gx-width.html fast/text/variations/font-face-clamp.html fast/text/justify-ideograph-complex.html fast/text/optical-sizing-trak-2.html
EWS Watchlist
Comment 21
2019-05-17 19:36:40 PDT
Created
attachment 370178
[details]
Archive of layout-test-results from ews104 for mac-highsierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-highsierra-wk2 Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 22
2019-05-17 20:09:34 PDT
Comment on
attachment 370173
[details]
Patch
Attachment 370173
[details]
did not pass mac-debug-ews (mac): Output:
https://webkit-queues.webkit.org/results/12221231
New failing tests: fast/text/variations/case-axis-names.html fast/text/variations/font-selection-properties.html fast/text/variations/gx-width.html fast/text/variations/font-face-clamp.html fast/text/justify-ideograph-complex.html fast/text/optical-sizing-trak-2.html
EWS Watchlist
Comment 23
2019-05-17 20:09:36 PDT
Created
attachment 370179
[details]
Archive of layout-test-results from ews115 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-highsierra Platform: Mac OS X 10.13.6
Daniel Bates
Comment 24
2019-05-17 20:24:15 PDT
Comment on
attachment 370173
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=370173&action=review
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:513 > + case 'trak':
Ok as is. Wow. Wow. Wow. A multi character constant. I have never run across this in practice until now... its impl defined. Clever. Very clever. I actually don't know which I prefer the cleverness or using the k-type constant. Kinda leaning towards the later if I were to ever touch this function for source compatibility. Likely never will or could be changed though :/ could in theory be made safe for all compilers though :/
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:514 > + foundTrak = true;
Ok as is. Missing a break.
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:529 > + enum class TrackingType {
Ok as is. Missing a width. In my opinion, looks prettier in one line.
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:532 > + Manual
Ok as-is. Missing comma for future proofing.
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:555 > const auto& variations = fontDescription.variationSettings();
^^^^ remove the unused_param for size above this line.
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:558 > + FontType fontType(originalFont);
Ok as is. Uniform initializer syntax is prettier in my opinion.
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:560 > + bool forceOpticalSizingOn = fontOpticalSizing == FontOpticalSizing::Enabled && (fontType.variationType == FontType::VariationType::TrueTypeGX && defaultValues.contains({{'o', 'p', 's', 'z'}}));
Ok as is. Parens not needed. All you have are &&s
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:563 > + if (!originalFont || (!features.size() && variations.isEmpty() && textRenderingMode == TextRenderingMode::AutoTextRendering && variantSettings.isAllNormal() && fontOpticalSizing == FontOpticalSizing::Enabled && !forceOpticalSizingOn
Ok as is. No, features.isEmpty? I would add one in my opinion.
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:564 > && (!fontFaceFeatures || !fontFaceFeatures->size()) && (!fontFaceVariantSettings || fontFaceVariantSettings->isAllNormal())))
Ok as is. Again, no isEmpty()?
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:565 > return originalFont;
^^^^ in my opinion if condition could be simplified and made more readable by extracting into local vars.
Daniel Bates
Comment 25
2019-05-17 20:24:18 PDT
View in context:
https://bugs.webkit.org/attachment.cgi?id=370173&action=review
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:513 > + case 'trak':
Ok as is. Wow. Wow. Wow. A multi character constant. I have never run across this in practice until now... its impl defined. Clever. Very clever. I actually don't know which I prefer the cleverness or using the k-type constant. Kinda leaning towards the later if I were to ever touch this function for source compatibility. Likely never will or could be changed though :/ could in theory be made safe for all compilers though :/
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:514 > + foundTrak = true;
Ok as is. Missing a break.
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:529 > + enum class TrackingType {
Ok as is. Missing a width. In my opinion, looks prettier in one line.
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:532 > + Manual
Ok as-is. Missing comma for future proofing.
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:555 > const auto& variations = fontDescription.variationSettings();
^^^^ remove the unused_param for size above this line.
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:558 > + FontType fontType(originalFont);
Ok as is. Uniform initializer syntax is prettier in my opinion.
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:560 > + bool forceOpticalSizingOn = fontOpticalSizing == FontOpticalSizing::Enabled && (fontType.variationType == FontType::VariationType::TrueTypeGX && defaultValues.contains({{'o', 'p', 's', 'z'}}));
Ok as is. Parens not needed. All you have are &&s
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:563 > + if (!originalFont || (!features.size() && variations.isEmpty() && textRenderingMode == TextRenderingMode::AutoTextRendering && variantSettings.isAllNormal() && fontOpticalSizing == FontOpticalSizing::Enabled && !forceOpticalSizingOn
Ok as is. No, features.isEmpty? I would add one in my opinion.
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:564 > && (!fontFaceFeatures || !fontFaceFeatures->size()) && (!fontFaceVariantSettings || fontFaceVariantSettings->isAllNormal())))
Ok as is. Again, no isEmpty()?
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:565 > return originalFont;
^^^^ in my opinion if condition could be simplified and made more readable by extracting into local vars.
Maciej Stachowiak
Comment 26
2019-05-19 15:30:38 PDT
Looks like the new tests are all failing on High Sierra.
Myles C. Maxfield
Comment 27
2019-05-20 09:33:29 PDT
Created
attachment 370255
[details]
Patch
EWS Watchlist
Comment 28
2019-05-20 10:48:04 PDT
Comment on
attachment 370255
[details]
Patch
Attachment 370255
[details]
did not pass win-ews (win): Output:
https://webkit-queues.webkit.org/results/12237507
New failing tests: fast/text/optical-sizing-units-2.html fast/text/optical-sizing-trak-2.html
EWS Watchlist
Comment 29
2019-05-20 10:48:07 PDT
Created
attachment 370262
[details]
Archive of layout-test-results from ews215 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews215 Port: win-future Platform: CYGWIN_NT-10.0-17763-3.0.5-338.x86_64-x86_64-64bit
EWS Watchlist
Comment 30
2019-05-20 10:51:07 PDT
Comment on
attachment 370255
[details]
Patch
Attachment 370255
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
https://webkit-queues.webkit.org/results/12237448
New failing tests: fast/text/justify-ideograph-complex.html fast/text/optical-sizing-trak-2.html
EWS Watchlist
Comment 31
2019-05-20 10:51:09 PDT
Created
attachment 370263
[details]
Archive of layout-test-results from ews105 for mac-highsierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-highsierra-wk2 Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 32
2019-05-20 11:24:26 PDT
Comment on
attachment 370255
[details]
Patch
Attachment 370255
[details]
did not pass mac-debug-ews (mac): Output:
https://webkit-queues.webkit.org/results/12237569
New failing tests: fast/text/justify-ideograph-complex.html fast/text/optical-sizing-trak-2.html
EWS Watchlist
Comment 33
2019-05-20 11:24:28 PDT
Created
attachment 370266
[details]
Archive of layout-test-results from ews117 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews117 Port: mac-highsierra Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 34
2019-05-20 13:12:35 PDT
Comment on
attachment 370255
[details]
Patch
Attachment 370255
[details]
did not pass mac-ews (mac): Output:
https://webkit-queues.webkit.org/results/12238574
New failing tests: fast/text/justify-ideograph-complex.html fast/text/optical-sizing-trak-2.html
EWS Watchlist
Comment 35
2019-05-20 13:12:37 PDT
Created
attachment 370269
[details]
Archive of layout-test-results from ews101 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-highsierra Platform: Mac OS X 10.13.6
Myles C. Maxfield
Comment 36
2019-05-20 16:54:21 PDT
Created
attachment 370281
[details]
Patch
Myles C. Maxfield
Comment 37
2019-05-20 16:55:41 PDT
Created
attachment 370282
[details]
Patch
EWS Watchlist
Comment 38
2019-05-20 19:04:14 PDT
Comment on
attachment 370282
[details]
Patch
Attachment 370282
[details]
did not pass mac-debug-ews (mac): Output:
https://webkit-queues.webkit.org/results/12240975
New failing tests: webaudio/silent-audio-interrupted-in-background.html
EWS Watchlist
Comment 39
2019-05-20 19:04:16 PDT
Created
attachment 370291
[details]
Archive of layout-test-results from ews114 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-highsierra Platform: Mac OS X 10.13.6
Myles C. Maxfield
Comment 40
2019-05-20 22:43:39 PDT
Test failure is unrelated.
Antti Koivisto
Comment 41
2019-05-21 13:02:22 PDT
Comment on
attachment 370282
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=370282&action=review
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:557 > + if (!originalFont || (features.isEmpty() && !forceVariations && variations.isEmpty() && textRenderingMode == TextRenderingMode::AutoTextRendering && variantSettings.isAllNormal() && fontOpticalSizing == FontOpticalSizing::Enabled && !forceOpticalSizingOn > + && (!fontFaceFeatures || fontFaceFeatures->isEmpty()) && (!fontFaceVariantSettings || fontFaceVariantSettings->isAllNormal())))
The test would read better with some sensibly named helper booleans, or as a lambda function.
Antti Koivisto
Comment 42
2019-05-21 13:36:55 PDT
Comment on
attachment 370282
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=370282&action=review
> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:527 > + enum class TrackingType : uint8_t { None, Automatic, Manual, }; > + TrackingType trackingType { TrackingType::None };
We have this new code to compute trackingType but I don't see trackingType actually being used anywhere? Can you just remove the code and simplify the patch?
Myles C. Maxfield
Comment 43
2019-05-21 16:20:54 PDT
Committed
r245598
: <
https://trac.webkit.org/changeset/245598
>
Ryan Haddad
Comment 44
2019-05-22 14:39:21 PDT
Reverted
r245598
for reason: Breaks watchOS build. Committed
r245647
: <
https://trac.webkit.org/changeset/245647
>
Myles C. Maxfield
Comment 45
2019-05-22 17:15:47 PDT
Created
attachment 370470
[details]
Patch for committing
Myles C. Maxfield
Comment 46
2019-05-22 21:16:36 PDT
This latest patch includes the fix from
https://bugs.webkit.org/show_bug.cgi?id=198099
Myles C. Maxfield
Comment 47
2019-05-22 21:18:20 PDT
***
Bug 198099
has been marked as a duplicate of this bug. ***
Myles C. Maxfield
Comment 48
2019-05-22 21:18:59 PDT
Committed
r245672
: <
https://trac.webkit.org/changeset/245672
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug