diff --git a/dlls/mshtml/htmlstylesheet.c b/dlls/mshtml/htmlstylesheet.c index 4b4308238a4..a1669c1b797 100644 --- a/dlls/mshtml/htmlstylesheet.c +++ b/dlls/mshtml/htmlstylesheet.c @@ -552,8 +552,14 @@ static HRESULT WINAPI HTMLStyleSheet_put_href(IHTMLStyleSheet *iface, BSTR v) static HRESULT WINAPI HTMLStyleSheet_get_href(IHTMLStyleSheet *iface, BSTR *p) { HTMLStyleSheet *This = impl_from_IHTMLStyleSheet(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsAString href_str; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsAString_Init(&href_str, NULL); + nsres = nsIDOMCSSStyleSheet_GetHref(This->nsstylesheet, &href_str); + return return_nsstr(nsres, &href_str, p); } static HRESULT WINAPI HTMLStyleSheet_get_type(IHTMLStyleSheet *iface, BSTR *p) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 2b2eea52674..892e8122ff0 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -5958,6 +5958,7 @@ static void test_stylesheet(IDispatch *disp) IHTMLStyleSheetRulesCollection *col = NULL; IHTMLStyleSheet *stylesheet; HRESULT hres; + BSTR href; test_disp2((IUnknown*)disp, &DIID_DispHTMLStyleSheet, &IID_IHTMLStyleSheet, "[object]"); @@ -5967,8 +5968,14 @@ static void test_stylesheet(IDispatch *disp) hres = IHTMLStyleSheet_get_rules(stylesheet, &col); ok(hres == S_OK, "get_rules failed: %08x\n", hres); ok(col != NULL, "col == NULL\n"); - IHTMLStyleSheetRulesCollection_Release(col); + + href = (void*)0xdeadbeef; + hres = IHTMLStyleSheet_get_href(stylesheet, &href); + ok(hres == S_OK, "get_href failed: %08x\n", hres); + ok(href == NULL, "got href != NULL\n"); + SysFreeString(href); + IHTMLStyleSheet_Release(stylesheet); }