Module: wine Branch: master Commit: 069d5de90af595f75272f2e446c3f16ccf25ff4e URL: https://source.winehq.org/git/wine.git/?a=commit;h=069d5de90af595f75272f2e44...
Author: Jacek Caban jacek@codeweavers.com Date: Tue Mar 26 17:26:36 2019 +0100
mshtml: Add IHTMLCSSStyleDeclaration::getPropertyValue implementation.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/mshtml/htmlstyle.c | 16 +++++++++++++--- dlls/mshtml/tests/elements.js | 8 ++++++++ 2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 5e2d68a..88dd4a3 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -4989,11 +4989,21 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_get_parentRule(IHTMLCSSStyleDeclar return E_NOTIMPL; }
-static HRESULT WINAPI HTMLCSSStyleDeclaration_getPropertyValue(IHTMLCSSStyleDeclaration *iface, BSTR bstrPropertyName, BSTR *pbstrPropertyValue) +static HRESULT WINAPI HTMLCSSStyleDeclaration_getPropertyValue(IHTMLCSSStyleDeclaration *iface, BSTR name, BSTR *value) { CSSStyle *This = impl_from_IHTMLCSSStyleDeclaration(iface); - FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrPropertyName), pbstrPropertyValue); - return E_NOTIMPL; + const style_tbl_entry_t *style_entry; + nsAString name_str, value_str; + nsresult nsres; + + TRACE("(%p)->(%s %p)\n", This, debugstr_w(name), value); + + style_entry = lookup_style_tbl(name); + nsAString_InitDepend(&name_str, style_entry ? style_entry->name : name); + nsAString_InitDepend(&value_str, NULL); + nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(This->nsstyle, &name_str, &value_str); + nsAString_Finish(&name_str); + return return_nsstr(nsres, &value_str, value); }
static HRESULT WINAPI HTMLCSSStyleDeclaration_getPropertyPriority(IHTMLCSSStyleDeclaration *iface, BSTR bstrPropertyName, BSTR *pbstrPropertyPriority) diff --git a/dlls/mshtml/tests/elements.js b/dlls/mshtml/tests/elements.js index b23f5c1..188a277 100644 --- a/dlls/mshtml/tests/elements.js +++ b/dlls/mshtml/tests/elements.js @@ -238,6 +238,10 @@ function test_style_properties() {
style.cssFloat = "left"; ok(style.cssFloat === "left", "cssFloat = " + style.cssFloat); + ok(style.getPropertyValue("float") === "left", + 'style.getPropertyValue("float") = ' + style.getPropertyValue("float")); + ok(style.getPropertyValue("cssFloat") === "", + 'style.getPropertyValue("cssFloat") = ' + style.getPropertyValue("cssFloat"));
val = style.removeProperty("float"); ok(val === "left", "removeProperty() returned " + val); @@ -262,6 +266,10 @@ function test_style_properties() { style["z-index"] = 1; ok(style.zIndex === 1, "zIndex = " + style.zIndex); ok(style["z-index"] === 1, "z-index = " + style["z-index"]); + ok(style.getPropertyValue("z-index") === "1", + 'style.getPropertyValue("x-index") = ' + style.getPropertyValue("z-index")); + ok(style.getPropertyValue("zIndex") === "", + 'style.getPropertyValue("xIndex") = ' + style.getPropertyValue("zIndex"));
style.setProperty("border-width", "5px"); ok(style.borderWidth === "5px", "style.borderWidth = " + style.borderWidth);