Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 1958093002: CONTINUED Make FrameSelection to hold non-canonicalized positions Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2017-01-16T20:04:35 Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/DocumentTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index ed4d6b502cce34ed584c1032117a196c92425462..8e9a89ffebfe67538eb7b1c5958dab300ff0b6e1 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -2488,7 +2488,6 @@ void Document::shutdown() {
// Since |Document| class has multiple |LifecycleNotifier| as base class,
// we need to have |static_cast<SynchronousMutationNotifier>| here.
static_cast<SynchronousMutationNotifier*>(this)->notifyContextDestroyed();
- m_frame->selection().documentDetached(*this);
// If this Document is associated with a live DocumentLoader, the
// DocumentLoader will take care of clearing the FetchContext. Deferring
@@ -4217,8 +4216,6 @@ void Document::nodeChildrenWillBeRemoved(ContainerNode& container) {
}
notifyNodeChildrenWillBeRemoved(container);
- if (LocalFrame* frame = this->frame())
- frame->selection().nodeChildrenWillBeRemoved(container);
if (containsV1ShadowTree()) {
for (Node& n : NodeTraversal::childrenOf(container))
@@ -4235,10 +4232,6 @@ void Document::nodeWillBeRemoved(Node& n) {
notifyNodeWillBeRemoved(n);
- if (LocalFrame* frame = this->frame()) {
- frame->selection().nodeWillBeRemoved(n);
- }
-
if (containsV1ShadowTree())
n.checkSlotChangeBeforeRemoved();
@@ -4246,11 +4239,6 @@ void Document::nodeWillBeRemoved(Node& n) {
styleEngine().elementWillBeRemoved(toElement(n));
}
-void Document::dataWillChange(const CharacterData& characterData) {
- if (LocalFrame* frame = this->frame())
- frame->selection().dataWillChange(characterData);
-}
-
void Document::didInsertText(Node* text, unsigned offset, unsigned length) {
for (Range* range : m_ranges)
range->didInsertText(text, offset, length);
@@ -4266,16 +4254,16 @@ void Document::didRemoveText(Node* text, unsigned offset, unsigned length) {
m_markers->shiftMarkers(text, offset + length, 0 - length);
}
-void Document::didMergeTextNodes(Text& oldNode, unsigned offset) {
+void Document::didMergeTextNodes(const Text& mergedNode,
+ const Text& nodeToBeRemoved,
+ unsigned oldLength) {
+ NodeWithIndex nodeToBeRemovedWithIndex(const_cast<Text&>(nodeToBeRemoved));
if (!m_ranges.isEmpty()) {
- NodeWithIndex oldNodeWithIndex(oldNode);
for (Range* range : m_ranges)
- range->didMergeTextNodes(oldNodeWithIndex, offset);
+ range->didMergeTextNodes(nodeToBeRemovedWithIndex, oldLength);
}
- notifyMergeTextNodes(oldNode, offset);
- if (m_frame)
- m_frame->selection().didMergeTextNodes(oldNode, offset);
+ notifyMergeTextNodes(mergedNode, nodeToBeRemovedWithIndex, oldLength);
// FIXME: This should update markers for spelling and grammar checking.
}
@@ -4285,8 +4273,6 @@ void Document::didSplitTextNode(const Text& oldNode) {
range->didSplitTextNode(oldNode);
notifySplitTextNode(oldNode);
- if (m_frame)
- m_frame->selection().didSplitTextNode(oldNode);
// FIXME: This should update markers for spelling and grammar checking.
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/DocumentTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698