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
28 #include "mshtml_private.h"
29 #include "htmlstyle.h"
31 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
35 struct HTMLCurrentStyle
{
37 const IHTMLCurrentStyleVtbl
*lpIHTMLCurrentStyleVtbl
;
41 nsIDOMCSSStyleDeclaration
*nsstyle
;
44 #define HTMLCURSTYLE(x) ((IHTMLCurrentStyle*) &(x)->lpIHTMLCurrentStyleVtbl)
46 #define HTMLCURSTYLE_THIS(iface) DEFINE_THIS(HTMLCurrentStyle, IHTMLCurrentStyle, iface)
48 static HRESULT WINAPI
HTMLCurrentStyle_QueryInterface(IHTMLCurrentStyle
*iface
, REFIID riid
, void **ppv
)
50 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
54 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
55 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
56 *ppv
= HTMLCURSTYLE(This
);
57 }else if(IsEqualGUID(&IID_IHTMLCurrentStyle
, riid
)) {
58 TRACE("(%p)->(IID_IHTMLCurrentStyle %p)\n", This
, ppv
);
59 *ppv
= HTMLCURSTYLE(This
);
60 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
61 return *ppv
? S_OK
: E_NOINTERFACE
;
65 IUnknown_AddRef((IUnknown
*)*ppv
);
69 WARN("unsupported %s\n", debugstr_guid(riid
));
73 static ULONG WINAPI
HTMLCurrentStyle_AddRef(IHTMLCurrentStyle
*iface
)
75 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
76 LONG ref
= InterlockedIncrement(&This
->ref
);
78 TRACE("(%p) ref=%d\n", This
, ref
);
83 static ULONG WINAPI
HTMLCurrentStyle_Release(IHTMLCurrentStyle
*iface
)
85 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
86 LONG ref
= InterlockedDecrement(&This
->ref
);
88 TRACE("(%p) ref=%d\n", This
, ref
);
92 nsIDOMCSSStyleDeclaration_Release(This
->nsstyle
);
99 static HRESULT WINAPI
HTMLCurrentStyle_GetTypeInfoCount(IHTMLCurrentStyle
*iface
, UINT
*pctinfo
)
101 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
102 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This
->dispex
), pctinfo
);
105 static HRESULT WINAPI
HTMLCurrentStyle_GetTypeInfo(IHTMLCurrentStyle
*iface
, UINT iTInfo
,
106 LCID lcid
, ITypeInfo
**ppTInfo
)
108 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
109 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This
->dispex
), iTInfo
, lcid
, ppTInfo
);
112 static HRESULT WINAPI
HTMLCurrentStyle_GetIDsOfNames(IHTMLCurrentStyle
*iface
, REFIID riid
,
113 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
115 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
116 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This
->dispex
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
119 static HRESULT WINAPI
HTMLCurrentStyle_Invoke(IHTMLCurrentStyle
*iface
, DISPID dispIdMember
,
120 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
121 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
123 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
124 return IDispatchEx_Invoke(DISPATCHEX(&This
->dispex
), dispIdMember
, riid
, lcid
,
125 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
128 static HRESULT WINAPI
HTMLCurrentStyle_get_position(IHTMLCurrentStyle
*iface
, BSTR
*p
)
130 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
132 TRACE("(%p)->(%p)\n", This
, p
);
134 return get_nsstyle_attr(This
->nsstyle
, STYLEID_POSITION
, p
);
137 static HRESULT WINAPI
HTMLCurrentStyle_get_styleFloat(IHTMLCurrentStyle
*iface
, BSTR
*p
)
139 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
140 FIXME("(%p)->(%p)\n", This
, p
);
144 static HRESULT WINAPI
HTMLCurrentStyle_get_color(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
146 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
147 TRACE("(%p)->(%p)\n", This
, p
);
148 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_COLOR
, p
, 0);
151 static HRESULT WINAPI
HTMLCurrentStyle_get_backgroundColor(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
153 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
154 TRACE("(%p)->(%p)\n", This
, p
);
155 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BACKGROUND_COLOR
, p
, 0);
158 static HRESULT WINAPI
HTMLCurrentStyle_get_fontFamily(IHTMLCurrentStyle
*iface
, BSTR
*p
)
160 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
162 TRACE("(%p)->(%p)\n", This
, p
);
164 return get_nsstyle_attr(This
->nsstyle
, STYLEID_FONT_FAMILY
, p
);
167 static HRESULT WINAPI
HTMLCurrentStyle_get_fontStyle(IHTMLCurrentStyle
*iface
, BSTR
*p
)
169 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
170 TRACE("(%p)->(%p)\n", This
, p
);
171 return get_nsstyle_attr(This
->nsstyle
, STYLEID_FONT_STYLE
, p
);
174 static HRESULT WINAPI
HTMLCurrentStyle_get_fontVariant(IHTMLCurrentStyle
*iface
, BSTR
*p
)
176 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
177 TRACE("(%p)->(%p)\n", This
, p
);
178 return get_nsstyle_attr(This
->nsstyle
, STYLEID_FONT_VARIANT
, p
);
181 static HRESULT WINAPI
HTMLCurrentStyle_get_fontWeight(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
183 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
184 TRACE("(%p)->(%p)\n", This
, p
);
185 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_FONT_WEIGHT
, p
, ATTR_STR_TO_INT
);
188 static HRESULT WINAPI
HTMLCurrentStyle_get_fontSize(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
190 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
191 TRACE("(%p)->(%p)\n", This
, p
);
192 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_FONT_SIZE
, p
, 0);
195 static HRESULT WINAPI
HTMLCurrentStyle_get_backgroundImage(IHTMLCurrentStyle
*iface
, BSTR
*p
)
197 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
198 TRACE("(%p)->(%p)\n", This
, p
);
199 return get_nsstyle_attr(This
->nsstyle
, STYLEID_BACKGROUND_IMAGE
, p
);
202 static HRESULT WINAPI
HTMLCurrentStyle_get_backgroundPositionX(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
204 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
205 FIXME("(%p)->(%p)\n", This
, p
);
209 static HRESULT WINAPI
HTMLCurrentStyle_get_backgroundPositionY(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
211 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
212 FIXME("(%p)->(%p)\n", This
, p
);
216 static HRESULT WINAPI
HTMLCurrentStyle_get_backgroundRepeat(IHTMLCurrentStyle
*iface
, BSTR
*p
)
218 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
219 TRACE("(%p)->(%p)\n", This
, p
);
220 return get_nsstyle_attr(This
->nsstyle
, STYLEID_BACKGROUND_REPEAT
, p
);
223 static HRESULT WINAPI
HTMLCurrentStyle_get_borderLeftColor(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
225 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
226 FIXME("(%p)->(%p)\n", This
, p
);
230 static HRESULT WINAPI
HTMLCurrentStyle_get_borderTopColor(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
232 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
233 FIXME("(%p)->(%p)\n", This
, p
);
237 static HRESULT WINAPI
HTMLCurrentStyle_get_borderRightColor(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
239 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
240 FIXME("(%p)->(%p)\n", This
, p
);
244 static HRESULT WINAPI
HTMLCurrentStyle_get_borderBottomColor(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
246 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
247 FIXME("(%p)->(%p)\n", This
, p
);
251 static HRESULT WINAPI
HTMLCurrentStyle_get_borderTopStyle(IHTMLCurrentStyle
*iface
, BSTR
*p
)
253 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
254 TRACE("(%p)->(%p)\n", This
, p
);
255 return get_nsstyle_attr(This
->nsstyle
, STYLEID_BORDER_TOP_STYLE
, p
);
258 static HRESULT WINAPI
HTMLCurrentStyle_get_borderRightStyle(IHTMLCurrentStyle
*iface
, BSTR
*p
)
260 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
261 TRACE("(%p)->(%p)\n", This
, p
);
262 return get_nsstyle_attr(This
->nsstyle
, STYLEID_BORDER_RIGHT_STYLE
, p
);
265 static HRESULT WINAPI
HTMLCurrentStyle_get_borderBottomStyle(IHTMLCurrentStyle
*iface
, BSTR
*p
)
267 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
268 TRACE("(%p)->(%p)\n", This
, p
);
269 return get_nsstyle_attr(This
->nsstyle
, STYLEID_BORDER_BOTTOM_STYLE
, p
);
272 static HRESULT WINAPI
HTMLCurrentStyle_get_borderLeftStyle(IHTMLCurrentStyle
*iface
, BSTR
*p
)
274 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
275 TRACE("(%p)->(%p)\n", This
, p
);
276 return get_nsstyle_attr(This
->nsstyle
, STYLEID_BORDER_LEFT_STYLE
, p
);
279 static HRESULT WINAPI
HTMLCurrentStyle_get_borderTopWidth(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
281 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
282 TRACE("(%p)->(%p)\n", This
, p
);
283 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_TOP_WIDTH
, p
, 0);
286 static HRESULT WINAPI
HTMLCurrentStyle_get_borderRightWidth(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
288 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
289 TRACE("(%p)->(%p)\n", This
, p
);
290 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_RIGHT_WIDTH
, p
, 0);
293 static HRESULT WINAPI
HTMLCurrentStyle_get_borderBottomWidth(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
295 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
296 TRACE("(%p)->(%p)\n", This
, p
);
297 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_BOTTOM_WIDTH
, p
, 0);
300 static HRESULT WINAPI
HTMLCurrentStyle_get_borderLeftWidth(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
302 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
303 TRACE("(%p)->(%p)\n", This
, p
);
304 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_BORDER_LEFT_WIDTH
, p
, 0);
307 static HRESULT WINAPI
HTMLCurrentStyle_get_left(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
309 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
310 TRACE("(%p)->(%p)\n", This
, p
);
311 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_LEFT
, p
, 0);
314 static HRESULT WINAPI
HTMLCurrentStyle_get_top(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
316 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
317 TRACE("(%p)->(%p)\n", This
, p
);
318 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_TOP
, p
, 0);
321 static HRESULT WINAPI
HTMLCurrentStyle_get_width(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
323 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
324 TRACE("(%p)->(%p)\n", This
, p
);
325 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_WIDTH
, p
, 0);
328 static HRESULT WINAPI
HTMLCurrentStyle_get_height(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
330 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
331 TRACE("(%p)->(%p)\n", This
, p
);
332 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_HEIGHT
, p
, 0);
335 static HRESULT WINAPI
HTMLCurrentStyle_get_paddingLeft(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
337 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
338 TRACE("(%p)->(%p)\n", This
, p
);
339 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_PADDING_LEFT
, p
, 0);
342 static HRESULT WINAPI
HTMLCurrentStyle_get_paddingTop(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
344 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
345 FIXME("(%p)->(%p)\n", This
, p
);
349 static HRESULT WINAPI
HTMLCurrentStyle_get_paddingRight(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
351 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
352 FIXME("(%p)->(%p)\n", This
, p
);
356 static HRESULT WINAPI
HTMLCurrentStyle_get_paddingBottom(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
358 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
359 FIXME("(%p)->(%p)\n", This
, p
);
363 static HRESULT WINAPI
HTMLCurrentStyle_get_textAlign(IHTMLCurrentStyle
*iface
, BSTR
*p
)
365 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
366 TRACE("(%p)->(%p)\n", This
, p
);
367 return get_nsstyle_attr(This
->nsstyle
, STYLEID_TEXT_ALIGN
, p
);
370 static HRESULT WINAPI
HTMLCurrentStyle_get_textDecoration(IHTMLCurrentStyle
*iface
, BSTR
*p
)
372 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
373 TRACE("(%p)->(%p)\n", This
, p
);
374 return get_nsstyle_attr(This
->nsstyle
, STYLEID_TEXT_DECORATION
, p
);
377 static HRESULT WINAPI
HTMLCurrentStyle_get_display(IHTMLCurrentStyle
*iface
, BSTR
*p
)
379 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
381 TRACE("(%p)->(%p)\n", This
, p
);
383 return get_nsstyle_attr(This
->nsstyle
, STYLEID_DISPLAY
, p
);
386 static HRESULT WINAPI
HTMLCurrentStyle_get_visibility(IHTMLCurrentStyle
*iface
, BSTR
*p
)
388 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
390 TRACE("(%p)->(%p)\n", This
, p
);
392 return get_nsstyle_attr(This
->nsstyle
, STYLEID_VISIBILITY
, p
);
395 static HRESULT WINAPI
HTMLCurrentStyle_get_zIndex(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
397 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
398 TRACE("(%p)->(%p)\n", This
, p
);
399 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_Z_INDEX
, p
, ATTR_STR_TO_INT
);
402 static HRESULT WINAPI
HTMLCurrentStyle_get_letterSpacing(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
404 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
405 FIXME("(%p)->(%p)\n", This
, p
);
409 static HRESULT WINAPI
HTMLCurrentStyle_get_lineHeight(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
411 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
412 FIXME("(%p)->(%p)\n", This
, p
);
416 static HRESULT WINAPI
HTMLCurrentStyle_get_textIndent(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
418 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
419 FIXME("(%p)->(%p)\n", This
, p
);
423 static HRESULT WINAPI
HTMLCurrentStyle_get_verticalAlign(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
425 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
426 TRACE("(%p)->(%p)\n", This
, p
);
427 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_VERTICAL_ALIGN
, p
, 0);
430 static HRESULT WINAPI
HTMLCurrentStyle_get_backgroundAttachment(IHTMLCurrentStyle
*iface
, BSTR
*p
)
432 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
433 FIXME("(%p)->(%p)\n", This
, p
);
437 static HRESULT WINAPI
HTMLCurrentStyle_get_marginTop(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
439 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
440 FIXME("(%p)->(%p)\n", This
, p
);
444 static HRESULT WINAPI
HTMLCurrentStyle_get_marginRight(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
446 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
447 TRACE("(%p)->(%p)\n", This
, p
);
448 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_RIGHT
, p
, 0);
451 static HRESULT WINAPI
HTMLCurrentStyle_get_marginBottom(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
453 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
454 FIXME("(%p)->(%p)\n", This
, p
);
458 static HRESULT WINAPI
HTMLCurrentStyle_get_marginLeft(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
460 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
461 TRACE("(%p)->(%p)\n", This
, p
);
462 return get_nsstyle_attr_var(This
->nsstyle
, STYLEID_MARGIN_LEFT
, p
, 0);
465 static HRESULT WINAPI
HTMLCurrentStyle_get_clear(IHTMLCurrentStyle
*iface
, BSTR
*p
)
467 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
468 FIXME("(%p)->(%p)\n", This
, p
);
472 static HRESULT WINAPI
HTMLCurrentStyle_get_listStyleType(IHTMLCurrentStyle
*iface
, BSTR
*p
)
474 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
475 FIXME("(%p)->(%p)\n", This
, p
);
479 static HRESULT WINAPI
HTMLCurrentStyle_get_listStylePosition(IHTMLCurrentStyle
*iface
, BSTR
*p
)
481 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
482 FIXME("(%p)->(%p)\n", This
, p
);
486 static HRESULT WINAPI
HTMLCurrentStyle_get_listStyleImage(IHTMLCurrentStyle
*iface
, BSTR
*p
)
488 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
489 FIXME("(%p)->(%p)\n", This
, p
);
493 static HRESULT WINAPI
HTMLCurrentStyle_get_clipTop(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
495 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
496 FIXME("(%p)->(%p)\n", This
, p
);
500 static HRESULT WINAPI
HTMLCurrentStyle_get_clipRight(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
502 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
503 FIXME("(%p)->(%p)\n", This
, p
);
507 static HRESULT WINAPI
HTMLCurrentStyle_get_clipBottom(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
509 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
510 FIXME("(%p)->(%p)\n", This
, p
);
514 static HRESULT WINAPI
HTMLCurrentStyle_get_clipLeft(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
516 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
517 FIXME("(%p)->(%p)\n", This
, p
);
521 static HRESULT WINAPI
HTMLCurrentStyle_get_overflow(IHTMLCurrentStyle
*iface
, BSTR
*p
)
523 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
524 TRACE("(%p)->(%p)\n", This
, p
);
525 return get_nsstyle_attr(This
->nsstyle
, STYLEID_OVERFLOW
, p
);
528 static HRESULT WINAPI
HTMLCurrentStyle_get_pageBreakBefore(IHTMLCurrentStyle
*iface
, BSTR
*p
)
530 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
531 FIXME("(%p)->(%p)\n", This
, p
);
535 static HRESULT WINAPI
HTMLCurrentStyle_get_pageBreakAfter(IHTMLCurrentStyle
*iface
, BSTR
*p
)
537 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
538 FIXME("(%p)->(%p)\n", This
, p
);
542 static HRESULT WINAPI
HTMLCurrentStyle_get_cursor(IHTMLCurrentStyle
*iface
, BSTR
*p
)
544 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
545 TRACE("(%p)->(%p)\n", This
, p
);
546 return get_nsstyle_attr(This
->nsstyle
, STYLEID_CURSOR
, p
);
549 static HRESULT WINAPI
HTMLCurrentStyle_get_tableLayout(IHTMLCurrentStyle
*iface
, BSTR
*p
)
551 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
552 FIXME("(%p)->(%p)\n", This
, p
);
556 static HRESULT WINAPI
HTMLCurrentStyle_get_borderCollapse(IHTMLCurrentStyle
*iface
, BSTR
*p
)
558 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
559 FIXME("(%p)->(%p)\n", This
, p
);
563 static HRESULT WINAPI
HTMLCurrentStyle_get_direction(IHTMLCurrentStyle
*iface
, BSTR
*p
)
565 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
566 FIXME("(%p)->(%p)\n", This
, p
);
570 static HRESULT WINAPI
HTMLCurrentStyle_get_behavior(IHTMLCurrentStyle
*iface
, BSTR
*p
)
572 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
573 FIXME("(%p)->(%p)\n", This
, p
);
577 static HRESULT WINAPI
HTMLCurrentStyle_getAttribute(IHTMLCurrentStyle
*iface
, BSTR strAttributeName
,
578 LONG lFlags
, VARIANT
*AttributeValue
)
580 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
581 FIXME("(%p)->(%s %x %p)\n", This
, debugstr_w(strAttributeName
), lFlags
, AttributeValue
);
585 static HRESULT WINAPI
HTMLCurrentStyle_get_unicodeBidi(IHTMLCurrentStyle
*iface
, BSTR
*p
)
587 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
588 FIXME("(%p)->(%p)\n", This
, p
);
592 static HRESULT WINAPI
HTMLCurrentStyle_get_right(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
594 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
595 FIXME("(%p)->(%p)\n", This
, p
);
599 static HRESULT WINAPI
HTMLCurrentStyle_get_bottom(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
601 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
602 FIXME("(%p)->(%p)\n", This
, p
);
606 static HRESULT WINAPI
HTMLCurrentStyle_get_imeMode(IHTMLCurrentStyle
*iface
, BSTR
*p
)
608 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
609 FIXME("(%p)->(%p)\n", This
, p
);
613 static HRESULT WINAPI
HTMLCurrentStyle_get_rubyAlign(IHTMLCurrentStyle
*iface
, BSTR
*p
)
615 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
616 FIXME("(%p)->(%p)\n", This
, p
);
620 static HRESULT WINAPI
HTMLCurrentStyle_get_rubyPosition(IHTMLCurrentStyle
*iface
, BSTR
*p
)
622 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
623 FIXME("(%p)->(%p)\n", This
, p
);
627 static HRESULT WINAPI
HTMLCurrentStyle_get_rubyOverhang(IHTMLCurrentStyle
*iface
, BSTR
*p
)
629 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
630 FIXME("(%p)->(%p)\n", This
, p
);
634 static HRESULT WINAPI
HTMLCurrentStyle_get_textAutospace(IHTMLCurrentStyle
*iface
, BSTR
*p
)
636 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
637 FIXME("(%p)->(%p)\n", This
, p
);
641 static HRESULT WINAPI
HTMLCurrentStyle_get_lineBreak(IHTMLCurrentStyle
*iface
, BSTR
*p
)
643 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
644 FIXME("(%p)->(%p)\n", This
, p
);
648 static HRESULT WINAPI
HTMLCurrentStyle_get_wordBreak(IHTMLCurrentStyle
*iface
, BSTR
*p
)
650 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
651 FIXME("(%p)->(%p)\n", This
, p
);
655 static HRESULT WINAPI
HTMLCurrentStyle_get_textJustify(IHTMLCurrentStyle
*iface
, BSTR
*p
)
657 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
658 FIXME("(%p)->(%p)\n", This
, p
);
662 static HRESULT WINAPI
HTMLCurrentStyle_get_textJustifyTrim(IHTMLCurrentStyle
*iface
, BSTR
*p
)
664 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
665 FIXME("(%p)->(%p)\n", This
, p
);
669 static HRESULT WINAPI
HTMLCurrentStyle_get_textKashida(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
671 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
672 FIXME("(%p)->(%p)\n", This
, p
);
676 static HRESULT WINAPI
HTMLCurrentStyle_get_blockDirection(IHTMLCurrentStyle
*iface
, BSTR
*p
)
678 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
679 FIXME("(%p)->(%p)\n", This
, p
);
683 static HRESULT WINAPI
HTMLCurrentStyle_get_layoutGridChar(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
685 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
686 FIXME("(%p)->(%p)\n", This
, p
);
690 static HRESULT WINAPI
HTMLCurrentStyle_get_layoutGridLine(IHTMLCurrentStyle
*iface
, VARIANT
*p
)
692 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
693 FIXME("(%p)->(%p)\n", This
, p
);
697 static HRESULT WINAPI
HTMLCurrentStyle_get_layoutGridMode(IHTMLCurrentStyle
*iface
, BSTR
*p
)
699 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
700 FIXME("(%p)->(%p)\n", This
, p
);
704 static HRESULT WINAPI
HTMLCurrentStyle_get_layoutGridType(IHTMLCurrentStyle
*iface
, BSTR
*p
)
706 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
707 FIXME("(%p)->(%p)\n", This
, p
);
711 static HRESULT WINAPI
HTMLCurrentStyle_get_borderStyle(IHTMLCurrentStyle
*iface
, BSTR
*p
)
713 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
714 TRACE("(%p)->(%p)\n", This
, p
);
715 return get_nsstyle_attr(This
->nsstyle
, STYLEID_BORDER_STYLE
, p
);
718 static HRESULT WINAPI
HTMLCurrentStyle_get_borderColor(IHTMLCurrentStyle
*iface
, BSTR
*p
)
720 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
721 TRACE("(%p)->(%p)\n", This
, p
);
722 return get_nsstyle_attr(This
->nsstyle
, STYLEID_BORDER_COLOR
, p
);
725 static HRESULT WINAPI
HTMLCurrentStyle_get_borderWidth(IHTMLCurrentStyle
*iface
, BSTR
*p
)
727 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
728 TRACE("(%p)->(%p)\n", This
, p
);
729 return get_nsstyle_attr(This
->nsstyle
, STYLEID_BORDER_WIDTH
, p
);
732 static HRESULT WINAPI
HTMLCurrentStyle_get_padding(IHTMLCurrentStyle
*iface
, BSTR
*p
)
734 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
735 FIXME("(%p)->(%p)\n", This
, p
);
739 static HRESULT WINAPI
HTMLCurrentStyle_get_margin(IHTMLCurrentStyle
*iface
, BSTR
*p
)
741 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
742 TRACE("(%p)->(%p)\n", This
, p
);
743 return get_nsstyle_attr(This
->nsstyle
, STYLEID_MARGIN
, p
);
746 static HRESULT WINAPI
HTMLCurrentStyle_get_accelerator(IHTMLCurrentStyle
*iface
, BSTR
*p
)
748 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
749 FIXME("(%p)->(%p)\n", This
, p
);
753 static HRESULT WINAPI
HTMLCurrentStyle_get_overflowX(IHTMLCurrentStyle
*iface
, BSTR
*p
)
755 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
756 FIXME("(%p)->(%p)\n", This
, p
);
760 static HRESULT WINAPI
HTMLCurrentStyle_get_overflowY(IHTMLCurrentStyle
*iface
, BSTR
*p
)
762 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
763 FIXME("(%p)->(%p)\n", This
, p
);
767 static HRESULT WINAPI
HTMLCurrentStyle_get_textTransform(IHTMLCurrentStyle
*iface
, BSTR
*p
)
769 HTMLCurrentStyle
*This
= HTMLCURSTYLE_THIS(iface
);
770 FIXME("(%p)->(%p)\n", This
, p
);
774 #undef HTMLCURSTYLE_THIS
776 static const IHTMLCurrentStyleVtbl HTMLCurrentStyleVtbl
= {
777 HTMLCurrentStyle_QueryInterface
,
778 HTMLCurrentStyle_AddRef
,
779 HTMLCurrentStyle_Release
,
780 HTMLCurrentStyle_GetTypeInfoCount
,
781 HTMLCurrentStyle_GetTypeInfo
,
782 HTMLCurrentStyle_GetIDsOfNames
,
783 HTMLCurrentStyle_Invoke
,
784 HTMLCurrentStyle_get_position
,
785 HTMLCurrentStyle_get_styleFloat
,
786 HTMLCurrentStyle_get_color
,
787 HTMLCurrentStyle_get_backgroundColor
,
788 HTMLCurrentStyle_get_fontFamily
,
789 HTMLCurrentStyle_get_fontStyle
,
790 HTMLCurrentStyle_get_fontVariant
,
791 HTMLCurrentStyle_get_fontWeight
,
792 HTMLCurrentStyle_get_fontSize
,
793 HTMLCurrentStyle_get_backgroundImage
,
794 HTMLCurrentStyle_get_backgroundPositionX
,
795 HTMLCurrentStyle_get_backgroundPositionY
,
796 HTMLCurrentStyle_get_backgroundRepeat
,
797 HTMLCurrentStyle_get_borderLeftColor
,
798 HTMLCurrentStyle_get_borderTopColor
,
799 HTMLCurrentStyle_get_borderRightColor
,
800 HTMLCurrentStyle_get_borderBottomColor
,
801 HTMLCurrentStyle_get_borderTopStyle
,
802 HTMLCurrentStyle_get_borderRightStyle
,
803 HTMLCurrentStyle_get_borderBottomStyle
,
804 HTMLCurrentStyle_get_borderLeftStyle
,
805 HTMLCurrentStyle_get_borderTopWidth
,
806 HTMLCurrentStyle_get_borderRightWidth
,
807 HTMLCurrentStyle_get_borderBottomWidth
,
808 HTMLCurrentStyle_get_borderLeftWidth
,
809 HTMLCurrentStyle_get_left
,
810 HTMLCurrentStyle_get_top
,
811 HTMLCurrentStyle_get_width
,
812 HTMLCurrentStyle_get_height
,
813 HTMLCurrentStyle_get_paddingLeft
,
814 HTMLCurrentStyle_get_paddingTop
,
815 HTMLCurrentStyle_get_paddingRight
,
816 HTMLCurrentStyle_get_paddingBottom
,
817 HTMLCurrentStyle_get_textAlign
,
818 HTMLCurrentStyle_get_textDecoration
,
819 HTMLCurrentStyle_get_display
,
820 HTMLCurrentStyle_get_visibility
,
821 HTMLCurrentStyle_get_zIndex
,
822 HTMLCurrentStyle_get_letterSpacing
,
823 HTMLCurrentStyle_get_lineHeight
,
824 HTMLCurrentStyle_get_textIndent
,
825 HTMLCurrentStyle_get_verticalAlign
,
826 HTMLCurrentStyle_get_backgroundAttachment
,
827 HTMLCurrentStyle_get_marginTop
,
828 HTMLCurrentStyle_get_marginRight
,
829 HTMLCurrentStyle_get_marginBottom
,
830 HTMLCurrentStyle_get_marginLeft
,
831 HTMLCurrentStyle_get_clear
,
832 HTMLCurrentStyle_get_listStyleType
,
833 HTMLCurrentStyle_get_listStylePosition
,
834 HTMLCurrentStyle_get_listStyleImage
,
835 HTMLCurrentStyle_get_clipTop
,
836 HTMLCurrentStyle_get_clipRight
,
837 HTMLCurrentStyle_get_clipBottom
,
838 HTMLCurrentStyle_get_clipLeft
,
839 HTMLCurrentStyle_get_overflow
,
840 HTMLCurrentStyle_get_pageBreakBefore
,
841 HTMLCurrentStyle_get_pageBreakAfter
,
842 HTMLCurrentStyle_get_cursor
,
843 HTMLCurrentStyle_get_tableLayout
,
844 HTMLCurrentStyle_get_borderCollapse
,
845 HTMLCurrentStyle_get_direction
,
846 HTMLCurrentStyle_get_behavior
,
847 HTMLCurrentStyle_getAttribute
,
848 HTMLCurrentStyle_get_unicodeBidi
,
849 HTMLCurrentStyle_get_right
,
850 HTMLCurrentStyle_get_bottom
,
851 HTMLCurrentStyle_get_imeMode
,
852 HTMLCurrentStyle_get_rubyAlign
,
853 HTMLCurrentStyle_get_rubyPosition
,
854 HTMLCurrentStyle_get_rubyOverhang
,
855 HTMLCurrentStyle_get_textAutospace
,
856 HTMLCurrentStyle_get_lineBreak
,
857 HTMLCurrentStyle_get_wordBreak
,
858 HTMLCurrentStyle_get_textJustify
,
859 HTMLCurrentStyle_get_textJustifyTrim
,
860 HTMLCurrentStyle_get_textKashida
,
861 HTMLCurrentStyle_get_blockDirection
,
862 HTMLCurrentStyle_get_layoutGridChar
,
863 HTMLCurrentStyle_get_layoutGridLine
,
864 HTMLCurrentStyle_get_layoutGridMode
,
865 HTMLCurrentStyle_get_layoutGridType
,
866 HTMLCurrentStyle_get_borderStyle
,
867 HTMLCurrentStyle_get_borderColor
,
868 HTMLCurrentStyle_get_borderWidth
,
869 HTMLCurrentStyle_get_padding
,
870 HTMLCurrentStyle_get_margin
,
871 HTMLCurrentStyle_get_accelerator
,
872 HTMLCurrentStyle_get_overflowX
,
873 HTMLCurrentStyle_get_overflowY
,
874 HTMLCurrentStyle_get_textTransform
877 static const tid_t HTMLCurrentStyle_iface_tids
[] = {
878 IHTMLCurrentStyle_tid
,
879 IHTMLCurrentStyle2_tid
,
880 IHTMLCurrentStyle3_tid
,
881 IHTMLCurrentStyle4_tid
,
884 static dispex_static_data_t HTMLCurrentStyle_dispex
= {
886 DispHTMLCurrentStyle_tid
,
888 HTMLCurrentStyle_iface_tids
891 HRESULT
HTMLCurrentStyle_Create(HTMLElement
*elem
, IHTMLCurrentStyle
**p
)
893 nsIDOMCSSStyleDeclaration
*nsstyle
;
894 nsIDOMDocumentView
*nsdocview
;
895 nsIDOMAbstractView
*nsview
;
896 nsIDOMViewCSS
*nsviewcss
;
897 nsAString nsempty_str
;
898 HTMLCurrentStyle
*ret
;
901 if(!elem
->node
.doc
->nsdoc
) {
902 WARN("NULL nsdoc\n");
906 nsres
= nsIDOMHTMLDocument_QueryInterface(elem
->node
.doc
->nsdoc
, &IID_nsIDOMDocumentView
, (void**)&nsdocview
);
907 if(NS_FAILED(nsres
)) {
908 ERR("Could not get nsIDOMDocumentView: %08x\n", nsres
);
912 nsres
= nsIDOMDocumentView_GetDefaultView(nsdocview
, &nsview
);
913 nsIDOMDocumentView_Release(nsdocview
);
914 if(NS_FAILED(nsres
)) {
915 ERR("GetDefaultView failed: %08x\n", nsres
);
919 nsres
= nsIDOMAbstractView_QueryInterface(nsview
, &IID_nsIDOMViewCSS
, (void**)&nsviewcss
);
920 nsIDOMAbstractView_Release(nsview
);
921 if(NS_FAILED(nsres
)) {
922 ERR("Could not get nsIDOMViewCSS: %08x\n", nsres
);
926 nsAString_Init(&nsempty_str
, NULL
);
927 nsres
= nsIDOMViewCSS_GetComputedStyle(nsviewcss
, (nsIDOMElement
*)elem
->nselem
, &nsempty_str
, &nsstyle
);
928 nsIDOMViewCSS_Release(nsviewcss
);
929 nsAString_Finish(&nsempty_str
);
930 if(NS_FAILED(nsres
)) {
931 ERR("GetComputedStyle failed: %08x\n", nsres
);
935 ret
= heap_alloc_zero(sizeof(HTMLCurrentStyle
));
937 nsIDOMCSSStyleDeclaration_Release(nsstyle
);
938 return E_OUTOFMEMORY
;
941 ret
->lpIHTMLCurrentStyleVtbl
= &HTMLCurrentStyleVtbl
;
943 ret
->nsstyle
= nsstyle
;
945 init_dispex(&ret
->dispex
, (IUnknown
*)HTMLCURSTYLE(ret
), &HTMLCurrentStyle_dispex
);
947 *p
= HTMLCURSTYLE(ret
);