Home | History | Annotate | Download | only in page

Lines Matching refs:selection

269 static void setSelectionIfNeeded(SelectionController* selection, const VisibleSelection& newSelection)
271 ASSERT(selection);
272 if (selection->selection() != newSelection && selection->shouldChangeSelection(newSelection))
273 selection->setSelection(newSelection);
276 static void setNonDirectionalSelectionIfNeeded(SelectionController* selection, const VisibleSelection& newSelection, TextGranularity granularity)
278 ASSERT(selection);
279 if (selection->selection() != newSelection && selection->shouldChangeSelection(newSelection))
280 selection->setSelection(newSelection, granularity, MakeNonDirectionalSelection);
303 setNonDirectionalSelectionIfNeeded(m_frame->selection(), newSelection, granularity);
327 setNonDirectionalSelectionIfNeeded(m_frame->selection(), newSelection, granularity);
336 if (m_frame->selection()->isRange())
338 // should not change the selection. So, do not call
341 // from setting caret selection.
371 setNonDirectionalSelectionIfNeeded(m_frame->selection(), newSelection, granularity);
388 // Extend the selection if the Shift key is down, unless the click is in a link.
391 // Don't restart the selection when the mouse is pressed on an
392 // existing selection so we can allow for text dragging.
395 if (!extendSelection && m_frame->selection()->contains(vPoint)) {
406 VisibleSelection newSelection = m_frame->selection()->selection();
410 m_frame->selection()->setIsDirectional(false);
414 // See <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection
428 if (m_frame->selection()->granularity() != CharacterGranularity) {
429 granularity = m_frame->selection()->granularity();
430 newSelection.expandUsingGranularity(m_frame->selection()->granularity());
437 setNonDirectionalSelectionIfNeeded(m_frame->selection(), newSelection, granularity);
459 // so it's allowed to start a drag or selection.
635 static VisiblePosition selectionExtentRespectingEditingBoundary(const VisibleSelection& selection, const IntPoint& localPoint, Node* targetNode)
638 Element* editableElement = selection.rootEditableElement();
667 VisiblePosition targetPosition = selectionExtentRespectingEditingBoundary(m_frame->selection()->selection(), hitTestResult.localPoint(), target);
669 // Don't modify the selection if we're not on a node.
673 // Restart the selection if this is the first mouse move. This work is usually
674 // done in handleMousePressEvent, but not if the mouse press was on an existing selection.
675 VisibleSelection newSelection = m_frame->selection()->selection();
678 // Special case to limit selection to the containing block for SVG text.
693 if (m_frame->selection()->granularity() != CharacterGranularity)
694 newSelection.expandUsingGranularity(m_frame->selection()->granularity());
696 setNonDirectionalSelectionIfNeeded(m_frame->selection(), newSelection, m_frame->selection()->granularity());
702 m_frame->selection()->setCaretBlinkingSuspended(false);
710 // If this was the first click in the window, we don't even want to clear the selection.
728 m_frame->selection()->setCaretBlinkingSuspended(false);
740 // Clear the selection if the mouse didn't move after the last mouse
742 // on the selection, the selection goes away. However, if we are
748 && m_frame->selection()->isRange()
758 setSelectionIfNeeded(m_frame->selection(), newSelection);
763 m_frame->selection()->notifyRendererOfSelectionChange(true);
765 m_frame->selection()->selectFrameElementInParentIfFullySelected();
1157 return frame->selection()->rootEditableElement() != node->rootEditableElement();
1169 // During selection, use an I-beam no matter what we're over.
1170 // If you're capturing mouse events for a particular node, don't treat this as a selection.
1171 if (m_mousePressed && m_mouseDownMayStartSelect && m_frame->selection()->isCaretOrRange() && !m_capturingMouseEventsNode)
1439 m_frame->selection()->setCaretBlinkingSuspended(true);
2059 // will set a selection inside it, which will call setFocuseNodeIfNeeded.
2062 if (m_frame->selection()->isRange()
2063 && m_frame->selection()->toNormalizedRange()->compareNode(n, ec) == Range::NODE_INSIDE
2223 && !m_frame->selection()->contains(viewportPos)
2224 // FIXME: In the editable case, word selection sometimes selects content that isn't underneath the mouse.
2225 // If the selection is non-editable, we do word selection to make it easier to use the contextual menu items
2227 && (m_frame->selection()->isContentEditable() || (targetNode(mev) && targetNode(mev)->isTextNode()))) {
2228 m_mouseDownMayStartSelect = true; // context menu events are always allowed to perform a selection
2257 SelectionController* selectionController = m_frame->selection();
2258 Position start = selectionController->selection().start();
2261 RefPtr<Range> selection = selectionController->toNormalizedRange();
2262 IntRect firstRect = m_frame->editor()->firstRectForRange(selection.get());
2362 // Whether or not a mouse down can begin the creation of a selection. Fires the selectStart event.
2577 m_frame->selection()->modify((isShifted) ? SelectionController::AlterationExtend : SelectionController::AlterationMove, DirectionBackward, (isCommanded) ? DocumentBoundary : LineGranularity, true);
2580 m_frame->selection()->modify((isShifted) ? SelectionController::AlterationExtend : SelectionController::AlterationMove, DirectionForward, (isCommanded) ? DocumentBoundary : LineGranularity, true);
2583 m_frame->selection()->modify((isShifted) ? SelectionController::AlterationExtend : SelectionController::AlterationMove, DirectionLeft, (isCommanded) ? LineBoundary : (isOptioned) ? WordGranularity : CharacterGranularity, true);
2586 m_frame->selection()->modify((isShifted) ? SelectionController::AlterationExtend : SelectionController::AlterationMove, DirectionRight, (isCommanded) ? LineBoundary : (isOptioned) ? WordGranularity : CharacterGranularity, true);
2607 // provides KB navigation and selection for enhanced accessibility users
2745 dragState().m_dragSrcInSelection = m_frame->selection()->contains(m_mouseDownPos);
2749 // For drags starting in the selection, the user must wait between the mousedown and mousedrag,
2750 // or else we bail on the dragging stuff and allow selection to occur
2754 // ...but if this was the first click in the window, we don't even want to start selection
2798 && !m_frame->selection()->isInPasswordField();
2834 // No more default handling (like selection), whether we're past the hysteresis bounds or not