SelectionRangeData should not hold raw RenderObject pointers
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Oct 2017 20:06:06 +0000 (20:06 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Oct 2017 20:06:06 +0000 (20:06 +0000)
commitbd6b119ea4246e4a32f70ecb48ff096786209888
tree1e0d8877b7c2c9c4f707e9aba716d5bdf5348f50
parentb7c51306c1e8df5d0b90cfbb8e4943440a7cbeaf
SelectionRangeData should not hold raw RenderObject pointers
https://bugs.webkit.org/show_bug.cgi?id=177677
<rdar://problem/34763060>

Reviewed by Sam Weinig.

SelectionRangeData::Context start and end renderers' lifetime is not strictly tied
to the lifetime of SelectionRangeData.

Covered by existing tests.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::updateAppearance):
* platform/DragImage.cpp:
(WebCore::createDragImageForRange):
* rendering/SelectionRangeData.cpp:
(WebCore::isValidRendererForSelection):
(WebCore::collect):
(WebCore::SelectionRangeData::set):
(WebCore::SelectionRangeData::clear):
(WebCore::SelectionRangeData::repaint const):
(WebCore::SelectionRangeData::collectBounds const):
(WebCore::SelectionRangeData::apply):
* rendering/SelectionRangeData.h:
(WebCore::SelectionRangeData::Context::Context):
(WebCore::SelectionRangeData::Context::start const):
(WebCore::SelectionRangeData::Context::end const):
(WebCore::SelectionRangeData::Context::startPosition const):
(WebCore::SelectionRangeData::Context::endPosition const):
(WebCore::SelectionRangeData::Context::operator== const):
(WebCore::SelectionRangeData::start const):
(WebCore::SelectionRangeData::end const):
(WebCore::SelectionRangeData::startPosition const):
(WebCore::SelectionRangeData::endPosition const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222738 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/platform/DragImage.cpp
Source/WebCore/rendering/SelectionRangeData.cpp
Source/WebCore/rendering/SelectionRangeData.h