Home | History | Annotate | Download | only in editing

Lines Matching refs:selection

79 // When an event handler has moved the selection outside of a text control
80 // we should use the target control's selection for this editing operation.
83 VisibleSelection selection = m_frame->selection()->selection();
85 return selection;
86 // If the target is a text control, and the current selection is outside of its shadow tree,
87 // then use the saved selection for that text control.
89 Node* selectionStart = selection.start().node();
92 return static_cast<HTMLInputElement*>(target)->selection();
94 return static_cast<HTMLTextAreaElement*>(target)->selection();
96 return selection;
120 return m_frame->selection()->isContentEditable();
125 return m_frame->selection()->isContentRichlyEditable();
135 return !m_frame->selection()->isInPasswordField() && !dispatchCPPEvent(eventNames().beforecutEvent, ClipboardNumb);
140 return !m_frame->selection()->isInPasswordField() && !dispatchCPPEvent(eventNames().beforecopyEvent, ClipboardNumb);
176 SelectionController* selection = m_frame->selection();
177 return selection->isRange() && !selection->isInPasswordField();
187 SelectionController* selection = m_frame->selection();
188 return selection->isRange() && selection->isContentEditable();
232 if (m_frame->selection()->isRange()) {
258 // when the selection was updated by deleting the range
267 if (m_frame->selection()->isNone())
308 if (m_frame->selection()->isNone() || !fragment)
324 return m_frame->selection()->toNormalizedRange();
341 if (m_frame->selection()->isInPasswordField())
354 if (m_frame->selection()->isInPasswordField())
409 if (!m_frame->selection()->isRange()) {
428 RefPtr<Range> range = m_frame->selection()->toNormalizedRange();
459 if (m_frame->selection()->isNone())
462 Position pos = m_frame->selection()->selection().start().downstream();
469 if (m_frame->selection()->isRange()) {
470 end = m_frame->selection()->selection().end().upstream();
489 if (m_frame->selection()->isCaret()) {
508 node = m_frame->selection()->selection().visibleStart().deepEquivalent().node();
511 // The selection is either a caret with no typing attributes or a range in which no embedding is added, so just use the start position
547 if (m_frame->selection()->isRange() && !end.node()->isDescendantOf(node))
558 if (m_frame->selection()->isNone())
562 if (m_frame->selection()->isRange()) {
563 startNode = m_frame->selection()->selection().start().downstream().node();
564 Node* endNode = m_frame->selection()->selection().end().upstream().node();
568 startNode = m_frame->selection()->selection().visibleStart().deepEquivalent().node();
586 if (m_frame->selection()->isCaret()) {
587 if (enclosingNodeWithTag(m_frame->selection()->selection().start(), ulTag))
589 } else if (m_frame->selection()->isRange()) {
590 Node* startNode = enclosingNodeWithTag(m_frame->selection()->selection().start(), ulTag);
591 Node* endNode = enclosingNodeWithTag(m_frame->selection()->selection().end(), ulTag);
601 if (m_frame->selection()->isCaret()) {
602 if (enclosingNodeWithTag(m_frame->selection()->selection().start(), olTag))
604 } else if (m_frame->selection()->isRange()) {
605 Node* startNode = enclosingNodeWithTag(m_frame->selection()->selection().start(), olTag);
606 Node* endNode = enclosingNodeWithTag(m_frame->selection()->selection().end(), olTag);
646 if (!canEditRichly() || m_frame->selection()->isNone())
656 if (!canEditRichly() || m_frame->selection()->isNone())
666 if (!canEditRichly() || m_frame->selection()->isNone())
676 if (!canEditRichly() || m_frame->selection()->isNone())
697 Node* target = m_frame->selection()->start().element();
719 switch (m_frame->selection()->selectionType()) {
740 switch (m_frame->selection()->selectionType()) {
757 if (client() && client()->shouldApplyStyle(style, m_frame->selection()->toNormalizedRange().get()))
766 if (client() && client()->shouldApplyStyle(style, m_frame->selection()->toNormalizedRange().get()))
817 if (!m_frame->selection()->isRange()) {
829 for (Node* node = m_frame->selection()->start().node(); node; node = node->traverseNextNode()) {
833 if (node == m_frame->selection()->start().node())
840 if (node == m_frame->selection()->end().node())
873 // Don't clear the typing style with this selection change. We do those things elsewhere if necessary.
949 VisibleSelection selection = selectionForCommand(triggeringEvent);
950 if (!selection.isContentEditable())
952 RefPtr<Range> range = selection.toNormalizedRange();
957 // Get the selection to use for the event that triggered this insertText.
958 // If the event handler changed the selection, we may want to use a different selection
960 selection = selectionForCommand(triggeringEvent);
961 if (selection.isContentEditable()) {
962 if (Node* selectionStart = selection.start().node()) {
966 TypingCommand::insertText(document.get(), text, selection, selectInsertedText);
968 // Reveal the current selection
983 if (!shouldInsertText("\n", m_frame->selection()->toNormalizedRange().get(), EditorInsertActionTyped))
999 if (!shouldInsertText("\n", m_frame->selection()->toNormalizedRange().get(), EditorInsertActionTyped))
1015 RefPtr<Range> selection = selectedRange();
1016 if (shouldDeleteRange(selection.get())) {
1017 if (isNodeInTextFormControl(m_frame->selection()->start().node()))
1020 Pasteboard::generalPasteboard()->writeSelection(selection.get(), canSmartCopyOrDelete(), m_frame);
1035 if (isNodeInTextFormControl(m_frame->selection()->start().node()))
1059 if (m_frame->selection()->isContentRichlyEditable())
1088 // when the selection was updated by deleting the range
1329 VisibleSelection selection;
1330 selection.setWithoutValidation(range->startPosition(), range->endPosition());
1331 m_frame->selection()->setSelection(selection, false, false);
1357 VisibleSelection oldSelection = m_frame->selection()->selection();
1361 if (m_frame->selection()->isNone()) {
1387 m_frame->selection()->setSelection(oldSelection, false, false);
1388 // An open typing command that disagrees about current selection would cause issues with typing later on.
1401 if (m_frame->selection()->isNone()) {
1448 Node* baseNode = m_frame->selection()->base().node();
1449 unsigned baseOffset = m_frame->selection()->base().deprecatedEditingOffset();
1450 Node* extentNode = m_frame->selection()->extent().node();
1451 unsigned extentOffset = m_frame->selection()->extent().deprecatedEditingOffset();
1469 m_frame->selection()->setSelectedRange(selectedRange.get(), DOWNSTREAM, false);
1481 RefPtr<Range> selectedRange = frame()->selection()->toNormalizedRange();
1826 // The basic approach is to search in two phases - from the selection end to the end of the doc, and
1829 // Start at the end of the selection, search to edge of document. Starting at the selection end makes
1831 VisibleSelection selection(frame()->selection()->selection());
1834 if (selection.start().node()) {
1837 VisiblePosition start(selection.visibleStart());
1838 // We match AppKit's rule: Start 1 character before the selection.
1842 setStart(spellingSearchRange.get(), selection.visibleEnd());
1848 // selection is editable.
1930 // block rather than at a selection).
1976 frame()->selection()->setSelection(VisibleSelection(badGrammarRange.get(), SEL_DEFAULT_AFFINITY));
1987 frame()->selection()->setSelection(VisibleSelection(misspellingRange.get(), DOWNSTREAM));
2009 // The selection only counts as misspelled if the selected text is exactly one misspelled word
2075 return isRangeUngrammatical(client(), frame()->selection()->toNormalizedRange().get(), ignoredGuesses);
2086 isRangeUngrammatical(client(), frame()->selection()->toNormalizedRange().get(), guesses);
2167 return guessesForMisspelledOrUngrammaticalRange(client(), frame()->selection()->toNormalizedRange().get(), isGrammarCheckingEnabled(), misspelled, ungrammatical);
2249 if (newSelection != frame()->selection()->selection()) {
2252 frame()->selection()->setSelection(newSelection);
2260 frame()->selection()->moveTo(frame()->selection()->end());
2261 frame()->selection()->modify(SelectionController::MOVE, SelectionController::FORWARD, CharacterGranularity);
2291 static void markMisspellingsOrBadGrammar(Editor* editor, const VisibleSelection& selection, bool checkSpelling, RefPtr<Range>& firstMisspellingRange)
2293 // This function is called with a selection already expanded to word boundaries.
2301 RefPtr<Range> searchRange(selection.toNormalizedRange());
2347 void Editor::markMisspellings(const VisibleSelection& selection, RefPtr<Range>& firstMisspellingRange)
2349 markMisspellingsOrBadGrammar(this, selection, true, firstMisspellingRange);
2352 void Editor::markBadGrammar(const VisibleSelection& selection)
2356 markMisspellingsOrBadGrammar(this, selection, false, firstMisspellingRange);
2358 UNUSED_PARAM(selection);
2417 if (m_frame->selection()->selectionType() == VisibleSelection::CaretSelection) {
2420 Position caretPosition = m_frame->selection()->end();
2510 if (doReplacement && selectionToReplace != m_frame->selection()->selection()) {
2512 m_frame->selection()->setSelection(selectionToReplace);
2548 m_frame->selection()->moveTo(selectionRange->endPosition(), DOWNSTREAM);
2550 m_frame->selection()->modify(SelectionController::MOVE, SelectionController::FORWARD, CharacterGranularity);
2553 m_frame->selection()->moveTo(m_frame->selection()->end());
2554 m_frame->selection()->modify(SelectionController::MOVE, SelectionController::FORWARD, CharacterGranularity);
2564 RefPtr<Range> selection = selectedRange();
2565 if (!shouldInsertText(replacedString, selection.get(), EditorInsertActionPasted))
2570 RefPtr<Range> paragraphRange = paragraphAlignedRangeForRange(selection.get(), selectionOffset, paragraphString);
2604 VisibleSelection selection(frame->visiblePositionForPoint(framePoint));
2605 return avoidIntersectionWithNode(selection.toNormalizedRange().get(), m_deleteButtonController->containerElement());
2642 Position start = m_frame->selection()->start();
2645 Position end = m_frame->selection()->end();
2664 VisibleSelection selection = m_frame->selection()->selection();
2665 if (!selection.isCaret())
2668 // Make a selection that goes back one character and forward two characters.
2669 VisiblePosition caret = selection.visibleStart();
2689 if (newSelection != m_frame->selection()->selection()) {
2692 m_frame->selection()->setSelection(newSelection);
2879 // If there is no selection change, don't bother sending shouldChangeSelection, but still call setSelection,
2881 // The old selection can be invalid here and calling shouldChangeSelection can produce some strange calls.
2883 bool selectionDidNotChangeDOMPosition = newSelection == m_frame->selection()->selection();
2885 m_frame->selection()->setSelection(newSelection, closeTyping, clearTypingStyle);
2887 // Some kinds of deletes and line break insertions change the selection's position within the document without
2892 // does not call EditorClient::respondToChangedSelection(), which, on the Mac, sends selection change notifications and