RenderView does not need to be a SelectionSubtreeRoot
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Oct 2017 04:46:32 +0000 (04:46 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Oct 2017 04:46:32 +0000 (04:46 +0000)
commitdeabbd05e391b841db760785d11fef20060ec103
tree1de80064e06e8aa2eae7d919dd7016a6730f7620
parent9c47c5e72162624483d180cb97367078e3f590ba
RenderView does not need to be a SelectionSubtreeRoot
https://bugs.webkit.org/show_bug.cgi?id=177713

Reviewed by Darin Adler and Antti Koivisto.

1. SelectionSubtreeRoot -> SelectionRangeData
2. Move all selection logic from RenderView to SelectionRangeData
3. class RenderView : public SelectionSubtreeRoot -> SelectionRangeData m_selection;
4. Remove redundant code
5. General modernization

No change in functionality.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setNeedsSelectionUpdate):
(WebCore::DragCaretController::nodeWillBeRemoved):
(WebCore::FrameSelection::respondToNodeModification):
(WebCore::FrameSelection::prepareForDestruction):
(WebCore::FrameSelection::focusedOrActiveStateChanged):
(WebCore::FrameSelection::updateAppearance):
(WebCore::FrameSelection::selectionBounds const):
* page/FrameView.cpp:
(WebCore::FrameView::paintContentsForSnapshot):
* platform/DragImage.cpp:
(WebCore::ScopedFrameSelectionState::ScopedFrameSelectionState):
(WebCore::ScopedFrameSelectionState::~ScopedFrameSelectionState):
(WebCore::createDragImageForRange):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::selectionState):
(WebCore::InlineTextBox::selectionStartEnd const):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::isSelectionRoot const):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::isSelectionBorder const):
* rendering/RenderObject.h:
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::isSelected const):
* rendering/RenderText.cpp:
(WebCore::RenderText::collectSelectionRectsForLineBoxes):
* rendering/RenderTextLineBoxes.cpp:
(WebCore::RenderTextLineBoxes::setSelectionState):
* rendering/RenderView.cpp:
(WebCore::RenderView::RenderView):
(WebCore::SelectionIterator::SelectionIterator): Deleted.
(WebCore::SelectionIterator::current const): Deleted.
(WebCore::SelectionIterator::next): Deleted.
(WebCore::SelectionIterator::checkForSpanner): Deleted.
(WebCore::rendererAfterPosition): Deleted.
(WebCore::RenderView::selectionBounds const): Deleted.
(WebCore::RenderView::subtreeSelectionBounds const): Deleted.
(WebCore::RenderView::repaintSelection const): Deleted.
(WebCore::RenderView::repaintSubtreeSelection const): Deleted.
(WebCore::RenderView::setSelection): Deleted.
(WebCore::isValidObjectForNewSelection): Deleted.
(WebCore::RenderView::clearSubtreeSelection const): Deleted.
(WebCore::RenderView::applySubtreeSelection): Deleted.
(WebCore::RenderView::getSelection const): Deleted.
(WebCore::RenderView::clearSelection): Deleted.
* rendering/RenderView.h:
* rendering/SelectionSubtreeRoot.cpp:
(WebCore::rendererAfterPosition):
(WebCore::SelectionIterator::SelectionIterator):
(WebCore::SelectionIterator::current const):
(WebCore::SelectionIterator::next):
(WebCore::SelectionIterator::checkForSpanner):
(WebCore::SelectionRangeData::SelectionRangeData):
(WebCore::SelectionRangeData::set):
(WebCore::SelectionRangeData::clear):
(WebCore::SelectionRangeData::repaint const):
(WebCore::SelectionRangeData::bounds const):
(WebCore::SelectionRangeData::collectAndClear const):
(WebCore::SelectionRangeData::apply):
(WebCore::SelectionRangeData::isValidRendererForNewSelection const):
(WebCore::SelectionSubtreeRoot::SelectionSubtreeRoot): Deleted.
* rendering/SelectionSubtreeRoot.h:
(WebCore::SelectionRangeData::Context::operator== const):
(WebCore::SelectionRangeData::get const):
(WebCore::SelectionRangeData::start const):
(WebCore::SelectionRangeData::end const):
(WebCore::SelectionRangeData::startPosition const):
(WebCore::SelectionRangeData::endPosition const):
(WebCore::SelectionSubtreeRoot::OldSelectionData::OldSelectionData): Deleted.
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::SelectionSubtreeData): Deleted.
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStart const): Deleted.
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartPos const): Deleted.
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEnd const): Deleted.
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEndPos const): Deleted.
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartEndPositions const): Deleted.
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::clearSelection): Deleted.
(WebCore::SelectionSubtreeRoot::selectionData): Deleted.
(WebCore::SelectionSubtreeRoot::selectionData const): Deleted.
(WebCore::SelectionSubtreeRoot::setSelectionData): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222697 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/platform/DragImage.cpp
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/RenderReplaced.cpp
Source/WebCore/rendering/RenderText.cpp
Source/WebCore/rendering/RenderTextLineBoxes.cpp
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderView.h
Source/WebCore/rendering/RenderingAllInOne.cpp
Source/WebCore/rendering/SelectionRangeData.cpp [new file with mode: 0644]
Source/WebCore/rendering/SelectionRangeData.h [new file with mode: 0644]
Source/WebCore/rendering/SelectionSubtreeRoot.cpp [deleted file]
Source/WebCore/rendering/SelectionSubtreeRoot.h [deleted file]