Bug 173328 - [macOS El Capitan and Sierra] [iOS 10] The system Japanese font cannot be italicized
Summary: [macOS El Capitan and Sierra] [iOS 10] The system Japanese font cannot be ita...
Status: RESOLVED DUPLICATE of bug 173300
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords:
Depends on:
Blocks: 173300
  Show dependency treegraph
 
Reported: 2017-06-13 14:12 PDT by Myles C. Maxfield
Modified: 2019-03-04 13:31 PST (History)
7 users (show)

See Also:


Attachments
Patch (1010.25 KB, patch)
2017-06-13 14:35 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (1.01 MB, patch)
2017-06-13 15:24 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (1.01 MB, patch)
2017-06-13 16:45 PDT, Myles C. Maxfield
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews100 for mac-elcapitan (1.75 MB, application/zip)
2017-06-13 18:13 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews115 for mac-elcapitan (2.23 MB, application/zip)
2017-06-13 20:47 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2017-06-13 14:12:40 PDT
[macOS El Capitan and Sierra] [iOS 10] The system Japanese font cannot be italicized
Comment 1 Myles C. Maxfield 2017-06-13 14:35:52 PDT
Created attachment 312811 [details]
Patch
Comment 2 Myles C. Maxfield 2017-06-13 15:24:43 PDT
Created attachment 312818 [details]
Patch
Comment 3 Myles C. Maxfield 2017-06-13 16:45:36 PDT
Created attachment 312828 [details]
Patch
Comment 4 Build Bot 2017-06-13 18:13:42 PDT
Comment on attachment 312828 [details]
Patch

Attachment 312828 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/3926337

New failing tests:
imported/w3c/web-platform-tests/html/dom/reflection-grouping.html
js/intl-datetimeformat.html
js/kde/parse.html
imported/w3c/web-platform-tests/html/dom/reflection-obsolete.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html
imported/w3c/web-platform-tests/html/dom/reflection-tabular.html
fast/url/idna2003.html
imported/w3c/web-platform-tests/html/dom/reflection-embedded.html
editing/text-iterator/rtl-first-letter-text-iterator-crash.html
fast/text/crash-obscure-text.html
imported/w3c/web-platform-tests/html/dom/reflection-forms.html
Comment 5 Build Bot 2017-06-13 18:13:44 PDT
Created attachment 312842 [details]
Archive of layout-test-results from ews100 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 6 Build Bot 2017-06-13 20:47:17 PDT
Comment on attachment 312828 [details]
Patch

Attachment 312828 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/3926894

New failing tests:
js/intl-datetimeformat.html
js/kde/parse.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html
fast/url/idna2003.html
editing/text-iterator/rtl-first-letter-text-iterator-crash.html
fast/text/crash-obscure-text.html
Comment 7 Build Bot 2017-06-13 20:47:19 PDT
Created attachment 312854 [details]
Archive of layout-test-results from ews115 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews115  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 8 Myles C. Maxfield 2017-06-15 18:20:11 PDT

*** This bug has been marked as a duplicate of bug 173300 ***
Comment 9 Daniel Bates 2019-03-02 15:39:44 PST
Comment on attachment 312828 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=312828&action=review

Is this patch still relevant? If it is then do you want to rebase it? If it isn’t then you want to close this bug? Patch contains too much magic for me.

> Source/WebCore/platform/graphics/ios/FontCacheIOS.mm:87
> +    if (weight >= FontSelectionValue(350)) {

Where is the magic number 350 coming from? What is the range we’re working with?

> Source/WebCore/platform/graphics/ios/FontCacheIOS.mm:90
> +    } else if (weight >= FontSelectionValue(250))

Such magic.

> Source/WebCore/platform/graphics/ios/FontCacheIOS.mm:92
> +    else if (weight >= FontSelectionValue(150))

Magic

> Source/WebCore/platform/graphics/ios/FontCacheIOS.mm:102
> +    RetainPtr<NSMutableDictionary> traitsDictionary = adoptNS([[NSMutableDictionary alloc] init]);

auto

> Source/WebCore/platform/graphics/ios/FontCacheIOS.mm:123
> +    [traitsDictionary setObject:[NSNumber numberWithFloat:ctWeight] forKey:static_cast<NSString *>(kCTFontWeightTrait)];

@(ctWeight)? @(kCT...)?

> Source/WebCore/platform/graphics/ios/FontCacheIOS.mm:128
> +        [traitsDictionary setObject:[NSNumber numberWithInt:kCTFontItalicTrait] forKey:static_cast<NSString *>(kCTFontSymbolicTrait)];

Similar questions, can we use literal syntax to simplify?

> Source/WebCore/platform/graphics/ios/FontCacheIOS.mm:130
> +    return @{ static_cast<NSString *>(kCTFontTraitsAttribute) : traitsDictionary.get() };

Can we use this syntax for all the unconditional items added to the dictionary and then that just leaves special handing for italic?