WebKit Bugzilla
Attachment 343570 Details for
Bug 186900
: Fix IBeam issues with iPad apps on Mac
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186900-20180625181938.patch (text/plain), 4.65 KB, created by
Megan Gardner
on 2018-06-25 18:19:38 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Megan Gardner
Created:
2018-06-25 18:19:38 PDT
Size:
4.65 KB
patch
obsolete
>Subversion Revision: 233064 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 05aa2ff1519d440bb2bbc3af5f1e0d6ce90a5161..4570a3adec45ea8808c74f7ea1c4beb5e7ed03f2 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,27 @@ >+2018-06-25 Megan Gardner <megan_gardner@apple.com> >+ >+ Fix IBeam issues with iPad apps on Mac >+ https://bugs.webkit.org/show_bug.cgi?id=186900 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Shared/ios/InteractionInformationAtPosition.h: >+ * Shared/ios/InteractionInformationAtPosition.mm: >+ (WebKit::InteractionInformationAtPosition::encode const): >+ (WebKit::InteractionInformationAtPosition::decode): >+ >+ Add functionality to determine what a caret rect should be, but as it is >+ expensive, it should only be done for this platform. >+ >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView closestPositionToPoint:]): >+ >+ UIKit is using this function to determine if we should show an iBeam or not. >+ So we need to implement it, at least for this platform. >+ >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::WebPage::getPositionInformation): >+ > 2018-06-21 Commit Queue <commit-queue@webkit.org> > > Unreviewed, rolling out r232884. >diff --git a/Source/WebKit/Shared/ios/InteractionInformationAtPosition.h b/Source/WebKit/Shared/ios/InteractionInformationAtPosition.h >index 9f6783e922857ee402c7ef2d33d14413935a9c48..7568041d48996fe599305a8848d3e1cc0cc7c53e 100644 >--- a/Source/WebKit/Shared/ios/InteractionInformationAtPosition.h >+++ b/Source/WebKit/Shared/ios/InteractionInformationAtPosition.h >@@ -62,6 +62,7 @@ struct InteractionInformationAtPosition { > String title; > String idAttribute; > WebCore::IntRect bounds; >+ WebCore::IntRect caretRect; // currenlty only valid on iPad apps on Mac > RefPtr<ShareableBitmap> image; > String textBefore; > String textAfter; >diff --git a/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm b/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm >index 641257ebbfb0f7df3392f6f35e424f99dabc31d4..d6cdb6b5ef2afc269c0d201432b2f6e27ad334d3 100644 >--- a/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm >+++ b/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm >@@ -61,6 +61,7 @@ void InteractionInformationAtPosition::encode(IPC::Encoder& encoder) const > encoder << title; > encoder << idAttribute; > encoder << bounds; >+ encoder << caretRect; > encoder << textBefore; > encoder << textAfter; > encoder << linkIndicator; >@@ -135,6 +136,9 @@ bool InteractionInformationAtPosition::decode(IPC::Decoder& decoder, Interaction > > if (!decoder.decode(result.bounds)) > return false; >+ >+ if (!decoder.decode(result.caretRect)) >+ return false; > > if (!decoder.decode(result.textBefore)) > return false; >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index 266926d0b0009658f2c6c21a5739aef530dae6a8..92df80b8ec48b97da0558ac4c0058f7e0cd02946 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -3319,6 +3319,12 @@ static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoi > /* Hit testing. */ > - (UITextPosition *)closestPositionToPoint:(CGPoint)point > { >+#if ENABLE(MINIMAL_SIMULATOR) >+ InteractionInformationRequest request(roundedIntPoint(point)); >+ [self requestAsynchronousPositionInformationUpdate:request]; >+ if (_positionInformation.isSelectable) >+ return [WKTextPosition textPositionWithRect:_positionInformation.caretRect]; >+#endif > return nil; > } > >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index 69d80aa852f59398d7c4c87fbe552aa4fe896a68..520bcc5f131e60866f673328f044ca6d98359558 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -2175,6 +2175,11 @@ void WebPage::getPositionInformation(const InteractionInformationRequest& reques > if (info.isSelectable && !hitNode->isTextNode()) > info.isSelectable = !isAssistableElement(*downcast<Element>(hitNode)) && !rectIsTooBigForSelection(info.bounds, *result.innerNodeFrame()); > } >+#if ENABLE(MINIMAL_SIMULATOR) >+ bool isInsideFixedPosition = false; >+ VisiblePosition visiblePos(renderer->positionForPoint(request.point, nullptr)); >+ info.caretRect = visiblePos.absoluteCaretBounds(&isInsideFixedPosition); >+#endif > } > } >
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 186900
:
343283
|
343286
|
343294
|
343434
|
343564
|
343570
|
343607
|
343643
|
343665
|
343770