Changeset 221234 in webkit
- Timestamp:
- Aug 27, 2017 10:12:56 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r221232 r221234 1 2017-08-27 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Picking an emoji via the emoji dialog (Ctrl+Cmd+Space) fires inconsistent beforeinput events. 4 https://bugs.webkit.org/show_bug.cgi?id=170955 5 <rdar://problem/31697653> 6 7 Reviewed by Ryosuke Niwa. 8 9 Augments two existing layout tests to check for additional cases of inserting text with replacement ranges. 10 Also enables this test for WebKit1 on Mac. Both these tests are currently enabled only for WebKit2, and also only 11 check the case where we're replacing an existing non-empty range of text. 12 13 * fast/events/before-input-prevent-insert-replacement-expected.txt: 14 * fast/events/before-input-prevent-insert-replacement.html: 15 * fast/events/input-event-insert-replacement-expected.txt: 16 * fast/events/input-event-insert-replacement.html: 17 18 Tests for cases of replacing existing text ranges, and inserting text at a position. 19 20 * platform/mac-wk1/TestExpectations: 21 * resources/ui-helper.js: 22 23 Add a new UIHelper function to insert text at a given replacement range. This codepath is taken when selecting 24 an emoji using the emoji picker menu on Mac, and also when selecting a dead key option after holding down on a 25 vowel key. 26 27 (window.UIHelper.replaceTextAtRange): 28 1 29 2017-08-27 Devin Rousso <webkit@devinrousso.com> 2 30 -
trunk/LayoutTests/fast/events/before-input-prevent-insert-replacement-expected.txt
r208143 r221234 1 a 2 Typing 'a'... 3 (editable): type=beforeinput, inputType=insertText, data=`a`, dataTransfer=`null` 4 (editable): type=input, inputType=insertText, data=`a`, dataTransfer=`null` 5 Attempting to replace 'a' with 'b'... 6 (editable): type=beforeinput, inputType=insertReplacementText, data=`null`, dataTransfer=`plain:"b", html:"b"` 1 To manually test, press and hold down 'a' and select one of the accented characters. 2 You should observe that the replacement accented character does not replace 'a'. 3 Then insert an emoji using the emoji picker. This should insert something into the editor. 4 Finally, select all the content and attempt to replace it with an emoji. This should do nothing. 5 ac 6 (1) Typing 'a'... 7 (editable): type=beforeinput, inputType=insertText, data=a, dataTransfer=(null) 8 (editable): type=input, inputType=insertText, data=a, dataTransfer=(null) 9 The editor now has text content: a 10 (2) Preventing default when replacing 'a' with 'b'... 11 (editable): type=beforeinput, inputType=insertReplacementText, data=null, dataTransfer=plain:"b", html:"b" 12 The editor now has text content: a 13 (3) Inserting 'c' after 'a'... 14 (editable): type=beforeinput, inputType=insertText, data=c, dataTransfer=(null) 15 (editable): type=input, inputType=insertText, data=c, dataTransfer=(null) 16 The editor now has text content: ac 17 (4) Selecting all and preventing replacement with 'd'... 18 (editable): type=beforeinput, inputType=insertReplacementText, data=null, dataTransfer=plain:"d", html:"d" 19 The editor now has text content: ac 7 20 -
trunk/LayoutTests/fast/events/before-input-prevent-insert-replacement.html
r208143 r221234 1 1 <!DOCTYPE html> 2 2 <html> 3 <body> 4 <div id="editable" onbeforeinput=handleInputEvent(event) oninput=handleInputEvent(event) contenteditable></div> 5 <div id="output"></div> 6 <script type="text/javascript"> 7 let write = s => output.innerHTML += s + "<br>"; 8 var progress = 0; 9 editable.focus(); 3 <head> 4 <script src="../../resources/ui-helper.js"></script> 5 </head> 10 6 11 if (window.internals && window.testRunner) { 12 internals.settings.setInputEventsEnabled(true); 13 testRunner.dumpAsText(); 14 testRunner.waitUntilDone(); 15 if (window.eventSender && testRunner.runUIScript) { 16 write("Typing 'a'..."); 17 eventSender.keyDown("a"); 18 write("Attempting to replace 'a' with 'b'..."); 19 testRunner.runUIScript(getUIScript(), (result) => incrementProgress()); 20 } 21 } else { 22 write("To manually test, press and hold down 'a' and select one of the accented characters."); 23 write("You should observe that the replacement accented character does not replace 'a'."); 24 } 7 <div>To manually test, press and hold down 'a' and select one of the accented characters.</div> 8 <div>You should observe that the replacement accented character does not replace 'a'.</div> 9 <div>Then insert an emoji using the emoji picker. This should insert something into the editor.</div> 10 <div>Finally, select all the content and attempt to replace it with an emoji. This should do nothing.</div> 11 <div id="editable" onbeforeinput=handleInputEvent(event) oninput=handleInputEvent(event) contenteditable></div> 12 <div id="output"></div> 25 13 26 function incrementProgress() 27 { 28 progress++; 29 if (progress == 2) 30 testRunner.notifyDone(); 31 } 14 <script type="text/javascript"> 15 let write = s => output.innerHTML += s + "<br>"; 16 editable.focus(); 32 17 33 function handleInputEvent(event) 34 { 35 write(`(${event.target.id}): type=${event.type}, inputType=${event.inputType}, data=\`${event.data}\`, dataTransfer=\`${dataTransferAsString(event.dataTransfer)}\``); 36 if (event.inputType === "insertReplacementText") { 37 event.preventDefault(); 38 incrementProgress(); 39 } 40 } 18 if (window.testRunner && window.eventSender && testRunner.runUIScript) { 19 testRunner.dumpAsText(); 20 testRunner.waitUntilDone(); 21 runTest(); 22 } 41 23 42 function dataTransferAsString(dataTransfer) 43 { 44 if (!dataTransfer) 45 return "null"; 24 async function runTest() { 25 write("(1) Typing 'a'..."); 26 eventSender.keyDown("a"); 27 write(`The editor now has text content: ${editable.textContent}`); 28 write("(2) Preventing default when replacing 'a' with 'b'..."); 29 await UIHelper.replaceTextAtRange("b", 0, 1) 30 write(`The editor now has text content: ${editable.textContent}`); 31 write("(3) Inserting 'c' after 'a'..."); 32 await UIHelper.replaceTextAtRange("c", 1, 0); 33 write(`The editor now has text content: ${editable.textContent}`); 34 write("(4) Selecting all and preventing replacement with 'd'..."); 35 document.execCommand("SelectAll") 36 await UIHelper.replaceTextAtRange("d", 0, 2); 37 write(`The editor now has text content: ${editable.textContent}`); 46 38 47 return `plain:"${dataTransfer.getData('text/plain')}", html:"${dataTransfer.getData('text/html')}"`;48 39 testRunner.notifyDone(); 40 } 49 41 50 function getUIScript()51 52 return `53 (function() {54 uiController.insertText("b", 0, 1); 55 uiController.uiScriptComplete();56 })();`57 58 42 function handleInputEvent(event) 43 { 44 let dataTransferString = event.dataTransfer ? `plain:"${event.dataTransfer.getData('text/plain')}", html:"${event.dataTransfer.getData('text/html')}"` : "(null)"; 45 write(`(${event.target.id}): type=${event.type}, inputType=${event.inputType}, data=${event.data}, dataTransfer=${dataTransferString}`); 46 47 if (event.type === "beforeinput" && event.inputType === "insertReplacementText") 48 event.preventDefault(); 49 } 50 </script> 59 51 </body> 60 52 </html> -
trunk/LayoutTests/fast/events/input-event-insert-replacement-expected.txt
r208143 r221234 1 To manually test, press and hold down 'a' and select one of the accented characters." 2 You should observe a pair of beforeinput/input events for both 'a' and the replacement accented character." 3 Importantly, the inputType of these four events should be 'insertReplacementText'." 4 Then insert a single emoji character. You should observe beforeinput/input events for the inserted emoji." 5 Importantly, the inputType of these two events should be 'insertText'." 1 6 2 Typing 'a'...3 (editable): type=beforeinput, inputType=insertText, data= `a`, dataTransfer=`null`4 (editable): type=input, inputType=insertText, data= `a`, dataTransfer=`null`7 (1) Typing 'a'... 8 (editable): type=beforeinput, inputType=insertText, data=a, dataTransfer=null 9 (editable): type=input, inputType=insertText, data=a, dataTransfer=null 5 10 The value of the input is now: a 11 (2) Replacing 'a' with 'b'... 12 (editable): type=beforeinput, inputType=insertReplacementText, data=b, dataTransfer=null 13 (editable): type=input, inputType=insertReplacementText, data=b, dataTransfer=null 14 The value of the input is now: b 15 (3) Inserting 'c' after 'b'... 16 (editable): type=beforeinput, inputType=insertText, data=c, dataTransfer=null 17 (editable): type=input, inputType=insertText, data=c, dataTransfer=null 18 The value of the input is now: bc 19 (4) Selecting all and replacing with 'd'... 20 (editable): type=beforeinput, inputType=insertReplacementText, data=d, dataTransfer=null 21 (editable): type=input, inputType=insertReplacementText, data=d, dataTransfer=null 22 The value of the input is now: d 6 23 7 Replacing 'a' with 'b'...8 (editable): type=beforeinput, inputType=insertReplacementText, data=`b`, dataTransfer=`null`9 (editable): type=input, inputType=insertReplacementText, data=`b`, dataTransfer=`null`10 The value of the input is now: b11 -
trunk/LayoutTests/fast/events/input-event-insert-replacement.html
r208143 r221234 1 1 <!DOCTYPE html> 2 2 <html> 3 <body> 4 <input id="editable" onbeforeinput=logInputEvent(event) oninput=logInputEvent(event)></input> 5 <div id="output"></div> 6 <script type="text/javascript"> 7 let write = s => output.innerHTML += s + "<br>"; 8 var progress = 0; 9 editable.focus(); 3 <head> 4 <script src="../../resources/ui-helper.js"></script> 5 </head> 10 6 11 if (window.internals && window.testRunner) { 12 internals.settings.setInputEventsEnabled(true); 13 testRunner.dumpAsText(); 14 testRunner.waitUntilDone(); 15 if (window.eventSender && testRunner.runUIScript) { 16 write("Typing 'a'..."); 17 eventSender.keyDown("a"); 18 write(`The value of the input is now: ${editable.value}`); 19 write(""); 20 write("Replacing 'a' with 'b'..."); 21 testRunner.runUIScript(getUIScript(), (result) => incrementProgress()); 22 } 23 } else { 24 write("To manually test, press and hold down 'a' and select one of the accented characters."); 25 write("You should observe a pair of beforeinput/input events for both 'a' and the replacement accented character."); 26 write("Importantly, the inputType of the last two events should be 'insertReplacementText'."); 27 } 7 <div>To manually test, press and hold down 'a' and select one of the accented characters."</div> 8 <div>You should observe a pair of beforeinput/input events for both 'a' and the replacement accented character."</div> 9 <div>Importantly, the inputType of these four events should be 'insertReplacementText'."</div> 10 <div>Then insert a single emoji character. You should observe beforeinput/input events for the inserted emoji."</div> 11 <div>Importantly, the inputType of these two events should be 'insertText'."</div> 28 12 29 function incrementProgress() 30 { 31 progress++; 32 if (progress != 5) 33 return; 13 <input id="editable" onbeforeinput=logInputEvent(event) oninput=logInputEvent(event)></input> 14 <div id="output"></div> 15 <script type="text/javascript"> 16 let write = s => output.innerHTML += s + "<br>"; 17 editable.focus(); 18 if (window.testRunner && window.eventSender && testRunner.runUIScript) { 19 testRunner.dumpAsText(); 20 testRunner.waitUntilDone(); 21 runTest(); 22 } 34 23 35 write(`The value of the input is now: ${editable.value}`); 36 testRunner.notifyDone(); 37 } 24 function logInputEvent(event) 25 { 26 write(`(${event.target.id}): type=${event.type}, inputType=${event.inputType}, data=${event.data}, dataTransfer=${event.dataTransfer}`); 27 } 38 28 39 function logInputEvent(event) 40 { 41 write(`(${event.target.id}): type=${event.type}, inputType=${event.inputType}, data=\`${event.data}\`, dataTransfer=\`${event.dataTransfer}\``); 42 incrementProgress(); 43 } 29 async function runTest() { 30 write("(1) Typing 'a'..."); 31 eventSender.keyDown("a"); 32 write(`The value of the input is now: ${editable.value}`); 33 write("(2) Replacing 'a' with 'b'..."); 34 await UIHelper.replaceTextAtRange("b", 0, 1); 35 write(`The value of the input is now: ${editable.value}`); 36 write("(3) Inserting 'c' after 'b'..."); 37 await UIHelper.replaceTextAtRange("c", 1, 0); 38 write(`The value of the input is now: ${editable.value}`); 39 write("(4) Selecting all and replacing with 'd'..."); 40 document.execCommand("SelectAll") 41 await UIHelper.replaceTextAtRange("d", 0, 2); 42 write(`The value of the input is now: ${editable.value}`); 44 43 45 function getUIScript() 46 { 47 return ` 48 (function() { 49 uiController.insertText("b", 0, 1); 50 uiController.uiScriptComplete(); 51 })();` 52 } 53 </script> 54 </body> 44 testRunner.notifyDone(); 45 } 46 </script> 55 47 </html> -
trunk/LayoutTests/platform/mac-wk1/TestExpectations
r221024 r221234 85 85 # WK1 and WK2 mousemove events are subtly different in ways that break this test on WK1. 86 86 fast/events/ghostly-mousemoves-in-subframe.html [ Skip ] 87 88 # Test support for inserting special characters is not yet implemented on WK1.89 fast/events/before-input-prevent-insert-replacement.html [ Skip ]90 fast/events/input-event-insert-replacement.html [ Skip ]91 87 92 88 # Media Stream API testing is not supported for WK1 yet. -
trunk/LayoutTests/resources/ui-helper.js
r221064 r221234 111 111 } 112 112 113 static replaceTextAtRange(text, location, length) { 114 return new Promise(resolve => { 115 testRunner.runUIScript(`(() => { 116 uiController.replaceTextAtRange("${text}", ${location}, ${length}); 117 uiController.uiScriptComplete('Done'); 118 })()`, resolve); 119 }); 120 } 121 113 122 static wait(promise) 114 123 { -
trunk/Source/WebKit/ChangeLog
r221233 r221234 1 2017-08-27 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Picking an emoji via the emoji dialog (Ctrl+Cmd+Space) fires inconsistent beforeinput events. 4 https://bugs.webkit.org/show_bug.cgi?id=170955 5 <rdar://problem/31697653> 6 7 Reviewed by Ryosuke Niwa. 8 9 Currently, we insert text with TextEventInputAutocompletion as the text event input type if any text range to 10 replace was specified by the platform. Instead, limit this only to when the text replacement range is not empty. 11 This more closely matches the intention of the spec, which states that the "insertReplacementText" inputType 12 should be used when "[replacing] existing text by means of a spell checker, auto-correct or similar". 13 14 * WebProcess/WebPage/WebPage.cpp: 15 (WebKit::WebPage::insertTextAsync): 16 1 17 2017-08-27 Wenson Hsieh <wenson_hsieh@apple.com> 2 18 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r221216 r221234 4844 4844 bool replacesText = false; 4845 4845 if (replacementEditingRange.location != notFound) { 4846 RefPtr<Range> replacementRange = rangeFromEditingRange(frame, replacementEditingRange, static_cast<EditingRangeIsRelativeTo>(editingRangeIsRelativeTo)); 4847 if (replacementRange) { 4846 if (auto replacementRange = rangeFromEditingRange(frame, replacementEditingRange, static_cast<EditingRangeIsRelativeTo>(editingRangeIsRelativeTo))) { 4848 4847 SetForScope<bool> isSelectingTextWhileInsertingAsynchronously(m_isSelectingTextWhileInsertingAsynchronously, suppressSelectionUpdate); 4849 4848 frame.selection().setSelection(VisibleSelection(*replacementRange, SEL_DEFAULT_AFFINITY)); 4850 replacesText = true;4849 replacesText = replacementEditingRange.length; 4851 4850 } 4852 4851 } -
trunk/Source/WebKitLegacy/mac/ChangeLog
r221177 r221234 1 2017-08-27 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Picking an emoji via the emoji dialog (Ctrl+Cmd+Space) fires inconsistent beforeinput events. 4 https://bugs.webkit.org/show_bug.cgi?id=170955 5 <rdar://problem/31697653> 6 7 Reviewed by Ryosuke Niwa. 8 9 Tweak -insertText: to pass TextEventInputAutocompletion to Editor::insertText when inserting text, if existing 10 text is being replaced. 11 12 * WebView/WebHTMLView.mm: 13 (-[WebHTMLView insertText:]): 14 1 15 2017-08-24 Chris Dumez <cdumez@apple.com> 2 16 -
trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
r220979 r221234 7155 7155 #endif 7156 7156 7157 bool replacesText = false; 7157 7158 if (replacementRange.location != NSNotFound) { 7158 7159 WebRangeIsRelativeTo rangeIsRelativeTo = needToRemoveSoftSpace ? WebRangeIsRelativeTo::Paragraph : WebRangeIsRelativeTo::EditableRoot; 7159 RefPtr<Range> domRange = [[self _frame] _convertToDOMRange:replacementRange rangeIsRelativeTo:rangeIsRelativeTo]; 7160 if (domRange) 7160 if (auto domRange = [[self _frame] _convertToDOMRange:replacementRange rangeIsRelativeTo:rangeIsRelativeTo]) { 7161 7161 coreFrame->selection().setSelection(VisibleSelection(*domRange, SEL_DEFAULT_AFFINITY)); 7162 replacesText = replacementRange.length; 7163 } 7162 7164 } 7163 7165 … … 7172 7174 eventHandled = coreFrame->editor().insertDictatedText(eventText, dictationAlternativeLocations, event); 7173 7175 else 7174 eventHandled = coreFrame->editor().insertText(eventText, event );7176 eventHandled = coreFrame->editor().insertText(eventText, event, replacesText ? TextEventInputAutocompletion : TextEventInputKeyboard); 7175 7177 7176 7178 #if USE(INSERTION_UNDO_GROUPING) -
trunk/Tools/ChangeLog
r221233 r221234 1 2017-08-27 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Picking an emoji via the emoji dialog (Ctrl+Cmd+Space) fires inconsistent beforeinput events. 4 https://bugs.webkit.org/show_bug.cgi?id=170955 5 <rdar://problem/31697653> 6 7 Reviewed by Ryosuke Niwa. 8 9 Replace UIScriptController.insertText with UIScriptController.replaceTextAtRange, and implement 10 replaceTextAtRange in WebKit1. See corresponding layout tests (input-event-insert-replacement.html and 11 before-input-prevent-insert-replacement.html) for more detail. 12 13 * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: 14 * DumpRenderTree/mac/AppKitTestSPI.h: Added. 15 16 Introduce an SPI header for private AppKit headers needed to support DumpRenderTree. 17 18 * DumpRenderTree/mac/UIScriptControllerMac.mm: 19 (WTR::UIScriptController::replaceTextAtRange): 20 (WTR::UIScriptController::insertText): Deleted. 21 * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: 22 * TestRunnerShared/UIScriptContext/UIScriptController.cpp: 23 (WTR::UIScriptController::replaceTextAtRange): 24 (WTR::UIScriptController::insertText): Deleted. 25 * TestRunnerShared/UIScriptContext/UIScriptController.h: 26 * WebKitTestRunner/mac/UIScriptControllerMac.mm: 27 (WTR::UIScriptController::replaceTextAtRange): 28 (WTR::UIScriptController::insertText): Deleted. 29 30 Replace UIScriptController.insertText with UIScriptController.replaceTextAtRange, which better describes the 31 behavior of this function. 32 1 33 2017-08-27 Wenson Hsieh <wenson_hsieh@apple.com> 2 34 -
trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
r218275 r221234 285 285 2DA2E3A31E1BA54100A3BBD0 /* DumpRenderTreeSpellChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DumpRenderTreeSpellChecker.h; path = mac/DumpRenderTreeSpellChecker.h; sourceTree = "<group>"; }; 286 286 2DA2E3A41E1BA54100A3BBD0 /* DumpRenderTreeSpellChecker.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DumpRenderTreeSpellChecker.mm; path = mac/DumpRenderTreeSpellChecker.mm; sourceTree = "<group>"; }; 287 2EDE0DAA1F5131DE00D5F8DF /* AppKitTestSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AppKitTestSPI.h; path = mac/AppKitTestSPI.h; sourceTree = "<group>"; }; 287 288 31117B3A15D9A56A00163BC8 /* MockWebNotificationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MockWebNotificationProvider.h; path = mac/MockWebNotificationProvider.h; sourceTree = "<group>"; }; 288 289 31117B3B15D9A56A00163BC8 /* MockWebNotificationProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MockWebNotificationProvider.mm; path = mac/MockWebNotificationProvider.mm; sourceTree = "<group>"; }; … … 546 547 isa = PBXGroup; 547 548 children = ( 549 2EDE0DAA1F5131DE00D5F8DF /* AppKitTestSPI.h */, 548 550 0F18E70E1D6BACB60027E547 /* UIScriptControllerMac.mm */, 549 551 ); … … 604 606 BCA18B2F0C9B01B400114369 /* ObjCController.h */, 605 607 BCA18B300C9B01B400114369 /* ObjCController.m */, 606 F4D423601DD5046900678290 /* TextInputController.h */,607 608 BC0131D80C9772010087317D /* TestRunner.cpp */, 608 609 BC0131D90C9772010087317D /* TestRunner.h */, 609 610 BCA18B220C9B014B00114369 /* TestRunnerMac.mm */, 611 F4D423601DD5046900678290 /* TextInputController.h */, 610 612 ); 611 613 name = Controllers; … … 1062 1064 A134E53618905EFF00901D06 /* AccessibilityCommonMac.mm in Sources */, 1063 1065 BCD08B3A0E1057EF00A7D0C1 /* AccessibilityController.cpp in Sources */, 1064 2DA2E3A51E1BA54100A3BBD0 /* DumpRenderTreeSpellChecker.mm in Sources */,1065 1066 AA5A15EF16E15CD000F7C561 /* AccessibilityControllerIOS.mm in Sources */, 1066 1067 BCD08B710E1059D200A7D0C1 /* AccessibilityControllerMac.mm in Sources */, … … 1081 1082 A8D79CEB0FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.m in Sources */, 1082 1083 A8B91ADA0CF3B32F008F91FF /* DumpRenderTreePasteboard.mm in Sources */, 1084 2DA2E3A51E1BA54100A3BBD0 /* DumpRenderTreeSpellChecker.mm in Sources */, 1083 1085 A8B91ADC0CF3B32F008F91FF /* DumpRenderTreeWindow.mm in Sources */, 1084 1086 BCA18B620C9B08C200114369 /* EditingDelegate.mm in Sources */, … … 1088 1090 BCA18B230C9B014B00114369 /* GCControllerMac.mm in Sources */, 1089 1091 5185F6B210714E07007AA393 /* HistoryDelegate.mm in Sources */, 1092 312943F91E71F2B4001EE2CC /* IOSLayoutTestCommunication.cpp in Sources */, 1090 1093 2CE88FA217124D8C00734FC0 /* JavaScriptThreading.cpp in Sources */, 1091 1094 0F18E7061D6BA0230027E547 /* JSUIScriptController.cpp in Sources */, … … 1099 1102 8465E2C70FFA8DF2003B8342 /* PixelDumpSupport.cpp in Sources */, 1100 1103 BCB284CD0CFA83C8007E533E /* PixelDumpSupportCG.cpp in Sources */, 1101 F4D423611DD5048200678290 /* TextInputControllerIOS.m in Sources */,1102 1104 A1158D59189274360088C17B /* PixelDumpSupportIOS.mm in Sources */, 1103 1105 BCB284D60CFA83D1007E533E /* PixelDumpSupportMac.mm in Sources */, 1104 1106 BCA18B660C9B08C200114369 /* PolicyDelegate.mm in Sources */, 1105 1107 BCA18B680C9B08C200114369 /* ResourceLoadDelegate.mm in Sources */, 1108 7CBBC3231DDFCF9A00786B9D /* TestOptions.mm in Sources */, 1106 1109 BC0131DA0C9772010087317D /* TestRunner.cpp in Sources */, 1107 1110 BCA18B240C9B014B00114369 /* TestRunnerMac.mm in Sources */, 1111 F4D423611DD5048200678290 /* TextInputControllerIOS.m in Sources */, 1108 1112 BCA18B490C9B02C400114369 /* TextInputControllerMac.m in Sources */, 1109 1113 BCA18B6A0C9B08C200114369 /* UIDelegate.mm in Sources */, … … 1111 1115 0F18E6ED1D6B9C070027E547 /* UIScriptController.cpp in Sources */, 1112 1116 0F18E70D1D6BAC8C0027E547 /* UIScriptControllerIOS.mm in Sources */, 1113 7CBBC3231DDFCF9A00786B9D /* TestOptions.mm in Sources */,1114 1117 0F18E70F1D6BACB60027E547 /* UIScriptControllerMac.mm in Sources */, 1115 1118 BC9D90240C97472E0099A4A3 /* WorkQueue.cpp in Sources */, 1116 312943F91E71F2B4001EE2CC /* IOSLayoutTestCommunication.cpp in Sources */,1117 1119 BCA18B260C9B015C00114369 /* WorkQueueItemMac.mm in Sources */, 1118 1120 ); -
trunk/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm
r216291 r221234 37 37 #if PLATFORM(MAC) 38 38 39 #import "AppKitTestSPI.h" 40 39 41 namespace WTR { 40 42 … … 65 67 } 66 68 67 void UIScriptController:: insertText(JSStringRef, int, int)69 void UIScriptController::replaceTextAtRange(JSStringRef text, int location, int length) 68 70 { 71 auto textToInsert = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, text)); 72 auto rangeAttribute = adoptNS([[NSDictionary alloc] initWithObjectsAndKeys:NSStringFromRange(NSMakeRange(location == -1 ? NSNotFound : location, length)), NSTextInputReplacementRangeAttributeName, nil]); 73 auto textAndRange = adoptNS([[NSAttributedString alloc] initWithString:(NSString *)textToInsert.get() attributes:rangeAttribute.get()]); 74 75 [mainFrame.webView insertText:textAndRange.get()]; 69 76 } 70 77 -
trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
r217587 r221234 227 227 readonly attribute object inputViewBounds; 228 228 229 void insertText(DOMString text, long location, long length);229 void replaceTextAtRange(DOMString text, long location, long length); 230 230 void removeAllDynamicDictionaries(); 231 231 -
trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp
r217587 r221234 462 462 } 463 463 464 void UIScriptController:: insertText(JSStringRef, int, int)464 void UIScriptController::replaceTextAtRange(JSStringRef, int, int) 465 465 { 466 466 } -
trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
r217587 r221234 152 152 JSObjectRef inputViewBounds() const; 153 153 154 void insertText(JSStringRef, int location, int length);154 void replaceTextAtRange(JSStringRef, int location, int length); 155 155 void removeAllDynamicDictionaries(); 156 156 -
trunk/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm
r216291 r221234 76 76 } 77 77 78 void UIScriptController:: insertText(JSStringRef text, int location, int length)78 void UIScriptController::replaceTextAtRange(JSStringRef text, int location, int length) 79 79 { 80 80 #if WK_API_ENABLED
Note: See TracChangeset
for help on using the changeset viewer.