WebKit Bugzilla
Attachment 372584 Details for
Bug 199080
: WebKit context menu highlights include extra padding
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199080-20190620143136.patch (text/plain), 8.15 KB, created by
Tim Horton
on 2019-06-20 14:31:36 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tim Horton
Created:
2019-06-20 14:31:36 PDT
Size:
8.15 KB
patch
obsolete
>Subversion Revision: 246640 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 4d853a146b7da1afffe23c4f49fd8235215af7b1..45c10c4d790e9a0de70dcc0d56f49f785db02d39 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,33 @@ >+2019-06-20 Tim Horton <timothy_horton@apple.com> >+ >+ WebKit context menu highlights include extra padding >+ https://bugs.webkit.org/show_bug.cgi?id=199080 >+ <rdar://problem/51140126> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Shared/ios/InteractionInformationRequest.cpp: >+ (WebKit::InteractionInformationRequest::encode const): >+ (WebKit::InteractionInformationRequest::decode): >+ (WebKit::InteractionInformationRequest::isValidForRequest): >+ (WebKit::InteractionInformationRequest::isApproximatelyValidForRequest): >+ * Shared/ios/InteractionInformationRequest.h: >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView gestureRecognizerShouldBegin:]): >+ (-[WKContentView positionInformationForActionSheetAssistant:]): >+ (-[WKContentView updatePositionInformationForActionSheetAssistant:]): >+ (-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]): >+ (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]): >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::linkIndicatorPositionInformation): >+ Disable the margin going forward, but leave it if we're using the legacy >+ API, because there is no way to add margin at the platform level with >+ the legacy API. >+ >+ In the future we should always have no margin in our indicator, and just >+ apply it in whatever consumes the indicator, so that there is no >+ disagreement between clients about the size of the margin. >+ > 2019-06-20 Alexander Mikhaylenko <exalm7659@gmail.com> > > [GTK] Enable navigation swipe layout tests >diff --git a/Source/WebKit/Shared/ios/InteractionInformationRequest.cpp b/Source/WebKit/Shared/ios/InteractionInformationRequest.cpp >index 7f1063afa16b7cda43cc82b4066a31622cf240be..442fbfc217bdeb39a9879470008ce4fb293a0e10 100644 >--- a/Source/WebKit/Shared/ios/InteractionInformationRequest.cpp >+++ b/Source/WebKit/Shared/ios/InteractionInformationRequest.cpp >@@ -38,6 +38,7 @@ void InteractionInformationRequest::encode(IPC::Encoder& encoder) const > encoder << point; > encoder << includeSnapshot; > encoder << includeLinkIndicator; >+ encoder << linkIndicatorShouldHaveLegacyMargins; > encoder << readonly; > } > >@@ -51,6 +52,9 @@ bool InteractionInformationRequest::decode(IPC::Decoder& decoder, InteractionInf > > if (!decoder.decode(result.includeLinkIndicator)) > return false; >+ >+ if (!decoder.decode(result.linkIndicatorShouldHaveLegacyMargins)) >+ return false; > > if (!decoder.decode(result.readonly)) > return false; >@@ -68,6 +72,9 @@ bool InteractionInformationRequest::isValidForRequest(const InteractionInformati > > if (other.includeLinkIndicator && !includeLinkIndicator) > return false; >+ >+ if (other.linkIndicatorShouldHaveLegacyMargins != linkIndicatorShouldHaveLegacyMargins) >+ return false; > > if (!other.readonly && readonly) > return false; >@@ -86,6 +93,9 @@ bool InteractionInformationRequest::isApproximatelyValidForRequest(const Interac > if (!other.readonly && readonly) > return false; > >+ if (other.linkIndicatorShouldHaveLegacyMargins != linkIndicatorShouldHaveLegacyMargins) >+ return false; >+ > return (other.point - point).diagonalLengthSquared() <= 4; > } > >diff --git a/Source/WebKit/Shared/ios/InteractionInformationRequest.h b/Source/WebKit/Shared/ios/InteractionInformationRequest.h >index 15bbe0943848e31df4299b3e9ea1cc607af213ba..b318b40e31ae712aedb7140f91a20df3834df4bb 100644 >--- a/Source/WebKit/Shared/ios/InteractionInformationRequest.h >+++ b/Source/WebKit/Shared/ios/InteractionInformationRequest.h >@@ -42,6 +42,8 @@ struct InteractionInformationRequest { > bool includeSnapshot { false }; > bool includeLinkIndicator { false }; > >+ bool linkIndicatorShouldHaveLegacyMargins { false }; >+ > // FIXME: This readonly flag ought to be true by default, but there are a number of interactions (e.g. selection) that currently > // rely on the fact that interaction information requests additionally change the focused frame. We should explicitly turn the > // readonly bit off in these scenarios, and make sure that all other position information requests don't move focus around. >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index 3111a48d127a8669b6cee3b2d608771bcbba7c8e..3bdc5c2227d7d584b9af287ec30537aecf2fe253 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -2066,6 +2066,7 @@ - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer > if (self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable) { > request.includeSnapshot = true; > request.includeLinkIndicator = true; >+ request.linkIndicatorShouldHaveLegacyMargins = !self._shouldUseContextMenus; > } > > [self requestAsynchronousPositionInformationUpdate:request]; >@@ -6062,6 +6063,7 @@ - (Optional<WebKit::InteractionInformationAtPosition>)positionInformationForActi > WebKit::InteractionInformationRequest request(_positionInformation.request.point); > request.includeSnapshot = true; > request.includeLinkIndicator = assistant.needsLinkIndicator; >+ request.linkIndicatorShouldHaveLegacyMargins = !self._shouldUseContextMenus; > if (![self ensurePositionInformationIsUpToDate:request]) > return WTF::nullopt; > >@@ -6074,6 +6076,7 @@ - (void)updatePositionInformationForActionSheetAssistant:(WKActionSheetAssistant > WebKit::InteractionInformationRequest request(_positionInformation.request.point); > request.includeSnapshot = true; > request.includeLinkIndicator = assistant.needsLinkIndicator; >+ request.linkIndicatorShouldHaveLegacyMargins = !self._shouldUseContextMenus; > > [self requestAsynchronousPositionInformationUpdate:request]; > } >@@ -7694,6 +7697,7 @@ - (void)_contextMenuInteraction:(UIContextMenuInteraction *)interaction configur > WebKit::InteractionInformationRequest request { WebCore::roundedIntPoint(position) }; > request.includeSnapshot = true; > request.includeLinkIndicator = true; >+ request.linkIndicatorShouldHaveLegacyMargins = !self._shouldUseContextMenus; > > [self doAfterPositionInformationUpdate:[weakSelf = WeakObjCPtr<WKContentView>(self), completion = makeBlockPtr(completion)] (WebKit::InteractionInformationAtPosition) { > auto strongSelf = weakSelf.get(); >@@ -8049,6 +8053,7 @@ - (BOOL)_interactionShouldBeginFromPreviewItemController:(UIPreviewItemControlle > WebKit::InteractionInformationRequest request(WebCore::roundedIntPoint(position)); > request.includeSnapshot = true; > request.includeLinkIndicator = true; >+ request.linkIndicatorShouldHaveLegacyMargins = !self._shouldUseContextMenus; > if (![self ensurePositionInformationIsUpToDate:request]) > return NO; > if (!_positionInformation.isLink && !_positionInformation.isImage && !_positionInformation.isAttachment) >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index 5aaca4b702b9eb3154470876cd8e0de7046c43cf..ad17b6e73ac7f2ab603193fbefd6f9aa1275ccaf 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -2492,7 +2492,7 @@ static void linkIndicatorPositionInformation(WebPage& page, Element& element, El > > auto linkRange = rangeOfContents(linkElement); > float deviceScaleFactor = page.corePage()->deviceScaleFactor(); >- const float marginInPoints = 4; >+ const float marginInPoints = request.linkIndicatorShouldHaveLegacyMargins ? 4 : 0; > > auto textIndicator = TextIndicator::createWithRange(linkRange.get(), > TextIndicatorOptionTightlyFitContent | TextIndicatorOptionRespectTextColor | TextIndicatorOptionPaintBackgrounds |
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 199080
:
372584
|
372645