Commit ac32debd authored by enrica@apple.com's avatar enrica@apple.com

REGRESSION(WebKit2): execCommand('undo') doesn't work (Windows).

https://bugs.webkit.org/show_bug.cgi?id=58056
<rdar://problem/8862023>
        
Reviewed by Oliver Hunt.

Adding support for execCommand('undo') and execCommand('redo')
in WebKit2 for Windows.

* UIProcess/API/C/win/WKView.h:
* UIProcess/win/WebUndoClient.cpp:
(WebKit::WebUndoClient::canUndoRedo):
(WebKit::WebUndoClient::executeUndoRedo):
* UIProcess/win/WebUndoClient.h:
* UIProcess/win/WebView.cpp:
(WebKit::WebView::canUndoRedo):
(WebKit::WebView::executeUndoRedo):



git-svn-id: svn://svn.chromium.org/blink/trunk@83229 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 84186239
2011-04-07 Enrica Casucci <enrica@apple.com>
Reviewed by Oliver Hunt.
REGRESSION(WebKit2): execCommand('undo') doesn't work (Windows).
https://bugs.webkit.org/show_bug.cgi?id=58056
<rdar://problem/8862023>
Adding support for execCommand('undo') and execCommand('redo')
in WebKit2 for Windows.
* UIProcess/API/C/win/WKView.h:
* UIProcess/win/WebUndoClient.cpp:
(WebKit::WebUndoClient::canUndoRedo):
(WebKit::WebUndoClient::executeUndoRedo):
* UIProcess/win/WebUndoClient.h:
* UIProcess/win/WebView.cpp:
(WebKit::WebView::canUndoRedo):
(WebKit::WebView::executeUndoRedo):
2011-04-07 Andrew Scherkus <scherkus@chromium.org> 2011-04-07 Andrew Scherkus <scherkus@chromium.org>
Revert ENABLE_TRACK patch due to compile failures. Revert ENABLE_TRACK patch due to compile failures.
......
...@@ -43,12 +43,16 @@ typedef uint32_t WKViewUndoType; ...@@ -43,12 +43,16 @@ typedef uint32_t WKViewUndoType;
typedef void (*WKViewRegisterEditCommandCallback)(WKViewRef, WKEditCommandRef, WKViewUndoType undoOrRedo, const void *clientInfo); typedef void (*WKViewRegisterEditCommandCallback)(WKViewRef, WKEditCommandRef, WKViewUndoType undoOrRedo, const void *clientInfo);
typedef void (*WKViewClearAllEditCommandsCallback)(WKViewRef, const void *clientInfo); typedef void (*WKViewClearAllEditCommandsCallback)(WKViewRef, const void *clientInfo);
typedef bool (*WKViewCanUndoRedoCallback)(WKViewRef, WKViewUndoType undoOrRedo, const void *clientInfo);
typedef void (*WKViewExecuteUndoRedoCallback)(WKViewRef, WKViewUndoType undoOrRedo, const void *clientInfo);
struct WKViewUndoClient { struct WKViewUndoClient {
int version; int version;
const void * clientInfo; const void * clientInfo;
WKViewRegisterEditCommandCallback registerEditCommand; WKViewRegisterEditCommandCallback registerEditCommand;
WKViewClearAllEditCommandsCallback clearAllEditCommands; WKViewClearAllEditCommandsCallback clearAllEditCommands;
WKViewCanUndoRedoCallback canUndoRedo;
WKViewExecuteUndoRedoCallback executeUndoRedo;
}; };
typedef struct WKViewUndoClient WKViewUndoClient; typedef struct WKViewUndoClient WKViewUndoClient;
......
...@@ -49,5 +49,21 @@ void WebUndoClient::clearAllEditCommands(WebView* view) ...@@ -49,5 +49,21 @@ void WebUndoClient::clearAllEditCommands(WebView* view)
m_client.clearAllEditCommands(toAPI(view), m_client.clientInfo); m_client.clearAllEditCommands(toAPI(view), m_client.clientInfo);
} }
bool WebUndoClient::canUndoRedo(WebView* view, WebPageProxy::UndoOrRedo undoOrRedo)
{
if (!m_client.canUndoRedo)
return false;
return m_client.canUndoRedo(toAPI(view), undoOrRedo, m_client.clientInfo);
}
void WebUndoClient::executeUndoRedo(WebView* view, WebPageProxy::UndoOrRedo undoOrRedo)
{
if (!m_client.executeUndoRedo)
return;
m_client.executeUndoRedo(toAPI(view), undoOrRedo, m_client.clientInfo);
}
} // namespace WebKit } // namespace WebKit
...@@ -39,6 +39,8 @@ class WebUndoClient : public APIClient<WKViewUndoClient> { ...@@ -39,6 +39,8 @@ class WebUndoClient : public APIClient<WKViewUndoClient> {
public: public:
void registerEditCommand(WebView*, PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo); void registerEditCommand(WebView*, PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo);
void clearAllEditCommands(WebView*); void clearAllEditCommands(WebView*);
bool canUndoRedo(WebView*, WebPageProxy::UndoOrRedo);
void executeUndoRedo(WebView*, WebPageProxy::UndoOrRedo);
}; };
} // namespace WebKit } // namespace WebKit
......
...@@ -1051,13 +1051,14 @@ void WebView::clearAllEditCommands() ...@@ -1051,13 +1051,14 @@ void WebView::clearAllEditCommands()
m_undoClient.clearAllEditCommands(this); m_undoClient.clearAllEditCommands(this);
} }
bool WebView::canUndoRedo(WebPageProxy::UndoOrRedo) bool WebView::canUndoRedo(WebPageProxy::UndoOrRedo undoOrRedo)
{ {
return false; return m_undoClient.canUndoRedo(this, undoOrRedo);
} }
void WebView::executeUndoRedo(WebPageProxy::UndoOrRedo) void WebView::executeUndoRedo(WebPageProxy::UndoOrRedo undoOrRedo)
{ {
m_undoClient.executeUndoRedo(this, undoOrRedo);
} }
void WebView::reapplyEditCommand(WebEditCommandProxy* command) void WebView::reapplyEditCommand(WebEditCommandProxy* command)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment