⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 212375 in webkit


Ignore:
Timestamp:
Feb 15, 2017, 10:12:25 AM (10 years ago)
Author:
Chris Dumez
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:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r212374 r212375  
     12017-02-15  Chris Dumez  <cdumez@apple.com>
     2
     3        [iOS] Form Validation Bubble should be sensitive to Dynamic Type
     4        https://bugs.webkit.org/show_bug.cgi?id=168291
     5        <rdar://problem/30508593>
     6
     7        Reviewed by Tim Horton.
     8
     9        Skip fast/forms/validation-message-minimum-font-size.html on iOS now
     10        that the ValidationBubble implementation no longer obeys the minimum
     11        font size setting on iOS.
     12
     13        * platform/ios-simulator/TestExpectations:
     14
    1152017-02-15  Ryan Haddad  <ryanhaddad@apple.com>
    216
  • trunk/LayoutTests/platform/ios-simulator/TestExpectations

    r212242 r212375  
    28422842media/modern-media-controls/media-controller/media-controller-toggle-compact-mode.html [ Skip ]
    28432843
     2844# Form validation popover does not obey minimum font size setting on iOS but Dynamic Type instead.
     2845fast/forms/validation-message-minimum-font-size.html [ Skip ]
     2846
    28442847# New Encrypted Media API not enabled on iOS
    28452848media/encrypted-media/mock-navigator-requestMediaKeySystemAccess.html [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r212365 r212375  
     12017-02-15  Chris Dumez  <cdumez@apple.com>
     2
     3        [iOS] Form Validation Bubble should be sensitive to Dynamic Type
     4        https://bugs.webkit.org/show_bug.cgi?id=168291
     5        <rdar://problem/30508593>
     6
     7        Reviewed by Tim Horton.
     8
     9        Update ValidationBubble implementation on iOS to stop obeying the
     10        minimum font size setting, given that this setting is not exposed
     11        on iOS. Instead, we now rely on
     12        [UIFont preferredFontForTextStyle:UIFontTextStyleCallout], which
     13        will give us a font whose size obeys Dynamic Type [1] setting on iOS.
     14
     15        [1] https://developer.apple.com/ios/human-interface-guidelines/visual-design/typography/
     16
     17        No new tests, no easily testable.
     18
     19        * platform/ios/ValidationBubbleIOS.mm:
     20        (WebCore::ValidationBubble::ValidationBubble):
     21
    1222017-02-15  Yusuke Suzuki  <utatane.tea@gmail.com>
    223
  • trunk/Source/WebCore/platform/ios/ValidationBubbleIOS.mm

    r212325 r212375  
    4141SOFT_LINK_CLASS(UIKit, UIView);
    4242SOFT_LINK_CLASS(UIKit, UIViewController);
     43SOFT_LINK_CONSTANT(UIKit, UIFontTextStyleCallout, UIFontTextStyle);
    4344
    4445@interface WebValidationBubbleTapRecognizer : NSObject
    … …  
    9899static const CGFloat maxLabelWidth = 300;
    99100
    100 ValidationBubble::ValidationBubble(UIView* view, const String& message, const Settings& settings)
     101ValidationBubble::ValidationBubble(UIView* view, const String& message, const Settings&)
    101102    : m_view(view)
    102103    , m_message(message)
    … …  
    111112    RetainPtr<UILabel> label = adoptNS([[getUILabelClass() alloc] initWithFrame:CGRectZero]);
    112113    [label setText:message];
    113     m_fontSize = std::max(settings.minimumFontSize, 14.0);
    114     [label setFont:[getUIFontClass() systemFontOfSize:m_fontSize]];
     114    [label setFont:[getUIFontClass() preferredFontForTextStyle:getUIFontTextStyleCallout()]];
     115    m_fontSize = [[label font] pointSize];
    115116    [label setLineBreakMode:NSLineBreakByTruncatingTail];
    116117    [label setNumberOfLines:4];
  • trunk/Tools/ChangeLog

    r212372 r212375  
     12017-02-15  Chris Dumez  <cdumez@apple.com>
     2
     3        [iOS] Form Validation Bubble should be sensitive to Dynamic Type
     4        https://bugs.webkit.org/show_bug.cgi?id=168291
     5        <rdar://problem/30508593>
     6
     7        Reviewed by Tim Horton.
     8
     9        Drop overridePreference() implementation in iOS's UIScriptController
     10        as it was only used for the minimum font size setting and this setting
     11        is not exposed on iOS.
     12
     13        * DumpRenderTree/ios/UIScriptControllerIOS.mm:
     14        * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
     15        (WTR::UIScriptController::overridePreference):
     16        * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
     17
    1182017-02-15  Jonathan Bedard  <jbedard@apple.com>
    219
  • trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm

    r212325 r212375  
    160160}
    161161
    162 void UIScriptController::overridePreference(JSStringRef preferenceRef, JSStringRef valueRef)
    163 {
    164 }
    165 
    166162static CGPoint contentOffsetBoundedInValidRange(UIScrollView *scrollView, CGPoint contentOffset)
    167163{
  • trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp

    r212325 r212375  
    398398}
    399399
     400#endif // !PLATFORM(COCOA)
     401
     402#if !PLATFORM(MAC)
     403
    400404void UIScriptController::overridePreference(JSStringRef, JSStringRef)
    401405{
    402406}
    403 
    404 #endif // !PLATFORM(COCOA)
    405 
    406 #if !PLATFORM(MAC)
    407407
    408408void UIScriptController::insertText(JSStringRef, int, int)
  • trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm

    r212325 r212375  
    652652}
    653653
    654 void UIScriptController::overridePreference(JSStringRef preferenceRef, JSStringRef valueRef)
    655 {
    656     TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
    657     WKPreferences *preferences = webView.configuration.preferences;
    658 
    659     String preference = toWTFString(toWK(preferenceRef));
    660     String value = toWTFString(toWK(valueRef));
    661     if (preference == "WebKitMinimumFontSize")
    662         preferences.minimumFontSize = value.toDouble();
    663 }
    664 
    665654}
    666655
Note: See TracChangeset for help on using the changeset viewer.