Title: [233022] trunk/Source/WebCore
- Revision
- 233022
- Author
- wenson_hs...@apple.com
- Date
- 2018-06-20 14:26:43 -0700 (Wed, 20 Jun 2018)
Log Message
Unreviewed, fix the watchOS build after r233016.
* page/EventHandler.cpp:
(WebCore::EventHandler::selectionExtentRespectingEditingBoundary):
Move this helper out of the ENABLE(DRAG_SUPPORT) guard.
* page/EventHandler.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (233021 => 233022)
--- trunk/Source/WebCore/ChangeLog 2018-06-20 20:24:56 UTC (rev 233021)
+++ trunk/Source/WebCore/ChangeLog 2018-06-20 21:26:43 UTC (rev 233022)
@@ -1,3 +1,14 @@
+2018-06-20 Wenson Hsieh <wenson_hs...@apple.com>
+
+ Unreviewed, fix the watchOS build after r233016.
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::selectionExtentRespectingEditingBoundary):
+
+ Move this helper out of the ENABLE(DRAG_SUPPORT) guard.
+
+ * page/EventHandler.h:
+
2018-06-20 Simon Fraser <simon.fra...@apple.com>
AnimationList wastes 60KB of vector capacity
Modified: trunk/Source/WebCore/page/EventHandler.cpp (233021 => 233022)
--- trunk/Source/WebCore/page/EventHandler.cpp 2018-06-20 20:24:56 UTC (rev 233021)
+++ trunk/Source/WebCore/page/EventHandler.cpp 2018-06-20 21:26:43 UTC (rev 233022)
@@ -811,6 +811,26 @@
return swallowEvent;
}
+VisiblePosition EventHandler::selectionExtentRespectingEditingBoundary(const VisibleSelection& selection, const LayoutPoint& localPoint, Node* targetNode)
+{
+ FloatPoint selectionEndPoint = localPoint;
+ Element* editableElement = selection.rootEditableElement();
+
+ if (!targetNode || !targetNode->renderer())
+ return VisiblePosition();
+
+ if (editableElement && !editableElement->contains(targetNode)) {
+ if (!editableElement->renderer())
+ return VisiblePosition();
+
+ FloatPoint absolutePoint = targetNode->renderer()->localToAbsolute(FloatPoint(selectionEndPoint));
+ selectionEndPoint = editableElement->renderer()->absoluteToLocal(absolutePoint);
+ targetNode = editableElement;
+ }
+
+ return targetNode->renderer()->positionForPoint(LayoutPoint(selectionEndPoint), nullptr);
+}
+
#if ENABLE(DRAG_SUPPORT)
bool EventHandler::handleMouseDraggedEvent(const MouseEventWithHitTestResults& event, CheckDragHysteresis checkDragHysteresis)
{
@@ -904,26 +924,6 @@
updateSelectionForMouseDrag(result);
}
-VisiblePosition EventHandler::selectionExtentRespectingEditingBoundary(const VisibleSelection& selection, const LayoutPoint& localPoint, Node* targetNode)
-{
- FloatPoint selectionEndPoint = localPoint;
- Element* editableElement = selection.rootEditableElement();
-
- if (!targetNode || !targetNode->renderer())
- return VisiblePosition();
-
- if (editableElement && !editableElement->contains(targetNode)) {
- if (!editableElement->renderer())
- return VisiblePosition();
-
- FloatPoint absolutePoint = targetNode->renderer()->localToAbsolute(FloatPoint(selectionEndPoint));
- selectionEndPoint = editableElement->renderer()->absoluteToLocal(absolutePoint);
- targetNode = editableElement;
- }
-
- return targetNode->renderer()->positionForPoint(LayoutPoint(selectionEndPoint), nullptr);
-}
-
void EventHandler::updateSelectionForMouseDrag(const HitTestResult& hitTestResult)
{
if (!m_mouseDownMayStartSelect)
Modified: trunk/Source/WebCore/page/EventHandler.h (233021 => 233022)
--- trunk/Source/WebCore/page/EventHandler.h 2018-06-20 20:24:56 UTC (rev 233021)
+++ trunk/Source/WebCore/page/EventHandler.h 2018-06-20 21:26:43 UTC (rev 233022)
@@ -129,8 +129,9 @@
void clear();
void nodeWillBeRemoved(Node&);
+ WEBCORE_EXPORT VisiblePosition selectionExtentRespectingEditingBoundary(const VisibleSelection&, const LayoutPoint&, Node*);
+
#if ENABLE(DRAG_SUPPORT)
- WEBCORE_EXPORT VisiblePosition selectionExtentRespectingEditingBoundary(const VisibleSelection&, const LayoutPoint&, Node*);
void updateSelectionForMouseDrag();
#endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes