2 * Copyright 2006 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
32 #include "wine/debug.h"
33 #include "wine/unicode.h"
35 #include "mshtml_private.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
40 const IHTMLStyleSheetVtbl
*lpHTMLStyleSheetVtbl
;
44 nsIDOMCSSStyleSheet
*nsstylesheet
;
48 const IHTMLStyleSheetsCollectionVtbl
*lpHTMLStyleSheetsCollectionVtbl
;
52 nsIDOMStyleSheetList
*nslist
;
53 } HTMLStyleSheetsCollection
;
56 const IHTMLStyleSheetRulesCollectionVtbl
*lpHTMLStyleSheetRulesCollectionVtbl
;
60 nsIDOMCSSRuleList
*nslist
;
61 } HTMLStyleSheetRulesCollection
;
63 #define HTMLSTYLESHEET(x) ((IHTMLStyleSheet*) &(x)->lpHTMLStyleSheetVtbl);
64 #define HTMLSTYLESHEETSCOL(x) ((IHTMLStyleSheetsCollection*) &(x)->lpHTMLStyleSheetsCollectionVtbl);
65 #define HTMLSTYLERULESCOL(x) ((IHTMLStyleSheetRulesCollection*) &(x)->lpHTMLStyleSheetRulesCollectionVtbl)
67 #define HTMLSTYLERULESCOL_THIS(iface) \
68 DEFINE_THIS(HTMLStyleSheetRulesCollection, HTMLStyleSheetRulesCollection, iface)
70 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_QueryInterface(IHTMLStyleSheetRulesCollection
*iface
,
71 REFIID riid
, void **ppv
)
73 HTMLStyleSheetRulesCollection
*This
= HTMLSTYLERULESCOL_THIS(iface
);
75 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
76 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
77 *ppv
= HTMLSTYLERULESCOL(This
);
78 }else if(IsEqualGUID(&IID_IHTMLStyleSheetRulesCollection
, riid
)) {
79 TRACE("(%p)->(IID_IHTMLStyleSheetRulesCollection %p)\n", This
, ppv
);
80 *ppv
= HTMLSTYLERULESCOL(This
);
84 IUnknown_AddRef((IUnknown
*)*ppv
);
88 FIXME("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
92 static ULONG WINAPI
HTMLStyleSheetRulesCollection_AddRef(IHTMLStyleSheetRulesCollection
*iface
)
94 HTMLStyleSheetRulesCollection
*This
= HTMLSTYLERULESCOL_THIS(iface
);
95 LONG ref
= InterlockedIncrement(&This
->ref
);
97 TRACE("(%p) ref=%d\n", This
, ref
);
102 static ULONG WINAPI
HTMLStyleSheetRulesCollection_Release(IHTMLStyleSheetRulesCollection
*iface
)
104 HTMLStyleSheetRulesCollection
*This
= HTMLSTYLERULESCOL_THIS(iface
);
105 LONG ref
= InterlockedDecrement(&This
->ref
);
107 TRACE("(%p) ref=%d\n", This
, ref
);
111 nsIDOMCSSRuleList_Release(This
->nslist
);
118 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_GetTypeInfoCount(
119 IHTMLStyleSheetRulesCollection
*iface
, UINT
*pctinfo
)
121 HTMLStyleSheetRulesCollection
*This
= HTMLSTYLERULESCOL_THIS(iface
);
122 FIXME("(%p)->(%p)\n", This
, pctinfo
);
126 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_GetTypeInfo(IHTMLStyleSheetRulesCollection
*iface
,
127 UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
129 HTMLStyleSheetRulesCollection
*This
= HTMLSTYLERULESCOL_THIS(iface
);
130 FIXME("(%p)->(%u %u %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
134 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_GetIDsOfNames(IHTMLStyleSheetRulesCollection
*iface
,
135 REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
137 HTMLStyleSheetRulesCollection
*This
= HTMLSTYLERULESCOL_THIS(iface
);
138 FIXME("(%p)->(%s %p %u %u %p)\n", This
, debugstr_guid(riid
), rgszNames
, cNames
,
143 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_Invoke(IHTMLStyleSheetRulesCollection
*iface
,
144 DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
145 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
147 HTMLStyleSheetRulesCollection
*This
= HTMLSTYLERULESCOL_THIS(iface
);
148 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
149 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
153 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_get_length(IHTMLStyleSheetRulesCollection
*iface
,
156 HTMLStyleSheetRulesCollection
*This
= HTMLSTYLERULESCOL_THIS(iface
);
159 TRACE("(%p)->(%p)\n", This
, p
);
164 nsres
= nsIDOMCSSRuleList_GetLength(This
->nslist
, &len
);
166 ERR("GetLength failed: %08x\n", nsres
);
173 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_item(IHTMLStyleSheetRulesCollection
*iface
,
174 long index
, IHTMLStyleSheetRule
**ppHTMLStyleSheetRule
)
176 HTMLStyleSheetRulesCollection
*This
= HTMLSTYLERULESCOL_THIS(iface
);
177 FIXME("(%p)->(%ld %p)\n", This
, index
, ppHTMLStyleSheetRule
);
181 #undef HTMLSTYLERULECOL_THIS
183 static const IHTMLStyleSheetRulesCollectionVtbl HTMLStyleSheetRulesCollectionVtbl
= {
184 HTMLStyleSheetRulesCollection_QueryInterface
,
185 HTMLStyleSheetRulesCollection_AddRef
,
186 HTMLStyleSheetRulesCollection_Release
,
187 HTMLStyleSheetRulesCollection_GetTypeInfoCount
,
188 HTMLStyleSheetRulesCollection_GetTypeInfo
,
189 HTMLStyleSheetRulesCollection_GetIDsOfNames
,
190 HTMLStyleSheetRulesCollection_Invoke
,
191 HTMLStyleSheetRulesCollection_get_length
,
192 HTMLStyleSheetRulesCollection_item
195 static IHTMLStyleSheetRulesCollection
*HTMLStyleSheetRulesCollection_Create(nsIDOMCSSRuleList
*nslist
)
197 HTMLStyleSheetRulesCollection
*ret
;
199 ret
= heap_alloc(sizeof(*ret
));
200 ret
->lpHTMLStyleSheetRulesCollectionVtbl
= &HTMLStyleSheetRulesCollectionVtbl
;
202 ret
->nslist
= nslist
;
205 nsIDOMCSSRuleList_AddRef(nslist
);
207 return HTMLSTYLERULESCOL(ret
);
210 #define HTMLSTYLESHEETSCOL_THIS(iface) \
211 DEFINE_THIS(HTMLStyleSheetsCollection, HTMLStyleSheetsCollection, iface)
213 static HRESULT WINAPI
HTMLStyleSheetsCollection_QueryInterface(IHTMLStyleSheetsCollection
*iface
,
214 REFIID riid
, void **ppv
)
216 HTMLStyleSheetsCollection
*This
= HTMLSTYLESHEETSCOL_THIS(iface
);
220 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
221 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
222 *ppv
= HTMLSTYLESHEETSCOL(This
);
223 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
224 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
225 *ppv
= HTMLSTYLESHEETSCOL(This
);
226 }else if(IsEqualGUID(&IID_IHTMLStyleSheetsCollection
, riid
)) {
227 TRACE("(%p)->(IID_IHTMLStyleSheetsCollection %p)\n", This
, ppv
);
228 *ppv
= HTMLSTYLESHEETSCOL(This
);
232 IUnknown_AddRef((IUnknown
*)*ppv
);
236 WARN("unsupported %s\n", debugstr_guid(riid
));
237 return E_NOINTERFACE
;
240 static ULONG WINAPI
HTMLStyleSheetsCollection_AddRef(IHTMLStyleSheetsCollection
*iface
)
242 HTMLStyleSheetsCollection
*This
= HTMLSTYLESHEETSCOL_THIS(iface
);
243 LONG ref
= InterlockedIncrement(&This
->ref
);
245 TRACE("(%p) ref=%d\n", This
, ref
);
250 static ULONG WINAPI
HTMLStyleSheetsCollection_Release(IHTMLStyleSheetsCollection
*iface
)
252 HTMLStyleSheetsCollection
*This
= HTMLSTYLESHEETSCOL_THIS(iface
);
253 LONG ref
= InterlockedDecrement(&This
->ref
);
255 TRACE("(%p) ref=%d\n", This
, ref
);
259 nsIDOMStyleSheetList_Release(This
->nslist
);
266 static HRESULT WINAPI
HTMLStyleSheetsCollection_GetTypeInfoCount(IHTMLStyleSheetsCollection
*iface
,
269 HTMLStyleSheetsCollection
*This
= HTMLSTYLESHEETSCOL_THIS(iface
);
270 FIXME("(%p)->(%p)\n", This
, pctinfo
);
274 static HRESULT WINAPI
HTMLStyleSheetsCollection_GetTypeInfo(IHTMLStyleSheetsCollection
*iface
,
275 UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
277 HTMLStyleSheetsCollection
*This
= HTMLSTYLESHEETSCOL_THIS(iface
);
278 FIXME("(%p)->(%u %u %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
282 static HRESULT WINAPI
HTMLStyleSheetsCollection_GetIDsOfNames(IHTMLStyleSheetsCollection
*iface
,
283 REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
285 HTMLStyleSheetsCollection
*This
= HTMLSTYLESHEETSCOL_THIS(iface
);
286 FIXME("(%p)->(%s %p %u %u %p)\n", This
, debugstr_guid(riid
), rgszNames
, cNames
,
291 static HRESULT WINAPI
HTMLStyleSheetsCollection_Invoke(IHTMLStyleSheetsCollection
*iface
,
292 DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
293 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
295 HTMLStyleSheetsCollection
*This
= HTMLSTYLESHEETSCOL_THIS(iface
);
296 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
297 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
301 static HRESULT WINAPI
HTMLStyleSheetsCollection_get_length(IHTMLStyleSheetsCollection
*iface
,
304 HTMLStyleSheetsCollection
*This
= HTMLSTYLESHEETSCOL_THIS(iface
);
307 TRACE("(%p)->(%p)\n", This
, p
);
310 nsIDOMStyleSheetList_GetLength(This
->nslist
, &len
);
316 static HRESULT WINAPI
HTMLStyleSheetsCollection_get__newEnum(IHTMLStyleSheetsCollection
*iface
,
319 HTMLStyleSheetsCollection
*This
= HTMLSTYLESHEETSCOL_THIS(iface
);
320 FIXME("(%p)->(%p)\n", This
, p
);
324 static HRESULT WINAPI
HTMLStyleSheetsCollection_item(IHTMLStyleSheetsCollection
*iface
,
325 VARIANT
*pvarIndex
, VARIANT
*pvarResult
)
327 HTMLStyleSheetsCollection
*This
= HTMLSTYLESHEETSCOL_THIS(iface
);
329 TRACE("(%p)->(%p %p)\n", This
, pvarIndex
, pvarResult
);
331 switch(V_VT(pvarIndex
)) {
333 nsIDOMStyleSheet
*nsstylesheet
;
336 TRACE("index=%d\n", V_I4(pvarIndex
));
338 nsres
= nsIDOMStyleSheetList_Item(This
->nslist
, V_I4(pvarIndex
), &nsstylesheet
);
339 if(NS_FAILED(nsres
) || !nsstylesheet
) {
340 WARN("Item failed: %08x\n", nsres
);
341 V_VT(pvarResult
) = VT_EMPTY
;
345 V_VT(pvarResult
) = VT_DISPATCH
;
346 V_DISPATCH(pvarResult
) = (IDispatch
*)HTMLStyleSheet_Create(nsstylesheet
);
352 FIXME("id=%s not implemented\n", debugstr_w(V_BSTR(pvarResult
)));
356 WARN("Invalid vt=%d\n", V_VT(pvarIndex
));
362 #undef HTMLSTYLESHEETSCOL_THIS
364 static const IHTMLStyleSheetsCollectionVtbl HTMLStyleSheetsCollectionVtbl
= {
365 HTMLStyleSheetsCollection_QueryInterface
,
366 HTMLStyleSheetsCollection_AddRef
,
367 HTMLStyleSheetsCollection_Release
,
368 HTMLStyleSheetsCollection_GetTypeInfoCount
,
369 HTMLStyleSheetsCollection_GetTypeInfo
,
370 HTMLStyleSheetsCollection_GetIDsOfNames
,
371 HTMLStyleSheetsCollection_Invoke
,
372 HTMLStyleSheetsCollection_get_length
,
373 HTMLStyleSheetsCollection_get__newEnum
,
374 HTMLStyleSheetsCollection_item
377 IHTMLStyleSheetsCollection
*HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList
*nslist
)
379 HTMLStyleSheetsCollection
*ret
= heap_alloc(sizeof(HTMLStyleSheetsCollection
));
381 ret
->lpHTMLStyleSheetsCollectionVtbl
= &HTMLStyleSheetsCollectionVtbl
;
385 nsIDOMStyleSheetList_AddRef(nslist
);
386 ret
->nslist
= nslist
;
388 return HTMLSTYLESHEETSCOL(ret
);
391 #define HTMLSTYLESHEET_THIS(iface) DEFINE_THIS(HTMLStyleSheet, HTMLStyleSheet, iface)
393 static HRESULT WINAPI
HTMLStyleSheet_QueryInterface(IHTMLStyleSheet
*iface
, REFIID riid
, void **ppv
)
395 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
399 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
400 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
401 *ppv
= HTMLSTYLESHEET(This
);
402 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
403 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
404 *ppv
= HTMLSTYLESHEET(This
);
405 }else if(IsEqualGUID(&IID_IHTMLStyleSheet
, riid
)) {
406 TRACE("(%p)->(IID_IHTMLStyleSheet %p)\n", This
, ppv
);
407 *ppv
= HTMLSTYLESHEET(This
);
411 IUnknown_AddRef((IUnknown
*)*ppv
);
415 WARN("unsupported %s\n", debugstr_guid(riid
));
416 return E_NOINTERFACE
;
419 static ULONG WINAPI
HTMLStyleSheet_AddRef(IHTMLStyleSheet
*iface
)
421 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
422 LONG ref
= InterlockedIncrement(&This
->ref
);
424 TRACE("(%p) ref=%d\n", This
, ref
);
429 static ULONG WINAPI
HTMLStyleSheet_Release(IHTMLStyleSheet
*iface
)
431 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
432 LONG ref
= InterlockedDecrement(&This
->ref
);
434 TRACE("(%p) ref=%d\n", This
, ref
);
442 static HRESULT WINAPI
HTMLStyleSheet_GetTypeInfoCount(IHTMLStyleSheet
*iface
, UINT
*pctinfo
)
444 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
445 FIXME("(%p)->(%p)\n", This
, pctinfo
);
449 static HRESULT WINAPI
HTMLStyleSheet_GetTypeInfo(IHTMLStyleSheet
*iface
, UINT iTInfo
,
450 LCID lcid
, ITypeInfo
**ppTInfo
)
452 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
453 FIXME("(%p)->(%u %u %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
457 static HRESULT WINAPI
HTMLStyleSheet_GetIDsOfNames(IHTMLStyleSheet
*iface
, REFIID riid
,
458 LPOLESTR
*rgszNames
, UINT cNames
,
459 LCID lcid
, DISPID
*rgDispId
)
461 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
462 FIXME("(%p)->(%s %p %u %u %p)\n", This
, debugstr_guid(riid
), rgszNames
, cNames
,
467 static HRESULT WINAPI
HTMLStyleSheet_Invoke(IHTMLStyleSheet
*iface
, DISPID dispIdMember
,
468 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
469 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
471 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
472 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
473 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
477 static HRESULT WINAPI
HTMLStyleSheet_put_title(IHTMLStyleSheet
*iface
, BSTR v
)
479 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
480 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
484 static HRESULT WINAPI
HTMLStyleSheet_get_title(IHTMLStyleSheet
*iface
, BSTR
*p
)
486 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
487 FIXME("(%p)->(%p)\n", This
, p
);
491 static HRESULT WINAPI
HTMLStyleSheet_get_parentStyleSheet(IHTMLStyleSheet
*iface
,
494 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
495 FIXME("(%p)->(%p)\n", This
, p
);
499 static HRESULT WINAPI
HTMLStyleSheet_get_owningElement(IHTMLStyleSheet
*iface
, IHTMLElement
**p
)
501 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
502 FIXME("(%p)->(%p)\n", This
, p
);
506 static HRESULT WINAPI
HTMLStyleSheet_put_disabled(IHTMLStyleSheet
*iface
, VARIANT_BOOL v
)
508 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
509 FIXME("(%p)->(%x)\n", This
, v
);
513 static HRESULT WINAPI
HTMLStyleSheet_get_disabled(IHTMLStyleSheet
*iface
, VARIANT_BOOL
*p
)
515 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
516 FIXME("(%p)->(%p)\n", This
, p
);
520 static HRESULT WINAPI
HTMLStyleSheet_get_readOnly(IHTMLStyleSheet
*iface
, VARIANT_BOOL
*p
)
522 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
523 FIXME("(%p)->(%p)\n", This
, p
);
527 static HRESULT WINAPI
HTMLStyleSheet_get_imports(IHTMLStyleSheet
*iface
,
528 IHTMLStyleSheetsCollection
**p
)
530 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
531 FIXME("(%p)->(%p)\n", This
, p
);
535 static HRESULT WINAPI
HTMLStyleSheet_put_href(IHTMLStyleSheet
*iface
, BSTR v
)
537 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
538 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
542 static HRESULT WINAPI
HTMLStyleSheet_get_href(IHTMLStyleSheet
*iface
, BSTR
*p
)
544 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
545 FIXME("(%p)->(%p)\n", This
, p
);
549 static HRESULT WINAPI
HTMLStyleSheet_get_type(IHTMLStyleSheet
*iface
, BSTR
*p
)
551 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
552 FIXME("(%p)->(%p)\n", This
, p
);
556 static HRESULT WINAPI
HTMLStyleSheet_get_id(IHTMLStyleSheet
*iface
, BSTR
*p
)
558 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
559 FIXME("(%p)->(%p)\n", This
, p
);
563 static HRESULT WINAPI
HTMLStyleSheet_addImport(IHTMLStyleSheet
*iface
, BSTR bstrURL
,
564 long lIndex
, long *plIndex
)
566 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
567 FIXME("(%p)->(%s %ld %p)\n", This
, debugstr_w(bstrURL
), lIndex
, plIndex
);
571 static HRESULT WINAPI
HTMLStyleSheet_addRule(IHTMLStyleSheet
*iface
, BSTR bstrSelector
,
572 BSTR bstrStyle
, long lIndex
, long *plIndex
)
574 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
575 FIXME("(%p)->(%s %s %ld %p)\n", This
, debugstr_w(bstrSelector
), debugstr_w(bstrStyle
),
580 static HRESULT WINAPI
HTMLStyleSheet_removeImport(IHTMLStyleSheet
*iface
, long lIndex
)
582 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
583 FIXME("(%p)->(%ld)\n", This
, lIndex
);
587 static HRESULT WINAPI
HTMLStyleSheet_removeRule(IHTMLStyleSheet
*iface
, long lIndex
)
589 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
590 FIXME("(%p)->(%ld)\n", This
, lIndex
);
594 static HRESULT WINAPI
HTMLStyleSheet_put_media(IHTMLStyleSheet
*iface
, BSTR v
)
596 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
597 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
601 static HRESULT WINAPI
HTMLStyleSheet_get_media(IHTMLStyleSheet
*iface
, BSTR
*p
)
603 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
604 FIXME("(%p)->(%p)\n", This
, p
);
608 static HRESULT WINAPI
HTMLStyleSheet_put_cssText(IHTMLStyleSheet
*iface
, BSTR v
)
610 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
611 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
615 static HRESULT WINAPI
HTMLStyleSheet_get_cssText(IHTMLStyleSheet
*iface
, BSTR
*p
)
617 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
618 FIXME("(%p)->(%p)\n", This
, p
);
622 static HRESULT WINAPI
HTMLStyleSheet_get_rules(IHTMLStyleSheet
*iface
,
623 IHTMLStyleSheetRulesCollection
**p
)
625 HTMLStyleSheet
*This
= HTMLSTYLESHEET_THIS(iface
);
626 nsIDOMCSSRuleList
*nslist
= NULL
;
629 TRACE("(%p)->(%p)\n", This
, p
);
631 /* Gecko has buggy security checks and GetCssRules will fail. We have a correct
632 * implementation and it will work when the bug will be fixed in Gecko. */
633 nsres
= nsIDOMCSSStyleSheet_GetCssRules(This
->nsstylesheet
, &nslist
);
635 WARN("GetCssRules failed: %08x\n", nsres
);
637 *p
= HTMLStyleSheetRulesCollection_Create(nslist
);
641 static const IHTMLStyleSheetVtbl HTMLStyleSheetVtbl
= {
642 HTMLStyleSheet_QueryInterface
,
643 HTMLStyleSheet_AddRef
,
644 HTMLStyleSheet_Release
,
645 HTMLStyleSheet_GetTypeInfoCount
,
646 HTMLStyleSheet_GetTypeInfo
,
647 HTMLStyleSheet_GetIDsOfNames
,
648 HTMLStyleSheet_Invoke
,
649 HTMLStyleSheet_put_title
,
650 HTMLStyleSheet_get_title
,
651 HTMLStyleSheet_get_parentStyleSheet
,
652 HTMLStyleSheet_get_owningElement
,
653 HTMLStyleSheet_put_disabled
,
654 HTMLStyleSheet_get_disabled
,
655 HTMLStyleSheet_get_readOnly
,
656 HTMLStyleSheet_get_imports
,
657 HTMLStyleSheet_put_href
,
658 HTMLStyleSheet_get_href
,
659 HTMLStyleSheet_get_type
,
660 HTMLStyleSheet_get_id
,
661 HTMLStyleSheet_addImport
,
662 HTMLStyleSheet_addRule
,
663 HTMLStyleSheet_removeImport
,
664 HTMLStyleSheet_removeRule
,
665 HTMLStyleSheet_put_media
,
666 HTMLStyleSheet_get_media
,
667 HTMLStyleSheet_put_cssText
,
668 HTMLStyleSheet_get_cssText
,
669 HTMLStyleSheet_get_rules
672 IHTMLStyleSheet
*HTMLStyleSheet_Create(nsIDOMStyleSheet
*nsstylesheet
)
674 HTMLStyleSheet
*ret
= heap_alloc(sizeof(HTMLStyleSheet
));
677 ret
->lpHTMLStyleSheetVtbl
= &HTMLStyleSheetVtbl
;
679 ret
->nsstylesheet
= NULL
;
682 nsres
= nsIDOMStyleSheet_QueryInterface(nsstylesheet
, &IID_nsIDOMCSSStyleSheet
,
683 (void**)&ret
->nsstylesheet
);
685 ERR("Could not get nsICSSStyleSheet interface: %08x\n", nsres
);
688 return HTMLSTYLESHEET(ret
);