WebKit Bugzilla
Attachment 371111 Details for
Bug 198451
: Remove some unused selection code
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198451-20190601021738.patch (text/plain), 13.59 KB, created by
Tim Horton
on 2019-06-01 02:17:39 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tim Horton
Created:
2019-06-01 02:17:39 PDT
Size:
13.59 KB
patch
obsolete
>Subversion Revision: 246013 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 0d9ca5ad48c2be6edd7a200a6aa61438f0eb433b..a9915b44da53906901e54c14da7844525a10932d 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,25 @@ >+2019-06-01 Tim Horton <timothy_horton@apple.com> >+ >+ Remove some unused selection code >+ https://bugs.webkit.org/show_bug.cgi?id=198451 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Platform/spi/ios/UIKitSPI.h: >+ * Shared/ios/GestureTypes.h: >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (toGestureType): >+ (toUIWKGestureType): >+ * UIProcess/ios/WKPDFView.mm: >+ (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]): >+ * WebProcess/WebPage/WebPage.h: >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::WebPage::selectWithGesture): >+ (WebKit::WebPage::selectTextWithGranularityAtPoint): >+ (WebKit::canShrinkToTextSelection): Deleted. >+ (WebKit::hasCustomLineHeight): Deleted. >+ (WebKit::WebPage::rangeForWebSelectionAtPosition): Deleted. >+ > 2019-05-31 Megan Gardner <megan_gardner@apple.com> > > Ensure keyboard editing is up to date >diff --git a/Source/WebKit/Platform/spi/ios/UIKitSPI.h b/Source/WebKit/Platform/spi/ios/UIKitSPI.h >index c4c8105c83784d431553f27b72586d8825be79d5..1ffaa8d5cf3072c6737174b38204cc5d5cf35276 100644 >--- a/Source/WebKit/Platform/spi/ios/UIKitSPI.h >+++ b/Source/WebKit/Platform/spi/ios/UIKitSPI.h >@@ -69,7 +69,6 @@ > #import <UIKit/UIViewController_ViewService.h> > #import <UIKit/UIView_Private.h> > #import <UIKit/UIVisualEffect_Private.h> >-#import <UIKit/UIWKSelectionAssistant.h> > #import <UIKit/UIWKTextInteractionAssistant.h> > #import <UIKit/UIWebBrowserView.h> > #import <UIKit/UIWebDocumentView.h> >@@ -530,33 +529,10 @@ typedef NS_ENUM (NSInteger, _UIBackdropMaskViewFlags) { > - (UIColor *)_inheritedInteractionTintColor; > @end > >-@interface UIWebSelectionView : UIView >-@end >- >-@interface UIWebSelectionAssistant : NSObject <UIGestureRecognizerDelegate> >-@end >- > @protocol UISelectionInteractionAssistant > - (void)showSelectionCommands; > @end > >-@interface UIWebSelectionAssistant () >-- (BOOL)isSelectionGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer; >-- (id)initWithView:(UIView *)view; >-- (void)clearSelection; >-- (void)didEndScrollingOrZoomingPage; >-- (void)didEndScrollingOverflow; >-- (void)resignedFirstResponder; >-- (void)selectionChanged; >-- (void)setGestureRecognizers; >-- (void)willStartScrollingOrZoomingPage; >-- (void)willStartScrollingOverflow; >-#if !PLATFORM(IOSMAC) >-@property (nonatomic, retain) UIWebSelectionView *selectionView; >-#endif >-@property (nonatomic, readonly) CGRect selectionFrame; >-@end >- > typedef NS_ENUM(NSInteger, UIWKSelectionTouch) { > UIWKSelectionTouchStarted = 0, > UIWKSelectionTouchMoved = 1, >@@ -586,24 +562,9 @@ typedef NS_ENUM(NSInteger, UIWKGestureType) { > UIWKGestureTwoFingerSingleTap = 10, > UIWKGestureTwoFingerRangedSelectGesture = 11, > UIWKGestureTapOnLinkWithGesture = 12, >- UIWKGestureMakeWebSelection = 13, > UIWKGesturePhraseBoundary = 14, > }; > >-@interface UIWKSelectionAssistant : UIWebSelectionAssistant >-@end >- >-@interface UIWKSelectionAssistant () >-- (BOOL)shouldHandleSingleTapAtPoint:(CGPoint)point; >-- (void)selectionChangedWithGestureAt:(CGPoint)point withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)gestureState withFlags:(UIWKSelectionFlags)flags; >-- (void)selectionChangedWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch withFlags:(UIWKSelectionFlags)flags; >-- (void)showDictionaryFor:(NSString *)selectedTerm fromRect:(CGRect)presentationRect; >-- (void)showShareSheetFor:(NSString *)selectedTerm fromRect:(CGRect)presentationRect; >-- (void)showTextServiceFor:(NSString *)selectedTerm fromRect:(CGRect)presentationRect; >-- (void)lookup:(NSString *)textWithContext withRange:(NSRange)range fromRect:(CGRect)presentationRect; >-@property (nonatomic, readonly) UILongPressGestureRecognizer *selectionLongPressRecognizer; >-@end >- > @interface UIWKAutocorrectionRects : NSObject > @end > >diff --git a/Source/WebKit/Shared/ios/GestureTypes.h b/Source/WebKit/Shared/ios/GestureTypes.h >index 68450d0d602406ddfaa2d1c80f9b647d9b22cbdc..686f0d8bc075734c642fd903f111c515eb41f6cc 100644 >--- a/Source/WebKit/Shared/ios/GestureTypes.h >+++ b/Source/WebKit/Shared/ios/GestureTypes.h >@@ -42,7 +42,6 @@ enum class GestureType { > TwoFingerSingleTap, > TwoFingerRangedSelectGesture, > TapOnLinkWithGesture, >- MakeWebSelection, > PhraseBoundary > }; > >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index 2fbba75fec7eb010dc962f443bd0c1fbb24595ef..582c05a7cee75cc51ca95886959c4e622a933a6a 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -3278,8 +3278,6 @@ static inline WebKit::GestureType toGestureType(UIWKGestureType gestureType) > return WebKit::GestureType::TwoFingerRangedSelectGesture; > case UIWKGestureTapOnLinkWithGesture: > return WebKit::GestureType::TapOnLinkWithGesture; >- case UIWKGestureMakeWebSelection: >- return WebKit::GestureType::MakeWebSelection; > case UIWKGesturePhraseBoundary: > return WebKit::GestureType::PhraseBoundary; > } >@@ -3316,8 +3314,6 @@ static inline UIWKGestureType toUIWKGestureType(WebKit::GestureType gestureType) > return UIWKGestureTwoFingerRangedSelectGesture; > case WebKit::GestureType::TapOnLinkWithGesture: > return UIWKGestureTapOnLinkWithGesture; >- case WebKit::GestureType::MakeWebSelection: >- return UIWKGestureMakeWebSelection; > case WebKit::GestureType::PhraseBoundary: > return UIWKGesturePhraseBoundary; > } >diff --git a/Source/WebKit/UIProcess/ios/WKPDFView.mm b/Source/WebKit/UIProcess/ios/WKPDFView.mm >index d2f4ff3b8c5f085b092e70bc3a6378c73677a019..47a908470f041c1c59dec7913c2b12712df7cbba 100644 >--- a/Source/WebKit/UIProcess/ios/WKPDFView.mm >+++ b/Source/WebKit/UIProcess/ios/WKPDFView.mm >@@ -522,8 +522,7 @@ static NSStringCompareOptions stringCompareOptions(_WKFindOptions findOptions) > > - (void)actionSheetAssistant:(WKActionSheetAssistant *)assistant shareElementWithURL:(NSURL *)url rect:(CGRect)boundingRect > { >- auto selectionAssistant = adoptNS([[UIWKSelectionAssistant alloc] initWithView:[_hostViewController view]]); >- [selectionAssistant showShareSheetFor:WTF::userVisibleString(url) fromRect:boundingRect]; >+ // FIXME: Figure out how to do this with WKShareSheet. > } > > #if HAVE(APP_LINKS) >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index f2b24c2833437d8970db8c2b42d843ab296eb75f..28b02a7f53e079f8738a8c79121fd5efd2c696e9 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -1238,7 +1238,6 @@ private: > void updateViewportSizeForCSSViewportUnits(); > > static void convertSelectionRectsToRootView(WebCore::FrameView*, Vector<WebCore::SelectionRect>&); >- RefPtr<WebCore::Range> rangeForWebSelectionAtPosition(const WebCore::IntPoint&, const WebCore::VisiblePosition&, SelectionFlags&); > void getFocusedElementInformation(FocusedElementInformation&); > void platformInitializeAccessibility(); > void generateSyntheticEditingCommand(SyntheticEditingCommandType); >@@ -1850,7 +1849,6 @@ private: > > RefPtr<WebCore::Range> m_initialSelection; > WebCore::VisibleSelection m_storedSelectionForAccessibility { WebCore::VisibleSelection() }; >- WebCore::IntSize m_blockSelectionDesiredSize; > WebCore::FloatSize m_maximumUnobscuredSize; > int32_t m_deviceOrientation { 0 }; > bool m_keyboardIsAttached { false }; >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index c9ce18f1f2519cf8d8008bf6b95ee8c2f2c225e8..fb1ddde2ab393467a3534024941d5f9b8d241be7 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -133,9 +133,6 @@ > namespace WebKit { > using namespace WebCore; > >-const int blockSelectionStartWidth = 100; >-const int blockSelectionStartHeight = 100; >- > void WebPage::platformInitialize() > { > platformInitializeAccessibility(); >@@ -1235,93 +1232,6 @@ static IntRect selectionBoxForRange(WebCore::Range* range) > return boundingRect; > } > >-static bool canShrinkToTextSelection(Node* node) >-{ >- if (node && !is<Element>(*node)) >- node = node->parentElement(); >- >- auto* renderer = (node) ? node->renderer() : nullptr; >- return renderer && renderer->childrenInline() && (is<RenderBlock>(*renderer) && !downcast<RenderBlock>(*renderer).inlineContinuation()) && !renderer->isTable(); >-} >- >-static bool hasCustomLineHeight(Node& node) >-{ >- auto* renderer = node.renderer(); >- return renderer && renderer->style().lineHeight().isSpecified(); >-} >- >-RefPtr<Range> WebPage::rangeForWebSelectionAtPosition(const IntPoint& point, const VisiblePosition& position, SelectionFlags& flags) >-{ >- HitTestResult result = m_page->mainFrame().eventHandler().hitTestResultAtPoint((point), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowUserAgentShadowContent | HitTestRequest::AllowChildFrameContent); >- >- Node* currentNode = result.innerNode(); >- if (!currentNode) >- return nullptr; >- RefPtr<Range> range; >- FloatRect boundingRectInScrollViewCoordinates; >- >- if (!currentNode->isTextNode() && !canShrinkToTextSelection(currentNode) && hasCustomLineHeight(*currentNode)) { >- auto* renderer = currentNode->renderer(); >- if (is<RenderBlockFlow>(renderer)) { >- auto* renderText = downcast<RenderBlockFlow>(*renderer).findClosestTextAtAbsolutePoint(point); >- if (renderText && renderText->textNode()) >- currentNode = renderText->textNode(); >- } >- } >- >- if (currentNode->isTextNode()) { >- range = enclosingTextUnitOfGranularity(position, ParagraphGranularity, DirectionForward); >- if (!range || range->collapsed()) >- range = Range::create(currentNode->document(), position, position); >- else { >- m_blockRectForTextSelection = selectionBoxForRange(range.get()); >- range = wordRangeFromPosition(position); >- } >- >- return range; >- } >- >- if (!currentNode->isElementNode()) >- currentNode = currentNode->parentElement(); >- >- Node* bestChoice = currentNode; >- while (currentNode) { >- if (currentNode->renderer()) { >- boundingRectInScrollViewCoordinates = currentNode->renderer()->absoluteBoundingBoxRect(true); >- boundingRectInScrollViewCoordinates.scale(m_page->pageScaleFactor()); >- if (boundingRectInScrollViewCoordinates.width() > m_blockSelectionDesiredSize.width() && boundingRectInScrollViewCoordinates.height() > m_blockSelectionDesiredSize.height()) >- break; >- bestChoice = currentNode; >- } >- currentNode = currentNode->parentElement(); >- } >- >- if (!bestChoice) >- return nullptr; >- >- RenderObject* renderer = bestChoice->renderer(); >- if (!renderer || renderer->style().userSelect() == UserSelect::None) >- return nullptr; >- >- if (renderer->childrenInline() && (is<RenderBlock>(*renderer) && !downcast<RenderBlock>(*renderer).inlineContinuation()) && !renderer->isTable()) { >- range = enclosingTextUnitOfGranularity(position, WordGranularity, DirectionBackward); >- if (range && !range->collapsed()) >- return range; >- } >- >- // If all we could find is a block whose height is very close to the height >- // of the visible area, don't use it. >- const float adjustmentFactor = .97; >- boundingRectInScrollViewCoordinates = renderer->absoluteBoundingBoxRect(true); >- >- if (boundingRectInScrollViewCoordinates.height() > m_page->mainFrame().view()->exposedContentRect().height() * adjustmentFactor) >- return nullptr; >- >- range = Range::create(bestChoice->document()); >- range->selectNodeContents(*bestChoice); >- return range->collapsed() ? nullptr : range; >-} >- > void WebPage::selectWithGesture(const IntPoint& point, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithFocusedElement, CallbackID callbackID) > { > auto& frame = m_page->focusController().focusedOrMainFrame(); >@@ -1465,14 +1375,6 @@ void WebPage::selectWithGesture(const IntPoint& point, uint32_t granularity, uin > range = enclosingTextUnitOfGranularity(position, ParagraphGranularity, DirectionForward); > break; > >- case GestureType::MakeWebSelection: >- if (wkGestureState == GestureRecognizerState::Began) { >- m_blockSelectionDesiredSize.setWidth(blockSelectionStartWidth); >- m_blockSelectionDesiredSize.setHeight(blockSelectionStartHeight); >- } >- range = rangeForWebSelectionAtPosition(point, position, flags); >- break; >- > default: > break; > } >@@ -2056,8 +1958,6 @@ void WebPage::selectTextWithGranularityAtPoint(const WebCore::IntPoint& point, u > auto& frame = m_page->focusController().focusedOrMainFrame(); > RefPtr<Range> range = rangeForGranularityAtPoint(frame, point, granularity, isInteractingWithFocusedElement); > if (!isInteractingWithFocusedElement) { >- m_blockSelectionDesiredSize.setWidth(blockSelectionStartWidth); >- m_blockSelectionDesiredSize.setHeight(blockSelectionStartHeight); > auto* renderer = range ? range->startContainer().renderer() : nullptr; > if (renderer && renderer->style().preserveNewline()) > m_blockRectForTextSelection = renderer->absoluteBoundingBoxRect(true);
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 198451
:
371111
|
371251