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

Unified Diff: Source/core/editing/EditorCommand.cpp

Issue 1097693003: queryCommandSupported() should return 'true' for cut/copy/paste editing commands (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
« Source/core/editing/Editor.h ('K') | « Source/core/editing/Editor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/EditorCommand.cpp
diff --git a/Source/core/editing/EditorCommand.cpp b/Source/core/editing/EditorCommand.cpp
index 69e23abd25560ce05bbb70eb874db971de7a5d82..cdb82fdc73b6e7e769bd79d94e1538b3330c4556 100644
--- a/Source/core/editing/EditorCommand.cpp
+++ b/Source/core/editing/EditorCommand.cpp
@@ -1746,7 +1746,7 @@ bool Editor::Command::execute(Event* triggeringEvent) const
return execute(String(), triggeringEvent);
}
-bool Editor::Command::isSupported() const
+bool Editor::Command::isSupported(bool enabled) const
{
if (!m_command)
return false;
@@ -1754,7 +1754,7 @@ bool Editor::Command::isSupported() const
case CommandFromMenuOrKeyBinding:
return true;
case CommandFromDOM:
- return m_command->isSupportedFromDOM(m_frame.get());
+ return enabled ? m_command->isSupportedFromDOM(m_frame.get()) : true;
}
ASSERT_NOT_REACHED();
return false;
@@ -1762,7 +1762,7 @@ bool Editor::Command::isSupported() const
bool Editor::Command::isEnabled(Event* triggeringEvent) const
{
- if (!isSupported() || !m_frame)
+ if (!isSupported(true) || !m_frame)
return false;
return m_command->isEnabled(*m_frame, triggeringEvent, m_source);
}
« Source/core/editing/Editor.h ('K') | « Source/core/editing/Editor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698