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
{
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)->(%s %p)\n", This
, debugstr_variant(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 index %s\n", debugstr_variant(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
;
416 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
417 return *ppv
? S_OK
: E_NOINTERFACE
;
421 IUnknown_AddRef((IUnknown
*)*ppv
);
425 WARN("unsupported %s\n", debugstr_guid(riid
));
426 return E_NOINTERFACE
;
429 static ULONG WINAPI
HTMLStyleSheet_AddRef(IHTMLStyleSheet
*iface
)
431 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
432 LONG ref
= InterlockedIncrement(&This
->ref
);
434 TRACE("(%p) ref=%d\n", This
, ref
);
439 static ULONG WINAPI
HTMLStyleSheet_Release(IHTMLStyleSheet
*iface
)
441 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
442 LONG ref
= InterlockedDecrement(&This
->ref
);
444 TRACE("(%p) ref=%d\n", This
, ref
);
452 static HRESULT WINAPI
HTMLStyleSheet_GetTypeInfoCount(IHTMLStyleSheet
*iface
, UINT
*pctinfo
)
454 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
455 TRACE("(%p)->(%p)\n", This
, pctinfo
);
456 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
459 static HRESULT WINAPI
HTMLStyleSheet_GetTypeInfo(IHTMLStyleSheet
*iface
, UINT iTInfo
,
460 LCID lcid
, ITypeInfo
**ppTInfo
)
462 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
463 TRACE("(%p)->(%u %u %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
464 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
467 static HRESULT WINAPI
HTMLStyleSheet_GetIDsOfNames(IHTMLStyleSheet
*iface
, REFIID riid
,
468 LPOLESTR
*rgszNames
, UINT cNames
,
469 LCID lcid
, DISPID
*rgDispId
)
471 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
472 TRACE("(%p)->(%s %p %u %u %p)\n", This
, debugstr_guid(riid
), rgszNames
, cNames
, lcid
, rgDispId
);
473 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
476 static HRESULT WINAPI
HTMLStyleSheet_Invoke(IHTMLStyleSheet
*iface
, DISPID dispIdMember
,
477 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
478 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
480 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
481 TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
482 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
483 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
,
484 pVarResult
, pExcepInfo
, puArgErr
);
487 static HRESULT WINAPI
HTMLStyleSheet_put_title(IHTMLStyleSheet
*iface
, BSTR v
)
489 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
490 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
494 static HRESULT WINAPI
HTMLStyleSheet_get_title(IHTMLStyleSheet
*iface
, BSTR
*p
)
496 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
497 FIXME("(%p)->(%p)\n", This
, p
);
501 static HRESULT WINAPI
HTMLStyleSheet_get_parentStyleSheet(IHTMLStyleSheet
*iface
,
504 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
505 FIXME("(%p)->(%p)\n", This
, p
);
509 static HRESULT WINAPI
HTMLStyleSheet_get_owningElement(IHTMLStyleSheet
*iface
, IHTMLElement
**p
)
511 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
512 FIXME("(%p)->(%p)\n", This
, p
);
516 static HRESULT WINAPI
HTMLStyleSheet_put_disabled(IHTMLStyleSheet
*iface
, VARIANT_BOOL v
)
518 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
519 FIXME("(%p)->(%x)\n", This
, v
);
523 static HRESULT WINAPI
HTMLStyleSheet_get_disabled(IHTMLStyleSheet
*iface
, VARIANT_BOOL
*p
)
525 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
526 FIXME("(%p)->(%p)\n", This
, p
);
530 static HRESULT WINAPI
HTMLStyleSheet_get_readOnly(IHTMLStyleSheet
*iface
, VARIANT_BOOL
*p
)
532 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
533 FIXME("(%p)->(%p)\n", This
, p
);
537 static HRESULT WINAPI
HTMLStyleSheet_get_imports(IHTMLStyleSheet
*iface
,
538 IHTMLStyleSheetsCollection
**p
)
540 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
541 FIXME("(%p)->(%p)\n", This
, p
);
545 static HRESULT WINAPI
HTMLStyleSheet_put_href(IHTMLStyleSheet
*iface
, BSTR v
)
547 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
548 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
552 static HRESULT WINAPI
HTMLStyleSheet_get_href(IHTMLStyleSheet
*iface
, BSTR
*p
)
554 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
555 FIXME("(%p)->(%p)\n", This
, p
);
559 static HRESULT WINAPI
HTMLStyleSheet_get_type(IHTMLStyleSheet
*iface
, BSTR
*p
)
561 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
562 FIXME("(%p)->(%p)\n", This
, p
);
566 static HRESULT WINAPI
HTMLStyleSheet_get_id(IHTMLStyleSheet
*iface
, BSTR
*p
)
568 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
569 FIXME("(%p)->(%p)\n", This
, p
);
573 static HRESULT WINAPI
HTMLStyleSheet_addImport(IHTMLStyleSheet
*iface
, BSTR bstrURL
,
574 LONG lIndex
, LONG
*plIndex
)
576 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
577 FIXME("(%p)->(%s %d %p)\n", This
, debugstr_w(bstrURL
), lIndex
, plIndex
);
581 static HRESULT WINAPI
HTMLStyleSheet_addRule(IHTMLStyleSheet
*iface
, BSTR bstrSelector
,
582 BSTR bstrStyle
, LONG lIndex
, LONG
*plIndex
)
584 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
585 FIXME("(%p)->(%s %s %d %p)\n", This
, debugstr_w(bstrSelector
), debugstr_w(bstrStyle
),
590 static HRESULT WINAPI
HTMLStyleSheet_removeImport(IHTMLStyleSheet
*iface
, LONG lIndex
)
592 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
593 FIXME("(%p)->(%d)\n", This
, lIndex
);
597 static HRESULT WINAPI
HTMLStyleSheet_removeRule(IHTMLStyleSheet
*iface
, LONG lIndex
)
599 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
600 FIXME("(%p)->(%d)\n", This
, lIndex
);
604 static HRESULT WINAPI
HTMLStyleSheet_put_media(IHTMLStyleSheet
*iface
, BSTR v
)
606 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
607 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
611 static HRESULT WINAPI
HTMLStyleSheet_get_media(IHTMLStyleSheet
*iface
, BSTR
*p
)
613 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
614 FIXME("(%p)->(%p)\n", This
, p
);
618 static HRESULT WINAPI
HTMLStyleSheet_put_cssText(IHTMLStyleSheet
*iface
, BSTR v
)
620 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
621 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
625 static HRESULT WINAPI
HTMLStyleSheet_get_cssText(IHTMLStyleSheet
*iface
, BSTR
*p
)
627 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
628 FIXME("(%p)->(%p)\n", This
, p
);
632 static HRESULT WINAPI
HTMLStyleSheet_get_rules(IHTMLStyleSheet
*iface
,
633 IHTMLStyleSheetRulesCollection
**p
)
635 HTMLStyleSheet
*This
= impl_from_IHTMLStyleSheet(iface
);
636 nsIDOMCSSRuleList
*nslist
= NULL
;
639 TRACE("(%p)->(%p)\n", This
, p
);
641 /* Gecko has buggy security checks and GetCssRules will fail. We have a correct
642 * implementation and it will work when the bug will be fixed in Gecko. */
643 nsres
= nsIDOMCSSStyleSheet_GetCssRules(This
->nsstylesheet
, &nslist
);
645 WARN("GetCssRules failed: %08x\n", nsres
);
647 *p
= HTMLStyleSheetRulesCollection_Create(nslist
);
651 static const IHTMLStyleSheetVtbl HTMLStyleSheetVtbl
= {
652 HTMLStyleSheet_QueryInterface
,
653 HTMLStyleSheet_AddRef
,
654 HTMLStyleSheet_Release
,
655 HTMLStyleSheet_GetTypeInfoCount
,
656 HTMLStyleSheet_GetTypeInfo
,
657 HTMLStyleSheet_GetIDsOfNames
,
658 HTMLStyleSheet_Invoke
,
659 HTMLStyleSheet_put_title
,
660 HTMLStyleSheet_get_title
,
661 HTMLStyleSheet_get_parentStyleSheet
,
662 HTMLStyleSheet_get_owningElement
,
663 HTMLStyleSheet_put_disabled
,
664 HTMLStyleSheet_get_disabled
,
665 HTMLStyleSheet_get_readOnly
,
666 HTMLStyleSheet_get_imports
,
667 HTMLStyleSheet_put_href
,
668 HTMLStyleSheet_get_href
,
669 HTMLStyleSheet_get_type
,
670 HTMLStyleSheet_get_id
,
671 HTMLStyleSheet_addImport
,
672 HTMLStyleSheet_addRule
,
673 HTMLStyleSheet_removeImport
,
674 HTMLStyleSheet_removeRule
,
675 HTMLStyleSheet_put_media
,
676 HTMLStyleSheet_get_media
,
677 HTMLStyleSheet_put_cssText
,
678 HTMLStyleSheet_get_cssText
,
679 HTMLStyleSheet_get_rules
682 static const tid_t HTMLStyleSheet_iface_tids
[] = {
686 static dispex_static_data_t HTMLStyleSheet_dispex
= {
688 DispHTMLStyleSheet_tid
,
690 HTMLStyleSheet_iface_tids
693 IHTMLStyleSheet
*HTMLStyleSheet_Create(nsIDOMStyleSheet
*nsstylesheet
)
695 HTMLStyleSheet
*ret
= heap_alloc(sizeof(HTMLStyleSheet
));
698 ret
->IHTMLStyleSheet_iface
.lpVtbl
= &HTMLStyleSheetVtbl
;
700 ret
->nsstylesheet
= NULL
;
702 init_dispex(&ret
->dispex
, (IUnknown
*)&ret
->IHTMLStyleSheet_iface
, &HTMLStyleSheet_dispex
);
705 nsres
= nsIDOMStyleSheet_QueryInterface(nsstylesheet
, &IID_nsIDOMCSSStyleSheet
,
706 (void**)&ret
->nsstylesheet
);
708 ERR("Could not get nsICSSStyleSheet interface: %08x\n", nsres
);
711 return &ret
->IHTMLStyleSheet_iface
;