Changeset 260857 in webkit
- Timestamp:
- Apr 28, 2020 5:05:58 PM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r260856 r260857 1 2020-04-28 Daniel Bates <dabates@apple.com> 2 3 Move WebPage::textInputContextsInRect() to WebPageIOS.mm 4 https://bugs.webkit.org/show_bug.cgi?id=211136 5 6 Reviewed by Eric Carlson. 7 8 The function WebPage::textInputContextsInRect is very specific to a client on iOS. 9 Although it's tempting to keep this cross-platform because its implementation does 10 not make use of iOS-specific technologies it does a very specific operation, the 11 result of which is a list of contexts to editable elements on the page. The contexts 12 provide enough info for the specific iOS client, but not enough to ever be useful 13 to any other client. Therefore move it to WebPageIOS.mm. 14 15 Only Mac and iOS were ever using this function. The former only for testing purposes 16 that have since been removed. 17 18 A side effect of this change is that I also move WebPageProxy::textInputContextsInRect() 19 from WebPageProxy.cpp to WebPageProxyIOS.mm. 20 21 * UIProcess/WebPageProxy.cpp: 22 (WebKit::WebPageProxy::textInputContextsInRect): Deleted; moved to WebPageProxyIOS.mm. 23 * UIProcess/WebPageProxy.h: 24 * UIProcess/ios/WebPageProxyIOS.mm: 25 (WebKit::WebPageProxy::textInputContextsInRect): Moved from WebPageProxy.cpp. 26 * WebProcess/WebPage/WebPage.cpp: 27 (WebKit::WebPage::textInputContextsInRect): Deleted; moved to WebPageIOS.mm. 28 * WebProcess/WebPage/WebPage.h: 29 * WebProcess/WebPage/WebPage.messages.in: 30 * WebProcess/WebPage/ios/WebPageIOS.mm: 31 (WebKit::WebPage::textInputContextsInRect): Moved from WebPage.cpp. 32 1 33 2020-04-28 Chris Dumez <cdumez@apple.com> 2 34 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r260820 r260857 10027 10027 } 10028 10028 10029 void WebPageProxy::textInputContextsInRect(WebCore::FloatRect rect, CompletionHandler<void(const Vector<WebCore::ElementContext>&)>&& completionHandler)10030 {10031 if (!hasRunningProcess()) {10032 completionHandler({ });10033 return;10034 }10035 10036 sendWithAsyncReply(Messages::WebPage::TextInputContextsInRect(rect), WTFMove(completionHandler));10037 }10038 10039 10029 void WebPageProxy::setCanShowPlaceholder(const WebCore::ElementContext& context, bool canShowPlaceholder) 10040 10030 { -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r260764 r260857 707 707 void fontAttributesCallback(const WebCore::FontAttributes&, CallbackID); 708 708 709 void textInputContextsInRect(WebCore::FloatRect, CompletionHandler<void(const Vector<WebCore::ElementContext>&)>&&);710 709 void setCanShowPlaceholder(const WebCore::ElementContext&, bool); 711 710 … … 715 714 716 715 #if PLATFORM(IOS_FAMILY) 716 void textInputContextsInRect(WebCore::FloatRect, CompletionHandler<void(const Vector<WebCore::ElementContext>&)>&&); 717 717 void focusTextInputContextAndPlaceCaret(const WebCore::ElementContext&, const WebCore::IntPoint&, CompletionHandler<void(bool)>&&); 718 718 -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r260764 r260857 1547 1547 } 1548 1548 1549 void WebPageProxy::textInputContextsInRect(FloatRect rect, CompletionHandler<void(const Vector<ElementContext>&)>&& completionHandler) 1550 { 1551 if (!hasRunningProcess()) { 1552 completionHandler({ }); 1553 return; 1554 } 1555 1556 sendWithAsyncReply(Messages::WebPage::TextInputContextsInRect(rect), WTFMove(completionHandler)); 1557 } 1558 1549 1559 void WebPageProxy::focusTextInputContextAndPlaceCaret(const ElementContext& context, const IntPoint& point, CompletionHandler<void(bool)>&& completionHandler) 1550 1560 { -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r260846 r260857 6918 6918 #endif // !PLATFORM(IOS_FAMILY) 6919 6919 6920 void WebPage::textInputContextsInRect(WebCore::FloatRect searchRect, CompletionHandler<void(const Vector<WebCore::ElementContext>&)>&& completionHandler)6921 {6922 auto contexts = m_page->editableElementsInRect(searchRect).map([&] (const auto& element) {6923 auto& document = element->document();6924 6925 WebCore::ElementContext context;6926 context.webPageIdentifier = m_identifier;6927 context.documentIdentifier = document.identifier();6928 context.elementIdentifier = document.identifierForElement(element);6929 context.boundingRect = element->clientRect();6930 return context;6931 });6932 completionHandler(contexts);6933 }6934 6935 6920 void WebPage::setCanShowPlaceholder(const WebCore::ElementContext& elementContext, bool canShowPlaceholder) 6936 6921 { -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r260846 r260857 645 645 void selectAll(); 646 646 647 void setCanShowPlaceholder(const WebCore::ElementContext&, bool); 648 649 #if PLATFORM(IOS_FAMILY) 647 650 void textInputContextsInRect(WebCore::FloatRect, CompletionHandler<void(const Vector<WebCore::ElementContext>&)>&&); 648 void setCanShowPlaceholder(const WebCore::ElementContext&, bool);649 650 #if PLATFORM(IOS_FAMILY)651 651 void focusTextInputContextAndPlaceCaret(const WebCore::ElementContext&, const WebCore::IntPoint&, CompletionHandler<void(bool)>&&); 652 652 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
r260846 r260857 122 122 InsertTextPlaceholder(WebCore::IntSize size) -> (Optional<WebCore::ElementContext> placeholder) Async 123 123 RemoveTextPlaceholder(struct WebCore::ElementContext placeholder) -> () Async 124 TextInputContextsInRect(WebCore::FloatRect rect) -> (Vector<struct WebCore::ElementContext> contexts) Async 124 125 FocusTextInputContextAndPlaceCaret(struct WebCore::ElementContext context, WebCore::IntPoint point) -> (bool success) Async 125 126 ClearServiceWorkerEntitlementOverride() -> () Async … … 578 579 #endif 579 580 580 TextInputContextsInRect(WebCore::FloatRect rect) -> (Vector<struct WebCore::ElementContext> contexts) Async581 581 SetCanShowPlaceholder(struct WebCore::ElementContext context, bool canShowPlaceholder) 582 582 -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r260826 r260857 4316 4316 } 4317 4317 4318 void WebPage::textInputContextsInRect(FloatRect searchRect, CompletionHandler<void(const Vector<ElementContext>&)>&& completionHandler) 4319 { 4320 auto contexts = m_page->editableElementsInRect(searchRect).map([&] (const auto& element) { 4321 auto& document = element->document(); 4322 4323 ElementContext context; 4324 context.webPageIdentifier = m_identifier; 4325 context.documentIdentifier = document.identifier(); 4326 context.elementIdentifier = document.identifierForElement(element); 4327 context.boundingRect = element->clientRect(); 4328 return context; 4329 }); 4330 completionHandler(contexts); 4331 } 4332 4318 4333 void WebPage::focusTextInputContextAndPlaceCaret(const ElementContext& elementContext, const IntPoint& point, CompletionHandler<void(bool)>&& completionHandler) 4319 4334 {
Note: See TracChangeset
for help on using the changeset viewer.