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

Unified Diff: Source/core/dom/Position.cpp

Issue 20572005: Allow selection to skip over contenteditable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Work around minor platform differences in test Created 7 years, 3 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 | « LayoutTests/editing/selection/stay-in-textarea-expected.txt ('k') | Source/core/editing/FrameSelection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Position.cpp
diff --git a/Source/core/dom/Position.cpp b/Source/core/dom/Position.cpp
index bc8cfa6bdb60b9e0451ad327da30774ed850480b..6f9d753aab27d672a6579f84300e52515a6c7ffa 100644
--- a/Source/core/dom/Position.cpp
+++ b/Source/core/dom/Position.cpp
@@ -37,6 +37,8 @@
#include "core/editing/htmlediting.h"
#include "core/html/HTMLHtmlElement.h"
#include "core/html/HTMLTableElement.h"
+#include "core/page/Frame.h"
+#include "core/page/Settings.h"
#include "core/platform/Logging.h"
#include "core/rendering/InlineIterator.h"
#include "core/rendering/InlineTextBox.h"
@@ -899,8 +901,11 @@ bool Position::isCandidate() const
return atFirstEditingPositionForNode() && !Position::nodeIsUserSelectNone(deprecatedNode());
return m_anchorNode->rendererIsEditable() && !Position::nodeIsUserSelectNone(deprecatedNode()) && atEditingBoundary();
}
- } else
- return m_anchorNode->rendererIsEditable() && !Position::nodeIsUserSelectNone(deprecatedNode()) && atEditingBoundary();
+ } else {
+ Frame* frame = m_anchorNode->document().frame();
+ bool caretBrowsing = frame->settings() && frame->settings()->caretBrowsingEnabled();
+ return (caretBrowsing || m_anchorNode->rendererIsEditable()) && !Position::nodeIsUserSelectNone(deprecatedNode()) && atEditingBoundary();
+ }
return false;
}
« no previous file with comments | « LayoutTests/editing/selection/stay-in-textarea-expected.txt ('k') | Source/core/editing/FrameSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698