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"
29 #include "wine/unicode.h"
31 #include "mshtml_private.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
35 struct HTMLStyleSheet
{
36 IHTMLStyleSheet IHTMLStyleSheet_iface
;
40 nsIDOMCSSStyleSheet
*nsstylesheet
;
43 struct HTMLStyleSheetsCollection
{
45 IHTMLStyleSheetsCollection IHTMLStyleSheetsCollection_iface
;
49 nsIDOMStyleSheetList
*nslist
;
52 struct HTMLStyleSheetRulesCollection
{
53 IHTMLStyleSheetRulesCollection IHTMLStyleSheetRulesCollection_iface
;
57 nsIDOMCSSRuleList
*nslist
;
60 static inline HTMLStyleSheetRulesCollection
*impl_from_IHTMLStyleSheetRulesCollection(IHTMLStyleSheetRulesCollection
*iface
)
62 return CONTAINING_RECORD(iface
, HTMLStyleSheetRulesCollection
, IHTMLStyleSheetRulesCollection_iface
);
65 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_QueryInterface(IHTMLStyleSheetRulesCollection
*iface
,
66 REFIID riid
, void **ppv
)
68 HTMLStyleSheetRulesCollection
*This
= impl_from_IHTMLStyleSheetRulesCollection(iface
);
70 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
71 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
72 *ppv
= &This
->IHTMLStyleSheetRulesCollection_iface
;
73 }else if(IsEqualGUID(&IID_IHTMLStyleSheetRulesCollection
, riid
)) {
74 TRACE("(%p)->(IID_IHTMLStyleSheetRulesCollection %p)\n", This
, ppv
);
75 *ppv
= &This
->IHTMLStyleSheetRulesCollection_iface
;
79 IUnknown_AddRef((IUnknown
*)*ppv
);
83 FIXME("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
87 static ULONG WINAPI
HTMLStyleSheetRulesCollection_AddRef(IHTMLStyleSheetRulesCollection
*iface
)
89 HTMLStyleSheetRulesCollection
*This
= impl_from_IHTMLStyleSheetRulesCollection(iface
);
90 LONG ref
= InterlockedIncrement(&This
->ref
);
92 TRACE("(%p) ref=%d\n", This
, ref
);
97 static ULONG WINAPI
HTMLStyleSheetRulesCollection_Release(IHTMLStyleSheetRulesCollection
*iface
)
99 HTMLStyleSheetRulesCollection
*This
= impl_from_IHTMLStyleSheetRulesCollection(iface
);
100 LONG ref
= InterlockedDecrement(&This
->ref
);
102 TRACE("(%p) ref=%d\n", This
, ref
);
106 nsIDOMCSSRuleList_Release(This
->nslist
);
113 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_GetTypeInfoCount(
114 IHTMLStyleSheetRulesCollection
*iface
, UINT
*pctinfo
)
116 HTMLStyleSheetRulesCollection
*This
= impl_from_IHTMLStyleSheetRulesCollection(iface
);
117 FIXME("(%p)->(%p)\n", This
, pctinfo
);
121 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_GetTypeInfo(IHTMLStyleSheetRulesCollection
*iface
,
122 UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
124 HTMLStyleSheetRulesCollection
*This
= impl_from_IHTMLStyleSheetRulesCollection(iface
);
125 FIXME("(%p)->(%u %u %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
129 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_GetIDsOfNames(IHTMLStyleSheetRulesCollection
*iface
,
130 REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
132 HTMLStyleSheetRulesCollection
*This
= impl_from_IHTMLStyleSheetRulesCollection(iface
);
133 FIXME("(%p)->(%s %p %u %u %p)\n", This
, debugstr_guid(riid
), rgszNames
, cNames
,
138 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_Invoke(IHTMLStyleSheetRulesCollection
*iface
,
139 DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
140 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
142 HTMLStyleSheetRulesCollection
*This
= impl_from_IHTMLStyleSheetRulesCollection(iface
);
143 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
144 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
148 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_get_length(IHTMLStyleSheetRulesCollection
*iface
,
151 HTMLStyleSheetRulesCollection
*This
= impl_from_IHTMLStyleSheetRulesCollection(iface
);
154 TRACE("(%p)->(%p)\n", This
, p
);
159 nsres
= nsIDOMCSSRuleList_GetLength(This
->nslist
, &len
);
161 ERR("GetLength failed: %08x\n", nsres
);
168 static HRESULT WINAPI
HTMLStyleSheetRulesCollection_item(IHTMLStyleSheetRulesCollection
*iface
,
169 LONG index
, IHTMLStyleSheetRule
**ppHTMLStyleSheetRule
)
171 HTMLStyleSheetRulesCollection
*This
= impl_from_IHTMLStyleSheetRulesCollection(iface
);
172 FIXME("(%p)->(%d %p)\n", This
, index
, ppHTMLStyleSheetRule
);
176 static const IHTMLStyleSheetRulesCollectionVtbl HTMLStyleSheetRulesCollectionVtbl
= {
177 HTMLStyleSheetRulesCollection_QueryInterface
,
178 HTMLStyleSheetRulesCollection_AddRef
,
179 HTMLStyleSheetRulesCollection_Release
,
180 HTMLStyleSheetRulesCollection_GetTypeInfoCount
,
181 HTMLStyleSheetRulesCollection_GetTypeInfo
,
182 HTMLStyleSheetRulesCollection_GetIDsOfNames
,
183 HTMLStyleSheetRulesCollection_Invoke
,
184 HTMLStyleSheetRulesCollection_get_length
,
185 HTMLStyleSheetRulesCollection_item
188 static IHTMLStyleSheetRulesCollection
*HTMLStyleSheetRulesCollection_Create(nsIDOMCSSRuleList
*nslist
)
190 HTMLStyleSheetRulesCollection
*ret
;
192 ret
= heap_alloc(sizeof(*ret
));
193 ret
->IHTMLStyleSheetRulesCollection_iface
.lpVtbl
= &HTMLStyleSheetRulesCollectionVtbl
;
195 ret
->nslist
= nslist
;
198 nsIDOMCSSRuleList_AddRef(nslist
);
200 return &ret
->IHTMLStyleSheetRulesCollection_iface
;
203 static inline HTMLStyleSheetsCollection
*impl_from_IHTMLStyleSheetsCollection(IHTMLStyleSheetsCollection
*iface
)
205 return CONTAINING_RECORD(iface
, HTMLStyleSheetsCollection
, IHTMLStyleSheetsCollection_iface
);
208 static HRESULT WINAPI
HTMLStyleSheetsCollection_QueryInterface(IHTMLStyleSheetsCollection
*iface
,
209 REFIID riid
, void **ppv
)
211 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
215 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
216 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
217 *ppv
= &This
->IHTMLStyleSheetsCollection_iface
;
218 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
219 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
220 *ppv
= &This
->IHTMLStyleSheetsCollection_iface
;
221 }else if(IsEqualGUID(&IID_IHTMLStyleSheetsCollection
, riid
)) {
222 TRACE("(%p)->(IID_IHTMLStyleSheetsCollection %p)\n", This
, ppv
);
223 *ppv
= &This
->IHTMLStyleSheetsCollection_iface
;
224 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
225 return *ppv
? S_OK
: E_NOINTERFACE
;
229 IUnknown_AddRef((IUnknown
*)*ppv
);
233 WARN("unsupported %s\n", debugstr_guid(riid
));
234 return E_NOINTERFACE
;
237 static ULONG WINAPI
HTMLStyleSheetsCollection_AddRef(IHTMLStyleSheetsCollection
*iface
)
239 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
240 LONG ref
= InterlockedIncrement(&This
->ref
);
242 TRACE("(%p) ref=%d\n", This
, ref
);
247 static ULONG WINAPI
HTMLStyleSheetsCollection_Release(IHTMLStyleSheetsCollection
*iface
)
249 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
250 LONG ref
= InterlockedDecrement(&This
->ref
);
252 TRACE("(%p) ref=%d\n", This
, ref
);
256 nsIDOMStyleSheetList_Release(This
->nslist
);
263 static HRESULT WINAPI
HTMLStyleSheetsCollection_GetTypeInfoCount(IHTMLStyleSheetsCollection
*iface
,
266 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
267 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
270 static HRESULT WINAPI
HTMLStyleSheetsCollection_GetTypeInfo(IHTMLStyleSheetsCollection
*iface
,
271 UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
273 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
274 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
277 static HRESULT WINAPI
HTMLStyleSheetsCollection_GetIDsOfNames(IHTMLStyleSheetsCollection
*iface
,
278 REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
280 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
281 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
,
285 static HRESULT WINAPI
HTMLStyleSheetsCollection_Invoke(IHTMLStyleSheetsCollection
*iface
,
286 DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
287 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
289 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
290 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
,
291 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
294 static HRESULT WINAPI
HTMLStyleSheetsCollection_get_length(IHTMLStyleSheetsCollection
*iface
,
297 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
300 TRACE("(%p)->(%p)\n", This
, p
);
303 nsIDOMStyleSheetList_GetLength(This
->nslist
, &len
);
309 static HRESULT WINAPI
HTMLStyleSheetsCollection_get__newEnum(IHTMLStyleSheetsCollection
*iface
,
312 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
313 FIXME("(%p)->(%p)\n", This
, p
);
317 static HRESULT WINAPI
HTMLStyleSheetsCollection_item(IHTMLStyleSheetsCollection
*iface
,
318 VARIANT
*pvarIndex
, VARIANT
*pvarResult
)
320 HTMLStyleSheetsCollection
*This
= impl_from_IHTMLStyleSheetsCollection(iface
);
322 TRACE("(%p)->(%p %p)\n", This
, pvarIndex
, pvarResult
);
324 switch(V_VT(pvarIndex
)) {
326 nsIDOMStyleSheet
*nsstylesheet
;
329 TRACE("index=%d\n", V_I4(pvarIndex
));
331 nsres
= nsIDOMStyleSheetList_Item(This
->nslist
, V_I4(pvarIndex
), &nsstylesheet
);
332 if(NS_FAILED(nsres
) || !nsstylesheet
) {
333 WARN("Item failed: %08x\n", nsres
);
334 V_VT(pvarResult
) = VT_EMPTY
;
338 V_VT(pvarResult
) = VT_DISPATCH
;
339 V_DISPATCH(pvarResult
) = (IDispatch
*)HTMLStyleSheet_Create(nsstylesheet
);
345 FIXME("id=%s not implemented\n", debugstr_w(V_BSTR(pvarResult
)));
349 WARN("Invalid vt=%d\n", V_VT(pvarIndex
));
355 static const IHTMLStyleSheetsCollectionVtbl HTMLStyleSheetsCollectionVtbl
= {
356 HTMLStyleSheetsCollection_QueryInterface
,
357 HTMLStyleSheetsCollection_AddRef
,
358 HTMLStyleSheetsCollection_Release
,
359 HTMLStyleSheetsCollection_GetTypeInfoCount
,
360 HTMLStyleSheetsCollection_GetTypeInfo
,
361 HTMLStyleSheetsCollection_GetIDsOfNames
,
362 HTMLStyleSheetsCollection_Invoke
,
363 HTMLStyleSheetsCollection_get_length
,
364 HTMLStyleSheetsCollection_get__newEnum
,
365 HTMLStyleSheetsCollection_item
368 static const tid_t HTMLStyleSheetsCollection_iface_tids
[] = {
369 IHTMLStyleSheetsCollection_tid
,
372 static dispex_static_data_t HTMLStyleSheetsCollection_dispex
= {
374 DispHTMLStyleSheetsCollection_tid
,
376 HTMLStyleSheetsCollection_iface_tids
379 IHTMLStyleSheetsCollection
*HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList
*nslist
)
381 HTMLStyleSheetsCollection
*ret
= heap_alloc(sizeof(HTMLStyleSheetsCollection
));
383 ret
->IHTMLStyleSheetsCollection_iface
.lpVtbl
= &HTMLStyleSheetsCollectionVtbl
;
387 nsIDOMStyleSheetList_AddRef(nslist
);
388 ret
->nslist
= nslist
;
390 init_dispex(&ret
->dispex
, (IUnknown
*)&ret
->IHTMLStyleSheetsCollection_iface
,
391 &HTMLStyleSheetsCollection_dispex
);
393 return &ret
->IHTMLStyleSheetsCollection_iface
;
396 static inline HTMLStyleSheet
*impl_from_IHTMLStyleSheet(IHTMLStyleSheet
*iface
)
398 return CONTAINING_RECORD(iface
, HTMLStyleSheet
, IHTMLStyleSheet_iface
);
401 static HRESULT WINAPI
HTMLStyleSheet_QueryInterface(IHTMLStyleSheet
*iface
, REFIID riid
, void **ppv
)
403 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
407 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
408 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
409 *ppv
= &This
->IHTMLStyleSheet_iface
;
410 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
411 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
412 *ppv
= &This
->IHTMLStyleSheet_iface
;
413 }else if(IsEqualGUID(&IID_IHTMLStyleSheet
, riid
)) {
414 TRACE("(%p)->(IID_IHTMLStyleSheet %p)\n", This
, ppv
);
415 *ppv
= &This
->IHTMLStyleSheet_iface
;
419 IUnknown_AddRef((IUnknown
*)*ppv
);
423 WARN("unsupported %s\n", debugstr_guid(riid
));
424 return E_NOINTERFACE
;
427 static ULONG WINAPI
HTMLStyleSheet_AddRef(IHTMLStyleSheet
*iface
)
429 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
430 LONG ref
= InterlockedIncrement(&This
->ref
);
432 TRACE("(%p) ref=%d\n", This
, ref
);
437 static ULONG WINAPI
HTMLStyleSheet_Release(IHTMLStyleSheet
*iface
)
439 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
440 LONG ref
= InterlockedDecrement(&This
->ref
);
442 TRACE("(%p) ref=%d\n", This
, ref
);
450 static HRESULT WINAPI
HTMLStyleSheet_GetTypeInfoCount(IHTMLStyleSheet
*iface
, UINT
*pctinfo
)
452 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
453 FIXME("(%p)->(%p)\n", This
, pctinfo
);
457 static HRESULT WINAPI
HTMLStyleSheet_GetTypeInfo(IHTMLStyleSheet
*iface
, UINT iTInfo
,
458 LCID lcid
, ITypeInfo
**ppTInfo
)
460 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
461 FIXME("(%p)->(%u %u %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
465 static HRESULT WINAPI
HTMLStyleSheet_GetIDsOfNames(IHTMLStyleSheet
*iface
, REFIID riid
,
466 LPOLESTR
*rgszNames
, UINT cNames
,
467 LCID lcid
, DISPID
*rgDispId
)
469 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
470 FIXME("(%p)->(%s %p %u %u %p)\n", This
, debugstr_guid(riid
), rgszNames
, cNames
,
475 static HRESULT WINAPI
HTMLStyleSheet_Invoke(IHTMLStyleSheet
*iface
, DISPID dispIdMember
,
476 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
477 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
479 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
480 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
481 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
485 static HRESULT WINAPI
HTMLStyleSheet_put_title(IHTMLStyleSheet
*iface
, BSTR v
)
487 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
488 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
492 static HRESULT WINAPI
HTMLStyleSheet_get_title(IHTMLStyleSheet
*iface
, BSTR
*p
)
494 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
495 FIXME("(%p)->(%p)\n", This
, p
);
499 static HRESULT WINAPI
HTMLStyleSheet_get_parentStyleSheet(IHTMLStyleSheet
*iface
,
502 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
503 FIXME("(%p)->(%p)\n", This
, p
);
507 static HRESULT WINAPI
HTMLStyleSheet_get_owningElement(IHTMLStyleSheet
*iface
, IHTMLElement
**p
)
509 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
510 FIXME("(%p)->(%p)\n", This
, p
);
514 static HRESULT WINAPI
HTMLStyleSheet_put_disabled(IHTMLStyleSheet
*iface
, VARIANT_BOOL v
)
516 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
517 FIXME("(%p)->(%x)\n", This
, v
);
521 static HRESULT WINAPI
HTMLStyleSheet_get_disabled(IHTMLStyleSheet
*iface
, VARIANT_BOOL
*p
)
523 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
524 FIXME("(%p)->(%p)\n", This
, p
);
528 static HRESULT WINAPI
HTMLStyleSheet_get_readOnly(IHTMLStyleSheet
*iface
, VARIANT_BOOL
*p
)
530 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
531 FIXME("(%p)->(%p)\n", This
, p
);
535 static HRESULT WINAPI
HTMLStyleSheet_get_imports(IHTMLStyleSheet
*iface
,
536 IHTMLStyleSheetsCollection
**p
)
538 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
539 FIXME("(%p)->(%p)\n", This
, p
);
543 static HRESULT WINAPI
HTMLStyleSheet_put_href(IHTMLStyleSheet
*iface
, BSTR v
)
545 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
546 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
550 static HRESULT WINAPI
HTMLStyleSheet_get_href(IHTMLStyleSheet
*iface
, BSTR
*p
)
552 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
553 FIXME("(%p)->(%p)\n", This
, p
);
557 static HRESULT WINAPI
HTMLStyleSheet_get_type(IHTMLStyleSheet
*iface
, BSTR
*p
)
559 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
560 FIXME("(%p)->(%p)\n", This
, p
);
564 static HRESULT WINAPI
HTMLStyleSheet_get_id(IHTMLStyleSheet
*iface
, BSTR
*p
)
566 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
567 FIXME("(%p)->(%p)\n", This
, p
);
571 static HRESULT WINAPI
HTMLStyleSheet_addImport(IHTMLStyleSheet
*iface
, BSTR bstrURL
,
572 LONG lIndex
, LONG
*plIndex
)
574 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
575 FIXME("(%p)->(%s %d %p)\n", This
, debugstr_w(bstrURL
), lIndex
, plIndex
);
579 static HRESULT WINAPI
HTMLStyleSheet_addRule(IHTMLStyleSheet
*iface
, BSTR bstrSelector
,
580 BSTR bstrStyle
, LONG lIndex
, LONG
*plIndex
)
582 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
583 FIXME("(%p)->(%s %s %d %p)\n", This
, debugstr_w(bstrSelector
), debugstr_w(bstrStyle
),
588 static HRESULT WINAPI
HTMLStyleSheet_removeImport(IHTMLStyleSheet
*iface
, LONG lIndex
)
590 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
591 FIXME("(%p)->(%d)\n", This
, lIndex
);
595 static HRESULT WINAPI
HTMLStyleSheet_removeRule(IHTMLStyleSheet
*iface
, LONG lIndex
)
597 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
598 FIXME("(%p)->(%d)\n", This
, lIndex
);
602 static HRESULT WINAPI
HTMLStyleSheet_put_media(IHTMLStyleSheet
*iface
, BSTR v
)
604 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
605 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
609 static HRESULT WINAPI
HTMLStyleSheet_get_media(IHTMLStyleSheet
*iface
, BSTR
*p
)
611 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
612 FIXME("(%p)->(%p)\n", This
, p
);
616 static HRESULT WINAPI
HTMLStyleSheet_put_cssText(IHTMLStyleSheet
*iface
, BSTR v
)
618 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
619 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
623 static HRESULT WINAPI
HTMLStyleSheet_get_cssText(IHTMLStyleSheet
*iface
, BSTR
*p
)
625 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
626 FIXME("(%p)->(%p)\n", This
, p
);
630 static HRESULT WINAPI
HTMLStyleSheet_get_rules(IHTMLStyleSheet
*iface
,
631 IHTMLStyleSheetRulesCollection
**p
)
633 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
634 nsIDOMCSSRuleList
*nslist
= NULL
;
637 TRACE("(%p)->(%p)\n", This
, p
);
639 /* Gecko has buggy security checks and GetCssRules will fail. We have a correct
640 * implementation and it will work when the bug will be fixed in Gecko. */
641 nsres
= nsIDOMCSSStyleSheet_GetCssRules(This
->nsstylesheet
, &nslist
);
643 WARN("GetCssRules failed: %08x\n", nsres
);
645 *p
= HTMLStyleSheetRulesCollection_Create(nslist
);
649 static const IHTMLStyleSheetVtbl HTMLStyleSheetVtbl
= {
650 HTMLStyleSheet_QueryInterface
,
651 HTMLStyleSheet_AddRef
,
652 HTMLStyleSheet_Release
,
653 HTMLStyleSheet_GetTypeInfoCount
,
654 HTMLStyleSheet_GetTypeInfo
,
655 HTMLStyleSheet_GetIDsOfNames
,
656 HTMLStyleSheet_Invoke
,
657 HTMLStyleSheet_put_title
,
658 HTMLStyleSheet_get_title
,
659 HTMLStyleSheet_get_parentStyleSheet
,
660 HTMLStyleSheet_get_owningElement
,
661 HTMLStyleSheet_put_disabled
,
662 HTMLStyleSheet_get_disabled
,
663 HTMLStyleSheet_get_readOnly
,
664 HTMLStyleSheet_get_imports
,
665 HTMLStyleSheet_put_href
,
666 HTMLStyleSheet_get_href
,
667 HTMLStyleSheet_get_type
,
668 HTMLStyleSheet_get_id
,
669 HTMLStyleSheet_addImport
,
670 HTMLStyleSheet_addRule
,
671 HTMLStyleSheet_removeImport
,
672 HTMLStyleSheet_removeRule
,
673 HTMLStyleSheet_put_media
,
674 HTMLStyleSheet_get_media
,
675 HTMLStyleSheet_put_cssText
,
676 HTMLStyleSheet_get_cssText
,
677 HTMLStyleSheet_get_rules
680 IHTMLStyleSheet
*HTMLStyleSheet_Create(nsIDOMStyleSheet
*nsstylesheet
)
682 HTMLStyleSheet
*ret
= heap_alloc(sizeof(HTMLStyleSheet
));
685 ret
->IHTMLStyleSheet_iface
.lpVtbl
= &HTMLStyleSheetVtbl
;
687 ret
->nsstylesheet
= NULL
;
690 nsres
= nsIDOMStyleSheet_QueryInterface(nsstylesheet
, &IID_nsIDOMCSSStyleSheet
,
691 (void**)&ret
->nsstylesheet
);
693 ERR("Could not get nsICSSStyleSheet interface: %08x\n", nsres
);
696 return &ret
->IHTMLStyleSheet_iface
;