Bug 172737

Summary: REGRESSION(r213464): [iOS] Fonts get too bold when the "Bold Text" accessibility setting is enabled
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: New BugsAssignee: Myles C. Maxfield <mmaxfield>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, dino, jonlee, mcatanzaro, mitz, rniwa, sam, simon.fraser, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Needs test
none
WIP
none
WIP
none
Patch
none
Archive of layout-test-results from ews124 for ios-simulator-wk2
none
Patch
none
Archive of layout-test-results from ews122 for ios-simulator-wk2
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
simon.fraser: review+, buildbot: commit-queue-
Patch for committing
buildbot: commit-queue-
Archive of layout-test-results from ews101 for mac-elcapitan
none
Archive of layout-test-results from ews106 for mac-elcapitan-wk2
none
Archive of layout-test-results from ews113 for mac-elcapitan
none
Archive of layout-test-results from ews100 for mac-elcapitan
none
Archive of layout-test-results from ews104 for mac-elcapitan-wk2
none
Archive of layout-test-results from ews114 for mac-elcapitan
none
Patch for committing none

Myles C. Maxfield
Reported 2017-05-30 15:25:57 PDT
[iOS] Fonts get too bold when the "Bold Text" accessibility setting is enabled
Attachments
Needs test (2.98 KB, patch)
2017-05-30 15:27 PDT, Myles C. Maxfield
no flags
WIP (24.10 KB, patch)
2017-05-30 19:13 PDT, Myles C. Maxfield
no flags
WIP (31.75 KB, patch)
2017-05-30 21:53 PDT, Myles C. Maxfield
no flags
Patch (36.76 KB, patch)
2017-05-30 23:47 PDT, Myles C. Maxfield
no flags
Archive of layout-test-results from ews124 for ios-simulator-wk2 (12.62 MB, application/zip)
2017-05-31 01:12 PDT, Build Bot
no flags
Patch (35.06 KB, patch)
2017-05-31 09:57 PDT, Myles C. Maxfield
no flags
Archive of layout-test-results from ews122 for ios-simulator-wk2 (1.05 MB, application/zip)
2017-05-31 12:10 PDT, Build Bot
no flags
Patch (37.61 KB, patch)
2017-06-01 16:52 PDT, Myles C. Maxfield
no flags
Patch (37.68 KB, patch)
2017-06-01 17:21 PDT, Myles C. Maxfield
no flags
Patch (20.60 KB, patch)
2017-06-02 13:16 PDT, Myles C. Maxfield
no flags
Patch (23.52 KB, patch)
2017-06-02 13:25 PDT, Myles C. Maxfield
no flags
Patch (23.53 KB, patch)
2017-06-02 13:34 PDT, Myles C. Maxfield
no flags
Patch (22.53 KB, patch)
2017-06-02 13:48 PDT, Myles C. Maxfield
simon.fraser: review+
buildbot: commit-queue-
Patch for committing (22.64 KB, patch)
2017-06-02 14:00 PDT, Myles C. Maxfield
buildbot: commit-queue-
Archive of layout-test-results from ews101 for mac-elcapitan (1.07 MB, application/zip)
2017-06-02 14:23 PDT, Build Bot
no flags
Archive of layout-test-results from ews106 for mac-elcapitan-wk2 (1.24 MB, application/zip)
2017-06-02 14:30 PDT, Build Bot
no flags
Archive of layout-test-results from ews113 for mac-elcapitan (1.85 MB, application/zip)
2017-06-02 14:49 PDT, Build Bot
no flags
Archive of layout-test-results from ews100 for mac-elcapitan (994.37 KB, application/zip)
2017-06-02 15:01 PDT, Build Bot
no flags
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 (1.11 MB, application/zip)
2017-06-02 15:05 PDT, Build Bot
no flags
Archive of layout-test-results from ews114 for mac-elcapitan (1.86 MB, application/zip)
2017-06-02 15:16 PDT, Build Bot
no flags
Patch for committing (23.37 KB, patch)
2017-06-02 15:58 PDT, Myles C. Maxfield
no flags
Myles C. Maxfield
Comment 1 2017-05-30 15:26:39 PDT
Myles C. Maxfield
Comment 2 2017-05-30 15:27:40 PDT
Created attachment 311545 [details] Needs test
Myles C. Maxfield
Comment 3 2017-05-30 19:13:37 PDT
Myles C. Maxfield
Comment 4 2017-05-30 21:53:13 PDT
Myles C. Maxfield
Comment 5 2017-05-30 23:47:17 PDT
Build Bot
Comment 6 2017-05-31 01:12:24 PDT
Comment on attachment 311576 [details] Patch Attachment 311576 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/3846821 New failing tests: fast/text/accessibility-bold-system-font-2.html
Build Bot
Comment 7 2017-05-31 01:12:25 PDT
Created attachment 311578 [details] Archive of layout-test-results from ews124 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews124 Port: ios-simulator-wk2 Platform: Mac OS X 10.12.5
Myles C. Maxfield
Comment 8 2017-05-31 09:57:12 PDT
Build Bot
Comment 9 2017-05-31 12:10:58 PDT
Comment on attachment 311603 [details] Patch Attachment 311603 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/3849301 New failing tests: fast/text/accessibility-bold-system-font-2.html
Build Bot
Comment 10 2017-05-31 12:10:59 PDT
Created attachment 311616 [details] Archive of layout-test-results from ews122 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews122 Port: ios-simulator-wk2 Platform: Mac OS X 10.12.5
Myles C. Maxfield
Comment 11 2017-06-01 16:52:32 PDT
mitz
Comment 12 2017-06-01 17:05:08 PDT
Comment on attachment 311780 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=311780&action=review > Source/WebKit2/Configurations/BaseTarget.xcconfig:116 > +ACCESSIBILITY_LDFLAGS[sdk=iphone*] = -lAccessibility; > +ACCESSIBILITY_LDFLAGS[sdk=macosx*] = ; Please prefix new custom build settings’ names with WK_ It would be better to make the first definition unconditional, so that it applies to all of PLATFORM(IOS) and not just TARGET_OS_IOS.
Myles C. Maxfield
Comment 13 2017-06-01 17:21:52 PDT
Simon Fraser (smfr)
Comment 14 2017-06-01 17:34:56 PDT
Comment on attachment 311786 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=311786&action=review > Source/WebCore/rendering/RenderThemeIOS.mm:1234 > + if (result < -0.6) > + return FontSelectionValue(100); > + if (result < -0.365) > + return FontSelectionValue(200); > + if (result < -0.115) > + return FontSelectionValue(300); > + if (result < 0.130) > + return FontSelectionValue(400); > + if (result < 0.235) > + return FontSelectionValue(500); > + if (result < 0.350) > + return FontSelectionValue(600); > + if (result < 0.500) > + return FontSelectionValue(700); > + if (result < 0.700) > + return FontSelectionValue(800); I feel like this could be a const data table and a for loop. > Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:156 > + _AXSSetEnhanceTextLegibilityEnabled(TRUE); > + atexit(&WebKit::unBoldSystemFontForAccessibility); This part is gross and I think we should try to avoid it.
Sam Weinig
Comment 15 2017-06-01 22:11:18 PDT
Comment on attachment 311786 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=311786&action=review >> Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:156 >> + atexit(&WebKit::unBoldSystemFontForAccessibility); > > This part is gross and I think we should try to avoid it. Agreed, I think we need an alternate solution here. Why is this atexit() needed? Your changelog did not say.
Myles C. Maxfield
Comment 16 2017-06-02 13:16:30 PDT
Build Bot
Comment 17 2017-06-02 13:22:21 PDT
Attachment 311850 [details] did not pass style-queue: ERROR: LayoutTests/platform/mac/TestExpectations:1548: Path does not exist. [test/expectations] [5] Total errors found: 1 in 11 files If any of these errors are false positives, please file a bug against check-webkit-style.
Myles C. Maxfield
Comment 18 2017-06-02 13:25:57 PDT
Myles C. Maxfield
Comment 19 2017-06-02 13:34:34 PDT
Simon Fraser (smfr)
Comment 20 2017-06-02 13:38:34 PDT
Comment on attachment 311854 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=311854&action=review > Source/WebCore/platform/graphics/FontCache.h:230 > + bool shouldMockBoldSystemFontForAccessibility() { return m_shouldMockBoldSystemFontForAccessibility; } const > Source/WebCore/rendering/RenderTheme.h:256 > + virtual bool shouldMockBoldSystemFontForAccessibility() { return false; } const > Source/WebCore/rendering/RenderThemeIOS.h:121 > + bool shouldMockBoldSystemFontForAccessibility() override { return m_shouldMockBoldSystemFontForAccessibility; } const > Source/WebCore/rendering/RenderThemeIOS.mm:1235 > + if (result < -0.6) > + return FontSelectionValue(100); > + if (result < -0.365) > + return FontSelectionValue(200); > + if (result < -0.115) > + return FontSelectionValue(300); > + if (result < 0.130) > + return FontSelectionValue(400); > + if (result < 0.235) > + return FontSelectionValue(500); > + if (result < 0.350) > + return FontSelectionValue(600); > + if (result < 0.500) > + return FontSelectionValue(700); > + if (result < 0.700) > + return FontSelectionValue(800); > + return FontSelectionValue(900); You didn't like the const data suggestion?
Myles C. Maxfield
Comment 21 2017-06-02 13:48:32 PDT
Simon Fraser (smfr)
Comment 22 2017-06-02 13:52:50 PDT
Comment on attachment 311856 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=311856&action=review > Source/WebCore/rendering/RenderThemeIOS.mm:1219 > + static float weightThresholds[] = { -0.6, -0.365, -0.115, 0.130, 0.235, 0.350, 0.5, 0.7 }; I'd like to see a comment saying where these magic numbers come from. > Source/WebCore/testing/InternalSettings.cpp:690 > + RenderTheme::singleton().setShouldMockBoldSystemFontForAccessibility(requires); > + FontCache::singleton().setShouldMockBoldSystemFontForAccessibility(requires); Feels slightly weird to stash this state in two places.
Myles C. Maxfield
Comment 23 2017-06-02 14:00:40 PDT
Created attachment 311857 [details] Patch for committing
Simon Fraser (smfr)
Comment 24 2017-06-02 14:04:56 PDT
Comment on attachment 311857 [details] Patch for committing View in context: https://bugs.webkit.org/attachment.cgi?id=311857&action=review > Source/WebCore/rendering/RenderThemeIOS.mm:1219 > + // These numbers were experimenatlly gathered from weights of the system font. "experimenatlly"
Build Bot
Comment 25 2017-06-02 14:23:22 PDT
Comment on attachment 311856 [details] Patch Attachment 311856 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/3861558 New failing tests: fast/text/accessibility-bold-system-font-2.html
Build Bot
Comment 26 2017-06-02 14:23:24 PDT
Created attachment 311859 [details] Archive of layout-test-results from ews101 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 27 2017-06-02 14:30:00 PDT
Comment on attachment 311856 [details] Patch Attachment 311856 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/3861588 New failing tests: fast/text/accessibility-bold-system-font-2.html
Build Bot
Comment 28 2017-06-02 14:30:01 PDT
Created attachment 311861 [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
Build Bot
Comment 29 2017-06-02 14:49:13 PDT
Comment on attachment 311856 [details] Patch Attachment 311856 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/3861617 New failing tests: fast/text/accessibility-bold-system-font-2.html
Build Bot
Comment 30 2017-06-02 14:49:14 PDT
Created attachment 311864 [details] Archive of layout-test-results from ews113 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews113 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 31 2017-06-02 15:01:22 PDT
Comment on attachment 311857 [details] Patch for committing Attachment 311857 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/3861755 New failing tests: fast/text/accessibility-bold-system-font-2.html
Build Bot
Comment 32 2017-06-02 15:01:23 PDT
Created attachment 311868 [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
Build Bot
Comment 33 2017-06-02 15:05:42 PDT
Comment on attachment 311857 [details] Patch for committing Attachment 311857 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/3861758 New failing tests: fast/text/accessibility-bold-system-font-2.html
Build Bot
Comment 34 2017-06-02 15:05:43 PDT
Created attachment 311869 [details] Archive of layout-test-results from ews104 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Build Bot
Comment 35 2017-06-02 15:16:47 PDT
Comment on attachment 311857 [details] Patch for committing Attachment 311857 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/3861680 New failing tests: fast/text/accessibility-bold-system-font-2.html
Build Bot
Comment 36 2017-06-02 15:16:49 PDT
Created attachment 311872 [details] Archive of layout-test-results from ews114 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Myles C. Maxfield
Comment 37 2017-06-02 15:58:58 PDT
Created attachment 311879 [details] Patch for committing
WebKit Commit Bot
Comment 38 2017-06-02 16:40:10 PDT
Comment on attachment 311879 [details] Patch for committing Clearing flags on attachment: 311879 Committed r217742: <http://trac.webkit.org/changeset/217742>
Michael Catanzaro
Comment 39 2017-08-15 09:56:41 PDT
Since this test is only intended to work on iOS, I'm going to skip it in the global TestExpectations and mark it as passing in the iOS expectations instead.
Myles C. Maxfield
Comment 40 2017-08-21 12:13:10 PDT
(In reply to Michael Catanzaro from comment #39) > Since this test is only intended to work on iOS, I'm going to skip it in the > global TestExpectations and mark it as passing in the iOS expectations > instead. 👍
Note You need to log in before you can comment on or make changes to this bug.