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
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
34 struct HTMLStyleSheet
{
35 IHTMLStyleSheet IHTMLStyleSheet_iface
;
39 nsIDOMCSSStyleSheet
*nsstylesheet
;
42 struct HTMLStyleSheetsCollection
{
44 IHTMLStyleSheetsCollection IHTMLStyleSheetsCollection_iface
;
48 nsIDOMStyleSheetList
*nslist
;
51 struct HTMLStyleSheetRulesCollection
{
52 IHTMLStyleSheetRulesCollection IHTMLStyleSheetRulesCollection_iface
;
56 nsIDOMCSSRuleList
*nslist
;
59 static inline HTMLStyleSheetRulesCollection
*impl_from_IHTMLStyleSheetRulesCollection(IHTMLStyleSheetRulesCollection
*iface
)
61 return CONTAINING_RECORD(iface
, HTMLStyleSheetRulesCollection
, IHTMLStyleSheetRulesCollection_iface
);
64 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_QueryInterface(IHTMLStyleSheetRulesCollection
*iface
,
65 REFIID riid
, void **ppv
)
67 HTMLStyleSheetRulesCollection
*This
= impl_from_IHTMLStyleSheetRulesCollection(iface
);
69 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
70 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
71 *ppv
= &This
->IHTMLStyleSheetRulesCollection_iface
;
72 }else if(IsEqualGUID(&IID_IHTMLStyleSheetRulesCollection
, riid
)) {
73 TRACE("(%p)->(IID_IHTMLStyleSheetRulesCollection %p)\n", This
, ppv
);
74 *ppv
= &This
->IHTMLStyleSheetRulesCollection_iface
;
78 IUnknown_AddRef((IUnknown
*)*ppv
);
82 FIXME("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
86 static ULONG WINAPI
HTMLStyleSheetRulesCollection_AddRef(IHTMLStyleSheetRulesCollection
*iface
)
88 HTMLStyleSheetRulesCollection
*This
= impl_from_IHTMLStyleSheetRulesCollection(iface
);
89 LONG ref
= InterlockedIncrement(&This
->ref
);
91 TRACE("(%p) ref=%d\n", This
, ref
);
96 static ULONG WINAPI
HTMLStyleSheetRulesCollection_Release(IHTMLStyleSheetRulesCollection
*iface
)
98 HTMLStyleSheetRulesCollection
*This
= impl_from_IHTMLStyleSheetRulesCollection(iface
);
99 LONG ref
= InterlockedDecrement(&This
->ref
);
101 TRACE("(%p) ref=%d\n", This
, ref
);
105 nsIDOMCSSRuleList_Release(This
->nslist
);
112 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_GetTypeInfoCount(
113 IHTMLStyleSheetRulesCollection
*iface
, UINT
*pctinfo
)
115 HTMLStyleSheetRulesCollection
*This
= impl_from_IHTMLStyleSheetRulesCollection(iface
);
116 FIXME("(%p)->(%p)\n", This
, pctinfo
);
120 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_GetTypeInfo(IHTMLStyleSheetRulesCollection
*iface
,
121 UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
123 HTMLStyleSheetRulesCollection
*This
= impl_from_IHTMLStyleSheetRulesCollection(iface
);
124 FIXME("(%p)->(%u %u %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
128 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_GetIDsOfNames(IHTMLStyleSheetRulesCollection
*iface
,
129 REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
131 HTMLStyleSheetRulesCollection
*This
= impl_from_IHTMLStyleSheetRulesCollection(iface
);
132 FIXME("(%p)->(%s %p %u %u %p)\n", This
, debugstr_guid(riid
), rgszNames
, cNames
,
137 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_Invoke(IHTMLStyleSheetRulesCollection
*iface
,
138 DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
139 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
141 HTMLStyleSheetRulesCollection
*This
= impl_from_IHTMLStyleSheetRulesCollection(iface
);
142 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
143 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
147 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_get_length(IHTMLStyleSheetRulesCollection
*iface
,
150 HTMLStyleSheetRulesCollection
*This
= impl_from_IHTMLStyleSheetRulesCollection(iface
);
153 TRACE("(%p)->(%p)\n", This
, p
);
158 nsres
= nsIDOMCSSRuleList_GetLength(This
->nslist
, &len
);
160 ERR("GetLength failed: %08x\n", nsres
);
167 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_item(IHTMLStyleSheetRulesCollection
*iface
,
168 LONG index
, IHTMLStyleSheetRule
**ppHTMLStyleSheetRule
)
170 HTMLStyleSheetRulesCollection
*This
= impl_from_IHTMLStyleSheetRulesCollection(iface
);
171 FIXME("(%p)->(%d %p)\n", This
, index
, ppHTMLStyleSheetRule
);
175 static const IHTMLStyleSheetRulesCollectionVtbl HTMLStyleSheetRulesCollectionVtbl
= {
176 HTMLStyleSheetRulesCollection_QueryInterface
,
177 HTMLStyleSheetRulesCollection_AddRef
,
178 HTMLStyleSheetRulesCollection_Release
,
179 HTMLStyleSheetRulesCollection_GetTypeInfoCount
,
180 HTMLStyleSheetRulesCollection_GetTypeInfo
,
181 HTMLStyleSheetRulesCollection_GetIDsOfNames
,
182 HTMLStyleSheetRulesCollection_Invoke
,
183 HTMLStyleSheetRulesCollection_get_length
,
184 HTMLStyleSheetRulesCollection_item
187 static IHTMLStyleSheetRulesCollection
*HTMLStyleSheetRulesCollection_Create(nsIDOMCSSRuleList
*nslist
)
189 HTMLStyleSheetRulesCollection
*ret
;
191 ret
= heap_alloc(sizeof(*ret
));
192 ret
->IHTMLStyleSheetRulesCollection_iface
.lpVtbl
= &HTMLStyleSheetRulesCollectionVtbl
;
194 ret
->nslist
= nslist
;
197 nsIDOMCSSRuleList_AddRef(nslist
);
199 return &ret
->IHTMLStyleSheetRulesCollection_iface
;
202 static inline HTMLStyleSheetsCollection
*impl_from_IHTMLStyleSheetsCollection(IHTMLStyleSheetsCollection
*iface
)
204 return CONTAINING_RECORD(iface
, HTMLStyleSheetsCollection
, IHTMLStyleSheetsCollection_iface
);
207 static HRESULT WINAPI
HTMLStyleSheetsCollection_QueryInterface(IHTMLStyleSheetsCollection
*iface
,
208 REFIID riid
, void **ppv
)
210 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
214 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
215 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
216 *ppv
= &This
->IHTMLStyleSheetsCollection_iface
;
217 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
218 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
219 *ppv
= &This
->IHTMLStyleSheetsCollection_iface
;
220 }else if(IsEqualGUID(&IID_IHTMLStyleSheetsCollection
, riid
)) {
221 TRACE("(%p)->(IID_IHTMLStyleSheetsCollection %p)\n", This
, ppv
);
222 *ppv
= &This
->IHTMLStyleSheetsCollection_iface
;
223 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
224 return *ppv
? S_OK
: E_NOINTERFACE
;
228 IUnknown_AddRef((IUnknown
*)*ppv
);
232 WARN("unsupported %s\n", debugstr_guid(riid
));
233 return E_NOINTERFACE
;
236 static ULONG WINAPI
HTMLStyleSheetsCollection_AddRef(IHTMLStyleSheetsCollection
*iface
)
238 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
239 LONG ref
= InterlockedIncrement(&This
->ref
);
241 TRACE("(%p) ref=%d\n", This
, ref
);
246 static ULONG WINAPI
HTMLStyleSheetsCollection_Release(IHTMLStyleSheetsCollection
*iface
)
248 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
249 LONG ref
= InterlockedDecrement(&This
->ref
);
251 TRACE("(%p) ref=%d\n", This
, ref
);
255 nsIDOMStyleSheetList_Release(This
->nslist
);
262 static HRESULT WINAPI
HTMLStyleSheetsCollection_GetTypeInfoCount(IHTMLStyleSheetsCollection
*iface
,
265 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
266 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
269 static HRESULT WINAPI
HTMLStyleSheetsCollection_GetTypeInfo(IHTMLStyleSheetsCollection
*iface
,
270 UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
272 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
273 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
276 static HRESULT WINAPI
HTMLStyleSheetsCollection_GetIDsOfNames(IHTMLStyleSheetsCollection
*iface
,
277 REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
279 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
280 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
284 static HRESULT WINAPI
HTMLStyleSheetsCollection_Invoke(IHTMLStyleSheetsCollection
*iface
,
285 DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
286 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
288 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
289 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
290 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
293 static HRESULT WINAPI
HTMLStyleSheetsCollection_get_length(IHTMLStyleSheetsCollection
*iface
,
296 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
299 TRACE("(%p)->(%p)\n", This
, p
);
302 nsIDOMStyleSheetList_GetLength(This
->nslist
, &len
);
308 static HRESULT WINAPI
HTMLStyleSheetsCollection_get__newEnum(IHTMLStyleSheetsCollection
*iface
,
311 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
312 FIXME("(%p)->(%p)\n", This
, p
);
316 static HRESULT WINAPI
HTMLStyleSheetsCollection_item(IHTMLStyleSheetsCollection
*iface
,
317 VARIANT
*pvarIndex
, VARIANT
*pvarResult
)
319 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
321 TRACE("(%p)->(%p %p)\n", This
, pvarIndex
, pvarResult
);
323 switch(V_VT(pvarIndex
)) {
325 nsIDOMStyleSheet
*nsstylesheet
;
328 TRACE("index=%d\n", V_I4(pvarIndex
));
330 nsres
= nsIDOMStyleSheetList_Item(This
->nslist
, V_I4(pvarIndex
), &nsstylesheet
);
331 if(NS_FAILED(nsres
) || !nsstylesheet
) {
332 WARN("Item failed: %08x\n", nsres
);
333 V_VT(pvarResult
) = VT_EMPTY
;
337 V_VT(pvarResult
) = VT_DISPATCH
;
338 V_DISPATCH(pvarResult
) = (IDispatch
*)HTMLStyleSheet_Create(nsstylesheet
);
344 FIXME("id=%s not implemented\n", debugstr_w(V_BSTR(pvarResult
)));
348 WARN("Invalid vt=%d\n", V_VT(pvarIndex
));
354 static const IHTMLStyleSheetsCollectionVtbl HTMLStyleSheetsCollectionVtbl
= {
355 HTMLStyleSheetsCollection_QueryInterface
,
356 HTMLStyleSheetsCollection_AddRef
,
357 HTMLStyleSheetsCollection_Release
,
358 HTMLStyleSheetsCollection_GetTypeInfoCount
,
359 HTMLStyleSheetsCollection_GetTypeInfo
,
360 HTMLStyleSheetsCollection_GetIDsOfNames
,
361 HTMLStyleSheetsCollection_Invoke
,
362 HTMLStyleSheetsCollection_get_length
,
363 HTMLStyleSheetsCollection_get__newEnum
,
364 HTMLStyleSheetsCollection_item
367 static const tid_t HTMLStyleSheetsCollection_iface_tids
[] = {
368 IHTMLStyleSheetsCollection_tid
,
371 static dispex_static_data_t HTMLStyleSheetsCollection_dispex
= {
373 DispHTMLStyleSheetsCollection_tid
,
375 HTMLStyleSheetsCollection_iface_tids
378 IHTMLStyleSheetsCollection
*HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList
*nslist
)
380 HTMLStyleSheetsCollection
*ret
= heap_alloc(sizeof(HTMLStyleSheetsCollection
));
382 ret
->IHTMLStyleSheetsCollection_iface
.lpVtbl
= &HTMLStyleSheetsCollectionVtbl
;
386 nsIDOMStyleSheetList_AddRef(nslist
);
387 ret
->nslist
= nslist
;
389 init_dispex(&ret
->dispex
, (IUnknown
*)&ret
->IHTMLStyleSheetsCollection_iface
,
390 &HTMLStyleSheetsCollection_dispex
);
392 return &ret
->IHTMLStyleSheetsCollection_iface
;
395 static inline HTMLStyleSheet
*impl_from_IHTMLStyleSheet(IHTMLStyleSheet
*iface
)
397 return CONTAINING_RECORD(iface
, HTMLStyleSheet
, IHTMLStyleSheet_iface
);
400 static HRESULT WINAPI
HTMLStyleSheet_QueryInterface(IHTMLStyleSheet
*iface
, REFIID riid
, void **ppv
)
402 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
406 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
407 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
408 *ppv
= &This
->IHTMLStyleSheet_iface
;
409 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
410 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
411 *ppv
= &This
->IHTMLStyleSheet_iface
;
412 }else if(IsEqualGUID(&IID_IHTMLStyleSheet
, riid
)) {
413 TRACE("(%p)->(IID_IHTMLStyleSheet %p)\n", This
, ppv
);
414 *ppv
= &This
->IHTMLStyleSheet_iface
;
418 IUnknown_AddRef((IUnknown
*)*ppv
);
422 WARN("unsupported %s\n", debugstr_guid(riid
));
423 return E_NOINTERFACE
;
426 static ULONG WINAPI
HTMLStyleSheet_AddRef(IHTMLStyleSheet
*iface
)
428 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
429 LONG ref
= InterlockedIncrement(&This
->ref
);
431 TRACE("(%p) ref=%d\n", This
, ref
);
436 static ULONG WINAPI
HTMLStyleSheet_Release(IHTMLStyleSheet
*iface
)
438 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
439 LONG ref
= InterlockedDecrement(&This
->ref
);
441 TRACE("(%p) ref=%d\n", This
, ref
);
449 static HRESULT WINAPI
HTMLStyleSheet_GetTypeInfoCount(IHTMLStyleSheet
*iface
, UINT
*pctinfo
)
451 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
452 FIXME("(%p)->(%p)\n", This
, pctinfo
);
456 static HRESULT WINAPI
HTMLStyleSheet_GetTypeInfo(IHTMLStyleSheet
*iface
, UINT iTInfo
,
457 LCID lcid
, ITypeInfo
**ppTInfo
)
459 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
460 FIXME("(%p)->(%u %u %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
464 static HRESULT WINAPI
HTMLStyleSheet_GetIDsOfNames(IHTMLStyleSheet
*iface
, REFIID riid
,
465 LPOLESTR
*rgszNames
, UINT cNames
,
466 LCID lcid
, DISPID
*rgDispId
)
468 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
469 FIXME("(%p)->(%s %p %u %u %p)\n", This
, debugstr_guid(riid
), rgszNames
, cNames
,
474 static HRESULT WINAPI
HTMLStyleSheet_Invoke(IHTMLStyleSheet
*iface
, DISPID dispIdMember
,
475 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
476 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
478 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
479 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
480 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
484 static HRESULT WINAPI
HTMLStyleSheet_put_title(IHTMLStyleSheet
*iface
, BSTR v
)
486 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
487 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
491 static HRESULT WINAPI
HTMLStyleSheet_get_title(IHTMLStyleSheet
*iface
, BSTR
*p
)
493 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
494 FIXME("(%p)->(%p)\n", This
, p
);
498 static HRESULT WINAPI
HTMLStyleSheet_get_parentStyleSheet(IHTMLStyleSheet
*iface
,
501 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
502 FIXME("(%p)->(%p)\n", This
, p
);
506 static HRESULT WINAPI
HTMLStyleSheet_get_owningElement(IHTMLStyleSheet
*iface
, IHTMLElement
**p
)
508 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
509 FIXME("(%p)->(%p)\n", This
, p
);
513 static HRESULT WINAPI
HTMLStyleSheet_put_disabled(IHTMLStyleSheet
*iface
, VARIANT_BOOL v
)
515 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
516 FIXME("(%p)->(%x)\n", This
, v
);
520 static HRESULT WINAPI
HTMLStyleSheet_get_disabled(IHTMLStyleSheet
*iface
, VARIANT_BOOL
*p
)
522 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
523 FIXME("(%p)->(%p)\n", This
, p
);
527 static HRESULT WINAPI
HTMLStyleSheet_get_readOnly(IHTMLStyleSheet
*iface
, VARIANT_BOOL
*p
)
529 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
530 FIXME("(%p)->(%p)\n", This
, p
);
534 static HRESULT WINAPI
HTMLStyleSheet_get_imports(IHTMLStyleSheet
*iface
,
535 IHTMLStyleSheetsCollection
**p
)
537 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
538 FIXME("(%p)->(%p)\n", This
, p
);
542 static HRESULT WINAPI
HTMLStyleSheet_put_href(IHTMLStyleSheet
*iface
, BSTR v
)
544 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
545 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
549 static HRESULT WINAPI
HTMLStyleSheet_get_href(IHTMLStyleSheet
*iface
, BSTR
*p
)
551 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
552 FIXME("(%p)->(%p)\n", This
, p
);
556 static HRESULT WINAPI
HTMLStyleSheet_get_type(IHTMLStyleSheet
*iface
, BSTR
*p
)
558 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
559 FIXME("(%p)->(%p)\n", This
, p
);
563 static HRESULT WINAPI
HTMLStyleSheet_get_id(IHTMLStyleSheet
*iface
, BSTR
*p
)
565 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
566 FIXME("(%p)->(%p)\n", This
, p
);
570 static HRESULT WINAPI
HTMLStyleSheet_addImport(IHTMLStyleSheet
*iface
, BSTR bstrURL
,
571 LONG lIndex
, LONG
*plIndex
)
573 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
574 FIXME("(%p)->(%s %d %p)\n", This
, debugstr_w(bstrURL
), lIndex
, plIndex
);
578 static HRESULT WINAPI
HTMLStyleSheet_addRule(IHTMLStyleSheet
*iface
, BSTR bstrSelector
,
579 BSTR bstrStyle
, LONG lIndex
, LONG
*plIndex
)
581 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
582 FIXME("(%p)->(%s %s %d %p)\n", This
, debugstr_w(bstrSelector
), debugstr_w(bstrStyle
),
587 static HRESULT WINAPI
HTMLStyleSheet_removeImport(IHTMLStyleSheet
*iface
, LONG lIndex
)
589 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
590 FIXME("(%p)->(%d)\n", This
, lIndex
);
594 static HRESULT WINAPI
HTMLStyleSheet_removeRule(IHTMLStyleSheet
*iface
, LONG lIndex
)
596 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
597 FIXME("(%p)->(%d)\n", This
, lIndex
);
601 static HRESULT WINAPI
HTMLStyleSheet_put_media(IHTMLStyleSheet
*iface
, BSTR v
)
603 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
604 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
608 static HRESULT WINAPI
HTMLStyleSheet_get_media(IHTMLStyleSheet
*iface
, BSTR
*p
)
610 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
611 FIXME("(%p)->(%p)\n", This
, p
);
615 static HRESULT WINAPI
HTMLStyleSheet_put_cssText(IHTMLStyleSheet
*iface
, BSTR v
)
617 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
618 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
622 static HRESULT WINAPI
HTMLStyleSheet_get_cssText(IHTMLStyleSheet
*iface
, BSTR
*p
)
624 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
625 FIXME("(%p)->(%p)\n", This
, p
);
629 static HRESULT WINAPI
HTMLStyleSheet_get_rules(IHTMLStyleSheet
*iface
,
630 IHTMLStyleSheetRulesCollection
**p
)
632 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
633 nsIDOMCSSRuleList
*nslist
= NULL
;
636 TRACE("(%p)->(%p)\n", This
, p
);
638 /* Gecko has buggy security checks and GetCssRules will fail. We have a correct
639 * implementation and it will work when the bug will be fixed in Gecko. */
640 nsres
= nsIDOMCSSStyleSheet_GetCssRules(This
->nsstylesheet
, &nslist
);
642 WARN("GetCssRules failed: %08x\n", nsres
);
644 *p
= HTMLStyleSheetRulesCollection_Create(nslist
);
648 static const IHTMLStyleSheetVtbl HTMLStyleSheetVtbl
= {
649 HTMLStyleSheet_QueryInterface
,
650 HTMLStyleSheet_AddRef
,
651 HTMLStyleSheet_Release
,
652 HTMLStyleSheet_GetTypeInfoCount
,
653 HTMLStyleSheet_GetTypeInfo
,
654 HTMLStyleSheet_GetIDsOfNames
,
655 HTMLStyleSheet_Invoke
,
656 HTMLStyleSheet_put_title
,
657 HTMLStyleSheet_get_title
,
658 HTMLStyleSheet_get_parentStyleSheet
,
659 HTMLStyleSheet_get_owningElement
,
660 HTMLStyleSheet_put_disabled
,
661 HTMLStyleSheet_get_disabled
,
662 HTMLStyleSheet_get_readOnly
,
663 HTMLStyleSheet_get_imports
,
664 HTMLStyleSheet_put_href
,
665 HTMLStyleSheet_get_href
,
666 HTMLStyleSheet_get_type
,
667 HTMLStyleSheet_get_id
,
668 HTMLStyleSheet_addImport
,
669 HTMLStyleSheet_addRule
,
670 HTMLStyleSheet_removeImport
,
671 HTMLStyleSheet_removeRule
,
672 HTMLStyleSheet_put_media
,
673 HTMLStyleSheet_get_media
,
674 HTMLStyleSheet_put_cssText
,
675 HTMLStyleSheet_get_cssText
,
676 HTMLStyleSheet_get_rules
679 IHTMLStyleSheet
*HTMLStyleSheet_Create(nsIDOMStyleSheet
*nsstylesheet
)
681 HTMLStyleSheet
*ret
= heap_alloc(sizeof(HTMLStyleSheet
));
684 ret
->IHTMLStyleSheet_iface
.lpVtbl
= &HTMLStyleSheetVtbl
;
686 ret
->nsstylesheet
= NULL
;
689 nsres
= nsIDOMStyleSheet_QueryInterface(nsstylesheet
, &IID_nsIDOMCSSStyleSheet
,
690 (void**)&ret
->nsstylesheet
);
692 ERR("Could not get nsICSSStyleSheet interface: %08x\n", nsres
);
695 return &ret
->IHTMLStyleSheet_iface
;