Title: [248700] trunk/Source/WebKit
Revision
248700
Author
wenson_hs...@apple.com
Date
2019-08-14 17:54:50 -0700 (Wed, 14 Aug 2019)

Log Message

Remove m_blockRectForTextSelection (along with related code)
https://bugs.webkit.org/show_bug.cgi?id=200695

Reviewed by Megan Gardner.

This member variable was consulted by block selection codepaths which no longer exist.
No change in behavior.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::selectTextWithGranularityAtPoint):
(WebKit::selectionBoxForRange): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (248699 => 248700)


--- trunk/Source/WebKit/ChangeLog	2019-08-15 00:30:51 UTC (rev 248699)
+++ trunk/Source/WebKit/ChangeLog	2019-08-15 00:54:50 UTC (rev 248700)
@@ -1,3 +1,18 @@
+2019-08-14  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        Remove m_blockRectForTextSelection (along with related code)
+        https://bugs.webkit.org/show_bug.cgi?id=200695
+
+        Reviewed by Megan Gardner.
+
+        This member variable was consulted by block selection codepaths which no longer exist.
+        No change in behavior.
+
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::selectTextWithGranularityAtPoint):
+        (WebKit::selectionBoxForRange): Deleted.
+
 2019-08-14  Ryan Haddad  <ryanhad...@apple.com>
 
         Unreviewed, rolling out r248526.

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (248699 => 248700)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2019-08-15 00:30:51 UTC (rev 248699)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2019-08-15 00:54:50 UTC (rev 248700)
@@ -1859,7 +1859,6 @@
     WebCore::FloatSize m_screenSize;
     WebCore::FloatSize m_availableScreenSize;
     WebCore::FloatSize m_overrideScreenSize;
-    WebCore::IntRect m_blockRectForTextSelection;
 
     RefPtr<WebCore::Range> m_initialSelection;
     WebCore::VisibleSelection m_storedSelectionForAccessibility { WebCore::VisibleSelection() };

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (248699 => 248700)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-08-15 00:30:51 UTC (rev 248699)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-08-15 00:54:50 UTC (rev 248700)
@@ -1275,26 +1275,6 @@
     return constrainedPoint;
 }
 
-static IntRect selectionBoxForRange(WebCore::Range* range)
-{
-    if (!range)
-        return IntRect();
-    
-    IntRect boundingRect;
-    Vector<SelectionRect> selectionRects;
-    range->collectSelectionRects(selectionRects);
-    unsigned size = selectionRects.size();
-    
-    for (unsigned i = 0; i < size; ++i) {
-        const IntRect &coreRect = selectionRects[i].rect();
-        if (!i)
-            boundingRect = coreRect;
-        else
-            boundingRect.unite(coreRect);
-    }
-    return boundingRect;
-}
-
 void WebPage::selectWithGesture(const IntPoint& point, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithFocusedElement, CallbackID callbackID)
 {
     if (static_cast<GestureRecognizerState>(gestureState) == GestureRecognizerState::Began)
@@ -2085,21 +2065,7 @@
     setFocusedFrameBeforeSelectingTextAtLocation(point);
 
     auto& frame = m_page->focusController().focusedOrMainFrame();
-    RefPtr<Range> range = rangeForGranularityAtPoint(frame, point, granularity, isInteractingWithFocusedElement);
-    if (!isInteractingWithFocusedElement) {
-        auto* renderer = range ? range->startContainer().renderer() : nullptr;
-        if (renderer && renderer->style().preserveNewline())
-            m_blockRectForTextSelection = renderer->absoluteBoundingBoxRect(true);
-        else {
-            auto paragraphRange = enclosingTextUnitOfGranularity(visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithFocusedElement), ParagraphGranularity, DirectionForward);
-            if (paragraphRange && !paragraphRange->collapsed())
-                m_blockRectForTextSelection = selectionBoxForRange(paragraphRange.get());
-        }
-        
-        if (rectIsTooBigForSelection(m_blockRectForTextSelection, frame))
-            m_blockRectForTextSelection.setHeight(0);
-    }
-
+    auto range = rangeForGranularityAtPoint(frame, point, granularity, isInteractingWithFocusedElement);
     if (range)
         frame.selection().setSelectedRange(range.get(), UPSTREAM, WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
     m_initialSelection = range;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to