Commit 87ea95ce authored by eric@webkit.org's avatar eric@webkit.org

First pass at s/Selection/VisibleSelection

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@40793 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 54d4dabb
2009-02-09 Eric Seidel <eric@webkit.org>
Reviewed by Dave Hyatt.
Rename Selection to VisibleSelection to allow us to separate
the selections the user works with from the ones used by
the JS editing APIs.
https://bugs.webkit.org/show_bug.cgi?id=23852
No functional changes, thus no tests.
* WebCore.base.exp:
* WebCore.pro:
* WebCore.scons:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* dom/Element.cpp:
(WebCore::Element::updateFocusAppearance):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::updateStartEnd):
(WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
* editing/BreakBlockquoteCommand.cpp:
(WebCore::BreakBlockquoteCommand::doApply):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::inputText):
(WebCore::CompositeEditCommand::deleteSelection):
(WebCore::CompositeEditCommand::rebalanceWhitespace):
(WebCore::CompositeEditCommand::pushAnchorElementDown):
(WebCore::CompositeEditCommand::pushPartiallySelectedAnchorElementsDown):
(WebCore::CompositeEditCommand::moveParagraphs):
(WebCore::CompositeEditCommand::breakOutOfEmptyListItem):
(WebCore::CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph):
* editing/CompositeEditCommand.h:
* editing/CreateLinkCommand.cpp:
(WebCore::CreateLinkCommand::doApply):
* editing/DeleteButtonController.cpp:
(WebCore::enclosingDeletableElement):
(WebCore::DeleteButtonController::respondToChangedSelection):
* editing/DeleteButtonController.h:
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::DeleteSelectionCommand):
(WebCore::DeleteSelectionCommand::clearTransientState):
(WebCore::DeleteSelectionCommand::doApply):
* editing/DeleteSelectionCommand.h:
(WebCore::DeleteSelectionCommand::create):
* editing/EditCommand.cpp:
(WebCore::EditCommand::setStartingSelection):
(WebCore::EditCommand::setEndingSelection):
* editing/EditCommand.h:
(WebCore::EditCommand::startingSelection):
(WebCore::EditCommand::endingSelection):
* editing/Editor.cpp:
(WebCore::Editor::selectionForCommand):
(WebCore::Editor::respondToChangedSelection):
(WebCore::Editor::respondToChangedContents):
(WebCore::Editor::applyStyle):
(WebCore::Editor::applyParagraphStyle):
(WebCore::Editor::appliedEditing):
(WebCore::Editor::unappliedEditing):
(WebCore::Editor::reappliedEditing):
(WebCore::Editor::insertTextWithoutSendingTextEvent):
(WebCore::Editor::selectComposition):
(WebCore::Editor::confirmComposition):
(WebCore::Editor::advanceToNextMisspelling):
(WebCore::Editor::markMisspellingsAfterTypingToPosition):
(WebCore::markMisspellingsOrBadGrammar):
(WebCore::Editor::markMisspellings):
(WebCore::Editor::markBadGrammar):
(WebCore::Editor::rangeForPoint):
(WebCore::Editor::transpose):
* editing/Editor.h:
* editing/EditorCommand.cpp:
(WebCore::expandSelectionToGranularity):
(WebCore::executeSwapWithMark):
(WebCore::enabledVisibleSelection):
(WebCore::enabledVisibleSelectionAndMark):
(WebCore::enableCaretInEditableText):
* editing/FormatBlockCommand.cpp:
(WebCore::FormatBlockCommand::modifyRange):
(WebCore::FormatBlockCommand::doApply):
* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::indentRegion):
(WebCore::IndentOutdentCommand::outdentRegion):
(WebCore::IndentOutdentCommand::doApply):
* editing/InsertLineBreakCommand.cpp:
(WebCore::InsertLineBreakCommand::doApply):
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::modifyRange):
(WebCore::InsertListCommand::doApply):
* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::doApply):
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::performTrivialReplace):
(WebCore::InsertTextCommand::input):
* editing/ModifySelectionListLevel.cpp:
(WebCore::getStartEndListChildren):
(WebCore::canIncreaseListLevel):
(WebCore::canDecreaseListLevel):
* editing/MoveSelectionCommand.cpp:
(WebCore::MoveSelectionCommand::doApply):
* editing/RemoveFormatCommand.cpp:
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplacementFragment::ReplacementFragment):
(WebCore::ReplaceSelectionCommand::doApply):
(WebCore::ReplaceSelectionCommand::completeHTMLReplacement):
* editing/Selection.cpp: Removed.
* editing/Selection.h: Removed.
* editing/SelectionController.cpp:
(WebCore::SelectionController::moveTo):
(WebCore::SelectionController::setSelection):
(WebCore::SelectionController::nodeWillBeRemoved):
(WebCore::SelectionController::clear):
(WebCore::SelectionController::setBase):
(WebCore::SelectionController::setExtent):
(WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
(WebCore::SelectionController::selectAll):
(WebCore::SelectionController::setSelectedRange):
* editing/SelectionController.h:
(WebCore::SelectionController::selection):
(WebCore::SelectionController::selectionType):
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::insertText):
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
* editing/TypingCommand.h:
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::honorEditableBoundaryAtOrBefore):
(WebCore::VisiblePosition::honorEditableBoundaryAtOrAfter):
* editing/VisibleSelection.cpp: Added.
(WebCore::VisibleSelection::VisibleSelection):
(WebCore::VisibleSelection::selectionFromContentsOfNode):
(WebCore::VisibleSelection::setBase):
(WebCore::VisibleSelection::setExtent):
(WebCore::VisibleSelection::firstRange):
(WebCore::VisibleSelection::toNormalizedRange):
(WebCore::VisibleSelection::expandUsingGranularity):
(WebCore::makeSearchRange):
(WebCore::VisibleSelection::appendTrailingWhitespace):
(WebCore::VisibleSelection::setBaseAndExtentToDeepEquivalents):
(WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity):
(WebCore::VisibleSelection::updateSelectionType):
(WebCore::VisibleSelection::validate):
(WebCore::VisibleSelection::setWithoutValidation):
(WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries):
(WebCore::VisibleSelection::isContentEditable):
(WebCore::VisibleSelection::isContentRichlyEditable):
(WebCore::VisibleSelection::rootEditableElement):
(WebCore::VisibleSelection::shadowTreeRootNode):
(WebCore::VisibleSelection::debugPosition):
(WebCore::VisibleSelection::formatForDebugger):
(WebCore::VisibleSelection::showTreeForThis):
(showTree):
* editing/VisibleSelection.h: Added.
(WebCore::VisibleSelection::):
(WebCore::VisibleSelection::selectionType):
(WebCore::VisibleSelection::setAffinity):
(WebCore::VisibleSelection::affinity):
(WebCore::VisibleSelection::base):
(WebCore::VisibleSelection::extent):
(WebCore::VisibleSelection::start):
(WebCore::VisibleSelection::end):
(WebCore::VisibleSelection::visibleStart):
(WebCore::VisibleSelection::visibleEnd):
(WebCore::VisibleSelection::isNone):
(WebCore::VisibleSelection::isCaret):
(WebCore::VisibleSelection::isRange):
(WebCore::VisibleSelection::isCaretOrRange):
(WebCore::VisibleSelection::isBaseFirst):
(WebCore::VisibleSelection::granularity):
(WebCore::operator==):
(WebCore::operator!=):
* editing/htmlediting.cpp:
(WebCore::selectionForParagraphIteration):
(WebCore::avoidIntersectionWithNode):
* editing/htmlediting.h:
* editing/markup.cpp:
(WebCore::createMarkup):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::selection):
* html/HTMLInputElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::selection):
* html/HTMLTextAreaElement.h:
* page/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::selection):
(WebCore::AccessibilityObject::visiblePositionRangeForUnorderedPositions):
* page/AccessibilityObject.h:
* page/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::selection):
(WebCore::AccessibilityRenderObject::setSelectedTextRange):
(WebCore::AccessibilityRenderObject::visiblePositionRangeForLine):
(WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
(WebCore::AccessibilityRenderObject::doAXRangeForLine):
* page/AccessibilityRenderObject.h:
* page/DOMSelection.cpp:
(WebCore::DOMSelection::anchorNode):
(WebCore::DOMSelection::anchorOffset):
(WebCore::DOMSelection::focusNode):
(WebCore::DOMSelection::focusOffset):
(WebCore::DOMSelection::collapseToEnd):
(WebCore::DOMSelection::collapseToStart):
(WebCore::DOMSelection::getRangeAt):
(WebCore::DOMSelection::addRange):
* page/DOMSelection.h:
* page/DragController.cpp:
(WebCore::DragController::tryDocumentDrag):
(WebCore::setSelectionToDragCaret):
(WebCore::DragController::concludeEditDrag):
(WebCore::prepareClipboardForImageDrag):
(WebCore::DragController::startDrag):
(WebCore::DragController::placeDragCaret):
* page/EditorClient.h:
* page/EventHandler.cpp:
(WebCore::EventHandler::selectClosestWordFromMouseEvent):
(WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent):
(WebCore::EventHandler::handleMousePressEventTripleClick):
(WebCore::EventHandler::handleMousePressEventSingleClick):
(WebCore::EventHandler::updateSelectionForMouseDrag):
(WebCore::EventHandler::handleMouseReleaseEvent):
* page/Frame.cpp:
(WebCore::Frame::mark):
(WebCore::Frame::setMark):
(WebCore::Frame::selectionLayoutChanged):
(WebCore::Frame::shouldChangeSelection):
(WebCore::Frame::shouldDeleteSelection):
(WebCore::Frame::revealSelection):
(WebCore::Frame::setSelectionFromNone):
(WebCore::Frame::findString):
(WebCore::Frame::respondToChangedSelection):
* page/Frame.h:
* page/Page.cpp:
(WebCore::Page::selection):
* page/Page.h:
* page/mac/AccessibilityObjectWrapper.mm:
(-[AccessibilityObjectWrapper textMarkerRangeForSelection]):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::fillInlineSelectionGaps):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::setSelectionRange):
(WebCore::RenderTextControl::selection):
* rendering/RenderTextControl.h:
* rendering/RenderTreeAsText.cpp:
(WebCore::writeSelection):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::fillLineSelectionGap):
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::selectSubString):
2009-02-09 Dimitri Glazkov <dglazkov@chromium.org>
Reviewed by Dave Hyatt.
......@@ -370,6 +370,8 @@ __ZN7WebCore16NavigationActionC1ERKNS_4KURLENS_14NavigationTypeE
__ZN7WebCore16NavigationActionC1Ev
__ZN7WebCore16ScriptController10initScriptEv
__ZN7WebCore16ScriptController18windowScriptObjectEv
__ZN7WebCore16VisibleSelectionC1EPKNS_5RangeENS_9EAffinityE
__ZN7WebCore16VisibleSelectionC1ERKNS_15VisiblePositionES3_
__ZN7WebCore16colorFromNSColorEP7NSColor
__ZN7WebCore16createFullMarkupEPKNS_4NodeE
__ZN7WebCore16createFullMarkupEPKNS_5RangeE
......@@ -398,7 +400,7 @@ __ZN7WebCore19InspectorController5closeEv
__ZN7WebCore19InspectorController7inspectEPNS_4NodeE
__ZN7WebCore19InspectorController9showPanelENS0_13SpecialPanelsE
__ZN7WebCore19SelectionController10setFocusedEb
__ZN7WebCore19SelectionController12setSelectionERKNS_9SelectionEbbb
__ZN7WebCore19SelectionController12setSelectionERKNS_16VisibleSelectionEbbb
__ZN7WebCore19SelectionController16setSelectedRangeEPNS_5RangeENS_9EAffinityEb
__ZN7WebCore19SelectionController5clearEv
__ZN7WebCore19SelectionController6modifyENS0_11EAlterationENS0_10EDirectionENS_15TextGranularityEb
......@@ -680,9 +682,6 @@ __ZN7WebCore9PageGroup14addVisitedLinkEPKtm
__ZN7WebCore9PageGroup17closeLocalStorageEv
__ZN7WebCore9PageGroup21removeAllVisitedLinksEv
__ZN7WebCore9PageGroup26setShouldTrackVisitedLinksEb
__ZN7WebCore9Selection22expandUsingGranularityENS_15TextGranularityE
__ZN7WebCore9SelectionC1EPKNS_5RangeENS_9EAffinityE
__ZN7WebCore9SelectionC1ERKNS_15VisiblePositionES3_
__ZN7WebCore9TimerBase4stopEv
__ZN7WebCore9TimerBase5startEdd
__ZN7WebCore9TimerBaseC2Ev
......@@ -788,6 +787,10 @@ __ZNK7WebCore15VisiblePosition4nextEb
__ZNK7WebCore15VisiblePosition8previousEb
__ZNK7WebCore16HTMLInputElement12autoCompleteEv
__ZNK7WebCore16ResourceResponse13nsURLResponseEv
__ZNK7WebCore16VisibleSelection17isContentEditableEv
__ZNK7WebCore16VisibleSelection17toNormalizedRangeEv
__ZNK7WebCore16VisibleSelection19rootEditableElementEv
__ZNK7WebCore16VisibleSelection23isContentRichlyEditableEv
__ZNK7WebCore17ResourceErrorBase8lazyInitEv
__ZNK7WebCore19AnimationController24numberOfActiveAnimationsEv
__ZNK7WebCore19InspectorController17drawNodeHighlightERNS_15GraphicsContextE
......@@ -900,10 +903,6 @@ __ZNK7WebCore9FrameTree4findERKNS_12AtomicStringE
__ZNK7WebCore9FrameTree5childERKNS_12AtomicStringE
__ZNK7WebCore9FrameTree6parentEb
__ZNK7WebCore9FrameView11needsLayoutEv
__ZNK7WebCore9Selection17isContentEditableEv
__ZNK7WebCore9Selection17toNormalizedRangeEv
__ZNK7WebCore9Selection19rootEditableElementEv
__ZNK7WebCore9Selection23isContentRichlyEditableEv
__ZNK7WebCore9TimerBase8isActiveEv
__ZTVN7WebCore12ChromeClientE
__ZTVN7WebCore17FileChooserClientE
......
......@@ -665,7 +665,6 @@ SOURCES += \
editing/RemoveNodePreservingChildrenCommand.cpp \
editing/ReplaceSelectionCommand.cpp \
editing/SelectionController.cpp \
editing/Selection.cpp \
editing/SetNodeAttributeCommand.cpp \
editing/SmartReplace.cpp \
editing/SmartReplaceICU.cpp \
......@@ -676,6 +675,7 @@ SOURCES += \
editing/TypingCommand.cpp \
editing/UnlinkCommand.cpp \
editing/VisiblePosition.cpp \
editing/VisibleSelection.cpp \
editing/visible_units.cpp \
editing/WrapContentsInDummySpanCommand.cpp \
history/BackForwardList.cpp \
......
......@@ -180,7 +180,6 @@ sources['editing'] = [
'editing/RemoveNodeCommand.cpp',
'editing/RemoveNodePreservingChildrenCommand.cpp',
'editing/ReplaceSelectionCommand.cpp',
'editing/Selection.cpp',
'editing/SelectionController.cpp',
'editing/SetNodeAttributeCommand.cpp',
'editing/SmartReplace.cpp',
......@@ -194,6 +193,7 @@ sources['editing'] = [
'editing/UnlinkCommand.cpp',
'editing/visible_units.cpp',
'editing/VisiblePosition.cpp',
'editing/VisibleSelection.cpp',
'editing/WrapContentsInDummySpanCommand.cpp',
]
sources['history'] = [
......
......@@ -12517,14 +12517,6 @@
RelativePath="..\editing\ReplaceSelectionCommand.h"
>
</File>
<File
RelativePath="..\editing\Selection.cpp"
>
</File>
<File
RelativePath="..\editing\Selection.h"
>
</File>
<File
RelativePath="..\editing\SelectionController.cpp"
>
......@@ -12625,6 +12617,14 @@
RelativePath="..\editing\VisiblePosition.h"
>
</File>
<File
RelativePath="..\editing\VisibleSelection.cpp"
>
</File>
<File
RelativePath="..\editing\VisibleSelection.h"
>
</File>
<File
RelativePath="..\editing\WrapContentsInDummySpanCommand.cpp"
>
......
......@@ -1892,8 +1892,6 @@
93309E07099E64920056E581 /* RemoveNodePreservingChildrenCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 93309DB8099E64910056E581 /* RemoveNodePreservingChildrenCommand.h */; };
93309E09099E64920056E581 /* ReplaceSelectionCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93309DBA099E64910056E581 /* ReplaceSelectionCommand.cpp */; };
93309E0A099E64920056E581 /* ReplaceSelectionCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 93309DBB099E64910056E581 /* ReplaceSelectionCommand.h */; settings = {ATTRIBUTES = (Private, ); }; };
93309E0B099E64920056E581 /* Selection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93309DBC099E64910056E581 /* Selection.cpp */; };
93309E0C099E64920056E581 /* Selection.h in Headers */ = {isa = PBXBuildFile; fileRef = 93309DBD099E64910056E581 /* Selection.h */; settings = {ATTRIBUTES = (Private, ); }; };
93309E0D099E64920056E581 /* SelectionController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93309DBE099E64910056E581 /* SelectionController.cpp */; };
93309E0E099E64920056E581 /* SelectionController.h in Headers */ = {isa = PBXBuildFile; fileRef = 93309DBF099E64910056E581 /* SelectionController.h */; settings = {ATTRIBUTES = (Private, ); }; };
93309E0F099E64920056E581 /* SetNodeAttributeCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93309DC0099E64910056E581 /* SetNodeAttributeCommand.cpp */; };
......@@ -2501,6 +2499,8 @@
A871DFE30A15376B00B12A68 /* RenderReplaced.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DFDF0A15376B00B12A68 /* RenderReplaced.h */; settings = {ATTRIBUTES = (Private, ); }; };
A871DFE40A15376B00B12A68 /* RenderWidget.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DFE00A15376B00B12A68 /* RenderWidget.h */; settings = {ATTRIBUTES = (Private, ); }; };
A871DFE50A15376B00B12A68 /* RenderWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A871DFE10A15376B00B12A68 /* RenderWidget.cpp */; };
A883DF270F3D045D00F19BF6 /* VisibleSelection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A883DF250F3D045D00F19BF6 /* VisibleSelection.cpp */; };
A883DF280F3D045D00F19BF6 /* VisibleSelection.h in Headers */ = {isa = PBXBuildFile; fileRef = A883DF260F3D045D00F19BF6 /* VisibleSelection.h */; settings = {ATTRIBUTES = (Private, ); }; };
A88AD52F09524B92001DD196 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A85D7A2F0879EBA9006A9172 /* QuartzCore.framework */; };
A88DD4870B4629A300C02990 /* PathTraversalState.h in Headers */ = {isa = PBXBuildFile; fileRef = A88DD4860B4629A300C02990 /* PathTraversalState.h */; };
A88DD4890B4629B000C02990 /* PathTraversalState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A88DD4880B4629B000C02990 /* PathTraversalState.cpp */; };
......@@ -6789,8 +6789,6 @@
93309DB8099E64910056E581 /* RemoveNodePreservingChildrenCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoveNodePreservingChildrenCommand.h; sourceTree = "<group>"; };
93309DBA099E64910056E581 /* ReplaceSelectionCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReplaceSelectionCommand.cpp; sourceTree = "<group>"; };
93309DBB099E64910056E581 /* ReplaceSelectionCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReplaceSelectionCommand.h; sourceTree = "<group>"; };
93309DBC099E64910056E581 /* Selection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Selection.cpp; sourceTree = "<group>"; };
93309DBD099E64910056E581 /* Selection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Selection.h; sourceTree = "<group>"; };
93309DBE099E64910056E581 /* SelectionController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SelectionController.cpp; sourceTree = "<group>"; };
93309DBF099E64910056E581 /* SelectionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectionController.h; sourceTree = "<group>"; };
93309DC0099E64910056E581 /* SetNodeAttributeCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SetNodeAttributeCommand.cpp; sourceTree = "<group>"; };
......@@ -7242,6 +7240,8 @@
A871DFDF0A15376B00B12A68 /* RenderReplaced.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderReplaced.h; sourceTree = "<group>"; };
A871DFE00A15376B00B12A68 /* RenderWidget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderWidget.h; sourceTree = "<group>"; };
A871DFE10A15376B00B12A68 /* RenderWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderWidget.cpp; sourceTree = "<group>"; };
A883DF250F3D045D00F19BF6 /* VisibleSelection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisibleSelection.cpp; sourceTree = "<group>"; };
A883DF260F3D045D00F19BF6 /* VisibleSelection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisibleSelection.h; sourceTree = "<group>"; };
A88DD4860B4629A300C02990 /* PathTraversalState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathTraversalState.h; sourceTree = "<group>"; };
A88DD4880B4629B000C02990 /* PathTraversalState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PathTraversalState.cpp; sourceTree = "<group>"; };
A88FE3330E5EEE87008D8C0F /* GraphicsContextPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsContextPrivate.h; sourceTree = "<group>"; };
......@@ -11381,8 +11381,6 @@
93309DB8099E64910056E581 /* RemoveNodePreservingChildrenCommand.h */,
93309DBA099E64910056E581 /* ReplaceSelectionCommand.cpp */,
93309DBB099E64910056E581 /* ReplaceSelectionCommand.h */,
93309DBC099E64910056E581 /* Selection.cpp */,
93309DBD099E64910056E581 /* Selection.h */,
93309DBE099E64910056E581 /* SelectionController.cpp */,
93309DBF099E64910056E581 /* SelectionController.h */,
93309DC0099E64910056E581 /* SetNodeAttributeCommand.cpp */,
......@@ -11406,6 +11404,8 @@
D086FE9609D53AAB005BC74D /* UnlinkCommand.h */,
93309DD0099E64910056E581 /* VisiblePosition.cpp */,
93309DD1099E64910056E581 /* VisiblePosition.h */,
A883DF250F3D045D00F19BF6 /* VisibleSelection.cpp */,
A883DF260F3D045D00F19BF6 /* VisibleSelection.h */,
93309DD4099E64910056E581 /* WrapContentsInDummySpanCommand.cpp */,
93309DD5099E64910056E581 /* WrapContentsInDummySpanCommand.h */,
93309D98099E64910056E581 /* htmlediting.cpp */,
......@@ -16452,7 +16452,6 @@
BCD0E0FC0E972C3500265DEA /* SecurityOriginHash.h in Headers */,
371F4FFC0D25E7F300ECE0D5 /* SegmentedFontData.h in Headers */,
B2C3DA2F0D006C1D00EF6F26 /* SegmentedString.h in Headers */,
93309E0C099E64920056E581 /* Selection.h in Headers */,
93309E0E099E64920056E581 /* SelectionController.h in Headers */,
BC7FA6810D1F167900DB22A9 /* SelectorNodeList.h in Headers */,
51E0BB230DA572A600A9E417 /* SessionStorage.h in Headers */,
......@@ -16723,6 +16722,7 @@
BC96DB430F3A880E00573CB3 /* RenderBoxModelObject.h in Headers */,
2E3AC84E0F3D06D100633F04 /* WorkerContextProxy.h in Headers */,
2E3AC8500F3D06F700633F04 /* WorkerObjectProxy.h in Headers */,
A883DF280F3D045D00F19BF6 /* VisibleSelection.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -18461,7 +18461,6 @@
BCD0E0FA0E972C3500265DEA /* SecurityOrigin.cpp in Sources */,
371F4FFD0D25E7F300ECE0D5 /* SegmentedFontData.cpp in Sources */,
B2C3DA2E0D006C1D00EF6F26 /* SegmentedString.cpp in Sources */,
93309E0B099E64920056E581 /* Selection.cpp in Sources */,
93309E0D099E64920056E581 /* SelectionController.cpp in Sources */,
4A8C96EB0BE69032004EEFF0 /* SelectionControllerMac.mm in Sources */,
BC7FA6820D1F167900DB22A9 /* SelectorNodeList.cpp in Sources */,
......@@ -18703,6 +18702,7 @@
1A569D240D7E2B82007C3983 /* runtime_root.cpp in Sources */,
93309E1D099E64920056E581 /* visible_units.cpp in Sources */,
BC96DB460F3A882200573CB3 /* RenderBoxModelObject.cpp in Sources */,
A883DF270F3D045D00F19BF6 /* VisibleSelection.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -1096,7 +1096,7 @@ void Element::updateFocusAppearance(bool /*restorePreviousSelection*/)
return;
// FIXME: We should restore the previous selection if there is one.
Selection newSelection = hasTagName(htmlTag) || hasTagName(bodyTag) ? Selection(Position(this, 0), DOWNSTREAM) : Selection::selectionFromContentsOfNode(this);
VisibleSelection newSelection = hasTagName(htmlTag) || hasTagName(bodyTag) ? VisibleSelection(Position(this, 0), DOWNSTREAM) : VisibleSelection::selectionFromContentsOfNode(this);
if (frame->shouldChangeSelection(newSelection)) {
frame->selection()->setSelection(newSelection);
......
......@@ -342,7 +342,7 @@ void ApplyStyleCommand::updateStartEnd(const Position& newStart, const Position&
if (!m_useEndingSelection && (newStart != m_start || newEnd != m_end))
m_useEndingSelection = true;
setEndingSelection(Selection(newStart, newEnd, VP_DEFAULT_AFFINITY));
setEndingSelection(VisibleSelection(newStart, newEnd, VP_DEFAULT_AFFINITY));
m_start = newStart;
m_end = newEnd;
}
......@@ -1480,7 +1480,7 @@ void ApplyStyleCommand::surroundNodeRangeWithElement(Node* startNode, Node* endN
}
// FIXME: We should probably call updateStartEnd if the start or end was in the node
// range so that the endingSelection() is canonicalized. See the comments at the end of
// Selection::validate().
// VisibleSelection::validate().
}
void ApplyStyleCommand::addBlockStyle(const StyleChange& styleChange, HTMLElement* block)
......
......@@ -72,7 +72,7 @@ void BreakBlockquoteCommand::doApply()
insertNodeAfter(breakNode.get(), topBlockquote);
if (isLastVisiblePositionInNode(visiblePos, topBlockquote)) {
setEndingSelection(Selection(Position(breakNode.get(), 0), DOWNSTREAM));
setEndingSelection(VisibleSelection(Position(breakNode.get(), 0), DOWNSTREAM));
rebalanceWhitespace();
return;
}
......@@ -97,7 +97,7 @@ void BreakBlockquoteCommand::doApply()
// If there's nothing inside topBlockquote to move, we're finished.
if (!startNode->isDescendantOf(topBlockquote)) {
setEndingSelection(Selection(VisiblePosition(Position(startNode, 0))));
setEndingSelection(VisibleSelection(VisiblePosition(Position(startNode, 0))));
return;
}
......@@ -168,7 +168,7 @@ void BreakBlockquoteCommand::doApply()
addBlockPlaceholderIfNeeded(clonedBlockquote.get());
// Put the selection right before the break.
setEndingSelection(Selection(Position(breakNode.get(), 0), DOWNSTREAM));
setEndingSelection(VisibleSelection(Position(breakNode.get(), 0), DOWNSTREAM));
rebalanceWhitespace();
}
......
......@@ -296,7 +296,7 @@ void CompositeEditCommand::inputText(const String& text, bool selectInsertedText
if (selectInsertedText) {
RefPtr<Range> selectedRange = TextIterator::rangeFromLocationAndLength(document()->documentElement(), startIndex, length);
setEndingSelection(Selection(selectedRange.get()));
setEndingSelection(VisibleSelection(selectedRange.get()));
}
}
......@@ -345,7 +345,7 @@ void CompositeEditCommand::deleteSelection(bool smartDelete, bool mergeBlocksAft
applyCommandToComposite(DeleteSelectionCommand::create(document(), smartDelete, mergeBlocksAfterDelete, replace, expandForSpecialElements));
}
void CompositeEditCommand::deleteSelection(const Selection &selection, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements)
void CompositeEditCommand::deleteSelection(const VisibleSelection &selection, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements)
{
if (selection.isRange())
applyCommandToComposite(DeleteSelectionCommand::create(selection, smartDelete, mergeBlocksAfterDelete, replace, expandForSpecialElements));
......@@ -452,7 +452,7 @@ void CompositeEditCommand::prepareWhitespaceAtPositionForSplit(Position& positio
void CompositeEditCommand::rebalanceWhitespace()
{
Selection selection = endingSelection();
VisibleSelection selection = endingSelection();
if (selection.isNone())
return;
......@@ -696,7 +696,7 @@ void CompositeEditCommand::pushAnchorElementDown(Node* anchorNode)
ASSERT(anchorNode->isLink());
setEndingSelection(Selection::selectionFromContentsOfNode(anchorNode));
setEndingSelection(VisibleSelection::selectionFromContentsOfNode(anchorNode));
applyStyledElement(static_cast<Element*>(anchorNode));
// Clones of anchorNode have been pushed down, now remove it.
if (anchorNode->inDocument())
......@@ -709,7 +709,7 @@ void CompositeEditCommand::pushAnchorElementDown(Node* anchorNode)
// Anchors cannot be nested.
void CompositeEditCommand::pushPartiallySelectedAnchorElementsDown()
{
Selection originalSelection = endingSelection();
VisibleSelection originalSelection = endingSelection();
VisiblePosition visibleStart(originalSelection.start());
VisiblePosition visibleEnd(originalSelection.end());
......@@ -797,7 +797,7 @@ void CompositeEditCommand::moveParagraphs(const VisiblePosition& startOfParagrap
// FIXME (5098931): We should add a new insert action "WebViewInsertActionMoved" and call shouldInsertFragment here.
setEndingSelection(Selection(start, end, DOWNSTREAM));
setEndingSelection(VisibleSelection(start, end, DOWNSTREAM));
deleteSelection(false, false, false, false);
ASSERT(destination.deepEquivalent().node()->inDocument());
......@@ -866,7 +866,7 @@ void CompositeEditCommand::moveParagraphs(const VisiblePosition& startOfParagrap
RefPtr<Range> start = TextIterator::rangeFromLocationAndLength(document()->documentElement(), destinationIndex + startIndex, 0, true);
RefPtr<Range> end = TextIterator::rangeFromLocationAndLength(document()->documentElement(), destinationIndex + endIndex, 0, true);
if (start && end)
setEndingSelection(Selection(start->startPosition(), end->startPosition(), DOWNSTREAM));
setEndingSelection(VisibleSelection(start->startPosition(), end->startPosition(), DOWNSTREAM));
}
}
......@@ -897,7 +897,7 @@ bool CompositeEditCommand::breakOutOfEmptyListItem()
}
appendBlockPlaceholder(newBlock);
setEndingSelection(Selection(Position(newBlock.get(), 0), DOWNSTREAM));
setEndingSelection(VisibleSelection(Position(newBlock.get(), 0), DOWNSTREAM));
computedStyle(endingSelection().start().node())->diff(style.get());
if (style->length() > 0)
......@@ -935,7 +935,7 @@ bool CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph()
// a second one.
if (!isStartOfParagraph(atBR))
insertNodeBefore(createBreakElement(document()), br);
setEndingSelection(Selection(atBR));
setEndingSelection(VisibleSelection(atBR));
// If this is an empty paragraph there must be a line break here.
if (!lineBreakExistsAtPosition(caret))
......
......@@ -52,7 +52,7 @@ protected:
void applyStyledElement(PassRefPtr<Element>);
void removeStyledElement(PassRefPtr<Element>);
void deleteSelection(bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = true);
void deleteSelection(const Selection&, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = true);
void deleteSelection(const VisibleSelection&, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = true);
virtual void deleteTextFromNode(PassRefPtr<Text>, unsigned offset, unsigned count);
void inputText(const String&, bool selectInsertedText = false);
void insertNodeAfter(PassRefPtr<Node>, PassRefPtr<Node> refChild);
......
......@@ -53,7 +53,7 @@ void CreateLinkCommand::doApply()
insertNodeAt(anchorElement.get(), endingSelection().start());
RefPtr<Text> textNode = new Text(document(), m_url);
appendNode(textNode.get(), anchorElement.get());
setEndingSelection(Selection(positionBeforeNode(anchorElement.get()), positionAfterNode(anchorElement.get()), DOWNSTREAM));
setEndingSelection(VisibleSelection(positionBeforeNode(anchorElement.get()), positionAfterNode(anchorElement.get()), DOWNSTREAM));
}
}
......
......@@ -101,7 +101,7 @@ static bool isDeletableElement(const Node* node)
return false;
}
static HTMLElement* enclosingDeletableElement(const Selection& selection)
static HTMLElement* enclosingDeletableElement(const VisibleSelection& selection)
{
if (!selection.isContentEditable())
return 0;
......@@ -128,7 +128,7 @@ static HTMLElement* enclosingDeletableElement(const Selection& selection)
return static_cast<HTMLElement*>(element);
}
void DeleteButtonController::respondToChangedSelection(const Selection& oldSelection)
void DeleteButtonController::respondToChangedSelection(const VisibleSelection& oldSelection)
{
if (!enabled())
return;
......
......@@ -34,7 +34,7 @@ class DeleteButton;
class Frame;
class HTMLElement;
class RenderObject;
class Selection;
class VisibleSelection;
class DeleteButtonController {
public:
......@@ -45,7 +45,7 @@ public:
HTMLElement* target() const { return m_target.get(); }
HTMLElement* containerElement() const { return m_containerElement.get(); }
void respondToChangedSelection(const Selection& oldSelection);
void respondToChangedSelection(const VisibleSelection& oldSelection);