From e51ece778fcef338b62f4634343f8b9b78778b27 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 16 Feb 2017 16:35:37 +0100 Subject: [PATCH] mshtml: Added IHTMLDocument4::onselectionchange property implementation. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/mshtml/htmldoc.c | 12 ++++++++---- dlls/mshtml/htmlevent.c | 5 +++++ dlls/mshtml/htmlevent.h | 1 + 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 9ef11e9699b..3241c6a4f93 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -2624,15 +2624,19 @@ static HRESULT WINAPI HTMLDocument4_hasFocus(IHTMLDocument4 *iface, VARIANT_BOOL static HRESULT WINAPI HTMLDocument4_put_onselectionchange(IHTMLDocument4 *iface, VARIANT v) { HTMLDocument *This = impl_from_IHTMLDocument4(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; + + TRACE("(%p)->(%s)\n", This, debugstr_variant(&v)); + + return set_doc_event(This, EVENTID_SELECTIONCHANGE, &v); } static HRESULT WINAPI HTMLDocument4_get_onselectionchange(IHTMLDocument4 *iface, VARIANT *p) { HTMLDocument *This = impl_from_IHTMLDocument4(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + return get_doc_event(This, EVENTID_SELECTIONCHANGE, p); } static HRESULT WINAPI HTMLDocument4_get_namespace(IHTMLDocument4 *iface, IDispatch **p) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index 57c13c69b5c..77c998fac7e 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -139,6 +139,9 @@ static const WCHAR onscrollW[] = {'o','n','s','c','r','o','l','l',0}; static const WCHAR selectstartW[] = {'s','e','l','e','c','t','s','t','a','r','t',0}; static const WCHAR onselectstartW[] = {'o','n','s','e','l','e','c','t','s','t','a','r','t',0}; +static const WCHAR selectionchangeW[] = {'s','e','l','e','c','t','i','o','n','c','h','a','n','g','e',0}; +static const WCHAR onselectionchangeW[] = {'o','n','s','e','l','e','c','t','i','o','n','c','h','a','n','g','e',0}; + static const WCHAR submitW[] = {'s','u','b','m','i','t',0}; static const WCHAR onsubmitW[] = {'o','n','s','u','b','m','i','t',0}; @@ -242,6 +245,8 @@ static const event_info_t event_info[] = { EVENT_DEFAULTLISTENER|EVENT_BUBBLE}, {scrollW, onscrollW, EVENTT_HTML, DISPID_EVMETH_ONSCROLL, EVENT_DEFAULTLISTENER|EVENT_BUBBLE}, + {selectionchangeW, onselectionchangeW, EVENTT_NONE, DISPID_EVMETH_ONSELECTSTART, + EVENT_FIXME}, {selectstartW, onselectstartW, EVENTT_MOUSE, DISPID_EVMETH_ONSELECTSTART, EVENT_CANCELABLE}, {submitW, onsubmitW, EVENTT_HTML, DISPID_EVMETH_ONSUBMIT, diff --git a/dlls/mshtml/htmlevent.h b/dlls/mshtml/htmlevent.h index 8844eb3b1bf..b88f32f359b 100644 --- a/dlls/mshtml/htmlevent.h +++ b/dlls/mshtml/htmlevent.h @@ -48,6 +48,7 @@ typedef enum { EVENTID_READYSTATECHANGE, EVENTID_RESIZE, EVENTID_SCROLL, + EVENTID_SELECTIONCHANGE, EVENTID_SELECTSTART, EVENTID_SUBMIT, EVENTID_UNLOAD,