Changeset 247180 in webkit
- Timestamp:
- Jul 5, 2019 2:56:58 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r247174 r247180 1 2019-07-05 Ryosuke Niwa <rniwa@webkit.org> 2 3 [iOS] Crash in WebKit::WebPage::positionInformation via Range::startPosition 4 https://bugs.webkit.org/show_bug.cgi?id=199503 5 6 Reviewed by Wenson Hsieh. 7 8 Added a regression test for the crash. 9 10 * editing/input/delete-text-in-composition-expected.txt: Added. 11 * editing/input/delete-text-in-composition.html: Added. 12 * resources/ui-helper.js: 13 (window.UIHelper.ensurePositionInformationUpdateForElement): Added. 14 1 15 2019-07-02 Myles C. Maxfield <mmaxfield@apple.com> 2 16 -
trunk/LayoutTests/resources/ui-helper.js
r247158 r247180 255 255 } 256 256 257 static ensurePositionInformationUpdateForElement(element) 258 { 259 const boundingRect = element.getBoundingClientRect(); 260 const x = boundingRect.x + 5; 261 const y = boundingRect.y + 5; 262 263 if (!this.isWebKit2()) { 264 testRunner.display(); 265 return Promise.resolve(); 266 } 267 268 return new Promise(resolve => { 269 testRunner.runUIScript(` 270 uiController.ensurePositionInformationIsUpToDateAt(${x}, ${y}, function () { 271 uiController.uiScriptComplete(); 272 });`, resolve); 273 }); 274 } 275 257 276 static delayFor(ms) 258 277 { -
trunk/Source/WebCore/ChangeLog
r247174 r247180 1 2019-07-05 Ryosuke Niwa <rniwa@webkit.org> 2 3 [iOS] Crash in WebKit::WebPage::positionInformation via Range::startPosition 4 https://bugs.webkit.org/show_bug.cgi?id=199503 5 6 Reviewed by Wenson Hsieh. 7 8 * editing/Editor.cpp: 9 (WebCore::Editor::compositionRange const): Added a FIXME. 10 1 11 2019-07-02 Myles C. Maxfield <mmaxfield@apple.com> 2 12 -
trunk/Source/WebCore/editing/Editor.cpp
r246490 r247180 3078 3078 unsigned start = std::min(m_compositionStart, length); 3079 3079 unsigned end = std::min(std::max(start, m_compositionEnd), length); 3080 // FIXME: Why is this early return neeed? 3080 3081 if (start >= end) 3081 3082 return nullptr; -
trunk/Source/WebKit/ChangeLog
r247167 r247180 1 2019-07-05 Ryosuke Niwa <rniwa@webkit.org> 2 3 [iOS] Crash in WebKit::WebPage::positionInformation via Range::startPosition 4 https://bugs.webkit.org/show_bug.cgi?id=199503 5 6 Reviewed by Wenson Hsieh. 7 8 The crash was caused because focusedElementPositionInformation asssumes Editor::compositionRange is not null 9 whenever Editor::hasComposition returns true, which is not necessary the case when Editor::m_compositionNode 10 contains no text (data is of length 0). 11 12 Fixed the crash by adding an early return for when Editor::compositionRange returns nullptr. 13 14 * WebProcess/WebPage/ios/WebPageIOS.mm: 15 (WebKit::focusedElementPositionInformation): 16 1 17 2019-07-05 Zalan Bujtas <zalan@apple.com> 2 18 -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r247167 r247180 2509 2509 2510 2510 RefPtr<Range> compositionRange = frame.editor().compositionRange(); 2511 if (!compositionRange) 2512 return; 2513 2511 2514 if (position < compositionRange->startPosition()) 2512 2515 position = compositionRange->startPosition(); -
trunk/Tools/ChangeLog
r247164 r247180 1 2019-07-05 Ryosuke Niwa <rniwa@webkit.org> 2 3 [iOS] Crash in WebKit::WebPage::positionInformation via Range::startPosition 4 https://bugs.webkit.org/show_bug.cgi?id=199503 5 6 Reviewed by Wenson Hsieh. 7 8 Added UIScriptController.ensurePositionInformationIsUpToDateAt using the existing WKWebView SPI: 9 _requestActivatedElementAtPosition 10 11 * DumpRenderTree/ios/UIScriptControllerIOS.mm: 12 (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt): 13 * DumpRenderTree/mac/UIScriptControllerMac.mm: 14 (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt): 15 * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: 16 * TestRunnerShared/UIScriptContext/UIScriptController.cpp: 17 (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt): 18 * TestRunnerShared/UIScriptContext/UIScriptController.h: 19 * WebKitTestRunner/ios/UIScriptControllerIOS.mm: 20 (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt): 21 * WebKitTestRunner/ios/UIScriptControllerMac.mm: 22 (WTR::UIScriptController::ensurePositionInformationIsUpToDateAt): 23 1 24 2019-07-05 Ryan Haddad <ryanhaddad@apple.com> 2 25 -
trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm
r247158 r247180 64 64 } 65 65 66 void UIScriptController::ensurePositionInformationIsUpToDateAt(long x, long y, JSValueRef callback) 67 { 68 return doAsyncTask(callback); 69 } 70 66 71 void UIScriptController::doAfterVisibleContentRectUpdate(JSValueRef callback) 67 72 { -
trunk/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm
r242069 r247180 62 62 } 63 63 64 void UIScriptController::ensurePositionInformationIsUpToDateAt(long x, long y, JSValueRef callback) 65 { 66 doAsyncTask(callback); 67 } 68 64 69 void UIScriptController::doAfterVisibleContentRectUpdate(JSValueRef callback) 65 70 { -
trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
r247158 r247180 46 46 void doAfterPresentationUpdate(object callback); // Call the callback after sending a message to the WebProcess and receiving a subsequent update. 47 47 void doAfterNextStablePresentationUpdate(object callback); 48 48 void ensurePositionInformationIsUpToDateAt(long x, long y, object callback); 49 49 void doAfterVisibleContentRectUpdate(object callback); 50 50 -
trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp
r247158 r247180 102 102 } 103 103 104 void UIScriptController::ensurePositionInformationIsUpToDateAt(long x, long y, JSValueRef) 105 { 106 } 107 104 108 void UIScriptController::doAfterVisibleContentRectUpdate(JSValueRef) 105 109 { -
trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
r247158 r247180 68 68 void doAfterPresentationUpdate(JSValueRef callback); 69 69 void doAfterNextStablePresentationUpdate(JSValueRef callback); 70 void ensurePositionInformationIsUpToDateAt(long x, long y, JSValueRef callback); 70 71 void doAfterVisibleContentRectUpdate(JSValueRef callback); 71 72 -
trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm
r247158 r247180 158 158 } 159 159 160 void UIScriptController::ensurePositionInformationIsUpToDateAt(long x, long y, JSValueRef callback) 161 { 162 TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView(); 163 164 unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent); 165 [webView _requestActivatedElementAtPosition:CGPointMake(x, y) completionBlock:^(_WKActivatedElementInfo *) { 166 if (!m_context) 167 return; 168 m_context->asyncTaskComplete(callbackID); 169 }]; 170 } 171 160 172 void UIScriptController::doAfterVisibleContentRectUpdate(JSValueRef callback) 161 173 { -
trunk/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm
r242339 r247180 60 60 } 61 61 62 void UIScriptController::ensurePositionInformationIsUpToDateAt(long, long, JSValueRef callback) 63 { 64 doAsyncTask(callback); 65 } 66 62 67 void UIScriptController::doAfterVisibleContentRectUpdate(JSValueRef callback) 63 68 {
Note: See TracChangeset
for help on using the changeset viewer.