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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2121313003: [Editing][DOM][CodeHealth] Make Node::isContentEditable and Node::isRichEditable global functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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/web/WebNode.cpp ('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/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 575fd6d01ed1187d75b7dd02eb6a1c13e0e035e0..fd50765a3d526faa0323d6805470ffd402e00f3a 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -2275,7 +2275,7 @@ void WebViewImpl::setFocus(bool enable)
// no caret and does respond to keyboard inputs.
if (element->isTextFormControl()) {
element->updateFocusAppearance(SelectionBehaviorOnFocus::Restore);
- } else if (element->isContentEditable()) {
+ } else if (isContentEditable(*element)) {
// updateFocusAppearance() selects all the text of
// contentseditable DIVs. So we set the selection explicitly
// instead. Note that this has the side effect of moving the
@@ -2344,7 +2344,7 @@ bool WebViewImpl::setComposition(
const EphemeralRange range = inputMethodController.compositionEphemeralRange();
if (range.isNotNull()) {
Node* node = range.startPosition().computeContainerNode();
- if (!node || !node->isContentEditable())
+ if (!node || !isContentEditable(*node))
return false;
}
@@ -2542,7 +2542,7 @@ WebTextInputType WebViewImpl::textInputType()
return WebTextInputTypeDateTimeField;
}
- if (element->isContentEditable())
+ if (isContentEditable(*element))
return WebTextInputTypeContentEditable;
return WebTextInputTypeNone;
@@ -2997,7 +2997,7 @@ void WebViewImpl::clearFocusedElement()
// knows to remove selection from it. Otherwise, the text field is still
// processing keyboard events even though focus has been moved to the page and
// keystrokes get eaten as a result.
- if (oldFocusedElement->isContentEditable() || oldFocusedElement->isTextFormControl())
+ if (isContentEditable(*oldFocusedElement) || oldFocusedElement->isTextFormControl())
localFrame->selection().clear();
}
@@ -3005,7 +3005,7 @@ void WebViewImpl::clearFocusedElement()
// http://crbug.com/612560
static bool isElementEditable(const Element* element)
{
- if (element->isContentEditable())
+ if (isContentEditable(*element))
return true;
if (element->isTextFormControl()) {
« no previous file with comments | « third_party/WebKit/Source/web/WebNode.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698