Module: wine Branch: master Commit: d66dacce6847cd80091cd87038d3fde30eeb5cd3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d66dacce6847cd80091cd87038...
Author: Jacek Caban jacek@codeweavers.com Date: Wed Apr 18 15:26:12 2012 +0200
mshtml: Copy filter value in HTMLElement_clone.
---
dlls/mshtml/htmlelem.c | 10 +++++++++- dlls/mshtml/tests/jstest.html | 12 ++++++++++++ 2 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 02a49d2..9184b9b 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -269,7 +269,7 @@ static HRESULT WINAPI HTMLElement_setAttribute(IHTMLElement *iface, BSTR strAttr DISPPARAMS dispParams; EXCEPINFO excep;
- TRACE("(%p)->(%s . %08x)\n", This, debugstr_w(strAttributeName), lFlags); + TRACE("(%p)->(%s %s %08x)\n", This, debugstr_w(strAttributeName), debugstr_variant(&AttributeValue), lFlags);
hres = IDispatchEx_GetDispID(&This->node.dispex.IDispatchEx_iface, strAttributeName, fdexNameCaseInsensitive | fdexNameEnsure, &dispid); @@ -1627,6 +1627,14 @@ HRESULT HTMLElement_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode ** if(FAILED(hres)) return hres;
+ if(This->filter) { + new_elem->filter = heap_strdupW(This->filter); + if(!new_elem->filter) { + IHTMLElement_Release(&This->IHTMLElement_iface); + return E_OUTOFMEMORY; + } + } + IHTMLElement_AddRef(&new_elem->IHTMLElement_iface); *ret = &new_elem->node; return S_OK; diff --git a/dlls/mshtml/tests/jstest.html b/dlls/mshtml/tests/jstest.html index 10863f4..e61ee85 100644 --- a/dlls/mshtml/tests/jstest.html +++ b/dlls/mshtml/tests/jstest.html @@ -80,6 +80,17 @@ function test_remove_style_attribute() { ok(b === false, "removeAttribute returned " + b + " expected false"); }
+function test_clone_node() { + var elem, cloned; + + elem = document.getElementById("divid"); + elem.style.filter = "alpha(opacity=50)"; + ok(elem.style.filter === "alpha(opacity=50)", "elem.style.filter = " + elem.style.filter); + + cloned = elem.cloneNode(true); + ok(cloned.style.filter === "alpha(opacity=50)", "cloned.style.filter = " + cloned.style.filter); +} + var globalVar = false;
function runTest() { @@ -91,6 +102,7 @@ function runTest() { test_removeAttribute(document.getElementById("divid")); test_removeAttribute(document.body); test_select_index(); + test_clone_node(); test_createDocumentFragment(); test_document_name_as_index(); test_remove_style_attribute();