Bug 173043

Summary: [Cocoa] Expand system-ui to include every item in the Core Text cascade list
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: New BugsAssignee: Myles C. Maxfield <mmaxfield>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, buildbot, commit-queue, dino, jlewis3, jonlee, koivisto, mitz, rniwa, ryanhaddad, simon.fraser, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=173379
Attachments:
Description Flags
WIP
none
WIP
none
WIP
none
WIP
none
Patch
none
Archive of layout-test-results from ews102 for mac-elcapitan
none
Archive of layout-test-results from ews105 for mac-elcapitan-wk2
none
Patch
none
Archive of layout-test-results from ews106 for mac-elcapitan-wk2
none
Patch
none
Patch
none
Updated patch for committing
none
Updated patch for committing
none
Test fix
none
Patch
none
Patch
none
Patch for committing none

Myles C. Maxfield
Reported 2017-06-06 18:04:39 PDT
Make system-ui not suck
Attachments
WIP (17.07 KB, patch)
2017-06-06 18:04 PDT, Myles C. Maxfield
no flags
WIP (17.93 KB, patch)
2017-06-06 18:21 PDT, Myles C. Maxfield
no flags
WIP (22.01 KB, patch)
2017-06-06 19:42 PDT, Myles C. Maxfield
no flags
WIP (26.97 KB, patch)
2017-06-07 18:09 PDT, Myles C. Maxfield
no flags
Patch (49.70 KB, patch)
2017-06-08 01:19 PDT, Myles C. Maxfield
no flags
Archive of layout-test-results from ews102 for mac-elcapitan (1.72 MB, application/zip)
2017-06-08 11:22 PDT, Build Bot
no flags
Archive of layout-test-results from ews105 for mac-elcapitan-wk2 (1.93 MB, application/zip)
2017-06-08 11:30 PDT, Build Bot
no flags
Patch (1.02 MB, patch)
2017-06-08 12:11 PDT, Myles C. Maxfield
no flags
Archive of layout-test-results from ews106 for mac-elcapitan-wk2 (1.09 MB, application/zip)
2017-06-08 13:21 PDT, Build Bot
no flags
Patch (1.02 MB, patch)
2017-06-08 15:29 PDT, Myles C. Maxfield
no flags
Patch (1.03 MB, patch)
2017-06-10 23:51 PDT, Myles C. Maxfield
no flags
Updated patch for committing (1.03 MB, patch)
2017-06-12 16:32 PDT, Myles C. Maxfield
no flags
Updated patch for committing (1.03 MB, patch)
2017-06-12 16:53 PDT, Myles C. Maxfield
no flags
Test fix (1.78 KB, patch)
2017-06-13 15:30 PDT, Myles C. Maxfield
no flags
Patch (67.41 KB, patch)
2017-06-15 14:12 PDT, Myles C. Maxfield
no flags
Patch (69.41 KB, patch)
2017-06-15 16:56 PDT, Myles C. Maxfield
no flags
Patch for committing (69.44 KB, patch)
2017-06-15 17:15 PDT, Myles C. Maxfield
no flags
Myles C. Maxfield
Comment 1 2017-06-06 18:04:56 PDT
Myles C. Maxfield
Comment 2 2017-06-06 18:21:15 PDT
Myles C. Maxfield
Comment 3 2017-06-06 19:42:29 PDT
Myles C. Maxfield
Comment 4 2017-06-07 18:09:25 PDT
Myles C. Maxfield
Comment 5 2017-06-08 01:19:45 PDT
Build Bot
Comment 6 2017-06-08 11:22:50 PDT
Comment on attachment 312285 [details] Patch Attachment 312285 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/3895013 New failing tests: fast/text/international/pop-up-button-text-alignment-and-direction.html fast/forms/visual-hebrew-text-field.html fast/forms/searchfield-heights.html fast/forms/listbox-bidi-align.html fast/forms/select-visual-hebrew.html fast/text/system-font-fallback-emoji.html fast/css/rtl-ordering.html fast/text/updateNewFont.html fast/text/drawBidiText.html fast/forms/search-rtl.html fast/forms/listbox-hit-test-zoomed.html
Build Bot
Comment 7 2017-06-08 11:22:51 PDT
Created attachment 312325 [details] Archive of layout-test-results from ews102 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 8 2017-06-08 11:30:45 PDT
Comment on attachment 312285 [details] Patch Attachment 312285 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/3895051 New failing tests: fast/text/international/pop-up-button-text-alignment-and-direction.html fast/forms/visual-hebrew-text-field.html fast/forms/searchfield-heights.html fast/forms/listbox-bidi-align.html fast/forms/select-visual-hebrew.html fast/text/system-font-fallback-emoji.html fast/css/rtl-ordering.html fast/text/updateNewFont.html fast/text/drawBidiText.html fast/forms/listbox-hit-test-zoomed.html fast/forms/search-rtl.html
Build Bot
Comment 9 2017-06-08 11:30:47 PDT
Created attachment 312327 [details] Archive of layout-test-results from ews105 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Myles C. Maxfield
Comment 10 2017-06-08 12:11:44 PDT
Build Bot
Comment 11 2017-06-08 13:21:33 PDT
Comment on attachment 312332 [details] Patch Attachment 312332 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/3895570 New failing tests: fast/mediastream/getUserMedia-grant-persistency.html
Build Bot
Comment 12 2017-06-08 13:21:34 PDT
Created attachment 312336 [details] Archive of layout-test-results from ews106 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Myles C. Maxfield
Comment 13 2017-06-08 13:54:08 PDT
Looks like failure is unrelated.
Myles C. Maxfield
Comment 14 2017-06-08 14:05:57 PDT
Myles C. Maxfield
Comment 15 2017-06-08 14:06:20 PDT
Myles C. Maxfield
Comment 17 2017-06-08 15:29:47 PDT
Simon Fraser (smfr)
Comment 18 2017-06-08 15:40:34 PDT
Comment on attachment 312354 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=312354&action=review > Source/WebCore/platform/graphics/FontDescription.h:41 > +#include "FontFamilySpecificationCoreText.h" > +#else > +#include "FontFamilyPlatformSpecification.h" The name mismatch here is a bit jarring. > Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:732 > + CFNotificationCenterAddObserver(center, this, &fontCacheRegisteredFontsChangedNotificationCallback, notificationName, nullptr, CFNotificationSuspensionBehaviorDeliverImmediately); Do we need to call CFNotificationCenterRemove{Every}Observer at some point? > Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp:85 > + Vector<RetainPtr<CTFontDescriptorRef>> systemFontCascadeList(CoreTextCascadeListParameters parameters) const CoreTextCascadeListParameters& > Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp:105 > + RetainPtr<CTFontRef> applyWeightAndItalics(CTFontRef font, CGFloat weight, bool italic, float size) Can this be const or static? I don't see it changing local state. > Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp:121 > + Vector<RetainPtr<CTFontDescriptorRef>> computeCascadeList(CTFontRef font, CFStringRef locale) Can this be const or static? I don't see it changing local state. > Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp:182 > + auto weight = description.weight(); > + if (weight < FontSelectionValue(150)) > + result.weight = kCTFontWeightUltraLight; > + else if (weight < FontSelectionValue(250)) > + result.weight = kCTFontWeightThin; > + else if (weight < FontSelectionValue(350)) > + result.weight = kCTFontWeightLight; > + else if (weight < FontSelectionValue(450)) > + result.weight = kCTFontWeightRegular; > + else if (weight < FontSelectionValue(550)) > + result.weight = kCTFontWeightMedium; > + else if (weight < FontSelectionValue(650)) > + result.weight = kCTFontWeightSemibold; > + else if (weight < FontSelectionValue(750)) > + result.weight = kCTFontWeightBold; > + else if (weight < FontSelectionValue(850)) > + result.weight = kCTFontWeightHeavy; > + else > + result.weight = kCTFontWeightBlack; This feels like the reverse mapping of code I reviewed a short time ago. Would be nice to put both in the the same place. > Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp:214 > + index -= cascadeList.size(); What guarantees that index doesn't underflow? > Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp:218 > + --index; Ditto.
Myles C. Maxfield
Comment 19 2017-06-08 17:01:46 PDT
Comment on attachment 312354 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=312354&action=review >> Source/WebCore/platform/graphics/FontDescription.h:41 >> +#include "FontFamilyPlatformSpecification.h" > > The name mismatch here is a bit jarring. FontFamilyPlatformSpecification.h => FontFamilySpecificationNull.h >> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:732 >> + CFNotificationCenterAddObserver(center, this, &fontCacheRegisteredFontsChangedNotificationCallback, notificationName, nullptr, CFNotificationSuspensionBehaviorDeliverImmediately); > > Do we need to call CFNotificationCenterRemove{Every}Observer at some point? FontCache is a singleton that never gets destroyed, so we don't. >> Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp:214 >> + index -= cascadeList.size(); > > What guarantees that index doesn't underflow? Line 212, if (index < cascadeList.size()) >> Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp:218 >> + --index; > > Ditto. Line 215, if (!index)
mitz
Comment 20 2017-06-08 17:03:55 PDT
Comment on attachment 312354 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=312354&action=review > Source/WebCore/WebCore.xcodeproj/project.pbxproj:995 > + 1C12AC2B1EE778AE0079E0A0 /* FontFamilySpecificationCoreText.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C12AC291EE778AE0079E0A0 /* FontFamilySpecificationCoreText.h */; settings = {ATTRIBUTES = (Private, ); }; }; Does this really need to be a private header?
Myles C. Maxfield
Comment 21 2017-06-08 17:13:14 PDT
Comment on attachment 312354 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=312354&action=review >> Source/WebCore/WebCore.xcodeproj/project.pbxproj:995 >> + 1C12AC2B1EE778AE0079E0A0 /* FontFamilySpecificationCoreText.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C12AC291EE778AE0079E0A0 /* FontFamilySpecificationCoreText.h */; settings = {ATTRIBUTES = (Private, ); }; }; > > Does this really need to be a private header? Yes, because it's included from FontDescription.h which is also a private header. WebKit doesn't compile if it isn't.
Myles C. Maxfield
Comment 22 2017-06-08 17:31:23 PDT
Matt Lewis
Comment 23 2017-06-09 10:00:29 PDT
It looks like this revision may have cause several API Failures on macOS Debug with: WKWebView.NavigatorLanguage WebKit1.NavigatorLanguage It looks to be and assertion failure: ASSERTION FAILED: CFEqual(name, kCTFontManagerRegisteredFontsChangedNotification) https://build.webkit.org/builders/Apple%20El%20Capitan%20Debug%20WK2%20%28Tests%29/builds/1607 https://build.webkit.org/builders/Apple%20El%20Capitan%20Debug%20WK2%20%28Tests%29/builds/1607/steps/run-api-tests/logs/stdio
Alexey Proskuryakov
Comment 24 2017-06-09 12:28:37 PDT
This change was rolled back in r218009.
Myles C. Maxfield
Comment 25 2017-06-10 22:30:50 PDT
WebPopupMenu::setUpPlatformData() is trying to encode a new font for IPC. This new font has a cascade list full of CTFontDescriptorRefs, and our IPC code doesn’t know how to handle those. I could either teach our IPC code how to serialize a CTFontDescriptorRef, or I could just remove the kCTFontCascadeListAttribute key from the attributes dictionary.
Myles C. Maxfield
Comment 26 2017-06-10 23:51:36 PDT
Myles C. Maxfield
Comment 27 2017-06-12 16:32:47 PDT
Created attachment 312722 [details] Updated patch for committing
Myles C. Maxfield
Comment 28 2017-06-12 16:53:18 PDT
Created attachment 312730 [details] Updated patch for committing
WebKit Commit Bot
Comment 29 2017-06-12 18:35:17 PDT
Comment on attachment 312730 [details] Updated patch for committing Clearing flags on attachment: 312730 Committed r218161: <http://trac.webkit.org/changeset/218161>
WebKit Commit Bot
Comment 30 2017-06-12 18:35:21 PDT
All reviewed patches have been landed. Closing bug.
Myles C. Maxfield
Comment 32 2017-06-13 14:58:48 PDT
(In reply to Matt Lewis from comment #31) > So the new patch seems to have fixed the API issue on the Mac Release builds > but it is still failing on the Debug builds. > > Debug builds: > https://build.webkit.org/builders/Apple%20Sierra%20Debug%20WK2%20%28Tests%29/ > builds/1519 > https://build.webkit.org/builders/Apple%20Sierra%20Debug%20WK2%20%28Tests%29/ > builds/1519/steps/run-api-tests/logs/stdio > > Release: > https://build.webkit.org/builders/ > Apple%20Sierra%20Release%20WK2%20%28Tests%29/builds/2205 Yeah, I just forgot to update the ASSERT(). I'll do it ASAP. Thanks for catching this.
Myles C. Maxfield
Comment 33 2017-06-13 15:30:22 PDT
Reopening to attach new patch.
Myles C. Maxfield
Comment 34 2017-06-13 15:30:23 PDT
Created attachment 312820 [details] Test fix
Matt Lewis
Comment 35 2017-06-14 12:59:50 PDT
*** Bug 173379 has been marked as a duplicate of this bug. ***
Matt Lewis
Comment 36 2017-06-14 13:01:15 PDT
The Revision caused a Layout test failure for: fast/text/system-font-fallback-emoji.html
Matt Lewis
Comment 37 2017-06-14 13:01:19 PDT
Reverted r218161 for reason: Introduced bot API test failures and Layout Test Failures. Committed r218287: <http://trac.webkit.org/changeset/218287>
Myles C. Maxfield
Comment 38 2017-06-15 14:12:39 PDT
Myles C. Maxfield
Comment 39 2017-06-15 16:56:40 PDT
Myles C. Maxfield
Comment 40 2017-06-15 17:15:31 PDT
Created attachment 313031 [details] Patch for committing
Myles C. Maxfield
Comment 41 2017-06-15 17:56:51 PDT
Myles C. Maxfield
Comment 42 2017-06-15 18:08:04 PDT
Note You need to log in before you can comment on or make changes to this bug.