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

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

Issue 2776073002: Workaround for Samsung email issues (Closed)
Patch Set: add a comment to web_preferences.h Created 3 years, 8 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 | « content/renderer/render_view_impl.cc ('k') | third_party/WebKit/Source/core/frame/Settings.json5 » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Range.cpp
diff --git a/third_party/WebKit/Source/core/dom/Range.cpp b/third_party/WebKit/Source/core/dom/Range.cpp
index 304e806bad8f10962cec4d7f5806532a985743eb..e93ee299cd4345348dc02f43e7622d5ca9e52e3d 100644
--- a/third_party/WebKit/Source/core/dom/Range.cpp
+++ b/third_party/WebKit/Source/core/dom/Range.cpp
@@ -45,6 +45,7 @@
#include "core/editing/iterators/TextIterator.h"
#include "core/editing/serializers/Serialization.h"
#include "core/events/ScopedEventQueue.h"
+#include "core/frame/Settings.h"
#include "core/html/HTMLBodyElement.h"
#include "core/html/HTMLElement.h"
#include "core/layout/LayoutObject.h"
@@ -79,8 +80,13 @@ class RangeUpdateScope {
DCHECK_GE(s_scopeCount, 1);
if (--s_scopeCount > 0)
return;
- m_range->removeFromSelectionIfInDifferentRoot(*m_oldDocument);
- m_range->updateSelectionIfAddedToSelection();
+ Settings* settings =
+ m_oldDocument->frame() ? m_oldDocument->frame()->settings() : nullptr;
+ if (!settings ||
+ !settings->getDoNotUpdateSelectionOnMutatingSelectionRange()) {
+ m_range->removeFromSelectionIfInDifferentRoot(*m_oldDocument);
+ m_range->updateSelectionIfAddedToSelection();
+ }
#if DCHECK_IS_ON()
s_currentRange = nullptr;
#endif
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | third_party/WebKit/Source/core/frame/Settings.json5 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698