Changeset 231591 in webkit


Ignore:
Timestamp:
May 9, 2018 1:31:13 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[Cocoa] Some fields are not identified as [WKWebProcessPlugInNodeHandle isTextField]
https://bugs.webkit.org/show_bug.cgi?id=185260
<rdar://problem/39290394>

Source/WebKit:

INPUT element are not considered to be text fields when
calling -[WKWebProcessPlugInNodeHandle isTextField]
when they are of type number.

Patch by Richard Houle <rhoule@apple.com> on 2018-05-09
Reviewed by Tim Horton.

  • WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:

(WebKit::InjectedBundleNodeHandle::isTextField const):

Tools:

Patch by Richard Houle <rhoule@apple.com> on 2018-05-09
Reviewed by Tim Horton.

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKitCocoa/InjectedBundleNodeHandleIsTextField.mm: Added.

(-[InjectedBundleNodeHandleIsTextField isTextFieldForHTMLInputType:document:jsContext:]):
(-[InjectedBundleNodeHandleIsTextField webProcessPlugIn:didCreateBrowserContextController:]):

  • TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:

(-[InjectedBundleNodeHandleIsTextFieldDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r231588 r231591  
     12018-05-09  Richard Houle  <rhoule@apple.com>
     2
     3        [Cocoa] Some fields are not identified as [WKWebProcessPlugInNodeHandle isTextField]
     4        https://bugs.webkit.org/show_bug.cgi?id=185260
     5        <rdar://problem/39290394>
     6
     7        INPUT element are not considered to be text fields when
     8        calling -[WKWebProcessPlugInNodeHandle isTextField]
     9        when they are of type number.
     10
     11        Reviewed by Tim Horton.
     12
     13        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
     14        (WebKit::InjectedBundleNodeHandle::isTextField const):
     15
    1162018-05-09  Youenn Fablet  <youenn@apple.com>
    217
  • trunk/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp

    r226048 r231591  
    335335        return false;
    336336
    337     return downcast<HTMLInputElement>(m_node.get()).isText();
     337    return downcast<HTMLInputElement>(m_node.get()).isTextField();
    338338}
    339339
  • trunk/Tools/ChangeLog

    r231584 r231591  
     12018-05-09  Richard Houle  <rhoule@apple.com>
     2
     3        [Cocoa] Some fields are not identified as [WKWebProcessPlugInNodeHandle isTextField]
     4        https://bugs.webkit.org/show_bug.cgi?id=185260
     5        <rdar://problem/39290394>
     6
     7        Reviewed by Tim Horton.
     8
     9        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     10        * TestWebKitAPI/Tests/WebKitCocoa/InjectedBundleNodeHandleIsTextField.mm: Added.
     11        (-[InjectedBundleNodeHandleIsTextField isTextFieldForHTMLInputType:document:jsContext:]):
     12        (-[InjectedBundleNodeHandleIsTextField webProcessPlugIn:didCreateBrowserContextController:]):
     13        * TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
     14        (-[InjectedBundleNodeHandleIsTextFieldDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):
     15
    1162018-05-09  Thibault Saunier  <tsaunier@igalia.com>
    217
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r231321 r231591  
    294294                76E182DD1547569100F1FADD /* WillSendSubmitEvent_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76E182DC1547569100F1FADD /* WillSendSubmitEvent_Bundle.cpp */; };
    295295                76E182DF154767E600F1FADD /* auto-submitting-form.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 76E182DE15475A8300F1FADD /* auto-submitting-form.html */; };
     296                79C5D431209D768300F1E7CA /* InjectedBundleNodeHandleIsTextField.mm in Sources */ = {isa = PBXBuildFile; fileRef = 79C5D430209D768300F1E7CA /* InjectedBundleNodeHandleIsTextField.mm */; };
    296297                7A010BCB1D877C0500EDE72A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A010BCA1D877C0500EDE72A /* CoreGraphics.framework */; };
    297298                7A010BCD1D877C0D00EDE72A /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A010BCC1D877C0D00EDE72A /* QuartzCore.framework */; };
     
    15111512                76E182DC1547569100F1FADD /* WillSendSubmitEvent_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WillSendSubmitEvent_Bundle.cpp; sourceTree = "<group>"; };
    15121513                76E182DE15475A8300F1FADD /* auto-submitting-form.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "auto-submitting-form.html"; sourceTree = "<group>"; };
     1514                79C5D430209D768300F1E7CA /* InjectedBundleNodeHandleIsTextField.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InjectedBundleNodeHandleIsTextField.mm; sourceTree = "<group>"; };
    15131515                7A010BCA1D877C0500EDE72A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
    15141516                7A010BCC1D877C0D00EDE72A /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
     
    21922194                                5198A23F1EA7E595008910B7 /* InitialWarmedProcessUsed.mm */,
    21932195                                2DB0232E1E4E871800707123 /* InteractionDeadlockAfterCrash.mm */,
     2196                                79C5D430209D768300F1E7CA /* InjectedBundleNodeHandleIsTextField.mm */,
    21942197                                5C69BDD41F82A7EB000F4F4B /* JavaScriptDuringNavigation.mm */,
    21952198                                C25CCA051E51380B0026CB8A /* LineBreaking.mm */,
     
    38633866                                37A709AF1E3EA97E00CA5969 /* BundleRangeHandlePlugIn.mm in Sources */,
    38643867                                1C2B81831C891F0900A5529F /* CancelFontSubresourcePlugIn.mm in Sources */,
     3868                                79C5D431209D768300F1E7CA /* InjectedBundleNodeHandleIsTextField.mm in Sources */,
    38653869                                5CB18BA81F5645E300EE23C4 /* ClickAutoFillButton.mm in Sources */,
    38663870                                A14FC58B1B89927100D107EB /* ContentFilteringPlugIn.mm in Sources */,
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm

    r231519 r231591  
    628628}
    629629
     630@interface InjectedBundleNodeHandleIsTextFieldDelegate : NSObject <WKUIDelegatePrivate>
     631@end
     632
     633@implementation InjectedBundleNodeHandleIsTextFieldDelegate
     634
     635- (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)())completionHandler
     636{
     637    completionHandler();
     638    ASSERT_STREQ(message.UTF8String, "isTextField success");
     639    done = true;
     640}
     641
     642@end
     643
     644TEST(WebKit, InjectedBundleNodeHandleIsTextField)
     645{
     646    WKWebViewConfiguration *configuration = [WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"InjectedBundleNodeHandleIsTextField"];
     647
     648    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 800, 600) configuration:configuration]);
     649    auto delegate = adoptNS([[InjectedBundleNodeHandleIsTextFieldDelegate alloc] init]);
     650    [webView setUIDelegate:delegate.get()];
     651    TestWebKitAPI::Util::run(&done);
     652}
     653
    630654@interface PinnedStateObserver : NSObject
    631655@end
Note: See TracChangeset for help on using the changeset viewer.