Chromium Code Reviews| 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 { |