WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch and unit tests
bug-209380-20200321233436.patch (text/plain), 20.09 KB, created by
Daniel Bates
on 2020-03-21 23:34:37 PDT
(
hide
)
Description:
Patch and unit tests
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2020-03-21 23:34:37 PDT
Size:
20.09 KB
patch
obsolete
>Subversion Revision: 258803 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index ab02aae9ac2d75cd04eb616f9f6cef9e74f15786..45c1bd8dca4e7eb3fd0d4907ebe57ab9891b8650 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,38 @@ >+2020-03-21 Daniel Bates <dabates@apple.com> >+ >+ Support inserting text or dictation alternative by simulating keyboard input >+ https://bugs.webkit.org/show_bug.cgi?id=209380 >+ <rdar://problem/59445102> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ As a workaround for sites the implement their own editing system (e.g. facebook.com) >+ add a new insertion option that makes the insertion having a passing resemblance >+ of a person typing. The resemblance is achieved by dispatching DOM events with type >+ "keydown", "keyup", and "change". >+ >+ * Shared/Cocoa/InsertTextOptions.cpp: >+ (IPC::ArgumentCoder<WebKit::InsertTextOptions>::encode): >+ (IPC::ArgumentCoder<WebKit::InsertTextOptions>::decode): >+ Encode and decode the new option. >+ >+ * Shared/Cocoa/InsertTextOptions.h: Default the new option, simulateKeyboardInput, to false >+ to keep our current behavior. >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView _shouldSimulateKeyboardInputOnTextInsertion]): Added. Returns NO when >+ building without USE(TEXT_INTERACTION_ADDITIONS) to keep the current behavior. >+ >+ (-[WKContentView insertText:]): >+ (-[WKContentView insertText:alternatives:style:]): >+ Set the simulateKeyboardInput option. >+ >+ * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: >+ (WebKit::WebPage::insertDictatedTextAsync): >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::WebPage::insertTextAsync): >+ If simulateKeyboardInput is false then do what we do now. Otherwise, dispatch a DOM event >+ of type "keydown" and perform the insertion. Then dispatch DOM events of type "keyup" and "change". >+ > 2019-09-13 Daniel Bates <dabates@apple.com> > > Support building WebKit for Mac Catalyst from Xcode >diff --git a/Source/WebKit/Shared/Cocoa/InsertTextOptions.cpp b/Source/WebKit/Shared/Cocoa/InsertTextOptions.cpp >index 816442612a2279a8c33bd5cf3a8e2403746750be..2d952baaa3d0352664e8f29e4192016788f13ed5 100644 >--- a/Source/WebKit/Shared/Cocoa/InsertTextOptions.cpp >+++ b/Source/WebKit/Shared/Cocoa/InsertTextOptions.cpp >@@ -33,6 +33,7 @@ void ArgumentCoder<WebKit::InsertTextOptions>::encode(Encoder& encoder, const We > encoder << options.registerUndoGroup; > encoder << options.suppressSelectionUpdate; > encoder << options.processingUserGesture; >+ encoder << options.simulateKeyboardInput; > encoder << options.editingRangeIsRelativeTo; > } > >@@ -45,6 +46,8 @@ Optional<WebKit::InsertTextOptions> ArgumentCoder<WebKit::InsertTextOptions>::de > return WTF::nullopt; > if (!decoder.decode(options.processingUserGesture)) > return WTF::nullopt; >+ if (!decoder.decode(options.simulateKeyboardInput)) >+ return WTF::nullopt; > if (!decoder.decode(options.editingRangeIsRelativeTo)) > return WTF::nullopt; > return options; >diff --git a/Source/WebKit/Shared/Cocoa/InsertTextOptions.h b/Source/WebKit/Shared/Cocoa/InsertTextOptions.h >index cd201ab2bad3d293df8b3ea0387e341ad4b70b51..98c92b4499d05a56aa0895c61f6c79da60184e8e 100644 >--- a/Source/WebKit/Shared/Cocoa/InsertTextOptions.h >+++ b/Source/WebKit/Shared/Cocoa/InsertTextOptions.h >@@ -34,6 +34,7 @@ struct InsertTextOptions { > bool registerUndoGroup { false }; > bool suppressSelectionUpdate { false }; > bool processingUserGesture { false }; >+ bool simulateKeyboardInput { false }; > EditingRangeIsRelativeTo editingRangeIsRelativeTo { EditingRangeIsRelativeTo::EditableRoot }; > }; > >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index f66bee281a6fa11e68e5a5ff85565fa933c43188..53fc83836b97f0823a96312192fa714a0f4f4112 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -4710,6 +4710,15 @@ - (void)deleteBackward > _page->executeEditCommand("deleteBackward"_s); > } > >+- (BOOL)_shouldSimulateKeyboardInputOnTextInsertion >+{ >+#if USE(TEXT_INTERACTION_ADDITIONS) >+ return [self _shouldSimulateKeyboardInputOnTextInsertionInternal]; >+#else >+ return NO; >+#endif >+} >+ > // Inserts the given string, replacing any selected or marked text. > - (void)insertText:(NSString *)aStringValue > { >@@ -4717,7 +4726,7 @@ - (void)insertText:(NSString *)aStringValue > > WebKit::InsertTextOptions options; > options.processingUserGesture = [keyboard respondsToSelector:@selector(isCallingInputDelegate)] && keyboard.isCallingInputDelegate; >- >+ options.simulateKeyboardInput = [self _shouldSimulateKeyboardInputOnTextInsertion]; > _page->insertTextAsync(aStringValue, WebKit::EditingRange(), WTFMove(options)); > } > >@@ -4731,7 +4740,10 @@ - (void)insertText:(NSString *)aStringValue alternatives:(NSArray<NSString *> *) > BOOL isLowConfidence = style == UITextAlternativeStyleLowConfidence; > auto textAlternatives = adoptNS([[NSTextAlternatives alloc] initWithPrimaryString:aStringValue alternativeStrings:alternatives isLowConfidence:isLowConfidence]); > WebCore::TextAlternativeWithRange textAlternativeWithRange { textAlternatives.get(), NSMakeRange(0, aStringValue.length) }; >- _page->insertDictatedTextAsync(aStringValue, { }, { textAlternativeWithRange }, { }); >+ >+ WebKit::InsertTextOptions options; >+ options.simulateKeyboardInput = [self _shouldSimulateKeyboardInputOnTextInsertion]; >+ _page->insertDictatedTextAsync(aStringValue, { }, { textAlternativeWithRange }, WTFMove(options)); > } > } > >diff --git a/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm b/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm >index bc0ac68c720e96114533221c95e8bafb5eda2ec3..c6984a3bd373c692c036b66f3e8ff8ec7318804f 100644 >--- a/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm >+++ b/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm >@@ -39,6 +39,7 @@ > #import <WebCore/Editing.h> > #import <WebCore/Editor.h> > #import <WebCore/EventHandler.h> >+#import <WebCore/EventNames.h> > #import <WebCore/FocusController.h> > #import <WebCore/FrameView.h> > #import <WebCore/HTMLConverter.h> >@@ -200,8 +201,17 @@ void WebPage::insertDictatedTextAsync(const String& text, const EditingRange& re > if (options.registerUndoGroup) > send(Messages::WebPageProxy::RegisterInsertionUndoGrouping { }); > >+ RefPtr<Element> focusedElement = frame.document() ? frame.document()->focusedElement() : nullptr; >+ if (focusedElement && options.simulateKeyboardInput) >+ focusedElement->dispatchEvent(Event::create(eventNames().keydownEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes)); >+ > ASSERT(!frame.editor().hasComposition()); > frame.editor().insertDictatedText(text, dictationAlternativeLocations, nullptr /* triggeringEvent */); >+ >+ if (focusedElement && options.simulateKeyboardInput) { >+ focusedElement->dispatchEvent(Event::create(eventNames().keyupEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes)); >+ focusedElement->dispatchEvent(Event::create(eventNames().changeEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes)); >+ } > } > > void WebPage::accessibilityTransferRemoteToken(RetainPtr<NSData> remoteToken) >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index e1b9264221a49a86385dc88cd5843248bc561ea9..1048788a3143c633a59fec63aa28c9fdffd59100 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -5293,13 +5293,22 @@ void WebPage::insertTextAsync(const String& text, const EditingRange& replacemen > > if (options.registerUndoGroup) > send(Messages::WebPageProxy::RegisterInsertionUndoGrouping()); >- >+ >+ RefPtr<Element> focusedElement = frame.document() ? frame.document()->focusedElement() : nullptr; >+ if (focusedElement && options.simulateKeyboardInput) >+ focusedElement->dispatchEvent(Event::create(eventNames().keydownEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes)); >+ > if (!frame.editor().hasComposition()) { > // An insertText: might be handled by other responders in the chain if we don't handle it. > // One example is space bar that results in scrolling down the page. > frame.editor().insertText(text, nullptr, replacesText ? TextEventInputAutocompletion : TextEventInputKeyboard); > } else > frame.editor().confirmComposition(text); >+ >+ if (focusedElement && options.simulateKeyboardInput) { >+ focusedElement->dispatchEvent(Event::create(eventNames().keyupEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes)); >+ focusedElement->dispatchEvent(Event::create(eventNames().changeEvent, Event::CanBubble::Yes, Event::IsCancelable::Yes)); >+ } > } > > void WebPage::hasMarkedText(CompletionHandler<void(bool)>&& completionHandler) >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index e8536fe2e28277e52b11b4a91baeaa7178c88b8d..428d0edc6f1a2f59d0d932a4f3ed330c536e00df 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,28 @@ >+2020-03-21 Daniel Bates <dabates@apple.com> >+ >+ Support inserting text or dictation alternative by simulating keyboard input >+ https://bugs.webkit.org/show_bug.cgi?id=209380 >+ <rdar://problem/59445102> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add tests to ensure that DOM events are dispatched on insertion when simulateKeyboardInput >+ is enabled. >+ >+ I also added a convenience assertion function, EXPECT_NS_EQUAL, that can >+ compare NSObjects so long as they implement -isEqual and -description. I >+ make use of this to compare the actual array of fired DOM events types to >+ an expected array. >+ >+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: >+ * TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm: >+ (TestWebKitAPI::shouldSimulateKeyboardInputOnTextInsertionOverride): >+ (TestWebKitAPI::TEST): >+ * TestWebKitAPI/cocoa/TestCocoa.h: >+ (TestWebKitAPI::Util::assertNSObjectsAreEqual): Added. >+ (EXPECT_NS_EQUAL): Added. >+ * TestWebKitAPI/ios/insert-text.html: Added. >+ > 2019-10-02 Daniel Bates <dabates@apple.com> > > [lldb-webkit] Add support for pretty-printing complex bitmasks >diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >index 4ba71b1b7bf6aeaf9dea2532113ef284d8669fd4..377e1061b48bc8edc0e7f6ed8068073747db7bda 100644 >--- a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >+++ b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >@@ -984,6 +984,7 @@ > CE3524FA1B1443890028A7C5 /* input-focus-blur.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CE3524F51B142BBB0028A7C5 /* input-focus-blur.html */; }; > CE449E1121AE0F7200E7ADA1 /* WKWebViewFindString.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE449E1021AE0F7200E7ADA1 /* WKWebViewFindString.mm */; }; > CE4D5DE71F6743BA0072CFC6 /* StringWithDirection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE4D5DE51F6743BA0072CFC6 /* StringWithDirection.cpp */; }; >+ CE6D0EE32426B932002AD901 /* insert-text.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CE6D0EE22426B8ED002AD901 /* insert-text.html */; }; > CE6E81A020A6935F00E2C80F /* SetTimeoutFunction.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE6E819F20A6935F00E2C80F /* SetTimeoutFunction.mm */; }; > CE6E81A420A933D500E2C80F /* set-timeout-function.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CE6E81A320A933B800E2C80F /* set-timeout-function.html */; }; > CE78705F2107AB980053AC67 /* MoveOnlyLifecycleLogger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE78705D2107AB8C0053AC67 /* MoveOnlyLifecycleLogger.cpp */; }; >@@ -1374,6 +1375,7 @@ > 5110FCF61E01CD83006F8D0B /* IndexUpgrade.sqlite3 in Copy Resources */, > 2EFF06CD1D8A429A0004BB30 /* input-field-in-scrollable-document.html in Copy Resources */, > CE3524FA1B1443890028A7C5 /* input-focus-blur.html in Copy Resources */, >+ CE6D0EE32426B932002AD901 /* insert-text.html in Copy Resources */, > 57F56A5C1C7F8CC100F31D7E /* IsNavigationActionTrusted.html in Copy Resources */, > C9B4AD2C1ECA6F7F00F5FEA0 /* js-autoplay-audio.html in Copy Resources */, > C99B675D1E39722000FC6C80 /* js-play-with-controls.html in Copy Resources */, >@@ -2578,6 +2580,7 @@ > CE50D8C81C8665CE0072EA5A /* OptionSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionSet.cpp; sourceTree = "<group>"; }; > CE640CA52370A4F300C5CAA4 /* TestCocoa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TestCocoa.h; path = cocoa/TestCocoa.h; sourceTree = "<group>"; }; > CE640CA62370A4F300C5CAA4 /* TestCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = TestCocoa.mm; path = cocoa/TestCocoa.mm; sourceTree = "<group>"; }; >+ CE6D0EE22426B8ED002AD901 /* insert-text.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = "insert-text.html"; path = "ios/insert-text.html"; sourceTree = SOURCE_ROOT; }; > CE6E819F20A6935F00E2C80F /* SetTimeoutFunction.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SetTimeoutFunction.mm; sourceTree = "<group>"; }; > CE6E81A320A933B800E2C80F /* set-timeout-function.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = "set-timeout-function.html"; path = "ios/set-timeout-function.html"; sourceTree = SOURCE_ROOT; }; > CE78705C2107AB8C0053AC67 /* MoveOnlyLifecycleLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MoveOnlyLifecycleLogger.h; sourceTree = "<group>"; }; >@@ -3671,6 +3674,7 @@ > isa = PBXGroup; > children = ( > 0F16BED72304A1D100B4A167 /* composited.html */, >+ CE6D0EE22426B8ED002AD901 /* insert-text.html */, > 0F340777230382540060A1A0 /* overflow-scroll.html */, > A1C4FB721BACD1B7003742D0 /* pages.pages */, > CE6E81A320A933B800E2C80F /* set-timeout-function.html */, >diff --git a/Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm b/Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm >index 7498b28e444e99d93094290a0d1a0c47aaf329a2..e2d843b8c3d0dc6db6ffcdb4dfbaf22136ac8b28 100644 >--- a/Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm >+++ b/Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm >@@ -30,6 +30,7 @@ > #import "IPadUserInterfaceSwizzler.h" > #import "InstanceMethodSwizzler.h" > #import "PlatformUtilities.h" >+#import "TestCocoa.h" > #import "TestInputDelegate.h" > #import "TestWKWebView.h" > #import "UIKitSPI.h" >@@ -37,6 +38,10 @@ > #import <WebKitLegacy/WebEvent.h> > #import <cmath> > >+@interface WKContentView () >+- (BOOL)_shouldSimulateKeyboardInputOnTextInsertion; >+@end >+ > @interface InputAssistantItemTestingWebView : TestWKWebView > + (UIBarButtonItemGroup *)leadingItemsForWebView:(WKWebView *)webView; > + (UIBarButtonItemGroup *)trailingItemsForWebView:(WKWebView *)webView; >@@ -647,6 +652,47 @@ TEST(KeyboardInputTests, SuppressSoftwareKeyboard) > EXPECT_TRUE(UIKeyboardImpl.sharedInstance._shouldSuppressSoftwareKeyboard); > } > >+static BOOL shouldSimulateKeyboardInputOnTextInsertionOverride(id, SEL) >+{ >+ return YES; >+} >+ >+TEST(KeyboardInputTests, InsertTextSimulatingKeyboardInput) >+{ >+ InstanceMethodSwizzler overrideShouldSimulateKeyboardInputOnTextInsertion { NSClassFromString(@"WKContentView"), @selector(_shouldSimulateKeyboardInputOnTextInsertion), reinterpret_cast<IMP>(shouldSimulateKeyboardInputOnTextInsertionOverride) }; >+ >+ auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]); >+ auto inputDelegate = adoptNS([[TestInputDelegate alloc] init]); >+ [inputDelegate setFocusStartsInputSessionPolicyHandler:[&](WKWebView *, id <_WKFocusedElementInfo>) { return _WKFocusStartsInputSessionPolicyAllow; }]; >+ [webView _setInputDelegate:inputDelegate.get()]; >+ >+ RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"insert-text" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]; >+ [webView synchronouslyLoadRequest:[NSURLRequest requestWithURL:testURL.get()]]; >+ [webView evaluateJavaScriptAndWaitForInputSessionToChange:@"document.body.focus()"]; >+ [[webView textInputContentView] insertText:@"hello"]; >+ EXPECT_NS_EQUAL((@[@"keydown", @"beforeinput", @"input", @"keyup", @"change"]), [webView objectByEvaluatingJavaScript:@"firedEvents"]); >+} >+ >+#if USE(DICTATION_ALTERNATIVES) >+ >+TEST(KeyboardInputTests, InsertDictationAlternativesSimulatingKeyboardInput) >+{ >+ InstanceMethodSwizzler overrideShouldSimulateKeyboardInputOnTextInsertion { NSClassFromString(@"WKContentView"), @selector(_shouldSimulateKeyboardInputOnTextInsertion), reinterpret_cast<IMP>(shouldSimulateKeyboardInputOnTextInsertionOverride) }; >+ >+ auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]); >+ auto inputDelegate = adoptNS([[TestInputDelegate alloc] init]); >+ [inputDelegate setFocusStartsInputSessionPolicyHandler:[&](WKWebView *, id <_WKFocusedElementInfo>) { return _WKFocusStartsInputSessionPolicyAllow; }]; >+ [webView _setInputDelegate:inputDelegate.get()]; >+ >+ RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"insert-text" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]; >+ [webView synchronouslyLoadRequest:[NSURLRequest requestWithURL:testURL.get()]]; >+ [webView evaluateJavaScriptAndWaitForInputSessionToChange:@"document.body.focus()"]; >+ [[webView textInputContentView] insertText:@"hello" alternatives:@[ @"helo" ] style:UITextAlternativeStyleNone]; >+ EXPECT_NS_EQUAL((@[@"keydown", @"beforeinput", @"input", @"keyup", @"change"]), [webView objectByEvaluatingJavaScript:@"firedEvents"]); >+} >+ >+#endif >+ > } // namespace TestWebKitAPI > > #endif // PLATFORM(IOS_FAMILY) >diff --git a/Tools/TestWebKitAPI/cocoa/TestCocoa.h b/Tools/TestWebKitAPI/cocoa/TestCocoa.h >index 6e453959dda6b1b81edb211763dbb62e9ea8c2f1..eeadcbb9b30ceb0940ad33083674b7d25a4636dd 100644 >--- a/Tools/TestWebKitAPI/cocoa/TestCocoa.h >+++ b/Tools/TestWebKitAPI/cocoa/TestCocoa.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * Copyright (C) 2019-2020 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -25,8 +25,26 @@ > > #pragma once > >+#import "PlatformUtilities.h" > #import "Test.h" > >+namespace TestWebKitAPI { >+namespace Util { >+ >+template<typename T, typename U> >+static inline ::testing::AssertionResult assertNSObjectsAreEqual(const char* expectedExpression, const char* actualExpression, T *expected, U *actual) >+{ >+ if ((!expected && !actual) || [expected isEqual:actual]) >+ return ::testing::AssertionSuccess(); >+ return ::testing::internal::EqFailure(expectedExpression, actualExpression, toSTD([expected description]), toSTD([actual description]), false /* ignoring_case */); >+} >+ >+} // namespace Util >+} // namespace TestWebKitAPI >+ >+#define EXPECT_NS_EQUAL(expected, actual) \ >+ EXPECT_PRED_FORMAT2(TestWebKitAPI::Util::assertNSObjectsAreEqual, expected, actual) >+ > #if USE(CG) > > std::ostream& operator<<(std::ostream&, const CGRect&); >diff --git a/Tools/TestWebKitAPI/ios/insert-text.html b/Tools/TestWebKitAPI/ios/insert-text.html >new file mode 100644 >index 0000000000000000000000000000000000000000..5883a3eb2dc60d9775a08263b05b95cab1c63c49 >--- /dev/null >+++ b/Tools/TestWebKitAPI/ios/insert-text.html >@@ -0,0 +1,24 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script> >+let firedEvents = []; >+ >+function logEvent(event) >+{ >+ firedEvents.push(event.type); >+} >+ >+function setupTest() >+{ >+ document.body.addEventListener("keydown", logEvent, false); >+ document.body.addEventListener("beforeinput", logEvent, false); >+ document.body.addEventListener("input", logEvent, false); >+ document.body.addEventListener("keyup", logEvent, false); >+ document.body.addEventListener("change", logEvent, false); >+} >+</script> >+</head> >+<body onload="setupTest()" contenteditable="true"> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 209380
:
394184
|
394185
|
394195
|
394196
|
394197
|
394300