secur32/tests: Use importlib for functions available since Windows XP.
[wine.git] / dlls / mshtml / htmlcurstyle.c
blob32f5281477ad0588fd99e9830835bc3baaabc8b8
1 /*
2 * Copyright 2008 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
19 #include <stdarg.h>
20 #include <assert.h>
22 #define COBJMACROS
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "ole2.h"
29 #include "mshtml_private.h"
30 #include "htmlstyle.h"
32 #include "wine/debug.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
36 struct HTMLCurrentStyle {
37 DispatchEx dispex;
38 IHTMLCurrentStyle IHTMLCurrentStyle_iface;
39 IHTMLCurrentStyle2 IHTMLCurrentStyle2_iface;
40 IHTMLCurrentStyle3 IHTMLCurrentStyle3_iface;
41 IHTMLCurrentStyle4 IHTMLCurrentStyle4_iface;
43 LONG ref;
45 nsIDOMCSSStyleDeclaration *nsstyle;
46 HTMLElement *elem;
49 static inline HTMLCurrentStyle *impl_from_IHTMLCurrentStyle(IHTMLCurrentStyle *iface)
51 return CONTAINING_RECORD(iface, HTMLCurrentStyle, IHTMLCurrentStyle_iface);
54 static inline HTMLCurrentStyle *impl_from_IHTMLCurrentStyle2(IHTMLCurrentStyle2 *iface)
56 return CONTAINING_RECORD(iface, HTMLCurrentStyle, IHTMLCurrentStyle2_iface);
59 static inline HTMLCurrentStyle *impl_from_IHTMLCurrentStyle3(IHTMLCurrentStyle3 *iface)
61 return CONTAINING_RECORD(iface, HTMLCurrentStyle, IHTMLCurrentStyle3_iface);
64 static inline HTMLCurrentStyle *impl_from_IHTMLCurrentStyle4(IHTMLCurrentStyle4 *iface)
66 return CONTAINING_RECORD(iface, HTMLCurrentStyle, IHTMLCurrentStyle4_iface);
69 static HRESULT WINAPI HTMLCurrentStyle_QueryInterface(IHTMLCurrentStyle *iface, REFIID riid, void **ppv)
71 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
73 TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
75 if(IsEqualGUID(&IID_IUnknown, riid)) {
76 *ppv = &This->IHTMLCurrentStyle_iface;
77 }else if(IsEqualGUID(&IID_IHTMLCurrentStyle, riid)) {
78 *ppv = &This->IHTMLCurrentStyle_iface;
79 }else if(IsEqualGUID(&IID_IHTMLCurrentStyle2, riid)) {
80 *ppv = &This->IHTMLCurrentStyle2_iface;
81 }else if(IsEqualGUID(&IID_IHTMLCurrentStyle3, riid)) {
82 *ppv = &This->IHTMLCurrentStyle3_iface;
83 }else if(IsEqualGUID(&IID_IHTMLCurrentStyle4, riid)) {
84 *ppv = &This->IHTMLCurrentStyle4_iface;
85 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
86 return *ppv ? S_OK : E_NOINTERFACE;
87 }else {
88 *ppv = NULL;
89 WARN("unsupported %s\n", debugstr_mshtml_guid(riid));
90 return E_NOINTERFACE;
93 IUnknown_AddRef((IUnknown*)*ppv);
94 return S_OK;
97 static ULONG WINAPI HTMLCurrentStyle_AddRef(IHTMLCurrentStyle *iface)
99 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
100 LONG ref = InterlockedIncrement(&This->ref);
102 TRACE("(%p) ref=%d\n", This, ref);
104 return ref;
107 static ULONG WINAPI HTMLCurrentStyle_Release(IHTMLCurrentStyle *iface)
109 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
110 LONG ref = InterlockedDecrement(&This->ref);
112 TRACE("(%p) ref=%d\n", This, ref);
114 if(!ref) {
115 if(This->nsstyle)
116 nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
117 IHTMLElement_Release(&This->elem->IHTMLElement_iface);
118 release_dispex(&This->dispex);
119 heap_free(This);
122 return ref;
125 static HRESULT WINAPI HTMLCurrentStyle_GetTypeInfoCount(IHTMLCurrentStyle *iface, UINT *pctinfo)
127 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
128 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
131 static HRESULT WINAPI HTMLCurrentStyle_GetTypeInfo(IHTMLCurrentStyle *iface, UINT iTInfo,
132 LCID lcid, ITypeInfo **ppTInfo)
134 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
135 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
138 static HRESULT WINAPI HTMLCurrentStyle_GetIDsOfNames(IHTMLCurrentStyle *iface, REFIID riid,
139 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
141 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
142 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
143 lcid, rgDispId);
146 static HRESULT WINAPI HTMLCurrentStyle_Invoke(IHTMLCurrentStyle *iface, DISPID dispIdMember,
147 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
148 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
150 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
151 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
152 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
155 static HRESULT WINAPI HTMLCurrentStyle_get_position(IHTMLCurrentStyle *iface, BSTR *p)
157 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
159 TRACE("(%p)->(%p)\n", This, p);
161 return get_nsstyle_attr(This->nsstyle, STYLEID_POSITION, p, 0);
164 static HRESULT WINAPI HTMLCurrentStyle_get_styleFloat(IHTMLCurrentStyle *iface, BSTR *p)
166 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
168 TRACE("(%p)->(%p)\n", This, p);
170 return get_nsstyle_attr(This->nsstyle, STYLEID_FLOAT, p, 0);
173 static HRESULT WINAPI HTMLCurrentStyle_get_color(IHTMLCurrentStyle *iface, VARIANT *p)
175 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
176 TRACE("(%p)->(%p)\n", This, p);
177 return get_nsstyle_attr_var(This->nsstyle, STYLEID_COLOR, p, 0);
180 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundColor(IHTMLCurrentStyle *iface, VARIANT *p)
182 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
183 TRACE("(%p)->(%p)\n", This, p);
184 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_COLOR, p, 0);
187 static HRESULT WINAPI HTMLCurrentStyle_get_fontFamily(IHTMLCurrentStyle *iface, BSTR *p)
189 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
191 TRACE("(%p)->(%p)\n", This, p);
193 return get_nsstyle_attr(This->nsstyle, STYLEID_FONT_FAMILY, p, 0);
196 static HRESULT WINAPI HTMLCurrentStyle_get_fontStyle(IHTMLCurrentStyle *iface, BSTR *p)
198 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
199 TRACE("(%p)->(%p)\n", This, p);
200 return get_nsstyle_attr(This->nsstyle, STYLEID_FONT_STYLE, p, 0);
203 static HRESULT WINAPI HTMLCurrentStyle_get_fontVariant(IHTMLCurrentStyle *iface, BSTR *p)
205 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
206 TRACE("(%p)->(%p)\n", This, p);
207 return get_nsstyle_attr(This->nsstyle, STYLEID_FONT_VARIANT, p, 0);
210 static HRESULT WINAPI HTMLCurrentStyle_get_fontWeight(IHTMLCurrentStyle *iface, VARIANT *p)
212 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
213 TRACE("(%p)->(%p)\n", This, p);
214 return get_nsstyle_attr_var(This->nsstyle, STYLEID_FONT_WEIGHT, p, ATTR_STR_TO_INT);
217 static HRESULT WINAPI HTMLCurrentStyle_get_fontSize(IHTMLCurrentStyle *iface, VARIANT *p)
219 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
220 TRACE("(%p)->(%p)\n", This, p);
221 return get_nsstyle_attr_var(This->nsstyle, STYLEID_FONT_SIZE, p, 0);
224 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundImage(IHTMLCurrentStyle *iface, BSTR *p)
226 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
227 TRACE("(%p)->(%p)\n", This, p);
228 return get_nsstyle_attr(This->nsstyle, STYLEID_BACKGROUND_IMAGE, p, 0);
231 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundPositionX(IHTMLCurrentStyle *iface, VARIANT *p)
233 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
234 FIXME("(%p)->(%p)\n", This, p);
235 return E_NOTIMPL;
238 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundPositionY(IHTMLCurrentStyle *iface, VARIANT *p)
240 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
241 FIXME("(%p)->(%p)\n", This, p);
242 return E_NOTIMPL;
245 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundRepeat(IHTMLCurrentStyle *iface, BSTR *p)
247 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
248 TRACE("(%p)->(%p)\n", This, p);
249 return get_nsstyle_attr(This->nsstyle, STYLEID_BACKGROUND_REPEAT, p, 0);
252 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftColor(IHTMLCurrentStyle *iface, VARIANT *p)
254 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
255 TRACE("(%p)->(%p)\n", This, p);
256 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_COLOR, p, 0);
259 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopColor(IHTMLCurrentStyle *iface, VARIANT *p)
261 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
262 TRACE("(%p)->(%p)\n", This, p);
263 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_COLOR, p, 0);
266 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightColor(IHTMLCurrentStyle *iface, VARIANT *p)
268 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
269 TRACE("(%p)->(%p)\n", This, p);
270 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_COLOR, p, 0);
273 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomColor(IHTMLCurrentStyle *iface, VARIANT *p)
275 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
276 TRACE("(%p)->(%p)\n", This, p);
277 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_COLOR, p, 0);
280 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopStyle(IHTMLCurrentStyle *iface, BSTR *p)
282 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
283 TRACE("(%p)->(%p)\n", This, p);
284 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_TOP_STYLE, p, 0);
287 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightStyle(IHTMLCurrentStyle *iface, BSTR *p)
289 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
290 TRACE("(%p)->(%p)\n", This, p);
291 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_RIGHT_STYLE, p, 0);
294 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomStyle(IHTMLCurrentStyle *iface, BSTR *p)
296 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
297 TRACE("(%p)->(%p)\n", This, p);
298 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_BOTTOM_STYLE, p, 0);
301 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftStyle(IHTMLCurrentStyle *iface, BSTR *p)
303 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
304 TRACE("(%p)->(%p)\n", This, p);
305 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_LEFT_STYLE, p, 0);
308 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopWidth(IHTMLCurrentStyle *iface, VARIANT *p)
310 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
311 TRACE("(%p)->(%p)\n", This, p);
312 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_WIDTH, p, 0);
315 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightWidth(IHTMLCurrentStyle *iface, VARIANT *p)
317 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
318 TRACE("(%p)->(%p)\n", This, p);
319 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_WIDTH, p, 0);
322 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomWidth(IHTMLCurrentStyle *iface, VARIANT *p)
324 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
325 TRACE("(%p)->(%p)\n", This, p);
326 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_WIDTH, p, 0);
329 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftWidth(IHTMLCurrentStyle *iface, VARIANT *p)
331 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
332 TRACE("(%p)->(%p)\n", This, p);
333 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_WIDTH, p, 0);
336 static HRESULT WINAPI HTMLCurrentStyle_get_left(IHTMLCurrentStyle *iface, VARIANT *p)
338 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
339 TRACE("(%p)->(%p)\n", This, p);
340 return get_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, p, 0);
343 static HRESULT WINAPI HTMLCurrentStyle_get_top(IHTMLCurrentStyle *iface, VARIANT *p)
345 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
346 TRACE("(%p)->(%p)\n", This, p);
347 return get_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, p, 0);
350 static HRESULT WINAPI HTMLCurrentStyle_get_width(IHTMLCurrentStyle *iface, VARIANT *p)
352 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
353 TRACE("(%p)->(%p)\n", This, p);
354 return get_nsstyle_attr_var(This->nsstyle, STYLEID_WIDTH, p, 0);
357 static HRESULT WINAPI HTMLCurrentStyle_get_height(IHTMLCurrentStyle *iface, VARIANT *p)
359 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
360 TRACE("(%p)->(%p)\n", This, p);
361 return get_nsstyle_attr_var(This->nsstyle, STYLEID_HEIGHT, p, 0);
364 static HRESULT WINAPI HTMLCurrentStyle_get_paddingLeft(IHTMLCurrentStyle *iface, VARIANT *p)
366 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
367 TRACE("(%p)->(%p)\n", This, p);
368 return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_LEFT, p, 0);
371 static HRESULT WINAPI HTMLCurrentStyle_get_paddingTop(IHTMLCurrentStyle *iface, VARIANT *p)
373 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
374 TRACE("(%p)->(%p)\n", This, p);
375 return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_TOP, p, 0);
378 static HRESULT WINAPI HTMLCurrentStyle_get_paddingRight(IHTMLCurrentStyle *iface, VARIANT *p)
380 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
381 TRACE("(%p)->(%p)\n", This, p);
382 return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_RIGHT, p, 0);
385 static HRESULT WINAPI HTMLCurrentStyle_get_paddingBottom(IHTMLCurrentStyle *iface, VARIANT *p)
387 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
388 TRACE("(%p)->(%p)\n", This, p);
389 return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_BOTTOM, p, 0);
392 static HRESULT WINAPI HTMLCurrentStyle_get_textAlign(IHTMLCurrentStyle *iface, BSTR *p)
394 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
395 TRACE("(%p)->(%p)\n", This, p);
396 return get_nsstyle_attr(This->nsstyle, STYLEID_TEXT_ALIGN, p, 0);
399 static HRESULT WINAPI HTMLCurrentStyle_get_textDecoration(IHTMLCurrentStyle *iface, BSTR *p)
401 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
402 TRACE("(%p)->(%p)\n", This, p);
403 return get_nsstyle_attr(This->nsstyle, STYLEID_TEXT_DECORATION, p, 0);
406 static HRESULT WINAPI HTMLCurrentStyle_get_display(IHTMLCurrentStyle *iface, BSTR *p)
408 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
410 TRACE("(%p)->(%p)\n", This, p);
412 return get_nsstyle_attr(This->nsstyle, STYLEID_DISPLAY, p, 0);
415 static HRESULT WINAPI HTMLCurrentStyle_get_visibility(IHTMLCurrentStyle *iface, BSTR *p)
417 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
419 TRACE("(%p)->(%p)\n", This, p);
421 return get_nsstyle_attr(This->nsstyle, STYLEID_VISIBILITY, p, 0);
424 static HRESULT WINAPI HTMLCurrentStyle_get_zIndex(IHTMLCurrentStyle *iface, VARIANT *p)
426 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
427 TRACE("(%p)->(%p)\n", This, p);
428 return get_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, p, ATTR_STR_TO_INT);
431 static HRESULT WINAPI HTMLCurrentStyle_get_letterSpacing(IHTMLCurrentStyle *iface, VARIANT *p)
433 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
434 TRACE("(%p)->(%p)\n", This, p);
435 return get_nsstyle_attr_var(This->nsstyle, STYLEID_LETTER_SPACING, p, 0);
438 static HRESULT WINAPI HTMLCurrentStyle_get_lineHeight(IHTMLCurrentStyle *iface, VARIANT *p)
440 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
441 TRACE("(%p)->(%p)\n", This, p);
442 return get_nsstyle_attr_var(This->nsstyle, STYLEID_LINE_HEIGHT, p, 0);
445 static HRESULT WINAPI HTMLCurrentStyle_get_textIndent(IHTMLCurrentStyle *iface, VARIANT *p)
447 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
448 TRACE("(%p)->(%p)\n", This, p);
449 return get_nsstyle_attr_var(This->nsstyle, STYLEID_TEXT_INDENT, p, 0);
452 static HRESULT WINAPI HTMLCurrentStyle_get_verticalAlign(IHTMLCurrentStyle *iface, VARIANT *p)
454 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
455 TRACE("(%p)->(%p)\n", This, p);
456 return get_nsstyle_attr_var(This->nsstyle, STYLEID_VERTICAL_ALIGN, p, 0);
459 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundAttachment(IHTMLCurrentStyle *iface, BSTR *p)
461 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
462 FIXME("(%p)->(%p)\n", This, p);
463 return E_NOTIMPL;
466 static HRESULT WINAPI HTMLCurrentStyle_get_marginTop(IHTMLCurrentStyle *iface, VARIANT *p)
468 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
469 TRACE("(%p)->(%p)\n", This, p);
470 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_TOP, p, 0);
473 static HRESULT WINAPI HTMLCurrentStyle_get_marginRight(IHTMLCurrentStyle *iface, VARIANT *p)
475 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
476 TRACE("(%p)->(%p)\n", This, p);
477 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_RIGHT, p, 0);
480 static HRESULT WINAPI HTMLCurrentStyle_get_marginBottom(IHTMLCurrentStyle *iface, VARIANT *p)
482 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
483 TRACE("(%p)->(%p)\n", This, p);
484 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_BOTTOM, p, 0);
487 static HRESULT WINAPI HTMLCurrentStyle_get_marginLeft(IHTMLCurrentStyle *iface, VARIANT *p)
489 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
490 TRACE("(%p)->(%p)\n", This, p);
491 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_LEFT, p, 0);
494 static HRESULT WINAPI HTMLCurrentStyle_get_clear(IHTMLCurrentStyle *iface, BSTR *p)
496 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
497 FIXME("(%p)->(%p)\n", This, p);
498 return E_NOTIMPL;
501 static HRESULT WINAPI HTMLCurrentStyle_get_listStyleType(IHTMLCurrentStyle *iface, BSTR *p)
503 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
504 FIXME("(%p)->(%p)\n", This, p);
505 return E_NOTIMPL;
508 static HRESULT WINAPI HTMLCurrentStyle_get_listStylePosition(IHTMLCurrentStyle *iface, BSTR *p)
510 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
511 FIXME("(%p)->(%p)\n", This, p);
512 return E_NOTIMPL;
515 static HRESULT WINAPI HTMLCurrentStyle_get_listStyleImage(IHTMLCurrentStyle *iface, BSTR *p)
517 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
518 FIXME("(%p)->(%p)\n", This, p);
519 return E_NOTIMPL;
522 static HRESULT WINAPI HTMLCurrentStyle_get_clipTop(IHTMLCurrentStyle *iface, VARIANT *p)
524 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
525 FIXME("(%p)->(%p)\n", This, p);
526 return E_NOTIMPL;
529 static HRESULT WINAPI HTMLCurrentStyle_get_clipRight(IHTMLCurrentStyle *iface, VARIANT *p)
531 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
532 FIXME("(%p)->(%p)\n", This, p);
533 return E_NOTIMPL;
536 static HRESULT WINAPI HTMLCurrentStyle_get_clipBottom(IHTMLCurrentStyle *iface, VARIANT *p)
538 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
539 FIXME("(%p)->(%p)\n", This, p);
540 return E_NOTIMPL;
543 static HRESULT WINAPI HTMLCurrentStyle_get_clipLeft(IHTMLCurrentStyle *iface, VARIANT *p)
545 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
546 FIXME("(%p)->(%p)\n", This, p);
547 return E_NOTIMPL;
550 static HRESULT WINAPI HTMLCurrentStyle_get_overflow(IHTMLCurrentStyle *iface, BSTR *p)
552 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
553 TRACE("(%p)->(%p)\n", This, p);
554 return get_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, p, 0);
557 static HRESULT WINAPI HTMLCurrentStyle_get_pageBreakBefore(IHTMLCurrentStyle *iface, BSTR *p)
559 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
560 FIXME("(%p)->(%p)\n", This, p);
561 return E_NOTIMPL;
564 static HRESULT WINAPI HTMLCurrentStyle_get_pageBreakAfter(IHTMLCurrentStyle *iface, BSTR *p)
566 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
567 FIXME("(%p)->(%p)\n", This, p);
568 return E_NOTIMPL;
571 static HRESULT WINAPI HTMLCurrentStyle_get_cursor(IHTMLCurrentStyle *iface, BSTR *p)
573 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
574 TRACE("(%p)->(%p)\n", This, p);
575 return get_nsstyle_attr(This->nsstyle, STYLEID_CURSOR, p, 0);
578 static HRESULT WINAPI HTMLCurrentStyle_get_tableLayout(IHTMLCurrentStyle *iface, BSTR *p)
580 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
581 FIXME("(%p)->(%p)\n", This, p);
582 return E_NOTIMPL;
585 static HRESULT WINAPI HTMLCurrentStyle_get_borderCollapse(IHTMLCurrentStyle *iface, BSTR *p)
587 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
588 FIXME("(%p)->(%p)\n", This, p);
589 return E_NOTIMPL;
592 static HRESULT WINAPI HTMLCurrentStyle_get_direction(IHTMLCurrentStyle *iface, BSTR *p)
594 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
595 FIXME("(%p)->(%p)\n", This, p);
596 return E_NOTIMPL;
599 static HRESULT WINAPI HTMLCurrentStyle_get_behavior(IHTMLCurrentStyle *iface, BSTR *p)
601 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
602 FIXME("(%p)->(%p)\n", This, p);
603 return E_NOTIMPL;
606 static HRESULT WINAPI HTMLCurrentStyle_getAttribute(IHTMLCurrentStyle *iface, BSTR strAttributeName,
607 LONG lFlags, VARIANT *AttributeValue)
609 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
610 FIXME("(%p)->(%s %x %p)\n", This, debugstr_w(strAttributeName), lFlags, AttributeValue);
611 return E_NOTIMPL;
614 static HRESULT WINAPI HTMLCurrentStyle_get_unicodeBidi(IHTMLCurrentStyle *iface, BSTR *p)
616 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
617 FIXME("(%p)->(%p)\n", This, p);
618 return E_NOTIMPL;
621 static HRESULT WINAPI HTMLCurrentStyle_get_right(IHTMLCurrentStyle *iface, VARIANT *p)
623 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
624 TRACE("(%p)->(%p)\n", This, p);
625 return get_nsstyle_attr_var(This->nsstyle, STYLEID_RIGHT, p, 0);
628 static HRESULT WINAPI HTMLCurrentStyle_get_bottom(IHTMLCurrentStyle *iface, VARIANT *p)
630 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
631 TRACE("(%p)->(%p)\n", This, p);
632 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BOTTOM, p, 0);
635 static HRESULT WINAPI HTMLCurrentStyle_get_imeMode(IHTMLCurrentStyle *iface, BSTR *p)
637 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
638 FIXME("(%p)->(%p)\n", This, p);
639 return E_NOTIMPL;
642 static HRESULT WINAPI HTMLCurrentStyle_get_rubyAlign(IHTMLCurrentStyle *iface, BSTR *p)
644 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
645 FIXME("(%p)->(%p)\n", This, p);
646 return E_NOTIMPL;
649 static HRESULT WINAPI HTMLCurrentStyle_get_rubyPosition(IHTMLCurrentStyle *iface, BSTR *p)
651 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
652 FIXME("(%p)->(%p)\n", This, p);
653 return E_NOTIMPL;
656 static HRESULT WINAPI HTMLCurrentStyle_get_rubyOverhang(IHTMLCurrentStyle *iface, BSTR *p)
658 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
659 FIXME("(%p)->(%p)\n", This, p);
660 return E_NOTIMPL;
663 static HRESULT WINAPI HTMLCurrentStyle_get_textAutospace(IHTMLCurrentStyle *iface, BSTR *p)
665 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
666 FIXME("(%p)->(%p)\n", This, p);
667 return E_NOTIMPL;
670 static HRESULT WINAPI HTMLCurrentStyle_get_lineBreak(IHTMLCurrentStyle *iface, BSTR *p)
672 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
673 FIXME("(%p)->(%p)\n", This, p);
674 return E_NOTIMPL;
677 static HRESULT WINAPI HTMLCurrentStyle_get_wordBreak(IHTMLCurrentStyle *iface, BSTR *p)
679 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
680 FIXME("(%p)->(%p)\n", This, p);
681 return E_NOTIMPL;
684 static HRESULT WINAPI HTMLCurrentStyle_get_textJustify(IHTMLCurrentStyle *iface, BSTR *p)
686 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
687 FIXME("(%p)->(%p)\n", This, p);
688 return E_NOTIMPL;
691 static HRESULT WINAPI HTMLCurrentStyle_get_textJustifyTrim(IHTMLCurrentStyle *iface, BSTR *p)
693 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
694 FIXME("(%p)->(%p)\n", This, p);
695 return E_NOTIMPL;
698 static HRESULT WINAPI HTMLCurrentStyle_get_textKashida(IHTMLCurrentStyle *iface, VARIANT *p)
700 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
701 FIXME("(%p)->(%p)\n", This, p);
702 return E_NOTIMPL;
705 static HRESULT WINAPI HTMLCurrentStyle_get_blockDirection(IHTMLCurrentStyle *iface, BSTR *p)
707 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
708 FIXME("(%p)->(%p)\n", This, p);
709 return E_NOTIMPL;
712 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridChar(IHTMLCurrentStyle *iface, VARIANT *p)
714 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
715 FIXME("(%p)->(%p)\n", This, p);
716 return E_NOTIMPL;
719 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridLine(IHTMLCurrentStyle *iface, VARIANT *p)
721 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
722 FIXME("(%p)->(%p)\n", This, p);
723 return E_NOTIMPL;
726 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridMode(IHTMLCurrentStyle *iface, BSTR *p)
728 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
729 FIXME("(%p)->(%p)\n", This, p);
730 return E_NOTIMPL;
733 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridType(IHTMLCurrentStyle *iface, BSTR *p)
735 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
736 FIXME("(%p)->(%p)\n", This, p);
737 return E_NOTIMPL;
740 static HRESULT WINAPI HTMLCurrentStyle_get_borderStyle(IHTMLCurrentStyle *iface, BSTR *p)
742 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
743 TRACE("(%p)->(%p)\n", This, p);
744 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_STYLE, p, 0);
747 static HRESULT WINAPI HTMLCurrentStyle_get_borderColor(IHTMLCurrentStyle *iface, BSTR *p)
749 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
750 TRACE("(%p)->(%p)\n", This, p);
751 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_COLOR, p, 0);
754 static HRESULT WINAPI HTMLCurrentStyle_get_borderWidth(IHTMLCurrentStyle *iface, BSTR *p)
756 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
757 TRACE("(%p)->(%p)\n", This, p);
758 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_WIDTH, p, 0);
761 static HRESULT WINAPI HTMLCurrentStyle_get_padding(IHTMLCurrentStyle *iface, BSTR *p)
763 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
764 TRACE("(%p)->(%p)\n", This, p);
765 return get_nsstyle_attr(This->nsstyle, STYLEID_PADDING, p, 0);
768 static HRESULT WINAPI HTMLCurrentStyle_get_margin(IHTMLCurrentStyle *iface, BSTR *p)
770 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
771 TRACE("(%p)->(%p)\n", This, p);
772 return get_nsstyle_attr(This->nsstyle, STYLEID_MARGIN, p, 0);
775 static HRESULT WINAPI HTMLCurrentStyle_get_accelerator(IHTMLCurrentStyle *iface, BSTR *p)
777 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
778 FIXME("(%p)->(%p)\n", This, p);
779 return E_NOTIMPL;
782 static HRESULT WINAPI HTMLCurrentStyle_get_overflowX(IHTMLCurrentStyle *iface, BSTR *p)
784 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
785 TRACE("(%p)->(%p)\n", This, p);
786 return get_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW_X, p, 0);
789 static HRESULT WINAPI HTMLCurrentStyle_get_overflowY(IHTMLCurrentStyle *iface, BSTR *p)
791 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
792 TRACE("(%p)->(%p)\n", This, p);
793 return get_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW_Y, p, 0);
796 static HRESULT WINAPI HTMLCurrentStyle_get_textTransform(IHTMLCurrentStyle *iface, BSTR *p)
798 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle(iface);
799 TRACE("(%p)->(%p)\n", This, p);
800 return get_nsstyle_attr(This->nsstyle, STYLEID_TEXT_TRANSFORM, p, 0);
803 static const IHTMLCurrentStyleVtbl HTMLCurrentStyleVtbl = {
804 HTMLCurrentStyle_QueryInterface,
805 HTMLCurrentStyle_AddRef,
806 HTMLCurrentStyle_Release,
807 HTMLCurrentStyle_GetTypeInfoCount,
808 HTMLCurrentStyle_GetTypeInfo,
809 HTMLCurrentStyle_GetIDsOfNames,
810 HTMLCurrentStyle_Invoke,
811 HTMLCurrentStyle_get_position,
812 HTMLCurrentStyle_get_styleFloat,
813 HTMLCurrentStyle_get_color,
814 HTMLCurrentStyle_get_backgroundColor,
815 HTMLCurrentStyle_get_fontFamily,
816 HTMLCurrentStyle_get_fontStyle,
817 HTMLCurrentStyle_get_fontVariant,
818 HTMLCurrentStyle_get_fontWeight,
819 HTMLCurrentStyle_get_fontSize,
820 HTMLCurrentStyle_get_backgroundImage,
821 HTMLCurrentStyle_get_backgroundPositionX,
822 HTMLCurrentStyle_get_backgroundPositionY,
823 HTMLCurrentStyle_get_backgroundRepeat,
824 HTMLCurrentStyle_get_borderLeftColor,
825 HTMLCurrentStyle_get_borderTopColor,
826 HTMLCurrentStyle_get_borderRightColor,
827 HTMLCurrentStyle_get_borderBottomColor,
828 HTMLCurrentStyle_get_borderTopStyle,
829 HTMLCurrentStyle_get_borderRightStyle,
830 HTMLCurrentStyle_get_borderBottomStyle,
831 HTMLCurrentStyle_get_borderLeftStyle,
832 HTMLCurrentStyle_get_borderTopWidth,
833 HTMLCurrentStyle_get_borderRightWidth,
834 HTMLCurrentStyle_get_borderBottomWidth,
835 HTMLCurrentStyle_get_borderLeftWidth,
836 HTMLCurrentStyle_get_left,
837 HTMLCurrentStyle_get_top,
838 HTMLCurrentStyle_get_width,
839 HTMLCurrentStyle_get_height,
840 HTMLCurrentStyle_get_paddingLeft,
841 HTMLCurrentStyle_get_paddingTop,
842 HTMLCurrentStyle_get_paddingRight,
843 HTMLCurrentStyle_get_paddingBottom,
844 HTMLCurrentStyle_get_textAlign,
845 HTMLCurrentStyle_get_textDecoration,
846 HTMLCurrentStyle_get_display,
847 HTMLCurrentStyle_get_visibility,
848 HTMLCurrentStyle_get_zIndex,
849 HTMLCurrentStyle_get_letterSpacing,
850 HTMLCurrentStyle_get_lineHeight,
851 HTMLCurrentStyle_get_textIndent,
852 HTMLCurrentStyle_get_verticalAlign,
853 HTMLCurrentStyle_get_backgroundAttachment,
854 HTMLCurrentStyle_get_marginTop,
855 HTMLCurrentStyle_get_marginRight,
856 HTMLCurrentStyle_get_marginBottom,
857 HTMLCurrentStyle_get_marginLeft,
858 HTMLCurrentStyle_get_clear,
859 HTMLCurrentStyle_get_listStyleType,
860 HTMLCurrentStyle_get_listStylePosition,
861 HTMLCurrentStyle_get_listStyleImage,
862 HTMLCurrentStyle_get_clipTop,
863 HTMLCurrentStyle_get_clipRight,
864 HTMLCurrentStyle_get_clipBottom,
865 HTMLCurrentStyle_get_clipLeft,
866 HTMLCurrentStyle_get_overflow,
867 HTMLCurrentStyle_get_pageBreakBefore,
868 HTMLCurrentStyle_get_pageBreakAfter,
869 HTMLCurrentStyle_get_cursor,
870 HTMLCurrentStyle_get_tableLayout,
871 HTMLCurrentStyle_get_borderCollapse,
872 HTMLCurrentStyle_get_direction,
873 HTMLCurrentStyle_get_behavior,
874 HTMLCurrentStyle_getAttribute,
875 HTMLCurrentStyle_get_unicodeBidi,
876 HTMLCurrentStyle_get_right,
877 HTMLCurrentStyle_get_bottom,
878 HTMLCurrentStyle_get_imeMode,
879 HTMLCurrentStyle_get_rubyAlign,
880 HTMLCurrentStyle_get_rubyPosition,
881 HTMLCurrentStyle_get_rubyOverhang,
882 HTMLCurrentStyle_get_textAutospace,
883 HTMLCurrentStyle_get_lineBreak,
884 HTMLCurrentStyle_get_wordBreak,
885 HTMLCurrentStyle_get_textJustify,
886 HTMLCurrentStyle_get_textJustifyTrim,
887 HTMLCurrentStyle_get_textKashida,
888 HTMLCurrentStyle_get_blockDirection,
889 HTMLCurrentStyle_get_layoutGridChar,
890 HTMLCurrentStyle_get_layoutGridLine,
891 HTMLCurrentStyle_get_layoutGridMode,
892 HTMLCurrentStyle_get_layoutGridType,
893 HTMLCurrentStyle_get_borderStyle,
894 HTMLCurrentStyle_get_borderColor,
895 HTMLCurrentStyle_get_borderWidth,
896 HTMLCurrentStyle_get_padding,
897 HTMLCurrentStyle_get_margin,
898 HTMLCurrentStyle_get_accelerator,
899 HTMLCurrentStyle_get_overflowX,
900 HTMLCurrentStyle_get_overflowY,
901 HTMLCurrentStyle_get_textTransform
904 /* IHTMLCurrentStyle2 */
905 static HRESULT WINAPI HTMLCurrentStyle2_QueryInterface(IHTMLCurrentStyle2 *iface, REFIID riid, void **ppv)
907 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
909 return IHTMLCurrentStyle_QueryInterface(&This->IHTMLCurrentStyle_iface, riid, ppv);
912 static ULONG WINAPI HTMLCurrentStyle2_AddRef(IHTMLCurrentStyle2 *iface)
914 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
916 return IHTMLCurrentStyle_AddRef(&This->IHTMLCurrentStyle_iface);
919 static ULONG WINAPI HTMLCurrentStyle2_Release(IHTMLCurrentStyle2 *iface)
921 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
922 return IHTMLCurrentStyle_Release(&This->IHTMLCurrentStyle_iface);
925 static HRESULT WINAPI HTMLCurrentStyle2_GetTypeInfoCount(IHTMLCurrentStyle2 *iface, UINT *pctinfo)
927 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
928 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
931 static HRESULT WINAPI HTMLCurrentStyle2_GetTypeInfo(IHTMLCurrentStyle2 *iface, UINT iTInfo,
932 LCID lcid, ITypeInfo **ppTInfo)
934 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
935 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
938 static HRESULT WINAPI HTMLCurrentStyle2_GetIDsOfNames(IHTMLCurrentStyle2 *iface, REFIID riid,
939 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
941 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
942 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
943 lcid, rgDispId);
946 static HRESULT WINAPI HTMLCurrentStyle2_Invoke(IHTMLCurrentStyle2 *iface, DISPID dispIdMember,
947 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
948 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
950 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
951 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
952 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
955 static HRESULT WINAPI HTMLCurrentStyle2_get_layoutFlow(IHTMLCurrentStyle2 *iface, BSTR *p)
957 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
958 FIXME("(%p)->(%p)\n", This, p);
959 return E_NOTIMPL;
962 static HRESULT WINAPI HTMLCurrentStyle2_get_wordWrap(IHTMLCurrentStyle2 *iface, BSTR *p)
964 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
965 FIXME("(%p)->(%p)\n", This, p);
966 return E_NOTIMPL;
969 static HRESULT WINAPI HTMLCurrentStyle2_get_textUnderlinePosition(IHTMLCurrentStyle2 *iface, BSTR *p)
971 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
972 FIXME("(%p)->(%p)\n", This, p);
973 return E_NOTIMPL;
976 static HRESULT WINAPI HTMLCurrentStyle2_get_hasLayout(IHTMLCurrentStyle2 *iface, VARIANT_BOOL *p)
978 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
980 FIXME("(%p)->(%p) returning true\n", This, p);
982 *p = VARIANT_TRUE;
983 return S_OK;
986 static HRESULT WINAPI HTMLCurrentStyle2_get_scrollbarBaseColor(IHTMLCurrentStyle2 *iface, VARIANT *p)
988 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
989 FIXME("(%p)->(%p)\n", This, p);
990 return E_NOTIMPL;
993 static HRESULT WINAPI HTMLCurrentStyle2_get_scrollbarFaceColor(IHTMLCurrentStyle2 *iface, VARIANT *p)
995 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
996 FIXME("(%p)->(%p)\n", This, p);
997 return E_NOTIMPL;
1000 static HRESULT WINAPI HTMLCurrentStyle2_get_scrollbar3dLightColor(IHTMLCurrentStyle2 *iface, VARIANT *p)
1002 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1003 FIXME("(%p)->(%p)\n", This, p);
1004 return E_NOTIMPL;
1007 static HRESULT WINAPI HTMLCurrentStyle2_get_scrollbarShadowColor(IHTMLCurrentStyle2 *iface, VARIANT *p)
1009 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1010 FIXME("(%p)->(%p)\n", This, p);
1011 return E_NOTIMPL;
1014 static HRESULT WINAPI HTMLCurrentStyle2_get_scrollbarHighlightColor(IHTMLCurrentStyle2 *iface, VARIANT *p)
1016 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1017 FIXME("(%p)->(%p)\n", This, p);
1018 return E_NOTIMPL;
1021 static HRESULT WINAPI HTMLCurrentStyle2_get_scrollbarDarkShadowColor(IHTMLCurrentStyle2 *iface, VARIANT *p)
1023 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1024 FIXME("(%p)->(%p)\n", This, p);
1025 return E_NOTIMPL;
1028 static HRESULT WINAPI HTMLCurrentStyle2_get_scrollbarArrowColor(IHTMLCurrentStyle2 *iface, VARIANT *p)
1030 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1031 FIXME("(%p)->(%p)\n", This, p);
1032 return E_NOTIMPL;
1035 static HRESULT WINAPI HTMLCurrentStyle2_get_scrollbarTrackColor(IHTMLCurrentStyle2 *iface, VARIANT *p)
1037 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1038 FIXME("(%p)->(%p)\n", This, p);
1039 return E_NOTIMPL;
1042 static HRESULT WINAPI HTMLCurrentStyle2_get_writingMode(IHTMLCurrentStyle2 *iface, BSTR *p)
1044 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1045 FIXME("(%p)->(%p)\n", This, p);
1046 return E_NOTIMPL;
1049 static HRESULT WINAPI HTMLCurrentStyle2_get_zoom(IHTMLCurrentStyle2 *iface, VARIANT *p)
1051 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1052 FIXME("(%p)->(%p)\n", This, p);
1053 return E_NOTIMPL;
1056 static HRESULT WINAPI HTMLCurrentStyle2_get_filter(IHTMLCurrentStyle2 *iface, BSTR *p)
1058 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1060 TRACE("(%p)->(%p)\n", This, p);
1062 if(This->elem->filter) {
1063 *p = SysAllocString(This->elem->filter);
1064 if(!*p)
1065 return E_OUTOFMEMORY;
1066 }else {
1067 *p = NULL;
1070 return S_OK;
1073 static HRESULT WINAPI HTMLCurrentStyle2_get_textAlignLast(IHTMLCurrentStyle2 *iface, BSTR *p)
1075 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1076 FIXME("(%p)->(%p)\n", This, p);
1077 return E_NOTIMPL;
1080 static HRESULT WINAPI HTMLCurrentStyle2_get_textKashidaSpace(IHTMLCurrentStyle2 *iface, VARIANT *p)
1082 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1083 FIXME("(%p)->(%p)\n", This, p);
1084 return E_NOTIMPL;
1087 static HRESULT WINAPI HTMLCurrentStyle2_get_isBlock(IHTMLCurrentStyle2 *iface, VARIANT_BOOL *p)
1089 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle2(iface);
1090 FIXME("(%p)->(%p)\n", This, p);
1091 return E_NOTIMPL;
1094 static const IHTMLCurrentStyle2Vtbl HTMLCurrentStyle2Vtbl = {
1095 HTMLCurrentStyle2_QueryInterface,
1096 HTMLCurrentStyle2_AddRef,
1097 HTMLCurrentStyle2_Release,
1098 HTMLCurrentStyle2_GetTypeInfoCount,
1099 HTMLCurrentStyle2_GetTypeInfo,
1100 HTMLCurrentStyle2_GetIDsOfNames,
1101 HTMLCurrentStyle2_Invoke,
1102 HTMLCurrentStyle2_get_layoutFlow,
1103 HTMLCurrentStyle2_get_wordWrap,
1104 HTMLCurrentStyle2_get_textUnderlinePosition,
1105 HTMLCurrentStyle2_get_hasLayout,
1106 HTMLCurrentStyle2_get_scrollbarBaseColor,
1107 HTMLCurrentStyle2_get_scrollbarFaceColor,
1108 HTMLCurrentStyle2_get_scrollbar3dLightColor,
1109 HTMLCurrentStyle2_get_scrollbarShadowColor,
1110 HTMLCurrentStyle2_get_scrollbarHighlightColor,
1111 HTMLCurrentStyle2_get_scrollbarDarkShadowColor,
1112 HTMLCurrentStyle2_get_scrollbarArrowColor,
1113 HTMLCurrentStyle2_get_scrollbarTrackColor,
1114 HTMLCurrentStyle2_get_writingMode,
1115 HTMLCurrentStyle2_get_zoom,
1116 HTMLCurrentStyle2_get_filter,
1117 HTMLCurrentStyle2_get_textAlignLast,
1118 HTMLCurrentStyle2_get_textKashidaSpace,
1119 HTMLCurrentStyle2_get_isBlock
1122 /* IHTMLCurrentStyle3 */
1123 static HRESULT WINAPI HTMLCurrentStyle3_QueryInterface(IHTMLCurrentStyle3 *iface, REFIID riid, void **ppv)
1125 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1127 return IHTMLCurrentStyle_QueryInterface(&This->IHTMLCurrentStyle_iface, riid, ppv);
1130 static ULONG WINAPI HTMLCurrentStyle3_AddRef(IHTMLCurrentStyle3 *iface)
1132 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1134 return IHTMLCurrentStyle_AddRef(&This->IHTMLCurrentStyle_iface);
1137 static ULONG WINAPI HTMLCurrentStyle3_Release(IHTMLCurrentStyle3 *iface)
1139 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1140 return IHTMLCurrentStyle_Release(&This->IHTMLCurrentStyle_iface);
1143 static HRESULT WINAPI HTMLCurrentStyle3_GetTypeInfoCount(IHTMLCurrentStyle3 *iface, UINT *pctinfo)
1145 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1146 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
1149 static HRESULT WINAPI HTMLCurrentStyle3_GetTypeInfo(IHTMLCurrentStyle3 *iface, UINT iTInfo,
1150 LCID lcid, ITypeInfo **ppTInfo)
1152 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1153 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1156 static HRESULT WINAPI HTMLCurrentStyle3_GetIDsOfNames(IHTMLCurrentStyle3 *iface, REFIID riid,
1157 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
1159 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1160 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
1161 lcid, rgDispId);
1164 static HRESULT WINAPI HTMLCurrentStyle3_Invoke(IHTMLCurrentStyle3 *iface, DISPID dispIdMember,
1165 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1166 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1168 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1169 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
1170 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1173 static HRESULT WINAPI HTMLCurrentStyle3_get_textOverflow(IHTMLCurrentStyle3 *iface, BSTR *p)
1175 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1176 FIXME("(%p)->(%p)\n", This, p);
1177 return E_NOTIMPL;
1180 static HRESULT WINAPI HTMLCurrentStyle3_get_minHeight(IHTMLCurrentStyle3 *iface, VARIANT *p)
1182 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1183 FIXME("(%p)->(%p)\n", This, p);
1184 return E_NOTIMPL;
1187 static HRESULT WINAPI HTMLCurrentStyle3_get_wordSpacing(IHTMLCurrentStyle3 *iface, VARIANT *p)
1189 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1190 FIXME("(%p)->(%p)\n", This, p);
1191 return E_NOTIMPL;
1194 static HRESULT WINAPI HTMLCurrentStyle3_get_whiteSpace(IHTMLCurrentStyle3 *iface, BSTR *p)
1196 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle3(iface);
1198 TRACE("(%p)->(%p)\n", This, p);
1200 return get_nsstyle_attr(This->nsstyle, STYLEID_WHITE_SPACE, p, 0);
1203 static const IHTMLCurrentStyle3Vtbl HTMLCurrentStyle3Vtbl = {
1204 HTMLCurrentStyle3_QueryInterface,
1205 HTMLCurrentStyle3_AddRef,
1206 HTMLCurrentStyle3_Release,
1207 HTMLCurrentStyle3_GetTypeInfoCount,
1208 HTMLCurrentStyle3_GetTypeInfo,
1209 HTMLCurrentStyle3_GetIDsOfNames,
1210 HTMLCurrentStyle3_Invoke,
1211 HTMLCurrentStyle3_get_textOverflow,
1212 HTMLCurrentStyle3_get_minHeight,
1213 HTMLCurrentStyle3_get_wordSpacing,
1214 HTMLCurrentStyle3_get_whiteSpace
1217 /* IHTMLCurrentStyle4 */
1218 static HRESULT WINAPI HTMLCurrentStyle4_QueryInterface(IHTMLCurrentStyle4 *iface, REFIID riid, void **ppv)
1220 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1222 return IHTMLCurrentStyle_QueryInterface(&This->IHTMLCurrentStyle_iface, riid, ppv);
1225 static ULONG WINAPI HTMLCurrentStyle4_AddRef(IHTMLCurrentStyle4 *iface)
1227 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1229 return IHTMLCurrentStyle_AddRef(&This->IHTMLCurrentStyle_iface);
1232 static ULONG WINAPI HTMLCurrentStyle4_Release(IHTMLCurrentStyle4 *iface)
1234 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1235 return IHTMLCurrentStyle_Release(&This->IHTMLCurrentStyle_iface);
1238 static HRESULT WINAPI HTMLCurrentStyle4_GetTypeInfoCount(IHTMLCurrentStyle4 *iface, UINT *pctinfo)
1240 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1241 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
1244 static HRESULT WINAPI HTMLCurrentStyle4_GetTypeInfo(IHTMLCurrentStyle4 *iface, UINT iTInfo,
1245 LCID lcid, ITypeInfo **ppTInfo)
1247 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1248 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1251 static HRESULT WINAPI HTMLCurrentStyle4_GetIDsOfNames(IHTMLCurrentStyle4 *iface, REFIID riid,
1252 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
1254 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1255 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
1256 lcid, rgDispId);
1259 static HRESULT WINAPI HTMLCurrentStyle4_Invoke(IHTMLCurrentStyle4 *iface, DISPID dispIdMember,
1260 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1261 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1263 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1264 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
1265 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1268 static HRESULT WINAPI HTMLCurrentStyle4_msInterpolationMode(IHTMLCurrentStyle4 *iface, BSTR *p)
1270 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1271 FIXME("(%p)->(%p)\n", This, p);
1272 return E_NOTIMPL;
1275 static HRESULT WINAPI HTMLCurrentStyle4_get_maxHeight(IHTMLCurrentStyle4 *iface, VARIANT *p)
1277 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1278 FIXME("(%p)->(%p)\n", This, p);
1279 return E_NOTIMPL;
1282 static HRESULT WINAPI HTMLCurrentStyle4_get_minWidth(IHTMLCurrentStyle4 *iface, VARIANT *p)
1284 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1285 TRACE("(%p)->(%p)\n", This, p);
1286 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MIN_WIDTH, p, 0);
1289 static HRESULT WINAPI HTMLCurrentStyle4_get_maxWidth(IHTMLCurrentStyle4 *iface, VARIANT *p)
1291 HTMLCurrentStyle *This = impl_from_IHTMLCurrentStyle4(iface);
1292 FIXME("(%p)->(%p)\n", This, p);
1293 return E_NOTIMPL;
1296 static const IHTMLCurrentStyle4Vtbl HTMLCurrentStyle4Vtbl = {
1297 HTMLCurrentStyle4_QueryInterface,
1298 HTMLCurrentStyle4_AddRef,
1299 HTMLCurrentStyle4_Release,
1300 HTMLCurrentStyle4_GetTypeInfoCount,
1301 HTMLCurrentStyle4_GetTypeInfo,
1302 HTMLCurrentStyle4_GetIDsOfNames,
1303 HTMLCurrentStyle4_Invoke,
1304 HTMLCurrentStyle4_msInterpolationMode,
1305 HTMLCurrentStyle4_get_maxHeight,
1306 HTMLCurrentStyle4_get_minWidth,
1307 HTMLCurrentStyle4_get_maxWidth
1310 static const tid_t HTMLCurrentStyle_iface_tids[] = {
1311 IHTMLCurrentStyle_tid,
1312 IHTMLCurrentStyle2_tid,
1313 IHTMLCurrentStyle3_tid,
1314 IHTMLCurrentStyle4_tid,
1317 static dispex_static_data_t HTMLCurrentStyle_dispex = {
1318 NULL,
1319 DispHTMLCurrentStyle_tid,
1320 HTMLCurrentStyle_iface_tids
1323 HRESULT HTMLCurrentStyle_Create(HTMLElement *elem, IHTMLCurrentStyle **p)
1325 nsIDOMCSSStyleDeclaration *nsstyle;
1326 mozIDOMWindowProxy *nsview;
1327 nsIDOMWindow *nswindow;
1328 nsAString nsempty_str;
1329 HTMLCurrentStyle *ret;
1330 nsresult nsres;
1332 if(!elem->node.doc->nsdoc) {
1333 WARN("NULL nsdoc\n");
1334 return E_UNEXPECTED;
1337 nsres = nsIDOMHTMLDocument_GetDefaultView(elem->node.doc->nsdoc, &nsview);
1338 if(NS_FAILED(nsres)) {
1339 ERR("GetDefaultView failed: %08x\n", nsres);
1340 return E_FAIL;
1343 nsres = mozIDOMWindowProxy_QueryInterface(nsview, &IID_nsIDOMWindow, (void**)&nswindow);
1344 mozIDOMWindowProxy_Release(nsview);
1345 assert(nsres == NS_OK);
1347 nsAString_Init(&nsempty_str, NULL);
1348 nsres = nsIDOMWindow_GetComputedStyle(nswindow, (nsIDOMElement*)elem->nselem, &nsempty_str, &nsstyle);
1349 nsAString_Finish(&nsempty_str);
1350 nsIDOMWindow_Release(nswindow);
1351 if(NS_FAILED(nsres)) {
1352 ERR("GetComputedStyle failed: %08x\n", nsres);
1353 return E_FAIL;
1356 if(!nsstyle) {
1357 ERR("GetComputedStyle returned NULL nsstyle\n");
1358 return E_FAIL;
1361 ret = heap_alloc_zero(sizeof(HTMLCurrentStyle));
1362 if(!ret) {
1363 nsIDOMCSSStyleDeclaration_Release(nsstyle);
1364 return E_OUTOFMEMORY;
1367 ret->IHTMLCurrentStyle_iface.lpVtbl = &HTMLCurrentStyleVtbl;
1368 ret->IHTMLCurrentStyle2_iface.lpVtbl = &HTMLCurrentStyle2Vtbl;
1369 ret->IHTMLCurrentStyle3_iface.lpVtbl = &HTMLCurrentStyle3Vtbl;
1370 ret->IHTMLCurrentStyle4_iface.lpVtbl = &HTMLCurrentStyle4Vtbl;
1371 ret->ref = 1;
1372 ret->nsstyle = nsstyle;
1374 init_dispex(&ret->dispex, (IUnknown*)&ret->IHTMLCurrentStyle_iface, &HTMLCurrentStyle_dispex);
1376 IHTMLElement_AddRef(&elem->IHTMLElement_iface);
1377 ret->elem = elem;
1379 *p = &ret->IHTMLCurrentStyle_iface;
1380 return S_OK;