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

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

Issue 2787893004: Fixing select all for contenteditable (Closed)
Patch Set: rebase 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..041629aa382518fa40f0e4c05c257cd528b1b665 100644
--- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
@@ -2114,13 +2114,12 @@ 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 (selection.isContentEditable()) {
+ Node* root = highestEditableRoot(selection.start());
yosin_UTC9 2017/04/06 08:27:27 For safety, we would like to do null check for |ro
amaralp 2017/04/06 21:51:21 Done.
+ 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