Title: [212375] trunk
Revision
212375
Author
[email protected]
Date
2017-02-15 10:12:25 -0800 (Wed, 15 Feb 2017)

Log Message

[iOS] Form Validation Bubble should be sensitive to Dynamic Type
https://bugs.webkit.org/show_bug.cgi?id=168291
<rdar://problem/30508593>

Reviewed by Tim Horton.

Source/WebCore:

Update ValidationBubble implementation on iOS to stop obeying the
minimum font size setting, given that this setting is not exposed
on iOS. Instead, we now rely on
[UIFont preferredFontForTextStyle:UIFontTextStyleCallout], which
will give us a font whose size obeys Dynamic Type [1] setting on iOS.

[1] https://developer.apple.com/ios/human-interface-guidelines/visual-design/typography/

No new tests, no easily testable.

* platform/ios/ValidationBubbleIOS.mm:
(WebCore::ValidationBubble::ValidationBubble):

Tools:

Drop overridePreference() implementation in iOS's UIScriptController
as it was only used for the minimum font size setting and this setting
is not exposed on iOS.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::overridePreference):
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:

LayoutTests:

Skip fast/forms/validation-message-minimum-font-size.html on iOS now
that the ValidationBubble implementation no longer obeys the minimum
font size setting on iOS.

* platform/ios-simulator/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (212374 => 212375)


--- trunk/LayoutTests/ChangeLog	2017-02-15 18:09:41 UTC (rev 212374)
+++ trunk/LayoutTests/ChangeLog	2017-02-15 18:12:25 UTC (rev 212375)
@@ -1,3 +1,17 @@
+2017-02-15  Chris Dumez  <[email protected]>
+
+        [iOS] Form Validation Bubble should be sensitive to Dynamic Type
+        https://bugs.webkit.org/show_bug.cgi?id=168291
+        <rdar://problem/30508593>
+
+        Reviewed by Tim Horton.
+
+        Skip fast/forms/validation-message-minimum-font-size.html on iOS now
+        that the ValidationBubble implementation no longer obeys the minimum
+        font size setting on iOS.
+
+        * platform/ios-simulator/TestExpectations:
+
 2017-02-15  Ryan Haddad  <[email protected]>
 
         Mark animations/trigger-container-scroll-empty.html as flaky.

Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (212374 => 212375)


--- trunk/LayoutTests/platform/ios-simulator/TestExpectations	2017-02-15 18:09:41 UTC (rev 212374)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations	2017-02-15 18:12:25 UTC (rev 212375)
@@ -2841,6 +2841,9 @@
 media/modern-media-controls/media-controller/media-controller-tight-padding.html [ Skip ]
 media/modern-media-controls/media-controller/media-controller-toggle-compact-mode.html [ Skip ]
 
+# Form validation popover does not obey minimum font size setting on iOS but Dynamic Type instead.
+fast/forms/validation-message-minimum-font-size.html [ Skip ]
+
 # New Encrypted Media API not enabled on iOS
 media/encrypted-media/mock-navigator-requestMediaKeySystemAccess.html [ Skip ]
 

Modified: trunk/Source/WebCore/ChangeLog (212374 => 212375)


--- trunk/Source/WebCore/ChangeLog	2017-02-15 18:09:41 UTC (rev 212374)
+++ trunk/Source/WebCore/ChangeLog	2017-02-15 18:12:25 UTC (rev 212375)
@@ -1,3 +1,24 @@
+2017-02-15  Chris Dumez  <[email protected]>
+
+        [iOS] Form Validation Bubble should be sensitive to Dynamic Type
+        https://bugs.webkit.org/show_bug.cgi?id=168291
+        <rdar://problem/30508593>
+
+        Reviewed by Tim Horton.
+
+        Update ValidationBubble implementation on iOS to stop obeying the
+        minimum font size setting, given that this setting is not exposed
+        on iOS. Instead, we now rely on
+        [UIFont preferredFontForTextStyle:UIFontTextStyleCallout], which
+        will give us a font whose size obeys Dynamic Type [1] setting on iOS.
+
+        [1] https://developer.apple.com/ios/human-interface-guidelines/visual-design/typography/
+
+        No new tests, no easily testable.
+
+        * platform/ios/ValidationBubbleIOS.mm:
+        (WebCore::ValidationBubble::ValidationBubble):
+
 2017-02-15  Yusuke Suzuki  <[email protected]>
 
         [JSC] Drop PassRefPtr

Modified: trunk/Source/WebCore/platform/ios/ValidationBubbleIOS.mm (212374 => 212375)


--- trunk/Source/WebCore/platform/ios/ValidationBubbleIOS.mm	2017-02-15 18:09:41 UTC (rev 212374)
+++ trunk/Source/WebCore/platform/ios/ValidationBubbleIOS.mm	2017-02-15 18:12:25 UTC (rev 212375)
@@ -40,6 +40,7 @@
 SOFT_LINK_CLASS(UIKit, UITapGestureRecognizer);
 SOFT_LINK_CLASS(UIKit, UIView);
 SOFT_LINK_CLASS(UIKit, UIViewController);
+SOFT_LINK_CONSTANT(UIKit, UIFontTextStyleCallout, UIFontTextStyle);
 
 @interface WebValidationBubbleTapRecognizer : NSObject
 @end
@@ -97,7 +98,7 @@
 static const CGFloat verticalPadding = 9;
 static const CGFloat maxLabelWidth = 300;
 
-ValidationBubble::ValidationBubble(UIView* view, const String& message, const Settings& settings)
+ValidationBubble::ValidationBubble(UIView* view, const String& message, const Settings&)
     : m_view(view)
     , m_message(message)
 {
@@ -110,8 +111,8 @@
 
     RetainPtr<UILabel> label = adoptNS([[getUILabelClass() alloc] initWithFrame:CGRectZero]);
     [label setText:message];
-    m_fontSize = std::max(settings.minimumFontSize, 14.0);
-    [label setFont:[getUIFontClass() systemFontOfSize:m_fontSize]];
+    [label setFont:[getUIFontClass() preferredFontForTextStyle:getUIFontTextStyleCallout()]];
+    m_fontSize = [[label font] pointSize];
     [label setLineBreakMode:NSLineBreakByTruncatingTail];
     [label setNumberOfLines:4];
     [popoverView addSubview:label.get()];

Modified: trunk/Tools/ChangeLog (212374 => 212375)


--- trunk/Tools/ChangeLog	2017-02-15 18:09:41 UTC (rev 212374)
+++ trunk/Tools/ChangeLog	2017-02-15 18:12:25 UTC (rev 212375)
@@ -1,3 +1,20 @@
+2017-02-15  Chris Dumez  <[email protected]>
+
+        [iOS] Form Validation Bubble should be sensitive to Dynamic Type
+        https://bugs.webkit.org/show_bug.cgi?id=168291
+        <rdar://problem/30508593>
+
+        Reviewed by Tim Horton.
+
+        Drop overridePreference() implementation in iOS's UIScriptController
+        as it was only used for the minimum font size setting and this setting
+        is not exposed on iOS.
+
+        * DumpRenderTree/ios/UIScriptControllerIOS.mm:
+        * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
+        (WTR::UIScriptController::overridePreference):
+        * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
+
 2017-02-15  Jonathan Bedard  <[email protected]>
 
         webkitpy: Memoize app_identifier_from_bundle for efficiency, call parent class for _get_crash_log

Modified: trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm (212374 => 212375)


--- trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm	2017-02-15 18:09:41 UTC (rev 212374)
+++ trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm	2017-02-15 18:12:25 UTC (rev 212375)
@@ -159,10 +159,6 @@
     return nullptr;
 }
 
-void UIScriptController::overridePreference(JSStringRef preferenceRef, JSStringRef valueRef)
-{
-}
-
 static CGPoint contentOffsetBoundedInValidRange(UIScrollView *scrollView, CGPoint contentOffset)
 {
     UIEdgeInsets contentInsets = scrollView.contentInset;

Modified: trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp (212374 => 212375)


--- trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp	2017-02-15 18:09:41 UTC (rev 212374)
+++ trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp	2017-02-15 18:12:25 UTC (rev 212375)
@@ -397,14 +397,14 @@
 {
 }
 
+#endif // !PLATFORM(COCOA)
+
+#if !PLATFORM(MAC)
+
 void UIScriptController::overridePreference(JSStringRef, JSStringRef)
 {
 }
 
-#endif // !PLATFORM(COCOA)
-
-#if !PLATFORM(MAC)
-
 void UIScriptController::insertText(JSStringRef, int, int)
 {
 }

Modified: trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm (212374 => 212375)


--- trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm	2017-02-15 18:09:41 UTC (rev 212374)
+++ trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm	2017-02-15 18:12:25 UTC (rev 212375)
@@ -651,17 +651,6 @@
     webView.didEndScrollingCallback = nil;
 }
 
-void UIScriptController::overridePreference(JSStringRef preferenceRef, JSStringRef valueRef)
-{
-    TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
-    WKPreferences *preferences = webView.configuration.preferences;
-
-    String preference = toWTFString(toWK(preferenceRef));
-    String value = toWTFString(toWK(valueRef));
-    if (preference == "WebKitMinimumFontSize")
-        preferences.minimumFontSize = value.toDouble();
 }
 
-}
-
 #endif // PLATFORM(IOS)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to