Commit d5a6064e 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: http://svn.webkit.org/repository/webkit/trunk@83229 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6e34f5e0
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>
Revert ENABLE_TRACK patch due to compile failures.
......
......@@ -43,12 +43,16 @@ typedef uint32_t WKViewUndoType;
typedef void (*WKViewRegisterEditCommandCallback)(WKViewRef, WKEditCommandRef, WKViewUndoType undoOrRedo, 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 {
int version;
const void * clientInfo;
WKViewRegisterEditCommandCallback registerEditCommand;
WKViewClearAllEditCommandsCallback clearAllEditCommands;
WKViewCanUndoRedoCallback canUndoRedo;
WKViewExecuteUndoRedoCallback executeUndoRedo;
};
typedef struct WKViewUndoClient WKViewUndoClient;
......
......@@ -49,5 +49,21 @@ void WebUndoClient::clearAllEditCommands(WebView* view)
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
......@@ -39,6 +39,8 @@ class WebUndoClient : public APIClient<WKViewUndoClient> {
public:
void registerEditCommand(WebView*, PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo);
void clearAllEditCommands(WebView*);
bool canUndoRedo(WebView*, WebPageProxy::UndoOrRedo);
void executeUndoRedo(WebView*, WebPageProxy::UndoOrRedo);
};
} // namespace WebKit
......
......@@ -1051,13 +1051,14 @@ void WebView::clearAllEditCommands()
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)
......
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