Hi Hans,
On 10/13/14 13:56, Hans Leidekker wrote:
> HRESULT go_back(DocHost *This)
> {
> + HRESULT hres;
> +
> if(!This->travellog.position) {
> WARN("No history available\n");
> return E_FAIL;
> }
>
> - return navigate_history(This, This->travellog.position-1);
> + hres = navigate_history(This, This->travellog.position-1);
> + if(SUCCEEDED(hres))
> + on_commandstate_change(This, CSC_NAVIGATEFORWARD, VARIANT_TRUE);
We probably shouldn't call this notification if forward navigation was
already possible before the call. Also, if we reach the bottom of
history stack, we should also probably notify that back navigation is no
longer possible. It would be more generic and easier to get right if you
did that in navigate_history, based on previous and current history
position.
> HRESULT get_location_url(DocHost *This, BSTR *ret)
> diff --git a/dlls/ieframe/tests/webbrowser.c b/dlls/ieframe/tests/webbrowser.c
> index fa37169..238b6de 100644
> --- a/dlls/ieframe/tests/webbrowser.c
> +++ b/dlls/ieframe/tests/webbrowser.c
> @@ -3022,7 +3022,7 @@ static void test_go_back(IWebBrowser2 *wb, const char *back_url)
> hres = IWebBrowser2_GoBack(wb);
> ok(hres == S_OK, "GoBack failed: %08x\n", hres);
> CHECK_CALLED(Invoke_BEFORENAVIGATE2);
> - todo_wine CHECK_CALLED(Invoke_COMMANDSTATECHANGE);
> + CHECK_CALLED(Invoke_COMMANDSTATECHANGE);
> CLEAR_CALLED(Invoke_PROPERTYCHANGE); /* called by IE11 */
> }
>
> @@ -3038,7 +3038,7 @@ static void test_go_forward(IWebBrowser2 *wb, const char *forward_url)
> hres = IWebBrowser2_GoForward(wb);
> ok(hres == S_OK, "GoForward failed: %08x\n", hres);
> CHECK_CALLED(Invoke_BEFORENAVIGATE2);
> - todo_wine CHECK_CALLED(Invoke_COMMANDSTATECHANGE);
> + CHECK_CALLED(Invoke_COMMANDSTATECHANGE);
>
I would be nice to have those tests stricter. For example, by checking
command in COMMANDSTATECHANGE notification and have separated
Invoke_COMMANDSTATECHANGE_NAVIGATEFORWARD and
Invoke_COMMANDSTATECHANGE_NAVIGATEBACK.
Thanks,
Jacek