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

Unified Diff: third_party/WebKit/Source/core/editing/FrameSelection.cpp

Issue 2638423005: Make FrameSelection to utilize SynchronousMutationObserver (Closed)
Patch Set: 2017-01-20T19:16:11 Rebase 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/editing/FrameSelection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/FrameSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/FrameSelection.cpp b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
index 464ca351009703fc1146a4da0ce061f790eb36b5..47f5c0d3e4a2bcd47a4874c779b4371943aee441 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
@@ -35,6 +35,7 @@
#include "core/dom/Element.h"
#include "core/dom/ElementTraversal.h"
#include "core/dom/NodeTraversal.h"
+#include "core/dom/NodeWithIndex.h"
#include "core/dom/Text.h"
#include "core/editing/CaretBase.h"
#include "core/editing/EditingUtilities.h"
@@ -550,7 +551,11 @@ static Position updatePostionAfterAdoptingTextNodesMerged(
return position;
}
-void FrameSelection::didMergeTextNodes(const Text& oldNode, unsigned offset) {
+void FrameSelection::didMergeTextNodes(
+ const Text& mergedNode,
+ const NodeWithIndex& nodeToBeRemovedWithIndex,
+ unsigned offset) {
+ const Text& oldNode = toText(nodeToBeRemovedWithIndex.node());
if (isNone() || !oldNode.isConnected())
return;
Position base = updatePostionAfterAdoptingTextNodesMerged(selection().base(),
@@ -710,9 +715,10 @@ void FrameSelection::documentAttached(Document* document) {
m_useSecureKeyboardEntryWhenActive = false;
m_selectionEditor->documentAttached(document);
m_frameCaret->documentAttached(document);
+ setContext(document);
}
-void FrameSelection::documentDetached(const Document& document) {
+void FrameSelection::contextDestroyed(Document* document) {
DCHECK_EQ(m_document, document);
m_document = nullptr;
m_granularity = CharacterGranularity;
@@ -722,7 +728,7 @@ void FrameSelection::documentDetached(const Document& document) {
view.clearSelection();
clearTypingStyle();
- m_selectionEditor->documentDetached(document);
+ m_selectionEditor->documentDetached(*document);
}
LayoutBlock* FrameSelection::caretLayoutObject() const {
@@ -1294,6 +1300,7 @@ DEFINE_TRACE(FrameSelection) {
visitor->trace(m_selectionEditor);
visitor->trace(m_typingStyle);
visitor->trace(m_frameCaret);
+ SynchronousMutationObserver::trace(visitor);
}
void FrameSelection::scheduleVisualUpdate() const {
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698