Bug 152322

Summary: [Cocoa] lang=zh-HK doesn't cause a Hong Kong-specific font to be used
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: New BugsAssignee: Myles C. Maxfield <mmaxfield>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: buildbot, commit-queue, dino, jonlee, rniwa, simon.fraser, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Archive of layout-test-results from ews103 for mac-yosemite
none
Archive of layout-test-results from ews105 for mac-yosemite-wk2
none
Archive of layout-test-results from ews113 for mac-yosemite
none
Patch darin: review+

Myles C. Maxfield
Reported 2015-12-15 20:01:03 PST
[Cocoa] lang=zh-HK doesn't cause a Hong Kong-specific font to be used
Attachments
Patch (6.97 KB, patch)
2015-12-15 20:02 PST, Myles C. Maxfield
no flags
Patch (7.04 KB, patch)
2015-12-15 20:06 PST, Myles C. Maxfield
no flags
Archive of layout-test-results from ews103 for mac-yosemite (1.63 MB, application/zip)
2015-12-15 20:54 PST, Build Bot
no flags
Archive of layout-test-results from ews105 for mac-yosemite-wk2 (1.34 MB, application/zip)
2015-12-15 20:58 PST, Build Bot
no flags
Archive of layout-test-results from ews113 for mac-yosemite (1.25 MB, application/zip)
2015-12-15 20:59 PST, Build Bot
no flags
Patch (9.70 KB, patch)
2015-12-15 21:00 PST, Myles C. Maxfield
darin: review+
Myles C. Maxfield
Comment 1 2015-12-15 20:02:14 PST
WebKit Commit Bot
Comment 2 2015-12-15 20:04:13 PST
Attachment 267425 [details] did not pass style-queue: ERROR: Source/WebCore/platform/text/LocaleToScriptMapping.h:40: USCRIPT_HONG_KONG is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 1 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Myles C. Maxfield
Comment 3 2015-12-15 20:06:24 PST
Myles C. Maxfield
Comment 4 2015-12-15 20:06:39 PST
WebKit Commit Bot
Comment 5 2015-12-15 20:08:43 PST
Attachment 267426 [details] did not pass style-queue: ERROR: Source/WebCore/platform/text/LocaleToScriptMapping.h:40: USCRIPT_HONG_KONG is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 1 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Build Bot
Comment 6 2015-12-15 20:54:38 PST
Comment on attachment 267426 [details] Patch Attachment 267426 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/565175 New failing tests: fast/text/han-generic-font-families.html
Build Bot
Comment 7 2015-12-15 20:54:42 PST
Created attachment 267429 [details] Archive of layout-test-results from ews103 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews103 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 8 2015-12-15 20:58:56 PST
Comment on attachment 267426 [details] Patch Attachment 267426 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/565178 New failing tests: fast/text/han-generic-font-families.html
Build Bot
Comment 9 2015-12-15 20:58:59 PST
Created attachment 267431 [details] Archive of layout-test-results from ews105 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Build Bot
Comment 10 2015-12-15 20:59:39 PST
Comment on attachment 267426 [details] Patch Attachment 267426 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/565170 New failing tests: fast/text/han-generic-font-families.html
Build Bot
Comment 11 2015-12-15 20:59:42 PST
Created attachment 267432 [details] Archive of layout-test-results from ews113 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews113 Port: mac-yosemite Platform: Mac OS X 10.10.5
Myles C. Maxfield
Comment 12 2015-12-15 21:00:44 PST
WebKit Commit Bot
Comment 13 2015-12-15 21:01:43 PST
Attachment 267433 [details] did not pass style-queue: ERROR: Source/WebCore/platform/text/LocaleToScriptMapping.h:40: USCRIPT_HONG_KONG is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 1 in 12 files If any of these errors are false positives, please file a bug against check-webkit-style.
Darin Adler
Comment 14 2015-12-16 09:16:13 PST
Comment on attachment 267433 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=267433&action=review > Source/WebCore/platform/text/LocaleToScriptMapping.h:40 > +// No script for Hong Kong, but generic font selection must receive a unique identifier > +const UScriptCode USCRIPT_HONG_KONG = static_cast<UScriptCode>(USCRIPT_CODE_LIMIT + 1); I think it’s slightly peculiar for us to use the same formatting that ICU itself uses for our non-ICU constant. I understand that it’s safe for us to define our own value for UScriptCode as long as we don’t try to pass it back to ICU, but I think it would be slightly nicer to use a constant name that makes it clearer that it’s not actually a real ICU UScriptCode.
Darin Adler
Comment 15 2015-12-16 09:25:57 PST
Comment on attachment 267433 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=267433&action=review >> Source/WebCore/platform/text/LocaleToScriptMapping.h:40 >> +const UScriptCode USCRIPT_HONG_KONG = static_cast<UScriptCode>(USCRIPT_CODE_LIMIT + 1); > > I think it’s slightly peculiar for us to use the same formatting that ICU itself uses for our non-ICU constant. I understand that it’s safe for us to define our own value for UScriptCode as long as we don’t try to pass it back to ICU, but I think it would be slightly nicer to use a constant name that makes it clearer that it’s not actually a real ICU UScriptCode. Given how we handle ICU headers, I think it’s risky to use USCRIPT_CODE_LIMIT for this. It’s possible that the actual ICU library will be newer than the headers, and so a script code will be higher than what the header thinks the limit is; that might even cause problem in practice. I suggest we consider the possibility something safer like use a maximum value of some sort, or even find a way to defining our own type that contains both a UScriptCode and additional information so we can track that this is a Hong Kong script without any non-standard UScriptCode tricks.
Myles C. Maxfield
Comment 16 2021-02-19 17:42:27 PST
This was fixed by r241288
Myles C. Maxfield
Comment 17 2021-02-19 18:34:46 PST
*** This bug has been marked as a duplicate of bug 187723 ***
Note You need to log in before you can comment on or make changes to this bug.