Jacek Caban : mshtml: Add IHTMLStyleSheet4::insertRule implementation.

Alexandre Julliard julliard at winehq.org
Wed Apr 7 15:48:29 CDT 2021


Module: wine
Branch: master
Commit: 9756574f884dbbc556f156f71c406e465cf9808c
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=9756574f884dbbc556f156f71c406e465cf9808c

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Apr  7 00:24:23 2021 +0200

mshtml: Add IHTMLStyleSheet4::insertRule implementation.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mshtml/htmlstylesheet.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/dlls/mshtml/htmlstylesheet.c b/dlls/mshtml/htmlstylesheet.c
index 321c1ae94a5..da9a1a0894a 100644
--- a/dlls/mshtml/htmlstylesheet.c
+++ b/dlls/mshtml/htmlstylesheet.c
@@ -1059,11 +1059,21 @@ static HRESULT WINAPI HTMLStyleSheet4_get_media(IHTMLStyleSheet4 *iface, VARIANT
     return E_NOTIMPL;
 }
 
-static HRESULT WINAPI HTMLStyleSheet4_insertRule(IHTMLStyleSheet4 *iface, BSTR rule, LONG index, LONG *new_index)
+static HRESULT WINAPI HTMLStyleSheet4_insertRule(IHTMLStyleSheet4 *iface, BSTR rule, LONG index, LONG *p)
 {
     HTMLStyleSheet *This = impl_from_IHTMLStyleSheet4(iface);
-    FIXME("(%p)->(%s %d %p)\n", This, debugstr_w(rule), index, new_index);
-    return E_NOTIMPL;
+    UINT32 new_index = 0;
+    nsAString nsstr;
+    nsresult nsres;
+
+    TRACE("(%p)->(%s %d %p)\n", This, debugstr_w(rule), index, p);
+
+    nsAString_InitDepend(&nsstr, rule);
+    nsres = nsIDOMCSSStyleSheet_InsertRule(This->nsstylesheet, &nsstr, index, &new_index);
+    if(NS_FAILED(nsres)) WARN("failed: %08x\n", nsres);
+    nsAString_Finish(&nsstr);
+    *p = new_index;
+    return map_nsresult(nsres);
 }
 
 static HRESULT WINAPI HTMLStyleSheet4_deleteRule(IHTMLStyleSheet4 *iface, LONG index)




More information about the wine-cvs mailing list