Title: [145553] trunk/Source/WebKit/blackberry
Revision
145553
Author
[email protected]
Date
2013-03-12 08:57:01 -0700 (Tue, 12 Mar 2013)

Log Message

[BlackBerry] Notify client if the selection is in a subframe when started.
https://bugs.webkit.org/show_bug.cgi?id=112065

Patch by Genevieve Mak <[email protected]> on 2013-03-12
Reviewed by Rob Buis.

PR #278490
Internally Reviewed by Mike Fenton.

* Api/InRegionScroller.cpp:
(BlackBerry::WebKit::InRegionScrollerPrivate::updateSelectionScrollView):
(WebKit):
* Api/InRegionScroller_p.h:
(InRegionScrollerPrivate):
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::updateSelectionScrollView):
(WebKit):
* Api/WebPageClient.h:
* Api/WebPage_p.h:
(WebPagePrivate):
* WebKitSupport/SelectionHandler.cpp:
(BlackBerry::WebKit::SelectionHandler::cancelSelection):
(BlackBerry::WebKit::SelectionHandler::setSelection):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/InRegionScroller.cpp (145552 => 145553)


--- trunk/Source/WebKit/blackberry/Api/InRegionScroller.cpp	2013-03-12 15:54:34 UTC (rev 145552)
+++ trunk/Source/WebKit/blackberry/Api/InRegionScroller.cpp	2013-03-12 15:57:01 UTC (rev 145553)
@@ -295,6 +295,13 @@
     }
 }
 
+void InRegionScrollerPrivate::updateSelectionScrollView(const Node* node)
+{
+    // TODO: don't notify the client if the node didn't change.
+    // Deleting the scrollview is handled by the client.
+    m_webPage->m_client->notifySelectionScrollView(firstScrollableInRegionForNode(node));
+}
+
 Platform::ScrollViewBase* InRegionScrollerPrivate::firstScrollableInRegionForNode(const Node* node)
 {
     if (!node || !node->renderer())

Modified: trunk/Source/WebKit/blackberry/Api/InRegionScroller_p.h (145552 => 145553)


--- trunk/Source/WebKit/blackberry/Api/InRegionScroller_p.h	2013-03-12 15:54:34 UTC (rev 145552)
+++ trunk/Source/WebKit/blackberry/Api/InRegionScroller_p.h	2013-03-12 15:57:01 UTC (rev 145553)
@@ -53,7 +53,7 @@
 
     void calculateInRegionScrollableAreasForPoint(const WebCore::IntPoint&);
     const std::vector<Platform::ScrollViewBase*>& activeInRegionScrollableAreas() const;
-    Platform::ScrollViewBase* firstScrollableInRegionForNode(const WebCore::Node*);
+    void updateSelectionScrollView(const WebCore::Node*);
 
     void clearDocumentData(const WebCore::Document*);
 
@@ -63,6 +63,7 @@
     bool m_needsActiveScrollableAreaCalculation;
 
 private:
+    Platform::ScrollViewBase* firstScrollableInRegionForNode(const WebCore::Node*);
     bool setLayerScrollPosition(WebCore::RenderLayer*, const WebCore::IntPoint& scrollPosition);
 
     void calculateActiveAndShrinkCachedScrollableAreas(WebCore::RenderLayer*);

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (145552 => 145553)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2013-03-12 15:54:34 UTC (rev 145552)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2013-03-12 15:57:01 UTC (rev 145553)
@@ -3311,6 +3311,11 @@
     m_page->focusController()->setFocusedFrame(frame);
 }
 
+void WebPagePrivate::updateSelectionScrollView(const Node* node)
+{
+    m_inRegionScroller->d->updateSelectionScrollView(node);
+}
+
 void WebPagePrivate::updateDelegatedOverlays(bool dispatched)
 {
     // Track a dispatched message, we don't want to flood the webkit thread.

Modified: trunk/Source/WebKit/blackberry/Api/WebPageClient.h (145552 => 145553)


--- trunk/Source/WebKit/blackberry/Api/WebPageClient.h	2013-03-12 15:54:34 UTC (rev 145552)
+++ trunk/Source/WebKit/blackberry/Api/WebPageClient.h	2013-03-12 15:57:01 UTC (rev 145553)
@@ -159,6 +159,7 @@
     virtual void cancelSelectionVisuals() = 0;
     virtual void notifySelectionHandlesReversed() = 0;
     virtual void notifyCaretChanged(const Platform::IntRect& documentCaretRect, bool userTouchTriggered, bool isSingleLineInput = false, const Platform::IntRect& singleLineDocumentBoundingBox = Platform::IntRect(), bool textFieldIsEmpty = false) = 0;
+    virtual void notifySelectionScrollView(Platform::ScrollViewBase*) = 0;
 
     virtual void cursorChanged(Platform::CursorType, const char* url, const Platform::IntPoint& hotSpotInImage) = 0;
 

Modified: trunk/Source/WebKit/blackberry/Api/WebPage_p.h (145552 => 145553)


--- trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2013-03-12 15:54:34 UTC (rev 145552)
+++ trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2013-03-12 15:57:01 UTC (rev 145553)
@@ -322,6 +322,7 @@
 
     void selectionChanged(WebCore::Frame*);
     void setOverlayExpansionPixelHeight(int);
+    void updateSelectionScrollView(const WebCore::Node*);
 
     void updateDelegatedOverlays(bool dispatched = false);
 

Modified: trunk/Source/WebKit/blackberry/ChangeLog (145552 => 145553)


--- trunk/Source/WebKit/blackberry/ChangeLog	2013-03-12 15:54:34 UTC (rev 145552)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2013-03-12 15:57:01 UTC (rev 145553)
@@ -1,3 +1,28 @@
+2013-03-12  Genevieve Mak  <[email protected]>
+
+        [BlackBerry] Notify client if the selection is in a subframe when started.
+        https://bugs.webkit.org/show_bug.cgi?id=112065
+
+        Reviewed by Rob Buis.
+
+        PR #278490
+        Internally Reviewed by Mike Fenton.
+
+        * Api/InRegionScroller.cpp:
+        (BlackBerry::WebKit::InRegionScrollerPrivate::updateSelectionScrollView):
+        (WebKit):
+        * Api/InRegionScroller_p.h:
+        (InRegionScrollerPrivate):
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::updateSelectionScrollView):
+        (WebKit):
+        * Api/WebPageClient.h:
+        * Api/WebPage_p.h:
+        (WebPagePrivate):
+        * WebKitSupport/SelectionHandler.cpp:
+        (BlackBerry::WebKit::SelectionHandler::cancelSelection):
+        (BlackBerry::WebKit::SelectionHandler::setSelection):
+
 2013-03-12  Alberto Garcia  <[email protected]>
 
         [BlackBerry] SelectionHandler: fix truncated line

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp (145552 => 145553)


--- trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp	2013-03-12 15:54:34 UTC (rev 145552)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp	2013-03-12 15:57:01 UTC (rev 145553)
@@ -91,6 +91,8 @@
     // rendering happened prior to processing on webkit thread
     m_webPage->m_client->notifySelectionDetailsChanged(SelectionDetails());
 
+    m_webPage->updateSelectionScrollView(0);
+
     SelectionLog(Platform::LogLevelInfo, "SelectionHandler::cancelSelection");
 
     if (m_webPage->m_inputHandler->isInputMode())
@@ -536,6 +538,9 @@
         }
     }
 
+    if (!controller->selection().isRange())
+        m_webPage->updateSelectionScrollView(newSelection.visibleEnd().deepEquivalent().anchorNode());
+
     newSelection.setIsDirectional(true);
 
     if (m_webPage->m_inputHandler->isInputMode()) {
@@ -848,6 +853,9 @@
     if (granularity == ParagraphGranularity)
         findNextAnimationOverlayRegion();
 
+    if (granularity == WordGranularity)
+        m_webPage->updateSelectionScrollView(selection.visibleEnd().deepEquivalent().anchorNode());
+
     return true;
 }
 
@@ -915,6 +923,7 @@
     VisibleSelection selection = VisibleSelection::selectionFromContentsOfNode(node);
     drawAnimationOverlay(regionForSelectionQuads(selection), false /* isExpandingOverlayAtConstantRate */, true /* isStartOfSelection */);
     focusedFrame->selection()->setSelection(selection);
+    m_webPage->updateSelectionScrollView(node);
 }
 
 static TextDirection directionOfEnclosingBlock(FrameSelection* selection)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to