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

Unified Diff: third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp

Issue 2787893004: Fixing select all for contenteditable (Closed)
Patch Set: yosin's comments 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
Index: third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
index 478fcb4edd8914ed027acc48bf0d2012a08651b9..8d88c0d18758a49921bd5c886bb6188ec7acf7c7 100644
--- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
@@ -2114,13 +2114,11 @@ static bool enabledSelectAll(LocalFrame& frame, Event*, EditorCommandSource) {
frame.selection().computeVisibleSelectionInDOMTree();
if (selection.isNone())
return true;
- if (TextControlElement* textControl =
- enclosingTextControl(selection.start())) {
- if (textControl->innerEditorValue().isEmpty())
+ if (Node* root = highestEditableRoot(selection.start())) {
+ if (!root->hasChildren())
return false;
// TODO(amaralp): Return false if already fully selected.
}
- // TODO(amaralp): Support contentEditable.
// TODO(amaralp): Address user-select handling.
return true;
}

Powered by Google App Engine
This is Rietveld 408576698