From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 35 +++++++++++++++++++++++++++++++---- dlls/mshtml/tests/dom.js | 4 ++++ 2 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index b9f0c71b13c..c77a9b848e6 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -970,15 +970,42 @@ static HRESULT WINAPI HTMLDocument_get_linkColor(IHTMLDocument2 *iface, VARIANT static HRESULT WINAPI HTMLDocument_put_vlinkColor(IHTMLDocument2 *iface, VARIANT v) { HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; + nsAString nsstr; + nsresult nsres; + HRESULT hres; + + TRACE("(%p)->(%s)\n", This, debugstr_variant(&v)); + + if(!This->html_document) { + FIXME("Not implemented for XML document\n"); + return E_NOTIMPL; + } + + hres = variant_to_nsstr(&v, FALSE, &nsstr); + if(FAILED(hres)) + return hres; + + nsres = nsIDOMHTMLDocument_SetVlinkColor(This->html_document, &nsstr); + nsAString_Finish(&nsstr); + return map_nsresult(nsres); }
static HRESULT WINAPI HTMLDocument_get_vlinkColor(IHTMLDocument2 *iface, VARIANT *p) { HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsAString nsstr; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + if(!This->html_document) { + FIXME("Not implemented for XML document\n"); + return E_NOTIMPL; + } + + nsAString_Init(&nsstr, NULL); + nsres = nsIDOMHTMLDocument_GetVlinkColor(This->html_document, &nsstr); + return return_nsstr_variant(nsres, &nsstr, NSSTR_COLOR, p); }
static HRESULT WINAPI HTMLDocument_get_referrer(IHTMLDocument2 *iface, BSTR *p) diff --git a/dlls/mshtml/tests/dom.js b/dlls/mshtml/tests/dom.js index dca41f60173..fd4c803893c 100644 --- a/dlls/mshtml/tests/dom.js +++ b/dlls/mshtml/tests/dom.js @@ -395,6 +395,10 @@ sync_test("document_style_props", function() { ok(document.linkColor === "#deadb8", "linkColor = " + document.linkColor); r = window.getComputedStyle(elem).color; ok(r === "rgb(222, 173, 184)", "style color = " + r); + + ok(document.vLinkColor === undefined, "default vLinkColor = " + document.vLinkColor); + document.vLinkColor = "#b8dead"; + ok(document.vLinkColor === "#b8dead", "vLinkColor = " + document.vLinkColor); });
sync_test("style_properties", function() {