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

Unified Diff: webkit/glue/webframe_impl.cc

Issue 254002: Fix cmd-up/cmd-down. (Closed)
Patch Set: Fix typo found by suzhe Created 11 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
Index: webkit/glue/webframe_impl.cc
diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc
index 68c688282ba756e7e3d4cd821498d65ca9ed7a12..e49fed8bdd6e2975b83ff11038a2d5fc9917534e 100644
--- a/webkit/glue/webframe_impl.cc
+++ b/webkit/glue/webframe_impl.cc
@@ -121,6 +121,7 @@ MSVC_PUSH_WARNING_LEVEL(0);
#include "ScriptSourceCode.h"
#include "ScriptValue.h"
#include "ScrollbarTheme.h"
+#include "ScrollTypes.h"
#include "SelectionController.h"
#include "Settings.h"
#include "SkiaUtils.h"
@@ -1011,8 +1012,22 @@ bool WebFrameImpl::executeCommand(const WebString& name) {
bool WebFrameImpl::executeCommand(const WebString& name,
const WebString& value) {
ASSERT(frame());
- return frame()->editor()->command(webkit_glue::WebStringToString(name)).
- execute(webkit_glue::WebStringToString(value));
+ WebCore::String web_name = webkit_glue::WebStringToString(name);
+
+ // moveToBeginningOfDocument and moveToEndfDocument are only handled by WebKit
+ // for editable nodes.
jeremy 2009/09/29 18:12:56 hbono had quite alot to say about this, could you
Nico 2009/09/30 03:51:35 Not sure what you're after…he suggested that we sh
+ if (!frame()->editor()->canEdit() &&
+ web_name == "moveToBeginningOfDocument") {
+ return GetWebViewImpl()->PropagateScroll(WebCore::ScrollUp,
+ WebCore::ScrollByDocument);
+ } else if (!frame()->editor()->canEdit() &&
+ web_name == "moveToEndOfDocument") {
+ return GetWebViewImpl()->PropagateScroll(WebCore::ScrollDown,
+ WebCore::ScrollByDocument);
+ } else {
+ return frame()->editor()->command(web_name).
+ execute(webkit_glue::WebStringToString(value));
+ }
}
bool WebFrameImpl::isCommandEnabled(const WebString& name) const {

Powered by Google App Engine
This is Rietveld 408576698