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 | 12 ++++++++++++ 2 files changed, 43 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 53b9c01bcba..b9f0c71b13c 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -929,15 +929,42 @@ static HRESULT WINAPI HTMLDocument_get_fgColor(IHTMLDocument2 *iface, VARIANT *p static HRESULT WINAPI HTMLDocument_put_linkColor(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_SetLinkColor(This->html_document, &nsstr); + nsAString_Finish(&nsstr); + return map_nsresult(nsres); }
static HRESULT WINAPI HTMLDocument_get_linkColor(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_GetLinkColor(This->html_document, &nsstr); + return return_nsstr_variant(nsres, &nsstr, NSSTR_COLOR, p); }
static HRESULT WINAPI HTMLDocument_put_vlinkColor(IHTMLDocument2 *iface, VARIANT v) diff --git a/dlls/mshtml/tests/dom.js b/dlls/mshtml/tests/dom.js index 46dc239c3eb..dca41f60173 100644 --- a/dlls/mshtml/tests/dom.js +++ b/dlls/mshtml/tests/dom.js @@ -385,6 +385,18 @@ sync_test("document_owner", function() { ok(node.ownerDocument === document, "text.ownerDocument = " + node.ownerDocument); });
+sync_test("document_style_props", function() { + document.body.innerHTML = '<a href="#"></a>'; + var r, elem = document.getElementsByTagName("a")[0]; + todo_wine. + ok(document.linkColor === "#0000ff", "default linkColor = " + document.linkColor); + + document.linkColor = "#deadb8"; + ok(document.linkColor === "#deadb8", "linkColor = " + document.linkColor); + r = window.getComputedStyle(elem).color; + ok(r === "rgb(222, 173, 184)", "style color = " + r); +}); + sync_test("style_properties", function() { document.body.innerHTML = '<div>test</div><svg></svg>'; var elem = document.body.firstChild;