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);
93 release_dispex(&This->dispex);
100 static HRESULT WINAPI HTMLCurrentStyle_GetTypeInfoCount(IHTMLCurrentStyle *iface, UINT *pctinfo)
102 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
103 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
106 static HRESULT WINAPI HTMLCurrentStyle_GetTypeInfo(IHTMLCurrentStyle *iface, UINT iTInfo,
107 LCID lcid, ITypeInfo **ppTInfo)
109 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
110 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
113 static HRESULT WINAPI HTMLCurrentStyle_GetIDsOfNames(IHTMLCurrentStyle *iface, REFIID riid,
114 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
116 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
117 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
121 static HRESULT WINAPI HTMLCurrentStyle_Invoke(IHTMLCurrentStyle *iface, DISPID dispIdMember,
122 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
123 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
125 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
126 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
127 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
130 static HRESULT WINAPI HTMLCurrentStyle_get_position(IHTMLCurrentStyle *iface, BSTR *p)
132 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
134 TRACE("(%p)->(%p)\n", This, p);
136 return get_nsstyle_attr(This->nsstyle, STYLEID_POSITION, p);
139 static HRESULT WINAPI HTMLCurrentStyle_get_styleFloat(IHTMLCurrentStyle *iface, BSTR *p)
141 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
142 FIXME("(%p)->(%p)\n", This, p);
146 static HRESULT WINAPI HTMLCurrentStyle_get_color(IHTMLCurrentStyle *iface, VARIANT *p)
148 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
149 TRACE("(%p)->(%p)\n", This, p);
150 return get_nsstyle_attr_var(This->nsstyle, STYLEID_COLOR, p, 0);
153 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundColor(IHTMLCurrentStyle *iface, VARIANT *p)
155 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
156 TRACE("(%p)->(%p)\n", This, p);
157 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_COLOR, p, 0);
160 static HRESULT WINAPI HTMLCurrentStyle_get_fontFamily(IHTMLCurrentStyle *iface, BSTR *p)
162 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
164 TRACE("(%p)->(%p)\n", This, p);
166 return get_nsstyle_attr(This->nsstyle, STYLEID_FONT_FAMILY, p);
169 static HRESULT WINAPI HTMLCurrentStyle_get_fontStyle(IHTMLCurrentStyle *iface, BSTR *p)
171 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
172 TRACE("(%p)->(%p)\n", This, p);
173 return get_nsstyle_attr(This->nsstyle, STYLEID_FONT_STYLE, p);
176 static HRESULT WINAPI HTMLCurrentStyle_get_fontVariant(IHTMLCurrentStyle *iface, BSTR *p)
178 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
179 TRACE("(%p)->(%p)\n", This, p);
180 return get_nsstyle_attr(This->nsstyle, STYLEID_FONT_VARIANT, p);
183 static HRESULT WINAPI HTMLCurrentStyle_get_fontWeight(IHTMLCurrentStyle *iface, VARIANT *p)
185 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
186 TRACE("(%p)->(%p)\n", This, p);
187 return get_nsstyle_attr_var(This->nsstyle, STYLEID_FONT_WEIGHT, p, ATTR_STR_TO_INT);
190 static HRESULT WINAPI HTMLCurrentStyle_get_fontSize(IHTMLCurrentStyle *iface, VARIANT *p)
192 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
193 TRACE("(%p)->(%p)\n", This, p);
194 return get_nsstyle_attr_var(This->nsstyle, STYLEID_FONT_SIZE, p, 0);
197 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundImage(IHTMLCurrentStyle *iface, BSTR *p)
199 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
200 TRACE("(%p)->(%p)\n", This, p);
201 return get_nsstyle_attr(This->nsstyle, STYLEID_BACKGROUND_IMAGE, p);
204 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundPositionX(IHTMLCurrentStyle *iface, VARIANT *p)
206 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
207 FIXME("(%p)->(%p)\n", This, p);
211 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundPositionY(IHTMLCurrentStyle *iface, VARIANT *p)
213 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
214 FIXME("(%p)->(%p)\n", This, p);
218 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundRepeat(IHTMLCurrentStyle *iface, BSTR *p)
220 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
221 TRACE("(%p)->(%p)\n", This, p);
222 return get_nsstyle_attr(This->nsstyle, STYLEID_BACKGROUND_REPEAT, p);
225 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftColor(IHTMLCurrentStyle *iface, VARIANT *p)
227 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
228 TRACE("(%p)->(%p)\n", This, p);
229 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_COLOR, p, 0);
232 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopColor(IHTMLCurrentStyle *iface, VARIANT *p)
234 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
235 TRACE("(%p)->(%p)\n", This, p);
236 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_COLOR, p, 0);
239 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightColor(IHTMLCurrentStyle *iface, VARIANT *p)
241 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
242 TRACE("(%p)->(%p)\n", This, p);
243 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_COLOR, p, 0);
246 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomColor(IHTMLCurrentStyle *iface, VARIANT *p)
248 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
249 TRACE("(%p)->(%p)\n", This, p);
250 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_COLOR, p, 0);
253 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopStyle(IHTMLCurrentStyle *iface, BSTR *p)
255 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
256 TRACE("(%p)->(%p)\n", This, p);
257 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_TOP_STYLE, p);
260 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightStyle(IHTMLCurrentStyle *iface, BSTR *p)
262 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
263 TRACE("(%p)->(%p)\n", This, p);
264 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_RIGHT_STYLE, p);
267 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomStyle(IHTMLCurrentStyle *iface, BSTR *p)
269 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
270 TRACE("(%p)->(%p)\n", This, p);
271 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_BOTTOM_STYLE, p);
274 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftStyle(IHTMLCurrentStyle *iface, BSTR *p)
276 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
277 TRACE("(%p)->(%p)\n", This, p);
278 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_LEFT_STYLE, p);
281 static HRESULT WINAPI HTMLCurrentStyle_get_borderTopWidth(IHTMLCurrentStyle *iface, VARIANT *p)
283 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
284 TRACE("(%p)->(%p)\n", This, p);
285 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_WIDTH, p, 0);
288 static HRESULT WINAPI HTMLCurrentStyle_get_borderRightWidth(IHTMLCurrentStyle *iface, VARIANT *p)
290 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
291 TRACE("(%p)->(%p)\n", This, p);
292 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_WIDTH, p, 0);
295 static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomWidth(IHTMLCurrentStyle *iface, VARIANT *p)
297 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
298 TRACE("(%p)->(%p)\n", This, p);
299 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_WIDTH, p, 0);
302 static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftWidth(IHTMLCurrentStyle *iface, VARIANT *p)
304 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
305 TRACE("(%p)->(%p)\n", This, p);
306 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_WIDTH, p, 0);
309 static HRESULT WINAPI HTMLCurrentStyle_get_left(IHTMLCurrentStyle *iface, VARIANT *p)
311 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
312 TRACE("(%p)->(%p)\n", This, p);
313 return get_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, p, 0);
316 static HRESULT WINAPI HTMLCurrentStyle_get_top(IHTMLCurrentStyle *iface, VARIANT *p)
318 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
319 TRACE("(%p)->(%p)\n", This, p);
320 return get_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, p, 0);
323 static HRESULT WINAPI HTMLCurrentStyle_get_width(IHTMLCurrentStyle *iface, VARIANT *p)
325 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
326 TRACE("(%p)->(%p)\n", This, p);
327 return get_nsstyle_attr_var(This->nsstyle, STYLEID_WIDTH, p, 0);
330 static HRESULT WINAPI HTMLCurrentStyle_get_height(IHTMLCurrentStyle *iface, VARIANT *p)
332 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
333 TRACE("(%p)->(%p)\n", This, p);
334 return get_nsstyle_attr_var(This->nsstyle, STYLEID_HEIGHT, p, 0);
337 static HRESULT WINAPI HTMLCurrentStyle_get_paddingLeft(IHTMLCurrentStyle *iface, VARIANT *p)
339 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
340 TRACE("(%p)->(%p)\n", This, p);
341 return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_LEFT, p, 0);
344 static HRESULT WINAPI HTMLCurrentStyle_get_paddingTop(IHTMLCurrentStyle *iface, VARIANT *p)
346 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
347 TRACE("(%p)->(%p)\n", This, p);
348 return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_TOP, p, 0);
351 static HRESULT WINAPI HTMLCurrentStyle_get_paddingRight(IHTMLCurrentStyle *iface, VARIANT *p)
353 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
354 TRACE("(%p)->(%p)\n", This, p);
355 return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_RIGHT, p, 0);
358 static HRESULT WINAPI HTMLCurrentStyle_get_paddingBottom(IHTMLCurrentStyle *iface, VARIANT *p)
360 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
361 TRACE("(%p)->(%p)\n", This, p);
362 return get_nsstyle_attr_var(This->nsstyle, STYLEID_PADDING_BOTTOM, p, 0);
365 static HRESULT WINAPI HTMLCurrentStyle_get_textAlign(IHTMLCurrentStyle *iface, BSTR *p)
367 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
368 TRACE("(%p)->(%p)\n", This, p);
369 return get_nsstyle_attr(This->nsstyle, STYLEID_TEXT_ALIGN, p);
372 static HRESULT WINAPI HTMLCurrentStyle_get_textDecoration(IHTMLCurrentStyle *iface, BSTR *p)
374 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
375 TRACE("(%p)->(%p)\n", This, p);
376 return get_nsstyle_attr(This->nsstyle, STYLEID_TEXT_DECORATION, p);
379 static HRESULT WINAPI HTMLCurrentStyle_get_display(IHTMLCurrentStyle *iface, BSTR *p)
381 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
383 TRACE("(%p)->(%p)\n", This, p);
385 return get_nsstyle_attr(This->nsstyle, STYLEID_DISPLAY, p);
388 static HRESULT WINAPI HTMLCurrentStyle_get_visibility(IHTMLCurrentStyle *iface, BSTR *p)
390 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
392 TRACE("(%p)->(%p)\n", This, p);
394 return get_nsstyle_attr(This->nsstyle, STYLEID_VISIBILITY, p);
397 static HRESULT WINAPI HTMLCurrentStyle_get_zIndex(IHTMLCurrentStyle *iface, VARIANT *p)
399 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
400 TRACE("(%p)->(%p)\n", This, p);
401 return get_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, p, ATTR_STR_TO_INT);
404 static HRESULT WINAPI HTMLCurrentStyle_get_letterSpacing(IHTMLCurrentStyle *iface, VARIANT *p)
406 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
407 TRACE("(%p)->(%p)\n", This, p);
408 return get_nsstyle_attr_var(This->nsstyle, STYLEID_LETTER_SPACING, p, 0);
411 static HRESULT WINAPI HTMLCurrentStyle_get_lineHeight(IHTMLCurrentStyle *iface, VARIANT *p)
413 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
414 TRACE("(%p)->(%p)\n", This, p);
415 return get_nsstyle_attr_var(This->nsstyle, STYLEID_LINE_HEIGHT, p, 0);
418 static HRESULT WINAPI HTMLCurrentStyle_get_textIndent(IHTMLCurrentStyle *iface, VARIANT *p)
420 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
421 TRACE("(%p)->(%p)\n", This, p);
422 return get_nsstyle_attr_var(This->nsstyle, STYLEID_TEXT_INDENT, p, 0);
425 static HRESULT WINAPI HTMLCurrentStyle_get_verticalAlign(IHTMLCurrentStyle *iface, VARIANT *p)
427 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
428 TRACE("(%p)->(%p)\n", This, p);
429 return get_nsstyle_attr_var(This->nsstyle, STYLEID_VERTICAL_ALIGN, p, 0);
432 static HRESULT WINAPI HTMLCurrentStyle_get_backgroundAttachment(IHTMLCurrentStyle *iface, BSTR *p)
434 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
435 FIXME("(%p)->(%p)\n", This, p);
439 static HRESULT WINAPI HTMLCurrentStyle_get_marginTop(IHTMLCurrentStyle *iface, VARIANT *p)
441 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
442 TRACE("(%p)->(%p)\n", This, p);
443 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_TOP, p, 0);
446 static HRESULT WINAPI HTMLCurrentStyle_get_marginRight(IHTMLCurrentStyle *iface, VARIANT *p)
448 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
449 TRACE("(%p)->(%p)\n", This, p);
450 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_RIGHT, p, 0);
453 static HRESULT WINAPI HTMLCurrentStyle_get_marginBottom(IHTMLCurrentStyle *iface, VARIANT *p)
455 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
456 TRACE("(%p)->(%p)\n", This, p);
457 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_BOTTOM, p, 0);
460 static HRESULT WINAPI HTMLCurrentStyle_get_marginLeft(IHTMLCurrentStyle *iface, VARIANT *p)
462 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
463 TRACE("(%p)->(%p)\n", This, p);
464 return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_LEFT, p, 0);
467 static HRESULT WINAPI HTMLCurrentStyle_get_clear(IHTMLCurrentStyle *iface, BSTR *p)
469 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
470 FIXME("(%p)->(%p)\n", This, p);
474 static HRESULT WINAPI HTMLCurrentStyle_get_listStyleType(IHTMLCurrentStyle *iface, BSTR *p)
476 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
477 FIXME("(%p)->(%p)\n", This, p);
481 static HRESULT WINAPI HTMLCurrentStyle_get_listStylePosition(IHTMLCurrentStyle *iface, BSTR *p)
483 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
484 FIXME("(%p)->(%p)\n", This, p);
488 static HRESULT WINAPI HTMLCurrentStyle_get_listStyleImage(IHTMLCurrentStyle *iface, BSTR *p)
490 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
491 FIXME("(%p)->(%p)\n", This, p);
495 static HRESULT WINAPI HTMLCurrentStyle_get_clipTop(IHTMLCurrentStyle *iface, VARIANT *p)
497 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
498 FIXME("(%p)->(%p)\n", This, p);
502 static HRESULT WINAPI HTMLCurrentStyle_get_clipRight(IHTMLCurrentStyle *iface, VARIANT *p)
504 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
505 FIXME("(%p)->(%p)\n", This, p);
509 static HRESULT WINAPI HTMLCurrentStyle_get_clipBottom(IHTMLCurrentStyle *iface, VARIANT *p)
511 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
512 FIXME("(%p)->(%p)\n", This, p);
516 static HRESULT WINAPI HTMLCurrentStyle_get_clipLeft(IHTMLCurrentStyle *iface, VARIANT *p)
518 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
519 FIXME("(%p)->(%p)\n", This, p);
523 static HRESULT WINAPI HTMLCurrentStyle_get_overflow(IHTMLCurrentStyle *iface, BSTR *p)
525 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
526 TRACE("(%p)->(%p)\n", This, p);
527 return get_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, p);
530 static HRESULT WINAPI HTMLCurrentStyle_get_pageBreakBefore(IHTMLCurrentStyle *iface, BSTR *p)
532 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
533 FIXME("(%p)->(%p)\n", This, p);
537 static HRESULT WINAPI HTMLCurrentStyle_get_pageBreakAfter(IHTMLCurrentStyle *iface, BSTR *p)
539 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
540 FIXME("(%p)->(%p)\n", This, p);
544 static HRESULT WINAPI HTMLCurrentStyle_get_cursor(IHTMLCurrentStyle *iface, BSTR *p)
546 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
547 TRACE("(%p)->(%p)\n", This, p);
548 return get_nsstyle_attr(This->nsstyle, STYLEID_CURSOR, p);
551 static HRESULT WINAPI HTMLCurrentStyle_get_tableLayout(IHTMLCurrentStyle *iface, BSTR *p)
553 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
554 FIXME("(%p)->(%p)\n", This, p);
558 static HRESULT WINAPI HTMLCurrentStyle_get_borderCollapse(IHTMLCurrentStyle *iface, BSTR *p)
560 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
561 FIXME("(%p)->(%p)\n", This, p);
565 static HRESULT WINAPI HTMLCurrentStyle_get_direction(IHTMLCurrentStyle *iface, BSTR *p)
567 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
568 FIXME("(%p)->(%p)\n", This, p);
572 static HRESULT WINAPI HTMLCurrentStyle_get_behavior(IHTMLCurrentStyle *iface, BSTR *p)
574 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
575 FIXME("(%p)->(%p)\n", This, p);
579 static HRESULT WINAPI HTMLCurrentStyle_getAttribute(IHTMLCurrentStyle *iface, BSTR strAttributeName,
580 LONG lFlags, VARIANT *AttributeValue)
582 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
583 FIXME("(%p)->(%s %x %p)\n", This, debugstr_w(strAttributeName), lFlags, AttributeValue);
587 static HRESULT WINAPI HTMLCurrentStyle_get_unicodeBidi(IHTMLCurrentStyle *iface, BSTR *p)
589 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
590 FIXME("(%p)->(%p)\n", This, p);
594 static HRESULT WINAPI HTMLCurrentStyle_get_right(IHTMLCurrentStyle *iface, VARIANT *p)
596 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
597 TRACE("(%p)->(%p)\n", This, p);
598 return get_nsstyle_attr_var(This->nsstyle, STYLEID_RIGHT, p, 0);
601 static HRESULT WINAPI HTMLCurrentStyle_get_bottom(IHTMLCurrentStyle *iface, VARIANT *p)
603 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
604 TRACE("(%p)->(%p)\n", This, p);
605 return get_nsstyle_attr_var(This->nsstyle, STYLEID_BOTTOM, p, 0);
608 static HRESULT WINAPI HTMLCurrentStyle_get_imeMode(IHTMLCurrentStyle *iface, BSTR *p)
610 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
611 FIXME("(%p)->(%p)\n", This, p);
615 static HRESULT WINAPI HTMLCurrentStyle_get_rubyAlign(IHTMLCurrentStyle *iface, BSTR *p)
617 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
618 FIXME("(%p)->(%p)\n", This, p);
622 static HRESULT WINAPI HTMLCurrentStyle_get_rubyPosition(IHTMLCurrentStyle *iface, BSTR *p)
624 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
625 FIXME("(%p)->(%p)\n", This, p);
629 static HRESULT WINAPI HTMLCurrentStyle_get_rubyOverhang(IHTMLCurrentStyle *iface, BSTR *p)
631 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
632 FIXME("(%p)->(%p)\n", This, p);
636 static HRESULT WINAPI HTMLCurrentStyle_get_textAutospace(IHTMLCurrentStyle *iface, BSTR *p)
638 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
639 FIXME("(%p)->(%p)\n", This, p);
643 static HRESULT WINAPI HTMLCurrentStyle_get_lineBreak(IHTMLCurrentStyle *iface, BSTR *p)
645 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
646 FIXME("(%p)->(%p)\n", This, p);
650 static HRESULT WINAPI HTMLCurrentStyle_get_wordBreak(IHTMLCurrentStyle *iface, BSTR *p)
652 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
653 FIXME("(%p)->(%p)\n", This, p);
657 static HRESULT WINAPI HTMLCurrentStyle_get_textJustify(IHTMLCurrentStyle *iface, BSTR *p)
659 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
660 FIXME("(%p)->(%p)\n", This, p);
664 static HRESULT WINAPI HTMLCurrentStyle_get_textJustifyTrim(IHTMLCurrentStyle *iface, BSTR *p)
666 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
667 FIXME("(%p)->(%p)\n", This, p);
671 static HRESULT WINAPI HTMLCurrentStyle_get_textKashida(IHTMLCurrentStyle *iface, VARIANT *p)
673 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
674 FIXME("(%p)->(%p)\n", This, p);
678 static HRESULT WINAPI HTMLCurrentStyle_get_blockDirection(IHTMLCurrentStyle *iface, BSTR *p)
680 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
681 FIXME("(%p)->(%p)\n", This, p);
685 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridChar(IHTMLCurrentStyle *iface, VARIANT *p)
687 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
688 FIXME("(%p)->(%p)\n", This, p);
692 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridLine(IHTMLCurrentStyle *iface, VARIANT *p)
694 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
695 FIXME("(%p)->(%p)\n", This, p);
699 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridMode(IHTMLCurrentStyle *iface, BSTR *p)
701 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
702 FIXME("(%p)->(%p)\n", This, p);
706 static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridType(IHTMLCurrentStyle *iface, BSTR *p)
708 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
709 FIXME("(%p)->(%p)\n", This, p);
713 static HRESULT WINAPI HTMLCurrentStyle_get_borderStyle(IHTMLCurrentStyle *iface, BSTR *p)
715 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
716 TRACE("(%p)->(%p)\n", This, p);
717 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_STYLE, p);
720 static HRESULT WINAPI HTMLCurrentStyle_get_borderColor(IHTMLCurrentStyle *iface, BSTR *p)
722 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
723 TRACE("(%p)->(%p)\n", This, p);
724 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_COLOR, p);
727 static HRESULT WINAPI HTMLCurrentStyle_get_borderWidth(IHTMLCurrentStyle *iface, BSTR *p)
729 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
730 TRACE("(%p)->(%p)\n", This, p);
731 return get_nsstyle_attr(This->nsstyle, STYLEID_BORDER_WIDTH, p);
734 static HRESULT WINAPI HTMLCurrentStyle_get_padding(IHTMLCurrentStyle *iface, BSTR *p)
736 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
737 FIXME("(%p)->(%p)\n", This, p);
741 static HRESULT WINAPI HTMLCurrentStyle_get_margin(IHTMLCurrentStyle *iface, BSTR *p)
743 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
744 TRACE("(%p)->(%p)\n", This, p);
745 return get_nsstyle_attr(This->nsstyle, STYLEID_MARGIN, p);
748 static HRESULT WINAPI HTMLCurrentStyle_get_accelerator(IHTMLCurrentStyle *iface, BSTR *p)
750 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
751 FIXME("(%p)->(%p)\n", This, p);
755 static HRESULT WINAPI HTMLCurrentStyle_get_overflowX(IHTMLCurrentStyle *iface, BSTR *p)
757 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
758 FIXME("(%p)->(%p)\n", This, p);
762 static HRESULT WINAPI HTMLCurrentStyle_get_overflowY(IHTMLCurrentStyle *iface, BSTR *p)
764 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
765 FIXME("(%p)->(%p)\n", This, p);
769 static HRESULT WINAPI HTMLCurrentStyle_get_textTransform(IHTMLCurrentStyle *iface, BSTR *p)
771 HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
772 FIXME("(%p)->(%p)\n", This, p);
776 #undef HTMLCURSTYLE_THIS
778 static const IHTMLCurrentStyleVtbl HTMLCurrentStyleVtbl = {
779 HTMLCurrentStyle_QueryInterface,
780 HTMLCurrentStyle_AddRef,
781 HTMLCurrentStyle_Release,
782 HTMLCurrentStyle_GetTypeInfoCount,
783 HTMLCurrentStyle_GetTypeInfo,
784 HTMLCurrentStyle_GetIDsOfNames,
785 HTMLCurrentStyle_Invoke,
786 HTMLCurrentStyle_get_position,
787 HTMLCurrentStyle_get_styleFloat,
788 HTMLCurrentStyle_get_color,
789 HTMLCurrentStyle_get_backgroundColor,
790 HTMLCurrentStyle_get_fontFamily,
791 HTMLCurrentStyle_get_fontStyle,
792 HTMLCurrentStyle_get_fontVariant,
793 HTMLCurrentStyle_get_fontWeight,
794 HTMLCurrentStyle_get_fontSize,
795 HTMLCurrentStyle_get_backgroundImage,
796 HTMLCurrentStyle_get_backgroundPositionX,
797 HTMLCurrentStyle_get_backgroundPositionY,
798 HTMLCurrentStyle_get_backgroundRepeat,
799 HTMLCurrentStyle_get_borderLeftColor,
800 HTMLCurrentStyle_get_borderTopColor,
801 HTMLCurrentStyle_get_borderRightColor,
802 HTMLCurrentStyle_get_borderBottomColor,
803 HTMLCurrentStyle_get_borderTopStyle,
804 HTMLCurrentStyle_get_borderRightStyle,
805 HTMLCurrentStyle_get_borderBottomStyle,
806 HTMLCurrentStyle_get_borderLeftStyle,
807 HTMLCurrentStyle_get_borderTopWidth,
808 HTMLCurrentStyle_get_borderRightWidth,
809 HTMLCurrentStyle_get_borderBottomWidth,
810 HTMLCurrentStyle_get_borderLeftWidth,
811 HTMLCurrentStyle_get_left,
812 HTMLCurrentStyle_get_top,
813 HTMLCurrentStyle_get_width,
814 HTMLCurrentStyle_get_height,
815 HTMLCurrentStyle_get_paddingLeft,
816 HTMLCurrentStyle_get_paddingTop,
817 HTMLCurrentStyle_get_paddingRight,
818 HTMLCurrentStyle_get_paddingBottom,
819 HTMLCurrentStyle_get_textAlign,
820 HTMLCurrentStyle_get_textDecoration,
821 HTMLCurrentStyle_get_display,
822 HTMLCurrentStyle_get_visibility,
823 HTMLCurrentStyle_get_zIndex,
824 HTMLCurrentStyle_get_letterSpacing,
825 HTMLCurrentStyle_get_lineHeight,
826 HTMLCurrentStyle_get_textIndent,
827 HTMLCurrentStyle_get_verticalAlign,
828 HTMLCurrentStyle_get_backgroundAttachment,
829 HTMLCurrentStyle_get_marginTop,
830 HTMLCurrentStyle_get_marginRight,
831 HTMLCurrentStyle_get_marginBottom,
832 HTMLCurrentStyle_get_marginLeft,
833 HTMLCurrentStyle_get_clear,
834 HTMLCurrentStyle_get_listStyleType,
835 HTMLCurrentStyle_get_listStylePosition,
836 HTMLCurrentStyle_get_listStyleImage,
837 HTMLCurrentStyle_get_clipTop,
838 HTMLCurrentStyle_get_clipRight,
839 HTMLCurrentStyle_get_clipBottom,
840 HTMLCurrentStyle_get_clipLeft,
841 HTMLCurrentStyle_get_overflow,
842 HTMLCurrentStyle_get_pageBreakBefore,
843 HTMLCurrentStyle_get_pageBreakAfter,
844 HTMLCurrentStyle_get_cursor,
845 HTMLCurrentStyle_get_tableLayout,
846 HTMLCurrentStyle_get_borderCollapse,
847 HTMLCurrentStyle_get_direction,
848 HTMLCurrentStyle_get_behavior,
849 HTMLCurrentStyle_getAttribute,
850 HTMLCurrentStyle_get_unicodeBidi,
851 HTMLCurrentStyle_get_right,
852 HTMLCurrentStyle_get_bottom,
853 HTMLCurrentStyle_get_imeMode,
854 HTMLCurrentStyle_get_rubyAlign,
855 HTMLCurrentStyle_get_rubyPosition,
856 HTMLCurrentStyle_get_rubyOverhang,
857 HTMLCurrentStyle_get_textAutospace,
858 HTMLCurrentStyle_get_lineBreak,
859 HTMLCurrentStyle_get_wordBreak,
860 HTMLCurrentStyle_get_textJustify,
861 HTMLCurrentStyle_get_textJustifyTrim,
862 HTMLCurrentStyle_get_textKashida,
863 HTMLCurrentStyle_get_blockDirection,
864 HTMLCurrentStyle_get_layoutGridChar,
865 HTMLCurrentStyle_get_layoutGridLine,
866 HTMLCurrentStyle_get_layoutGridMode,
867 HTMLCurrentStyle_get_layoutGridType,
868 HTMLCurrentStyle_get_borderStyle,
869 HTMLCurrentStyle_get_borderColor,
870 HTMLCurrentStyle_get_borderWidth,
871 HTMLCurrentStyle_get_padding,
872 HTMLCurrentStyle_get_margin,
873 HTMLCurrentStyle_get_accelerator,
874 HTMLCurrentStyle_get_overflowX,
875 HTMLCurrentStyle_get_overflowY,
876 HTMLCurrentStyle_get_textTransform
879 static const tid_t HTMLCurrentStyle_iface_tids[] = {
880 IHTMLCurrentStyle_tid,
881 IHTMLCurrentStyle2_tid,
882 IHTMLCurrentStyle3_tid,
883 IHTMLCurrentStyle4_tid,
886 static dispex_static_data_t HTMLCurrentStyle_dispex = {
888 DispHTMLCurrentStyle_tid,
890 HTMLCurrentStyle_iface_tids
893 HRESULT HTMLCurrentStyle_Create(HTMLElement *elem, IHTMLCurrentStyle **p)
895 nsIDOMCSSStyleDeclaration *nsstyle;
896 nsIDOMDocumentView *nsdocview;
897 nsIDOMAbstractView *nsview;
898 nsIDOMViewCSS *nsviewcss;
899 nsAString nsempty_str;
900 HTMLCurrentStyle *ret;
903 if(!elem->node.doc->nsdoc) {
904 WARN("NULL nsdoc\n");
908 nsres = nsIDOMHTMLDocument_QueryInterface(elem->node.doc->nsdoc, &IID_nsIDOMDocumentView, (void**)&nsdocview);
909 if(NS_FAILED(nsres)) {
910 ERR("Could not get nsIDOMDocumentView: %08x\n", nsres);
914 nsres = nsIDOMDocumentView_GetDefaultView(nsdocview, &nsview);
915 nsIDOMDocumentView_Release(nsdocview);
916 if(NS_FAILED(nsres)) {
917 ERR("GetDefaultView failed: %08x\n", nsres);
921 nsres = nsIDOMAbstractView_QueryInterface(nsview, &IID_nsIDOMViewCSS, (void**)&nsviewcss);
922 nsIDOMAbstractView_Release(nsview);
923 if(NS_FAILED(nsres)) {
924 ERR("Could not get nsIDOMViewCSS: %08x\n", nsres);
928 nsAString_Init(&nsempty_str, NULL);
929 nsres = nsIDOMViewCSS_GetComputedStyle(nsviewcss, (nsIDOMElement*)elem->nselem, &nsempty_str, &nsstyle);
930 nsIDOMViewCSS_Release(nsviewcss);
931 nsAString_Finish(&nsempty_str);
932 if(NS_FAILED(nsres)) {
933 ERR("GetComputedStyle failed: %08x\n", nsres);
937 ret = heap_alloc_zero(sizeof(HTMLCurrentStyle));
939 nsIDOMCSSStyleDeclaration_Release(nsstyle);
940 return E_OUTOFMEMORY;
943 ret->lpIHTMLCurrentStyleVtbl = &HTMLCurrentStyleVtbl;
945 ret->nsstyle = nsstyle;
947 init_dispex(&ret->dispex, (IUnknown*)HTMLCURSTYLE(ret), &HTMLCurrentStyle_dispex);
949 *p = HTMLCURSTYLE(ret);