ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

htmlstyle.c
Go to the documentation of this file.
00001 /*
00002  * Copyright 2006 Jacek Caban for CodeWeavers
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00017  */
00018 
00019 #include <stdarg.h>
00020 #include <math.h>
00021 
00022 #define COBJMACROS
00023 
00024 #include "windef.h"
00025 #include "winbase.h"
00026 #include "winuser.h"
00027 #include "ole2.h"
00028 #include "mshtmdid.h"
00029 
00030 #include "mshtml_private.h"
00031 #include "htmlstyle.h"
00032 
00033 #include "wine/debug.h"
00034 #include "wine/unicode.h"
00035 
00036 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
00037 
00038 static const WCHAR attrBackground[] =
00039     {'b','a','c','k','g','r','o','u','n','d',0};
00040 static const WCHAR attrBackgroundColor[] =
00041     {'b','a','c','k','g','r','o','u','n','d','-','c','o','l','o','r',0};
00042 static const WCHAR attrBackgroundImage[] =
00043     {'b','a','c','k','g','r','o','u','n','d','-','i','m','a','g','e',0};
00044 static const WCHAR attrBackgroundPositionX[] =
00045     {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','x',0};
00046 static const WCHAR attrBackgroundPositionY[] =
00047     {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','y',0};
00048 static const WCHAR attrBackgroundRepeat[] =
00049     {'b','a','c','k','g','r','o','u','n','d','-','r','e','p','e','a','t',0};
00050 static const WCHAR attrBorder[] =
00051     {'b','o','r','d','e','r',0};
00052 static const WCHAR attrBorderBottom[] =
00053     {'b','o','r','d','e','r','-','b','o','t','t','o','m',0};
00054 static const WCHAR attrBorderBottomColor[] =
00055     {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','c','o','l','o','r',0};
00056 static const WCHAR attrBorderBottomStyle[] =
00057     {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','s','t','y','l','e',0};
00058 static const WCHAR attrBorderBottomWidth[] =
00059     {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','w','i','d','t','h',0};
00060 static const WCHAR attrBorderColor[] =
00061     {'b','o','r','d','e','r','-','c','o','l','o','r',0};
00062 static const WCHAR attrBorderLeft[] =
00063     {'b','o','r','d','e','r','-','l','e','f','t',0};
00064 static const WCHAR attrBorderLeftColor[] =
00065     {'b','o','r','d','e','r','-','l','e','f','t','-','c','o','l','o','r',0};
00066 static const WCHAR attrBorderLeftStyle[] =
00067     {'b','o','r','d','e','r','-','l','e','f','t','-','s','t','y','l','e',0};
00068 static const WCHAR attrBorderLeftWidth[] =
00069     {'b','o','r','d','e','r','-','l','e','f','t','-','w','i','d','t','h',0};
00070 static const WCHAR attrBorderRight[] =
00071     {'b','o','r','d','e','r','-','r','i','g','h','t',0};
00072 static const WCHAR attrBorderRightColor[] =
00073     {'b','o','r','d','e','r','-','r','i','g','h','t','-','c','o','l','o','r',0};
00074 static const WCHAR attrBorderRightStyle[] =
00075     {'b','o','r','d','e','r','-','r','i','g','h','t','-','s','t','y','l','e',0};
00076 static const WCHAR attrBorderRightWidth[] =
00077     {'b','o','r','d','e','r','-','r','i','g','h','t','-','w','i','d','t','h',0};
00078 static const WCHAR attrBorderTop[] =
00079     {'b','o','r','d','e','r','-','t','o','p',0};
00080 static const WCHAR attrBorderTopColor[] =
00081     {'b','o','r','d','e','r','-','t','o','p','-','c','o','l','o','r',0};
00082 static const WCHAR attrBorderStyle[] =
00083     {'b','o','r','d','e','r','-','s','t','y','l','e',0};
00084 static const WCHAR attrBorderTopStyle[] =
00085     {'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e',0};
00086 static const WCHAR attrBorderTopWidth[] =
00087     {'b','o','r','d','e','r','-','t','o','p','-','w','i','d','t','h',0};
00088 static const WCHAR attrBorderWidth[] =
00089     {'b','o','r','d','e','r','-','w','i','d','t','h',0};
00090 static const WCHAR attrBottom[] =
00091     {'b','o','t','t','o','m',0};
00092 static const WCHAR attrColor[] =
00093     {'c','o','l','o','r',0};
00094 static const WCHAR attrCursor[] =
00095     {'c','u','r','s','o','r',0};
00096 static const WCHAR attrDisplay[] =
00097     {'d','i','s','p','l','a','y',0};
00098 static const WCHAR attrFilter[] =
00099     {'f','i','l','e','t','e','r',0};
00100 static const WCHAR attrFontFamily[] =
00101     {'f','o','n','t','-','f','a','m','i','l','y',0};
00102 static const WCHAR attrFontSize[] =
00103     {'f','o','n','t','-','s','i','z','e',0};
00104 static const WCHAR attrFontStyle[] =
00105     {'f','o','n','t','-','s','t','y','l','e',0};
00106 static const WCHAR attrFontVariant[] =
00107     {'f','o','n','t','-','v','a','r','i','a','n','t',0};
00108 static const WCHAR attrFontWeight[] =
00109     {'f','o','n','t','-','w','e','i','g','h','t',0};
00110 static const WCHAR attrHeight[] =
00111     {'h','e','i','g','h','t',0};
00112 static const WCHAR attrLeft[] =
00113     {'l','e','f','t',0};
00114 static const WCHAR attrLetterSpacing[] =
00115     {'l','e','t','t','e','r','-','s','p','a','c','i','n','g',0};
00116 static const WCHAR attrLineHeight[] =
00117     {'l','i','n','e','-','h','e','i','g','h','t',0};
00118 static const WCHAR attrMargin[] =
00119     {'m','a','r','g','i','n',0};
00120 static const WCHAR attrMarginBottom[] =
00121     {'m','a','r','g','i','n','-','b','o','t','t','o','m',0};
00122 static const WCHAR attrMarginLeft[] =
00123     {'m','a','r','g','i','n','-','l','e','f','t',0};
00124 static const WCHAR attrMarginRight[] =
00125     {'m','a','r','g','i','n','-','r','i','g','h','t',0};
00126 static const WCHAR attrMarginTop[] =
00127     {'m','a','r','g','i','n','-','t','o','p',0};
00128 static const WCHAR attrMinHeight[] =
00129     {'m','i','n','-','h','e','i','g','h','t',0};
00130 static const WCHAR attrOverflow[] =
00131     {'o','v','e','r','f','l','o','w',0};
00132 static const WCHAR attrPaddingBottom[] =
00133     {'p','a','d','d','i','n','g','-','b','o','t','t','o','m',0};
00134 static const WCHAR attrPaddingLeft[] =
00135     {'p','a','d','d','i','n','g','-','l','e','f','t',0};
00136 static const WCHAR attrPaddingRight[] =
00137     {'p','a','d','d','i','n','g','-','r','i','g','h','t',0};
00138 static const WCHAR attrPaddingTop[] =
00139     {'p','a','d','d','i','n','g','-','t','o','p',0};
00140 static const WCHAR attrPosition[] =
00141     {'p','o','s','i','t','i','o','n',0};
00142 static const WCHAR attrRight[] =
00143     {'r','i','g','h','t',0};
00144 static const WCHAR attrTextAlign[] =
00145     {'t','e','x','t','-','a','l','i','g','n',0};
00146 static const WCHAR attrTextDecoration[] =
00147     {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
00148 static const WCHAR attrTextIndent[] =
00149     {'t','e','x','t','-','i','n','d','e','n','t',0};
00150 static const WCHAR attrTop[] =
00151     {'t','o','p',0};
00152 static const WCHAR attrVerticalAlign[] =
00153     {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
00154 static const WCHAR attrVisibility[] =
00155     {'v','i','s','i','b','i','l','i','t','y',0};
00156 static const WCHAR attrWidth[] =
00157     {'w','i','d','t','h',0};
00158 static const WCHAR attrWordSpacing[] =
00159     {'w','o','r','d','-','s','p','a','c','i','n','g',0};
00160 static const WCHAR attrWordWrap[] =
00161     {'w','o','r','d','-','w','r','a','p',0};
00162 static const WCHAR attrZIndex[] =
00163     {'z','-','i','n','d','e','x',0};
00164 
00165 static const struct{
00166     const WCHAR *name;
00167     DISPID dispid;
00168 } style_tbl[] = {
00169     {attrBackground,           DISPID_IHTMLSTYLE_BACKGROUND},
00170     {attrBackgroundColor,      DISPID_IHTMLSTYLE_BACKGROUNDCOLOR},
00171     {attrBackgroundImage,      DISPID_IHTMLSTYLE_BACKGROUNDIMAGE},
00172     {attrBackgroundPositionX,  DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONX},
00173     {attrBackgroundPositionY,  DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONY},
00174     {attrBackgroundRepeat,     DISPID_IHTMLSTYLE_BACKGROUNDREPEAT},
00175     {attrBorder,               DISPID_IHTMLSTYLE_BORDER},
00176     {attrBorderBottom,         DISPID_IHTMLSTYLE_BORDERBOTTOM},
00177     {attrBorderBottomColor,    DISPID_IHTMLSTYLE_BORDERBOTTOMCOLOR},
00178     {attrBorderBottomStyle,    DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE},
00179     {attrBorderBottomWidth,    DISPID_IHTMLSTYLE_BORDERBOTTOMWIDTH},
00180     {attrBorderColor,          DISPID_IHTMLSTYLE_BORDERCOLOR},
00181     {attrBorderLeft,           DISPID_IHTMLSTYLE_BORDERLEFT},
00182     {attrBorderLeftColor,      DISPID_IHTMLSTYLE_BORDERLEFTCOLOR},
00183     {attrBorderLeftStyle,      DISPID_IHTMLSTYLE_BORDERLEFTSTYLE},
00184     {attrBorderLeftWidth,      DISPID_IHTMLSTYLE_BORDERLEFTWIDTH},
00185     {attrBorderRight,          DISPID_IHTMLSTYLE_BORDERRIGHT},
00186     {attrBorderRightColor,     DISPID_IHTMLSTYLE_BORDERRIGHTCOLOR},
00187     {attrBorderRightStyle,     DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE},
00188     {attrBorderRightWidth,     DISPID_IHTMLSTYLE_BORDERRIGHTWIDTH},
00189     {attrBorderStyle,          DISPID_IHTMLSTYLE_BORDERSTYLE},
00190     {attrBorderTop,            DISPID_IHTMLSTYLE_BORDERTOP},
00191     {attrBorderTopColor,       DISPID_IHTMLSTYLE_BORDERTOPCOLOR},
00192     {attrBorderTopStyle,       DISPID_IHTMLSTYLE_BORDERTOPSTYLE},
00193     {attrBorderTopWidth,       DISPID_IHTMLSTYLE_BORDERTOPWIDTH},
00194     {attrBorderWidth,          DISPID_IHTMLSTYLE_BORDERWIDTH},
00195     {attrBottom,               DISPID_IHTMLSTYLE2_BOTTOM},
00196     {attrColor,                DISPID_IHTMLSTYLE_COLOR},
00197     {attrCursor,               DISPID_IHTMLSTYLE_CURSOR},
00198     {attrDisplay,              DISPID_IHTMLSTYLE_DISPLAY},
00199     {attrFilter,               DISPID_IHTMLSTYLE_FILTER},
00200     {attrFontFamily,           DISPID_IHTMLSTYLE_FONTFAMILY},
00201     {attrFontSize,             DISPID_IHTMLSTYLE_FONTSIZE},
00202     {attrFontStyle,            DISPID_IHTMLSTYLE_FONTSTYLE},
00203     {attrFontVariant,          DISPID_IHTMLSTYLE_FONTVARIANT},
00204     {attrFontWeight,           DISPID_IHTMLSTYLE_FONTWEIGHT},
00205     {attrHeight,               DISPID_IHTMLSTYLE_HEIGHT},
00206     {attrLeft,                 DISPID_IHTMLSTYLE_LEFT},
00207     {attrLetterSpacing,        DISPID_IHTMLSTYLE_LETTERSPACING},
00208     {attrLineHeight,           DISPID_IHTMLSTYLE_LINEHEIGHT},
00209     {attrMargin,               DISPID_IHTMLSTYLE_MARGIN},
00210     {attrMarginBottom,         DISPID_IHTMLSTYLE_MARGINBOTTOM},
00211     {attrMarginLeft,           DISPID_IHTMLSTYLE_MARGINLEFT},
00212     {attrMarginRight,          DISPID_IHTMLSTYLE_MARGINRIGHT},
00213     {attrMarginTop,            DISPID_IHTMLSTYLE_MARGINTOP},
00214     {attrMinHeight,            DISPID_IHTMLSTYLE4_MINHEIGHT},
00215     {attrOverflow,             DISPID_IHTMLSTYLE_OVERFLOW},
00216     {attrPaddingBottom,        DISPID_IHTMLSTYLE_PADDINGBOTTOM},
00217     {attrPaddingLeft,          DISPID_IHTMLSTYLE_PADDINGLEFT},
00218     {attrPaddingRight,         DISPID_IHTMLSTYLE_PADDINGRIGHT},
00219     {attrPaddingTop,           DISPID_IHTMLSTYLE_PADDINGTOP},
00220     {attrPosition,             DISPID_IHTMLSTYLE2_POSITION},
00221     {attrRight,                DISPID_IHTMLSTYLE2_RIGHT},
00222     {attrTextAlign,            DISPID_IHTMLSTYLE_TEXTALIGN},
00223     {attrTextDecoration,       DISPID_IHTMLSTYLE_TEXTDECORATION},
00224     {attrTextIndent,           DISPID_IHTMLSTYLE_TEXTINDENT},
00225     {attrTop,                  DISPID_IHTMLSTYLE_TOP},
00226     {attrVerticalAlign,        DISPID_IHTMLSTYLE_VERTICALALIGN},
00227     {attrVisibility,           DISPID_IHTMLSTYLE_VISIBILITY},
00228     {attrWidth,                DISPID_IHTMLSTYLE_WIDTH},
00229     {attrWordSpacing,          DISPID_IHTMLSTYLE_WORDSPACING},
00230     {attrWordWrap,             DISPID_IHTMLSTYLE3_WORDWRAP},
00231     {attrZIndex,               DISPID_IHTMLSTYLE_ZINDEX}
00232 };
00233 
00234 static const WCHAR valLineThrough[] =
00235     {'l','i','n','e','-','t','h','r','o','u','g','h',0};
00236 static const WCHAR valUnderline[] =
00237     {'u','n','d','e','r','l','i','n','e',0};
00238 static const WCHAR szNormal[] =
00239     {'n','o','r','m','a','l',0};
00240 static const WCHAR styleNone[] =
00241     {'n','o','n','e',0};
00242 static const WCHAR valOverline[] =
00243     {'o','v','e','r','l','i','n','e',0};
00244 static const WCHAR valBlink[] =
00245     {'b','l','i','n','k',0};
00246 
00247 static const WCHAR px_formatW[] = {'%','d','p','x',0};
00248 static const WCHAR emptyW[] = {0};
00249 
00250 static LPWSTR fix_px_value(LPCWSTR val)
00251 {
00252     LPCWSTR ptr = val;
00253 
00254     while(*ptr) {
00255         while(*ptr && isspaceW(*ptr))
00256             ptr++;
00257         if(!*ptr)
00258             break;
00259 
00260         while(*ptr && isdigitW(*ptr))
00261             ptr++;
00262 
00263         if(!*ptr || isspaceW(*ptr)) {
00264             LPWSTR ret, p;
00265             int len = strlenW(val)+1;
00266 
00267             ret = heap_alloc((len+2)*sizeof(WCHAR));
00268             memcpy(ret, val, (ptr-val)*sizeof(WCHAR));
00269             p = ret + (ptr-val);
00270             *p++ = 'p';
00271             *p++ = 'x';
00272             strcpyW(p, ptr);
00273 
00274             TRACE("fixed %s -> %s\n", debugstr_w(val), debugstr_w(ret));
00275 
00276             return ret;
00277         }
00278 
00279         while(*ptr && !isspaceW(*ptr))
00280             ptr++;
00281     }
00282 
00283     return NULL;
00284 }
00285 
00286 static LPWSTR fix_url_value(LPCWSTR val)
00287 {
00288     WCHAR *ret, *ptr;
00289 
00290     static const WCHAR urlW[] = {'u','r','l','('};
00291 
00292     if(strncmpW(val, urlW, sizeof(urlW)/sizeof(WCHAR)) || !strchrW(val, '\\'))
00293         return NULL;
00294 
00295     ret = heap_strdupW(val);
00296 
00297     for(ptr = ret; *ptr; ptr++) {
00298         if(*ptr == '\\')
00299             *ptr = '/';
00300     }
00301 
00302     return ret;
00303 }
00304 
00305 HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCWSTR value, DWORD flags)
00306 {
00307     nsAString str_name, str_value, str_empty;
00308     LPWSTR val = NULL;
00309     nsresult nsres;
00310 
00311     static const PRUnichar wszEmpty[] = {0};
00312 
00313     if(flags & ATTR_FIX_PX)
00314         val = fix_px_value(value);
00315     if(flags & ATTR_FIX_URL)
00316         val = fix_url_value(value);
00317 
00318     nsAString_InitDepend(&str_name, style_tbl[sid].name);
00319     nsAString_InitDepend(&str_value, val ? val : value);
00320     nsAString_InitDepend(&str_empty, wszEmpty);
00321     heap_free(val);
00322 
00323     nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, &str_value, &str_empty);
00324     if(NS_FAILED(nsres))
00325         ERR("SetProperty failed: %08x\n", nsres);
00326 
00327     nsAString_Finish(&str_name);
00328     nsAString_Finish(&str_value);
00329     nsAString_Finish(&str_empty);
00330 
00331     return S_OK;
00332 }
00333 
00334 HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags)
00335 {
00336     switch(V_VT(value)) {
00337     case VT_NULL:
00338         return set_nsstyle_attr(nsstyle, sid, emptyW, flags);
00339 
00340     case VT_BSTR:
00341         return set_nsstyle_attr(nsstyle, sid, V_BSTR(value), flags);
00342 
00343     case VT_BSTR|VT_BYREF:
00344         return set_nsstyle_attr(nsstyle, sid, *V_BSTRREF(value), flags);
00345 
00346     case VT_I4: {
00347         WCHAR str[14];
00348 
00349         static const WCHAR format[] = {'%','d',0};
00350         static const WCHAR px_format[] = {'%','d','p','x',0};
00351 
00352         wsprintfW(str, flags&ATTR_FIX_PX ? px_format : format, V_I4(value));
00353         return set_nsstyle_attr(nsstyle, sid, str, flags & ~ATTR_FIX_PX);
00354     }
00355     default:
00356         FIXME("not implemented vt %d\n", V_VT(value));
00357         return E_NOTIMPL;
00358 
00359     }
00360 
00361     return S_OK;
00362 }
00363 
00364 static inline HRESULT set_style_attr(HTMLStyle *This, styleid_t sid, LPCWSTR value, DWORD flags)
00365 {
00366     return set_nsstyle_attr(This->nsstyle, sid, value, flags);
00367 }
00368 
00369 static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, nsAString *value)
00370 {
00371     nsAString str_name;
00372     nsresult nsres;
00373 
00374     nsAString_InitDepend(&str_name, style_tbl[sid].name);
00375 
00376     nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle, &str_name, value);
00377     if(NS_FAILED(nsres)) {
00378         ERR("SetProperty failed: %08x\n", nsres);
00379         return E_FAIL;
00380     }
00381 
00382     nsAString_Finish(&str_name);
00383 
00384     return NS_OK;
00385 }
00386 
00387 HRESULT get_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, BSTR *p)
00388 {
00389     nsAString str_value;
00390     const PRUnichar *value;
00391 
00392     nsAString_Init(&str_value, NULL);
00393 
00394     get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
00395 
00396     nsAString_GetData(&str_value, &value);
00397     *p = *value ? SysAllocString(value) : NULL;
00398 
00399     nsAString_Finish(&str_value);
00400 
00401     TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_w(*p));
00402     return S_OK;
00403 }
00404 
00405 HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags)
00406 {
00407     nsAString str_value;
00408     const PRUnichar *value;
00409     BOOL set = FALSE;
00410 
00411     nsAString_Init(&str_value, NULL);
00412 
00413     get_nsstyle_attr_nsval(nsstyle, sid, &str_value);
00414 
00415     nsAString_GetData(&str_value, &value);
00416 
00417     if(flags & ATTR_STR_TO_INT) {
00418         const PRUnichar *ptr = value;
00419         BOOL neg = FALSE;
00420         INT i = 0;
00421 
00422         if(*ptr == '-') {
00423             neg = TRUE;
00424             ptr++;
00425         }
00426 
00427         while(isdigitW(*ptr))
00428             i = i*10 + (*ptr++ - '0');
00429 
00430         if(!*ptr) {
00431             V_VT(p) = VT_I4;
00432             V_I4(p) = neg ? -i : i;
00433             set = TRUE;
00434         }
00435     }
00436 
00437     if(!set) {
00438         BSTR str = NULL;
00439 
00440         if(*value) {
00441             str = SysAllocString(value);
00442             if(!str)
00443                 return E_OUTOFMEMORY;
00444         }
00445 
00446         V_VT(p) = VT_BSTR;
00447         V_BSTR(p) = str;
00448     }
00449 
00450     nsAString_Finish(&str_value);
00451 
00452     TRACE("%s -> %s\n", debugstr_w(style_tbl[sid].name), debugstr_variant(p));
00453     return S_OK;
00454 }
00455 
00456 static inline HRESULT get_style_attr(HTMLStyle *This, styleid_t sid, BSTR *p)
00457 {
00458     return get_nsstyle_attr(This->nsstyle, sid, p);
00459 }
00460 
00461 static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR exval, VARIANT_BOOL *p)
00462 {
00463     nsAString str_value;
00464     const PRUnichar *value;
00465 
00466     nsAString_Init(&str_value, NULL);
00467 
00468     get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
00469 
00470     nsAString_GetData(&str_value, &value);
00471     *p = strcmpW(value, exval) ? VARIANT_FALSE : VARIANT_TRUE;
00472     nsAString_Finish(&str_value);
00473 
00474     TRACE("%s -> %x\n", debugstr_w(style_tbl[sid].name), *p);
00475     return S_OK;
00476 }
00477 
00478 static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value)
00479 {
00480     WCHAR szValue[25];
00481     WCHAR szFormat[] = {'%','.','0','f','p','x',0};
00482 
00483     value = floor(value);
00484 
00485     sprintfW(szValue, szFormat, value);
00486 
00487     return set_style_attr(This, sid, szValue, 0);
00488 }
00489 
00490 static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p)
00491 {
00492     nsAString str_value;
00493     HRESULT hres;
00494     WCHAR pxW[] = {'p','x',0};
00495 
00496     TRACE("%p %d %p\n", This, sid, p);
00497 
00498     *p = 0.0f;
00499 
00500     nsAString_Init(&str_value, NULL);
00501 
00502     hres = get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
00503     if(hres == S_OK)
00504     {
00505         WCHAR *ptr;
00506         const PRUnichar *value;
00507 
00508         nsAString_GetData(&str_value, &value);
00509         if(value)
00510         {
00511             *p = strtolW(value, &ptr, 10);
00512 
00513             if(*ptr && strcmpW(ptr, pxW))
00514             {
00515                 nsAString_Finish(&str_value);
00516                 FIXME("only px values are currently supported\n");
00517                 return E_FAIL;
00518             }
00519         }
00520     }
00521 
00522     TRACE("ret %f\n", *p);
00523 
00524     nsAString_Finish(&str_value);
00525 
00526     return hres;
00527 }
00528 
00529 static BOOL is_valid_border_style(BSTR v)
00530 {
00531     static const WCHAR styleDotted[] = {'d','o','t','t','e','d',0};
00532     static const WCHAR styleDashed[] = {'d','a','s','h','e','d',0};
00533     static const WCHAR styleSolid[]  = {'s','o','l','i','d',0};
00534     static const WCHAR styleDouble[] = {'d','o','u','b','l','e',0};
00535     static const WCHAR styleGroove[] = {'g','r','o','o','v','e',0};
00536     static const WCHAR styleRidge[]  = {'r','i','d','g','e',0};
00537     static const WCHAR styleInset[]  = {'i','n','s','e','t',0};
00538     static const WCHAR styleOutset[] = {'o','u','t','s','e','t',0};
00539 
00540     TRACE("%s\n", debugstr_w(v));
00541 
00542     if(!v || strcmpiW(v, styleNone)   == 0 || strcmpiW(v, styleDotted) == 0 ||
00543              strcmpiW(v, styleDashed) == 0 || strcmpiW(v, styleSolid)  == 0 ||
00544              strcmpiW(v, styleDouble) == 0 || strcmpiW(v, styleGroove) == 0 ||
00545              strcmpiW(v, styleRidge)  == 0 || strcmpiW(v, styleInset)  == 0 ||
00546              strcmpiW(v, styleOutset) == 0 )
00547     {
00548         return TRUE;
00549     }
00550 
00551     return FALSE;
00552 }
00553 
00554 #define HTMLSTYLE_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle, iface)
00555 
00556 static HRESULT WINAPI HTMLStyle_QueryInterface(IHTMLStyle *iface, REFIID riid, void **ppv)
00557 {
00558     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00559 
00560     *ppv = NULL;
00561 
00562     if(IsEqualGUID(&IID_IUnknown, riid)) {
00563         TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
00564         *ppv = HTMLSTYLE(This);
00565     }else if(IsEqualGUID(&IID_IHTMLStyle, riid)) {
00566         TRACE("(%p)->(IID_IHTMLStyle %p)\n", This, ppv);
00567         *ppv = HTMLSTYLE(This);
00568     }else if(IsEqualGUID(&IID_IHTMLStyle2, riid)) {
00569         TRACE("(%p)->(IID_IHTMLStyle2 %p)\n", This, ppv);
00570         *ppv = HTMLSTYLE2(This);
00571     }else if(IsEqualGUID(&IID_IHTMLStyle3, riid)) {
00572         TRACE("(%p)->(IID_IHTMLStyle3 %p)\n", This, ppv);
00573         *ppv = HTMLSTYLE3(This);
00574     }else if(IsEqualGUID(&IID_IHTMLStyle4, riid)) {
00575         TRACE("(%p)->(IID_IHTMLStyle4 %p)\n", This, ppv);
00576         *ppv = HTMLSTYLE4(This);
00577     }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
00578         return *ppv ? S_OK : E_NOINTERFACE;
00579     }
00580 
00581     if(*ppv) {
00582         IUnknown_AddRef((IUnknown*)*ppv);
00583         return S_OK;
00584     }
00585 
00586     WARN("unsupported %s\n", debugstr_guid(riid));
00587     return E_NOINTERFACE;
00588 }
00589 
00590 static ULONG WINAPI HTMLStyle_AddRef(IHTMLStyle *iface)
00591 {
00592     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00593     LONG ref = InterlockedIncrement(&This->ref);
00594 
00595     TRACE("(%p) ref=%d\n", This, ref);
00596 
00597     return ref;
00598 }
00599 
00600 static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
00601 {
00602     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00603     LONG ref = InterlockedDecrement(&This->ref);
00604 
00605     TRACE("(%p) ref=%d\n", This, ref);
00606 
00607     if(!ref) {
00608         if(This->nsstyle)
00609             nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
00610         release_dispex(&This->dispex);
00611         heap_free(This);
00612     }
00613 
00614     return ref;
00615 }
00616 
00617 static HRESULT WINAPI HTMLStyle_GetTypeInfoCount(IHTMLStyle *iface, UINT *pctinfo)
00618 {
00619     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00620     return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
00621 }
00622 
00623 static HRESULT WINAPI HTMLStyle_GetTypeInfo(IHTMLStyle *iface, UINT iTInfo,
00624                                               LCID lcid, ITypeInfo **ppTInfo)
00625 {
00626     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00627     return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
00628 }
00629 
00630 static HRESULT WINAPI HTMLStyle_GetIDsOfNames(IHTMLStyle *iface, REFIID riid,
00631                                                 LPOLESTR *rgszNames, UINT cNames,
00632                                                 LCID lcid, DISPID *rgDispId)
00633 {
00634     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00635     return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
00636 }
00637 
00638 static HRESULT WINAPI HTMLStyle_Invoke(IHTMLStyle *iface, DISPID dispIdMember,
00639                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
00640                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
00641 {
00642     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00643     return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
00644             wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
00645 }
00646 
00647 static HRESULT WINAPI HTMLStyle_put_fontFamily(IHTMLStyle *iface, BSTR v)
00648 {
00649     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00650 
00651     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
00652 
00653     return set_style_attr(This, STYLEID_FONT_FAMILY, v, 0);
00654 }
00655 
00656 static HRESULT WINAPI HTMLStyle_get_fontFamily(IHTMLStyle *iface, BSTR *p)
00657 {
00658     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00659 
00660     TRACE("(%p)->(%p)\n", This, p);
00661 
00662     return get_style_attr(This, STYLEID_FONT_FAMILY, p);
00663 }
00664 
00665 static HRESULT WINAPI HTMLStyle_put_fontStyle(IHTMLStyle *iface, BSTR v)
00666 {
00667     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00668     static const WCHAR szItalic[]  = {'i','t','a','l','i','c',0};
00669     static const WCHAR szOblique[]  = {'o','b','l','i','q','u','e',0};
00670 
00671     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
00672 
00673     /* fontStyle can only be one of the follow values. */
00674     if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szItalic, v) == 0 ||
00675              strcmpiW(szOblique, v) == 0)
00676     {
00677         return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_STYLE, v, 0);
00678     }
00679 
00680     return E_INVALIDARG;
00681 }
00682 
00683 static HRESULT WINAPI HTMLStyle_get_fontStyle(IHTMLStyle *iface, BSTR *p)
00684 {
00685     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00686 
00687     TRACE("(%p)->(%p)\n", This, p);
00688 
00689     return get_style_attr(This, STYLEID_FONT_STYLE, p);
00690 }
00691 
00692 static HRESULT WINAPI HTMLStyle_put_fontVariant(IHTMLStyle *iface, BSTR v)
00693 {
00694     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00695     static const WCHAR szCaps[]  = {'s','m','a','l','l','-','c','a','p','s',0};
00696 
00697     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
00698 
00699     /* fontVariant can only be one of the follow values. */
00700     if(!v || strcmpiW(szNormal, v) == 0 || strcmpiW(szCaps, v) == 0)
00701     {
00702         return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_VARIANT, v, 0);
00703     }
00704 
00705     return E_INVALIDARG;
00706 }
00707 
00708 static HRESULT WINAPI HTMLStyle_get_fontVariant(IHTMLStyle *iface, BSTR *p)
00709 {
00710     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00711     TRACE("(%p)->(%p)\n", This, p);
00712 
00713     if(!p)
00714        return E_INVALIDARG;
00715 
00716     return get_style_attr(This, STYLEID_FONT_VARIANT, p);
00717 }
00718 
00719 static HRESULT WINAPI HTMLStyle_put_fontWeight(IHTMLStyle *iface, BSTR v)
00720 {
00721     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00722     static const WCHAR styleBold[] = {'b','o','l','d',0};
00723     static const WCHAR styleBolder[] = {'b','o','l','d','e','r',0};
00724     static const WCHAR styleLighter[]  = {'l','i','g','h','t','e','r',0};
00725     static const WCHAR style100[] = {'1','0','0',0};
00726     static const WCHAR style200[] = {'2','0','0',0};
00727     static const WCHAR style300[] = {'3','0','0',0};
00728     static const WCHAR style400[] = {'4','0','0',0};
00729     static const WCHAR style500[] = {'5','0','0',0};
00730     static const WCHAR style600[] = {'6','0','0',0};
00731     static const WCHAR style700[] = {'7','0','0',0};
00732     static const WCHAR style800[] = {'8','0','0',0};
00733     static const WCHAR style900[] = {'9','0','0',0};
00734 
00735     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
00736 
00737     /* fontWeight can only be one of the following */
00738     if(!v || strcmpiW(szNormal, v) == 0    || strcmpiW(styleBold, v) == 0    ||
00739              strcmpiW(styleBolder, v) == 0 || strcmpiW(styleLighter, v) == 0 ||
00740              strcmpiW(style100, v) == 0    || strcmpiW(style200, v) == 0     ||
00741              strcmpiW(style300, v) == 0    || strcmpiW(style400, v) == 0     ||
00742              strcmpiW(style500, v) == 0    || strcmpiW(style600, v) == 0     ||
00743              strcmpiW(style700, v) == 0    || strcmpiW(style800, v) == 0     ||
00744              strcmpiW(style900, v) == 0
00745              )
00746     {
00747         return set_nsstyle_attr(This->nsstyle, STYLEID_FONT_WEIGHT, v, 0);
00748     }
00749 
00750     return E_INVALIDARG;
00751 }
00752 
00753 static HRESULT WINAPI HTMLStyle_get_fontWeight(IHTMLStyle *iface, BSTR *p)
00754 {
00755     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00756 
00757     TRACE("(%p)->(%p)\n", This, p);
00758 
00759     return get_style_attr(This, STYLEID_FONT_WEIGHT, p);
00760 }
00761 
00762 static HRESULT WINAPI HTMLStyle_put_fontSize(IHTMLStyle *iface, VARIANT v)
00763 {
00764     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00765 
00766     TRACE("(%p)->(v%d)\n", This, V_VT(&v));
00767 
00768     switch(V_VT(&v)) {
00769     case VT_BSTR:
00770         return set_style_attr(This, STYLEID_FONT_SIZE, V_BSTR(&v), 0);
00771     default:
00772         FIXME("not supported vt %d\n", V_VT(&v));
00773     }
00774 
00775     return S_OK;
00776 }
00777 
00778 static HRESULT WINAPI HTMLStyle_get_fontSize(IHTMLStyle *iface, VARIANT *p)
00779 {
00780     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00781 
00782     TRACE("(%p)->(%p)\n", This, p);
00783 
00784     V_VT(p) = VT_BSTR;
00785     return get_style_attr(This, STYLEID_FONT_SIZE, &V_BSTR(p));
00786 }
00787 
00788 static HRESULT WINAPI HTMLStyle_put_font(IHTMLStyle *iface, BSTR v)
00789 {
00790     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00791     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
00792     return E_NOTIMPL;
00793 }
00794 
00795 static HRESULT WINAPI HTMLStyle_get_font(IHTMLStyle *iface, BSTR *p)
00796 {
00797     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00798     FIXME("(%p)->(%p)\n", This, p);
00799     return E_NOTIMPL;
00800 }
00801 
00802 static HRESULT WINAPI HTMLStyle_put_color(IHTMLStyle *iface, VARIANT v)
00803 {
00804     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00805 
00806     TRACE("(%p)->(v%d)\n", This, V_VT(&v));
00807 
00808     switch(V_VT(&v)) {
00809     case VT_BSTR:
00810         TRACE("%s\n", debugstr_w(V_BSTR(&v)));
00811         return set_style_attr(This, STYLEID_COLOR, V_BSTR(&v), 0);
00812 
00813     default:
00814         FIXME("unsupported vt=%d\n", V_VT(&v));
00815     }
00816 
00817     return E_NOTIMPL;
00818 }
00819 
00820 static HRESULT WINAPI HTMLStyle_get_color(IHTMLStyle *iface, VARIANT *p)
00821 {
00822     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00823 
00824     TRACE("(%p)->(%p)\n", This, p);
00825 
00826     V_VT(p) = VT_BSTR;
00827     return get_style_attr(This, STYLEID_COLOR, &V_BSTR(p));
00828 }
00829 
00830 static HRESULT WINAPI HTMLStyle_put_background(IHTMLStyle *iface, BSTR v)
00831 {
00832     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00833 
00834     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
00835 
00836     return set_style_attr(This, STYLEID_BACKGROUND, v, 0);
00837 }
00838 
00839 static HRESULT WINAPI HTMLStyle_get_background(IHTMLStyle *iface, BSTR *p)
00840 {
00841     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00842 
00843     TRACE("(%p)->(%p)\n", This, p);
00844 
00845     return get_style_attr(This, STYLEID_BACKGROUND, p);
00846 }
00847 
00848 static HRESULT WINAPI HTMLStyle_put_backgroundColor(IHTMLStyle *iface, VARIANT v)
00849 {
00850     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00851 
00852     TRACE("(%p)->(v%d)\n", This, V_VT(&v));
00853 
00854     switch(V_VT(&v)) {
00855     case VT_BSTR:
00856         return set_style_attr(This, STYLEID_BACKGROUND_COLOR, V_BSTR(&v), 0);
00857     case VT_I4: {
00858         WCHAR value[10];
00859         static const WCHAR format[] = {'#','%','0','6','x',0};
00860 
00861         wsprintfW(value, format, V_I4(&v));
00862         return set_style_attr(This, STYLEID_BACKGROUND_COLOR, value, 0);
00863     }
00864     default:
00865         FIXME("unsupported vt %d\n", V_VT(&v));
00866     }
00867 
00868     return S_OK;
00869 }
00870 
00871 static HRESULT WINAPI HTMLStyle_get_backgroundColor(IHTMLStyle *iface, VARIANT *p)
00872 {
00873     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00874     TRACE("(%p)->(%p)\n", This, p);
00875 
00876     V_VT(p) = VT_BSTR;
00877     return get_style_attr(This, STYLEID_BACKGROUND_COLOR, &V_BSTR(p));
00878 }
00879 
00880 static HRESULT WINAPI HTMLStyle_put_backgroundImage(IHTMLStyle *iface, BSTR v)
00881 {
00882     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00883 
00884     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
00885 
00886     return set_style_attr(This, STYLEID_BACKGROUND_IMAGE, v, ATTR_FIX_URL);
00887 }
00888 
00889 static HRESULT WINAPI HTMLStyle_get_backgroundImage(IHTMLStyle *iface, BSTR *p)
00890 {
00891     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00892 
00893     TRACE("(%p)->(%p)\n", This, p);
00894 
00895     return get_style_attr(This, STYLEID_BACKGROUND_IMAGE, p);
00896 }
00897 
00898 static HRESULT WINAPI HTMLStyle_put_backgroundRepeat(IHTMLStyle *iface, BSTR v)
00899 {
00900     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00901     static const WCHAR styleRepeat[]   = {'r','e','p','e','a','t',0};
00902     static const WCHAR styleNoRepeat[] = {'n','o','-','r','e','p','e','a','t',0};
00903     static const WCHAR styleRepeatX[]  = {'r','e','p','e','a','t','-','x',0};
00904     static const WCHAR styleRepeatY[]  = {'r','e','p','e','a','t','-','y',0};
00905 
00906     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
00907 
00908     /* fontWeight can only be one of the following */
00909     if(!v || strcmpiW(styleRepeat, v) == 0    || strcmpiW(styleNoRepeat, v) == 0    ||
00910              strcmpiW(styleRepeatX, v) == 0 || strcmpiW(styleRepeatY, v) == 0 )
00911     {
00912         return set_style_attr(This, STYLEID_BACKGROUND_REPEAT , v, 0);
00913     }
00914 
00915     return E_INVALIDARG;
00916 }
00917 
00918 static HRESULT WINAPI HTMLStyle_get_backgroundRepeat(IHTMLStyle *iface, BSTR *p)
00919 {
00920     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00921 
00922     TRACE("(%p)->(%p)\n", This, p);
00923 
00924     return get_style_attr(This, STYLEID_BACKGROUND_REPEAT, p);
00925 }
00926 
00927 static HRESULT WINAPI HTMLStyle_put_backgroundAttachment(IHTMLStyle *iface, BSTR v)
00928 {
00929     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00930     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
00931     return E_NOTIMPL;
00932 }
00933 
00934 static HRESULT WINAPI HTMLStyle_get_backgroundAttachment(IHTMLStyle *iface, BSTR *p)
00935 {
00936     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00937     FIXME("(%p)->(%p)\n", This, p);
00938     return E_NOTIMPL;
00939 }
00940 
00941 static HRESULT WINAPI HTMLStyle_put_backgroundPosition(IHTMLStyle *iface, BSTR v)
00942 {
00943     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00944     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
00945     return E_NOTIMPL;
00946 }
00947 
00948 static HRESULT WINAPI HTMLStyle_get_backgroundPosition(IHTMLStyle *iface, BSTR *p)
00949 {
00950     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00951     FIXME("(%p)->(%p)\n", This, p);
00952     return E_NOTIMPL;
00953 }
00954 
00955 static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIANT v)
00956 {
00957     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00958     TRACE("(%p)->(v%d)\n", This, V_VT(&v));
00959     return set_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_X, &v, 0);
00960 }
00961 
00962 static HRESULT WINAPI HTMLStyle_get_backgroundPositionX(IHTMLStyle *iface, VARIANT *p)
00963 {
00964     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00965     TRACE("(%p)->(%p)\n", This, p);
00966     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_X, p, 0);
00967 }
00968 
00969 static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIANT v)
00970 {
00971     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00972     TRACE("(%p)->(v%d)\n", This, V_VT(&v));
00973     return set_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_Y, &v, 0);
00974 }
00975 
00976 static HRESULT WINAPI HTMLStyle_get_backgroundPositionY(IHTMLStyle *iface, VARIANT *p)
00977 {
00978     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00979     TRACE("(%p)->(%p)\n", This, p);
00980     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_Y, p, 0);
00981 }
00982 
00983 static HRESULT WINAPI HTMLStyle_put_wordSpacing(IHTMLStyle *iface, VARIANT v)
00984 {
00985     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00986     TRACE("(%p)->(v%d)\n", This, V_VT(&v));
00987     return set_nsstyle_attr_var(This->nsstyle, STYLEID_WORD_SPACING, &v, 0);
00988 }
00989 
00990 static HRESULT WINAPI HTMLStyle_get_wordSpacing(IHTMLStyle *iface, VARIANT *p)
00991 {
00992     HTMLStyle *This = HTMLSTYLE_THIS(iface);
00993     TRACE("(%p)->(%p)\n", This, p);
00994     return get_nsstyle_attr_var(This->nsstyle, STYLEID_WORD_SPACING, p, 0);
00995 }
00996 
00997 static HRESULT WINAPI HTMLStyle_put_letterSpacing(IHTMLStyle *iface, VARIANT v)
00998 {
00999     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01000     TRACE("(%p)->(v%d)\n", This, V_VT(&v));
01001     return set_nsstyle_attr_var(This->nsstyle, STYLEID_LETTER_SPACING, &v, 0);
01002 }
01003 
01004 static HRESULT WINAPI HTMLStyle_get_letterSpacing(IHTMLStyle *iface, VARIANT *p)
01005 {
01006     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01007     TRACE("(%p)->(%p)\n", This, p);
01008     return get_nsstyle_attr_var(This->nsstyle, STYLEID_LETTER_SPACING, p, 0);
01009 }
01010 
01011 static HRESULT WINAPI HTMLStyle_put_textDecoration(IHTMLStyle *iface, BSTR v)
01012 {
01013     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01014 
01015     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
01016 
01017     /* textDecoration can only be one of the following */
01018     if(!v || strcmpiW(styleNone, v)   == 0 || strcmpiW(valUnderline, v)   == 0 ||
01019              strcmpiW(valOverline, v) == 0 || strcmpiW(valLineThrough, v) == 0 ||
01020              strcmpiW(valBlink, v)    == 0)
01021     {
01022         return set_style_attr(This, STYLEID_TEXT_DECORATION , v, 0);
01023     }
01024 
01025     return E_INVALIDARG;
01026 }
01027 
01028 static HRESULT WINAPI HTMLStyle_get_textDecoration(IHTMLStyle *iface, BSTR *p)
01029 {
01030     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01031 
01032     TRACE("(%p)->(%p)\n", This, p);
01033 
01034     return get_style_attr(This, STYLEID_TEXT_DECORATION, p);
01035 }
01036 
01037 static HRESULT WINAPI HTMLStyle_put_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL v)
01038 {
01039     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01040 
01041     TRACE("(%p)->(%x)\n", This, v);
01042 
01043     return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? styleNone : emptyW, 0);
01044 }
01045 
01046 static HRESULT WINAPI HTMLStyle_get_textDecorationNone(IHTMLStyle *iface, VARIANT_BOOL *p)
01047 {
01048     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01049 
01050     TRACE("(%p)->(%p)\n", This, p);
01051 
01052     return check_style_attr_value(This, STYLEID_TEXT_DECORATION, styleNone, p);
01053 }
01054 
01055 static HRESULT WINAPI HTMLStyle_put_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL v)
01056 {
01057     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01058 
01059     TRACE("(%p)->(%x)\n", This, v);
01060 
01061     return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valUnderline : emptyW, 0);
01062 }
01063 
01064 static HRESULT WINAPI HTMLStyle_get_textDecorationUnderline(IHTMLStyle *iface, VARIANT_BOOL *p)
01065 {
01066     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01067 
01068     TRACE("(%p)->(%p)\n", This, p);
01069 
01070     return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valUnderline, p);
01071 }
01072 
01073 static HRESULT WINAPI HTMLStyle_put_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL v)
01074 {
01075     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01076 
01077     TRACE("(%p)->(%x)\n", This, v);
01078 
01079     return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valOverline : emptyW, 0);
01080 }
01081 
01082 static HRESULT WINAPI HTMLStyle_get_textDecorationOverline(IHTMLStyle *iface, VARIANT_BOOL *p)
01083 {
01084     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01085 
01086     TRACE("(%p)->(%p)\n", This, p);
01087 
01088     return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valOverline, p);
01089 }
01090 
01091 static HRESULT WINAPI HTMLStyle_put_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL v)
01092 {
01093     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01094 
01095     TRACE("(%p)->(%x)\n", This, v);
01096 
01097     return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valLineThrough : emptyW, 0);
01098 }
01099 
01100 static HRESULT WINAPI HTMLStyle_get_textDecorationLineThrough(IHTMLStyle *iface, VARIANT_BOOL *p)
01101 {
01102     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01103 
01104     TRACE("(%p)->(%p)\n", This, p);
01105 
01106     return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valLineThrough, p);
01107 }
01108 
01109 static HRESULT WINAPI HTMLStyle_put_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL v)
01110 {
01111     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01112 
01113     TRACE("(%p)->(%x)\n", This, v);
01114 
01115     return set_style_attr(This, STYLEID_TEXT_DECORATION, v ? valBlink : emptyW, 0);
01116 }
01117 
01118 static HRESULT WINAPI HTMLStyle_get_textDecorationBlink(IHTMLStyle *iface, VARIANT_BOOL *p)
01119 {
01120     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01121 
01122     TRACE("(%p)->(%p)\n", This, p);
01123 
01124     return check_style_attr_value(This, STYLEID_TEXT_DECORATION, valBlink, p);
01125 }
01126 
01127 static HRESULT WINAPI HTMLStyle_put_verticalAlign(IHTMLStyle *iface, VARIANT v)
01128 {
01129     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01130 
01131     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
01132 
01133     switch(V_VT(&v)) {
01134     case VT_BSTR:
01135         return set_style_attr(This, STYLEID_VERTICAL_ALIGN, V_BSTR(&v), 0);
01136     default:
01137         FIXME("not implemented vt %d\n", V_VT(&v));
01138         return E_NOTIMPL;
01139     }
01140 
01141     return S_OK;
01142 }
01143 
01144 static HRESULT WINAPI HTMLStyle_get_verticalAlign(IHTMLStyle *iface, VARIANT *p)
01145 {
01146     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01147     BSTR ret;
01148     HRESULT hres;
01149 
01150     TRACE("(%p)->(%p)\n", This, p);
01151 
01152     hres = get_style_attr(This, STYLEID_VERTICAL_ALIGN, &ret);
01153     if(FAILED(hres))
01154         return hres;
01155 
01156     V_VT(p) = VT_BSTR;
01157     V_BSTR(p) = ret;
01158     return S_OK;
01159 }
01160 
01161 static HRESULT WINAPI HTMLStyle_put_textTransform(IHTMLStyle *iface, BSTR v)
01162 {
01163     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01164     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
01165     return E_NOTIMPL;
01166 }
01167 
01168 static HRESULT WINAPI HTMLStyle_get_textTransform(IHTMLStyle *iface, BSTR *p)
01169 {
01170     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01171     FIXME("(%p)->(%p)\n", This, p);
01172     return E_NOTIMPL;
01173 }
01174 
01175 static HRESULT WINAPI HTMLStyle_put_textAlign(IHTMLStyle *iface, BSTR v)
01176 {
01177     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01178 
01179     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
01180 
01181     return set_style_attr(This, STYLEID_TEXT_ALIGN, v, 0);
01182 }
01183 
01184 static HRESULT WINAPI HTMLStyle_get_textAlign(IHTMLStyle *iface, BSTR *p)
01185 {
01186     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01187 
01188     TRACE("(%p)->(%p)\n", This, p);
01189 
01190     return get_style_attr(This, STYLEID_TEXT_ALIGN, p);
01191 }
01192 
01193 static HRESULT WINAPI HTMLStyle_put_textIndent(IHTMLStyle *iface, VARIANT v)
01194 {
01195     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01196     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
01197     return E_NOTIMPL;
01198 }
01199 
01200 static HRESULT WINAPI HTMLStyle_get_textIndent(IHTMLStyle *iface, VARIANT *p)
01201 {
01202     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01203     FIXME("(%p)->(%p)\n", This, p);
01204     return E_NOTIMPL;
01205 }
01206 
01207 static HRESULT WINAPI HTMLStyle_put_lineHeight(IHTMLStyle *iface, VARIANT v)
01208 {
01209     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01210     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
01211     return E_NOTIMPL;
01212 }
01213 
01214 static HRESULT WINAPI HTMLStyle_get_lineHeight(IHTMLStyle *iface, VARIANT *p)
01215 {
01216     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01217     FIXME("(%p)->(%p)\n", This, p);
01218     return E_NOTIMPL;
01219 }
01220 
01221 static HRESULT WINAPI HTMLStyle_put_marginTop(IHTMLStyle *iface, VARIANT v)
01222 {
01223     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01224 
01225     TRACE("(%p)->(v%d)\n", This, V_VT(&v));
01226 
01227     return set_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_TOP, &v, 0);
01228 }
01229 
01230 static HRESULT WINAPI HTMLStyle_get_marginTop(IHTMLStyle *iface, VARIANT *p)
01231 {
01232     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01233 
01234     TRACE("(%p)->(%p)\n", This, p);
01235 
01236     return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_TOP, p, 0);
01237 }
01238 
01239 static HRESULT WINAPI HTMLStyle_put_marginRight(IHTMLStyle *iface, VARIANT v)
01240 {
01241     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01242 
01243     TRACE("(%p)->(v(%d))\n", This, V_VT(&v));
01244 
01245     switch(V_VT(&v)) {
01246     case VT_NULL:
01247         return set_style_attr(This, STYLEID_MARGIN_RIGHT, emptyW, 0);
01248     case VT_I4: {
01249         WCHAR buf[14];
01250 
01251         wsprintfW(buf, px_formatW, V_I4(&v));
01252         return set_style_attr(This, STYLEID_MARGIN_RIGHT, buf, 0);
01253     }
01254     case VT_BSTR:
01255         return set_style_attr(This, STYLEID_MARGIN_RIGHT, V_BSTR(&v), 0);
01256     default:
01257         FIXME("Unsupported vt=%d\n", V_VT(&v));
01258     }
01259 
01260     return E_NOTIMPL;
01261 }
01262 
01263 static HRESULT WINAPI HTMLStyle_get_marginRight(IHTMLStyle *iface, VARIANT *p)
01264 {
01265     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01266     TRACE("(%p)->(%p)\n", This, p);
01267     return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_RIGHT, p, 0);
01268 }
01269 
01270 static HRESULT WINAPI HTMLStyle_put_marginBottom(IHTMLStyle *iface, VARIANT v)
01271 {
01272     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01273     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
01274     return E_NOTIMPL;
01275 }
01276 
01277 static HRESULT WINAPI HTMLStyle_get_marginBottom(IHTMLStyle *iface, VARIANT *p)
01278 {
01279     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01280     FIXME("(%p)->(%p)\n", This, p);
01281     return E_NOTIMPL;
01282 }
01283 
01284 static HRESULT WINAPI HTMLStyle_put_marginLeft(IHTMLStyle *iface, VARIANT v)
01285 {
01286     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01287 
01288     switch(V_VT(&v)) {
01289     case VT_NULL:
01290         TRACE("(%p)->(NULL)\n", This);
01291         return set_style_attr(This, STYLEID_MARGIN_LEFT, emptyW, 0);
01292     case VT_I4: {
01293         WCHAR buf[14];
01294 
01295         TRACE("(%p)->(%d)\n", This, V_I4(&v));
01296 
01297         wsprintfW(buf, px_formatW, V_I4(&v));
01298         return set_style_attr(This, STYLEID_MARGIN_LEFT, buf, 0);
01299     }
01300     case VT_BSTR:
01301         TRACE("(%p)->(%s)\n", This, debugstr_w(V_BSTR(&v)));
01302         return set_style_attr(This, STYLEID_MARGIN_LEFT, V_BSTR(&v), 0);
01303     default:
01304         FIXME("Unsupported vt=%d\n", V_VT(&v));
01305     }
01306 
01307     return E_NOTIMPL;
01308 }
01309 
01310 static HRESULT WINAPI HTMLStyle_put_margin(IHTMLStyle *iface, BSTR v)
01311 {
01312     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01313 
01314     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
01315 
01316     return set_style_attr(This, STYLEID_MARGIN, v, 0);
01317 }
01318 
01319 static HRESULT WINAPI HTMLStyle_get_margin(IHTMLStyle *iface, BSTR *p)
01320 {
01321     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01322 
01323     TRACE("(%p)->(%p)\n", This, p);
01324 
01325     return get_style_attr(This, STYLEID_MARGIN, p);
01326 }
01327 
01328 static HRESULT WINAPI HTMLStyle_get_marginLeft(IHTMLStyle *iface, VARIANT *p)
01329 {
01330     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01331     TRACE("(%p)->(%p)\n", This, p);
01332     return get_nsstyle_attr_var(This->nsstyle, STYLEID_MARGIN_LEFT, p, 0);
01333 }
01334 
01335 static HRESULT WINAPI HTMLStyle_put_paddingTop(IHTMLStyle *iface, VARIANT v)
01336 {
01337     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01338     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
01339     return E_NOTIMPL;
01340 }
01341 
01342 static HRESULT WINAPI HTMLStyle_get_paddingTop(IHTMLStyle *iface, VARIANT *p)
01343 {
01344     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01345     FIXME("(%p)->(%p)\n", This, p);
01346     return E_NOTIMPL;
01347 }
01348 
01349 static HRESULT WINAPI HTMLStyle_put_paddingRight(IHTMLStyle *iface, VARIANT v)
01350 {
01351     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01352     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
01353     return E_NOTIMPL;
01354 }
01355 
01356 static HRESULT WINAPI HTMLStyle_get_paddingRight(IHTMLStyle *iface, VARIANT *p)
01357 {
01358     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01359     FIXME("(%p)->(%p)\n", This, p);
01360     return E_NOTIMPL;
01361 }
01362 
01363 static HRESULT WINAPI HTMLStyle_put_paddingBottom(IHTMLStyle *iface, VARIANT v)
01364 {
01365     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01366     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
01367     return E_NOTIMPL;
01368 }
01369 
01370 static HRESULT WINAPI HTMLStyle_get_paddingBottom(IHTMLStyle *iface, VARIANT *p)
01371 {
01372     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01373     FIXME("(%p)->(%p)\n", This, p);
01374     return E_NOTIMPL;
01375 }
01376 
01377 static HRESULT WINAPI HTMLStyle_put_paddingLeft(IHTMLStyle *iface, VARIANT v)
01378 {
01379     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01380 
01381     TRACE("(%p)->(vt=%d)\n", This, V_VT(&v));
01382 
01383     switch(V_VT(&v)) {
01384     case VT_I4: {
01385         WCHAR buf[14];
01386 
01387         wsprintfW(buf, px_formatW, V_I4(&v));
01388         return set_style_attr(This, STYLEID_PADDING_LEFT, buf, 0);
01389     }
01390     case VT_BSTR:
01391         return set_style_attr(This, STYLEID_PADDING_LEFT, V_BSTR(&v), 0);
01392     default:
01393         FIXME("unsupported vt=%d\n", V_VT(&v));
01394     }
01395 
01396     return E_NOTIMPL;
01397 }
01398 
01399 static HRESULT WINAPI HTMLStyle_get_paddingLeft(IHTMLStyle *iface, VARIANT *p)
01400 {
01401     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01402     BSTR ret;
01403     HRESULT hres;
01404 
01405     TRACE("(%p)->(%p)\n", This, p);
01406 
01407     hres = get_style_attr(This, STYLEID_PADDING_LEFT, &ret);
01408     if(FAILED(hres))
01409         return hres;
01410 
01411     V_VT(p) = VT_BSTR;
01412     V_BSTR(p) = ret;
01413     return S_OK;
01414 }
01415 
01416 static HRESULT WINAPI HTMLStyle_put_padding(IHTMLStyle *iface, BSTR v)
01417 {
01418     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01419     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
01420     return E_NOTIMPL;
01421 }
01422 
01423 static HRESULT WINAPI HTMLStyle_get_padding(IHTMLStyle *iface, BSTR *p)
01424 {
01425     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01426     FIXME("(%p)->(%p)\n", This, p);
01427     return E_NOTIMPL;
01428 }
01429 
01430 static HRESULT WINAPI HTMLStyle_put_border(IHTMLStyle *iface, BSTR v)
01431 {
01432     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01433 
01434     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
01435 
01436     return set_style_attr(This, STYLEID_BORDER, v, 0);
01437 }
01438 
01439 static HRESULT WINAPI HTMLStyle_get_border(IHTMLStyle *iface, BSTR *p)
01440 {
01441     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01442 
01443     TRACE("(%p)->(%p)\n", This, p);
01444 
01445     return get_style_attr(This, STYLEID_BORDER, p);
01446 }
01447 
01448 static HRESULT WINAPI HTMLStyle_put_borderTop(IHTMLStyle *iface, BSTR v)
01449 {
01450     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01451     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
01452     return set_style_attr(This, STYLEID_BORDER_TOP, v, ATTR_FIX_PX);
01453 }
01454 
01455 static HRESULT WINAPI HTMLStyle_get_borderTop(IHTMLStyle *iface, BSTR *p)
01456 {
01457     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01458     TRACE("(%p)->(%p)\n", This, p);
01459     return get_style_attr(This, STYLEID_BORDER_TOP, p);
01460 }
01461 
01462 static HRESULT WINAPI HTMLStyle_put_borderRight(IHTMLStyle *iface, BSTR v)
01463 {
01464     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01465     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
01466     return set_style_attr(This, STYLEID_BORDER_RIGHT, v, ATTR_FIX_PX);
01467 }
01468 
01469 static HRESULT WINAPI HTMLStyle_get_borderRight(IHTMLStyle *iface, BSTR *p)
01470 {
01471     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01472     TRACE("(%p)->(%p)\n", This, p);
01473     return get_style_attr(This, STYLEID_BORDER_RIGHT, p);
01474 }
01475 
01476 static HRESULT WINAPI HTMLStyle_put_borderBottom(IHTMLStyle *iface, BSTR v)
01477 {
01478     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01479     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
01480     return set_style_attr(This, STYLEID_BORDER_BOTTOM, v, ATTR_FIX_PX);
01481 }
01482 
01483 static HRESULT WINAPI HTMLStyle_get_borderBottom(IHTMLStyle *iface, BSTR *p)
01484 {
01485     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01486     TRACE("(%p)->(%p)\n", This, p);
01487     return get_style_attr(This, STYLEID_BORDER_BOTTOM, p);
01488 }
01489 
01490 static HRESULT WINAPI HTMLStyle_put_borderLeft(IHTMLStyle *iface, BSTR v)
01491 {
01492     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01493 
01494     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
01495 
01496     return set_style_attr(This, STYLEID_BORDER_LEFT, v, ATTR_FIX_PX);
01497 }
01498 
01499 static HRESULT WINAPI HTMLStyle_get_borderLeft(IHTMLStyle *iface, BSTR *p)
01500 {
01501     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01502 
01503     TRACE("(%p)->(%p)\n", This, p);
01504 
01505     return get_style_attr(This, STYLEID_BORDER_LEFT, p);
01506 }
01507 
01508 static HRESULT WINAPI HTMLStyle_put_borderColor(IHTMLStyle *iface, BSTR v)
01509 {
01510     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01511 
01512     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
01513 
01514     return set_style_attr(This, STYLEID_BORDER_COLOR, v, 0);
01515 }
01516 
01517 static HRESULT WINAPI HTMLStyle_get_borderColor(IHTMLStyle *iface, BSTR *p)
01518 {
01519     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01520 
01521     TRACE("(%p)->(%p)\n", This, p);
01522 
01523     return get_style_attr(This, STYLEID_BORDER_COLOR, p);
01524 }
01525 
01526 static HRESULT WINAPI HTMLStyle_put_borderTopColor(IHTMLStyle *iface, VARIANT v)
01527 {
01528     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01529     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
01530     return E_NOTIMPL;
01531 }
01532 
01533 static HRESULT WINAPI HTMLStyle_get_borderTopColor(IHTMLStyle *iface, VARIANT *p)
01534 {
01535     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01536 
01537     TRACE("(%p)->(%p)\n", This, p);
01538 
01539     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_COLOR, p, 0);
01540 }
01541 
01542 static HRESULT WINAPI HTMLStyle_put_borderRightColor(IHTMLStyle *iface, VARIANT v)
01543 {
01544     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01545     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
01546     return E_NOTIMPL;
01547 }
01548 
01549 static HRESULT WINAPI HTMLStyle_get_borderRightColor(IHTMLStyle *iface, VARIANT *p)
01550 {
01551     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01552 
01553     TRACE("(%p)->(%p)\n", This, p);
01554 
01555     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_COLOR, p, 0);
01556 }
01557 
01558 static HRESULT WINAPI HTMLStyle_put_borderBottomColor(IHTMLStyle *iface, VARIANT v)
01559 {
01560     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01561     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
01562     return E_NOTIMPL;
01563 }
01564 
01565 static HRESULT WINAPI HTMLStyle_get_borderBottomColor(IHTMLStyle *iface, VARIANT *p)
01566 {
01567     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01568 
01569     TRACE("(%p)->(%p)\n", This, p);
01570 
01571     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_COLOR, p, 0);
01572 }
01573 
01574 static HRESULT WINAPI HTMLStyle_put_borderLeftColor(IHTMLStyle *iface, VARIANT v)
01575 {
01576     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01577     FIXME("(%p)->(v%d)\n", This, V_VT(&v));
01578     return E_NOTIMPL;
01579 }
01580 
01581 static HRESULT WINAPI HTMLStyle_get_borderLeftColor(IHTMLStyle *iface, VARIANT *p)
01582 {
01583     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01584 
01585     TRACE("(%p)->(%p)\n", This, p);
01586 
01587     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_COLOR, p, 0);
01588 }
01589 
01590 static HRESULT WINAPI HTMLStyle_put_borderWidth(IHTMLStyle *iface, BSTR v)
01591 {
01592     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01593     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
01594     return set_style_attr(This, STYLEID_BORDER_WIDTH, v, ATTR_FIX_PX);
01595 }
01596 
01597 static HRESULT WINAPI HTMLStyle_get_borderWidth(IHTMLStyle *iface, BSTR *p)
01598 {
01599     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01600     TRACE("(%p)->(%p)\n", This, p);
01601     return get_style_attr(This, STYLEID_BORDER_WIDTH, p);
01602 }
01603 
01604 static HRESULT WINAPI HTMLStyle_put_borderTopWidth(IHTMLStyle *iface, VARIANT v)
01605 {
01606     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01607     TRACE("(%p)->(v%d)\n", This, V_VT(&v));
01608     return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_WIDTH, &v, 0);
01609 }
01610 
01611 static HRESULT WINAPI HTMLStyle_get_borderTopWidth(IHTMLStyle *iface, VARIANT *p)
01612 {
01613     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01614 
01615     TRACE("(%p)->(%p)\n", This, p);
01616 
01617     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_TOP_WIDTH, p, 0);
01618 }
01619 
01620 static HRESULT WINAPI HTMLStyle_put_borderRightWidth(IHTMLStyle *iface, VARIANT v)
01621 {
01622     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01623     TRACE("(%p)->(v%d)\n", This, V_VT(&v));
01624     return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_WIDTH, &v, 0);
01625 }
01626 
01627 static HRESULT WINAPI HTMLStyle_get_borderRightWidth(IHTMLStyle *iface, VARIANT *p)
01628 {
01629     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01630     TRACE("(%p)->(%p)\n", This, p);
01631     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_RIGHT_WIDTH, p, 0);
01632 }
01633 
01634 static HRESULT WINAPI HTMLStyle_put_borderBottomWidth(IHTMLStyle *iface, VARIANT v)
01635 {
01636     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01637 
01638     TRACE("(%p)->(v%d)\n", This, V_VT(&v));
01639     return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_WIDTH, &v, 0);
01640 }
01641 
01642 static HRESULT WINAPI HTMLStyle_get_borderBottomWidth(IHTMLStyle *iface, VARIANT *p)
01643 {
01644     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01645     TRACE("(%p)->(%p)\n", This, p);
01646     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_BOTTOM_WIDTH, p, 0);
01647 }
01648 
01649 static HRESULT WINAPI HTMLStyle_put_borderLeftWidth(IHTMLStyle *iface, VARIANT v)
01650 {
01651     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01652     TRACE("(%p)->(v%d)\n", This, V_VT(&v));
01653     return set_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_WIDTH, &v, 0);
01654 }
01655 
01656 static HRESULT WINAPI HTMLStyle_get_borderLeftWidth(IHTMLStyle *iface, VARIANT *p)
01657 {
01658     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01659     TRACE("(%p)->(%p)\n", This, p);
01660     return get_nsstyle_attr_var(This->nsstyle, STYLEID_BORDER_LEFT_WIDTH, p, 0);
01661 }
01662 
01663 static HRESULT WINAPI HTMLStyle_put_borderStyle(IHTMLStyle *iface, BSTR v)
01664 {
01665     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01666     static const WCHAR styleWindowInset[]  = {'w','i','n','d','o','w','-','i','n','s','e','t',0};
01667     HRESULT hres = S_OK;
01668     BSTR pstyle;
01669     int i=0;
01670     int last = 0;
01671 
01672     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
01673 
01674     while(v[i] && hres == S_OK)
01675     {
01676         if(v[i] == (WCHAR)' ')
01677         {
01678             pstyle = SysAllocStringLen(&v[last], (i-last));
01679             if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
01680             {
01681                 TRACE("1. Invalid style (%s)\n", debugstr_w(pstyle));
01682                 hres = E_INVALIDARG;
01683             }
01684             SysFreeString(pstyle);
01685             last = i+1;
01686         }
01687         i++;
01688     }
01689 
01690     if(hres == S_OK)
01691     {
01692         pstyle = SysAllocStringLen(&v[last], i-last);
01693         if( !(is_valid_border_style(pstyle) || strcmpiW(styleWindowInset, pstyle) == 0))
01694         {
01695             TRACE("2. Invalid style (%s)\n", debugstr_w(pstyle));
01696             hres = E_INVALIDARG;
01697         }
01698         SysFreeString(pstyle);
01699     }
01700 
01701     if(hres == S_OK)
01702         hres = set_nsstyle_attr(This->nsstyle, STYLEID_BORDER_STYLE, v, 0);
01703 
01704     return hres;
01705 }
01706 
01707 static HRESULT WINAPI HTMLStyle_get_borderStyle(IHTMLStyle *iface, BSTR *p)
01708 {
01709     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01710     TRACE("(%p)->(%p)\n", This, p);
01711     return get_style_attr(This, STYLEID_BORDER_STYLE, p);
01712 }
01713 
01714 static HRESULT WINAPI HTMLStyle_put_borderTopStyle(IHTMLStyle *iface, BSTR v)
01715 {
01716     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01717     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
01718 
01719     if(!is_valid_border_style(v))
01720         return E_INVALIDARG;
01721 
01722     return set_style_attr(This, STYLEID_BORDER_TOP_STYLE, v, 0);
01723 }
01724 
01725 static HRESULT WINAPI HTMLStyle_get_borderTopStyle(IHTMLStyle *iface, BSTR *p)
01726 {
01727     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01728     TRACE("(%p)->(%p)\n", This, p);
01729     return get_style_attr(This, STYLEID_BORDER_TOP_STYLE, p);
01730 }
01731 
01732 static HRESULT WINAPI HTMLStyle_put_borderRightStyle(IHTMLStyle *iface, BSTR v)
01733 {
01734     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01735     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
01736 
01737     if(!is_valid_border_style(v))
01738         return E_INVALIDARG;
01739 
01740     return set_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, v, 0);
01741 }
01742 
01743 static HRESULT WINAPI HTMLStyle_get_borderRightStyle(IHTMLStyle *iface, BSTR *p)
01744 {
01745     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01746     TRACE("(%p)->(%p)\n", This, p);
01747     return get_style_attr(This, STYLEID_BORDER_RIGHT_STYLE, p);
01748 }
01749 
01750 static HRESULT WINAPI HTMLStyle_put_borderBottomStyle(IHTMLStyle *iface, BSTR v)
01751 {
01752     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01753     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
01754 
01755     if(!is_valid_border_style(v))
01756         return E_INVALIDARG;
01757 
01758     return set_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, v, 0);
01759 }
01760 
01761 static HRESULT WINAPI HTMLStyle_get_borderBottomStyle(IHTMLStyle *iface, BSTR *p)
01762 {
01763     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01764     TRACE("(%p)->(%p)\n", This, p);
01765     return get_style_attr(This, STYLEID_BORDER_BOTTOM_STYLE, p);
01766 }
01767 
01768 static HRESULT WINAPI HTMLStyle_put_borderLeftStyle(IHTMLStyle *iface, BSTR v)
01769 {
01770     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01771     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
01772 
01773     if(!is_valid_border_style(v))
01774         return E_INVALIDARG;
01775 
01776     return set_style_attr(This, STYLEID_BORDER_LEFT_STYLE, v, 0);
01777 }
01778 
01779 static HRESULT WINAPI HTMLStyle_get_borderLeftStyle(IHTMLStyle *iface, BSTR *p)
01780 {
01781     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01782     TRACE("(%p)->(%p)\n", This, p);
01783     return get_style_attr(This, STYLEID_BORDER_LEFT_STYLE, p);
01784 }
01785 
01786 static HRESULT WINAPI HTMLStyle_put_width(IHTMLStyle *iface, VARIANT v)
01787 {
01788     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01789 
01790     TRACE("(%p)->(v%d)\n", This, V_VT(&v));
01791 
01792     return set_nsstyle_attr_var(This->nsstyle, STYLEID_WIDTH, &v, ATTR_FIX_PX);
01793 }
01794 
01795 static HRESULT WINAPI HTMLStyle_get_width(IHTMLStyle *iface, VARIANT *p)
01796 {
01797     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01798 
01799     TRACE("(%p)->(%p)\n", This, p);
01800 
01801     V_VT(p) = VT_BSTR;
01802     return get_style_attr(This, STYLEID_WIDTH, &V_BSTR(p));
01803 }
01804 
01805 static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)
01806 {
01807     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01808 
01809     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
01810 
01811     switch(V_VT(&v)) {
01812     case VT_BSTR:
01813         return set_style_attr(This, STYLEID_HEIGHT, V_BSTR(&v), 0);
01814     default:
01815         FIXME("unimplemented vt %d\n", V_VT(&v));
01816         return E_NOTIMPL;
01817     }
01818 
01819     return S_OK;
01820 }
01821 
01822 static HRESULT WINAPI HTMLStyle_get_height(IHTMLStyle *iface, VARIANT *p)
01823 {
01824     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01825     BSTR ret;
01826     HRESULT hres;
01827 
01828     TRACE("(%p)->(%p)\n", This, p);
01829 
01830     hres = get_style_attr(This, STYLEID_HEIGHT, &ret);
01831     if(FAILED(hres))
01832         return hres;
01833 
01834     V_VT(p) = VT_BSTR;
01835     V_BSTR(p) = ret;
01836     return S_OK;
01837 }
01838 
01839 static HRESULT WINAPI HTMLStyle_put_styleFloat(IHTMLStyle *iface, BSTR v)
01840 {
01841     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01842     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
01843     return E_NOTIMPL;
01844 }
01845 
01846 static HRESULT WINAPI HTMLStyle_get_styleFloat(IHTMLStyle *iface, BSTR *p)
01847 {
01848     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01849     FIXME("(%p)->(%p)\n", This, p);
01850     return E_NOTIMPL;
01851 }
01852 
01853 static HRESULT WINAPI HTMLStyle_put_clear(IHTMLStyle *iface, BSTR v)
01854 {
01855     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01856     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
01857     return E_NOTIMPL;
01858 }
01859 
01860 static HRESULT WINAPI HTMLStyle_get_clear(IHTMLStyle *iface, BSTR *p)
01861 {
01862     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01863     FIXME("(%p)->(%p)\n", This, p);
01864     return E_NOTIMPL;
01865 }
01866 
01867 static HRESULT WINAPI HTMLStyle_put_display(IHTMLStyle *iface, BSTR v)
01868 {
01869     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01870 
01871     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
01872 
01873     return set_style_attr(This, STYLEID_DISPLAY, v, 0);
01874 }
01875 
01876 static HRESULT WINAPI HTMLStyle_get_display(IHTMLStyle *iface, BSTR *p)
01877 {
01878     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01879 
01880     TRACE("(%p)->(%p)\n", This, p);
01881 
01882     return get_style_attr(This, STYLEID_DISPLAY, p);
01883 }
01884 
01885 static HRESULT WINAPI HTMLStyle_put_visibility(IHTMLStyle *iface, BSTR v)
01886 {
01887     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01888 
01889     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
01890 
01891     return set_style_attr(This, STYLEID_VISIBILITY, v, 0);
01892 }
01893 
01894 static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p)
01895 {
01896     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01897 
01898     TRACE("(%p)->(%p)\n", This, p);
01899 
01900     return get_style_attr(This, STYLEID_VISIBILITY, p);
01901 }
01902 
01903 static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v)
01904 {
01905     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01906     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
01907     return E_NOTIMPL;
01908 }
01909 
01910 static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p)
01911 {
01912     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01913     FIXME("(%p)->(%p)\n", This, p);
01914     return E_NOTIMPL;
01915 }
01916 
01917 static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v)
01918 {
01919     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01920     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
01921     return E_NOTIMPL;
01922 }
01923 
01924 static HRESULT WINAPI HTMLStyle_get_listStylePosition(IHTMLStyle *iface, BSTR *p)
01925 {
01926     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01927     FIXME("(%p)->(%p)\n", This, p);
01928     return E_NOTIMPL;
01929 }
01930 
01931 static HRESULT WINAPI HTMLStyle_put_listStyleImage(IHTMLStyle *iface, BSTR v)
01932 {
01933     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01934     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
01935     return E_NOTIMPL;
01936 }
01937 
01938 static HRESULT WINAPI HTMLStyle_get_listStyleImage(IHTMLStyle *iface, BSTR *p)
01939 {
01940     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01941     FIXME("(%p)->(%p)\n", This, p);
01942     return E_NOTIMPL;
01943 }
01944 
01945 static HRESULT WINAPI HTMLStyle_put_listStyle(IHTMLStyle *iface, BSTR v)
01946 {
01947     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01948     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
01949     return E_NOTIMPL;
01950 }
01951 
01952 static HRESULT WINAPI HTMLStyle_get_listStyle(IHTMLStyle *iface, BSTR *p)
01953 {
01954     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01955     FIXME("(%p)->(%p)\n", This, p);
01956     return E_NOTIMPL;
01957 }
01958 
01959 static HRESULT WINAPI HTMLStyle_put_whiteSpace(IHTMLStyle *iface, BSTR v)
01960 {
01961     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01962     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
01963     return E_NOTIMPL;
01964 }
01965 
01966 static HRESULT WINAPI HTMLStyle_get_whiteSpace(IHTMLStyle *iface, BSTR *p)
01967 {
01968     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01969     FIXME("(%p)->(%p)\n", This, p);
01970     return E_NOTIMPL;
01971 }
01972 
01973 static HRESULT WINAPI HTMLStyle_put_top(IHTMLStyle *iface, VARIANT v)
01974 {
01975     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01976 
01977     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
01978 
01979     return set_nsstyle_attr_var(This->nsstyle, STYLEID_TOP, &v, 0);
01980 }
01981 
01982 static HRESULT WINAPI HTMLStyle_get_top(IHTMLStyle *iface, VARIANT *p)
01983 {
01984     HTMLStyle *This = HTMLSTYLE_THIS(iface);
01985     BSTR ret;
01986     HRESULT hres;
01987 
01988     TRACE("(%p)->(%p)\n", This, p);
01989 
01990     hres = get_style_attr(This, STYLEID_TOP, &ret);
01991     if(FAILED(hres))
01992         return hres;
01993 
01994     V_VT(p) = VT_BSTR;
01995     V_BSTR(p) = ret;
01996     return S_OK;
01997 }
01998 
01999 static HRESULT WINAPI HTMLStyle_put_left(IHTMLStyle *iface, VARIANT v)
02000 {
02001     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02002 
02003     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
02004 
02005     return set_nsstyle_attr_var(This->nsstyle, STYLEID_LEFT, &v, 0);
02006 }
02007 
02008 static HRESULT WINAPI HTMLStyle_get_left(IHTMLStyle *iface, VARIANT *p)
02009 {
02010     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02011     BSTR ret;
02012     HRESULT hres;
02013 
02014     TRACE("(%p)->(%p)\n", This, p);
02015 
02016     hres = get_style_attr(This, STYLEID_LEFT, &ret);
02017     if(FAILED(hres))
02018         return hres;
02019 
02020     V_VT(p) = VT_BSTR;
02021     V_BSTR(p) = ret;
02022     return S_OK;
02023 }
02024 
02025 static HRESULT WINAPI HTMLStyle_get_position(IHTMLStyle *iface, BSTR *p)
02026 {
02027     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02028     TRACE("(%p)->(%p)\n", This, p);
02029     return IHTMLStyle2_get_position(HTMLSTYLE2(This), p);
02030 }
02031 
02032 static HRESULT WINAPI HTMLStyle_put_zIndex(IHTMLStyle *iface, VARIANT v)
02033 {
02034     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02035 
02036     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
02037 
02038     switch(V_VT(&v)) {
02039     case VT_BSTR:
02040         return set_style_attr(This, STYLEID_Z_INDEX, V_BSTR(&v), 0);
02041     case VT_I4: {
02042         WCHAR value[14];
02043         static const WCHAR format[] = {'%','d',0};
02044 
02045         wsprintfW(value, format, V_I4(&v));
02046         return set_style_attr(This, STYLEID_Z_INDEX, value, 0);
02047     }
02048     default:
02049         FIXME("unimplemented vt %d\n", V_VT(&v));
02050         return E_NOTIMPL;
02051     }
02052 
02053     return S_OK;
02054 }
02055 
02056 static HRESULT WINAPI HTMLStyle_get_zIndex(IHTMLStyle *iface, VARIANT *p)
02057 {
02058     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02059 
02060     TRACE("(%p)->(%p)\n", This, p);
02061 
02062     return get_nsstyle_attr_var(This->nsstyle, STYLEID_Z_INDEX, p, ATTR_STR_TO_INT);
02063 }
02064 
02065 static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v)
02066 {
02067     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02068     static const WCHAR szVisible[] = {'v','i','s','i','b','l','e',0};
02069     static const WCHAR szScroll[]  = {'s','c','r','o','l','l',0};
02070     static const WCHAR szHidden[]  = {'h','i','d','d','e','n',0};
02071     static const WCHAR szAuto[]    = {'a','u','t','o',0};
02072 
02073     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
02074 
02075     /* overflow can only be one of the follow values. */
02076     if(!v || !*v || strcmpiW(szVisible, v) == 0 || strcmpiW(szScroll, v) == 0 ||
02077              strcmpiW(szHidden, v) == 0  || strcmpiW(szAuto, v) == 0)
02078     {
02079         return set_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, v, 0);
02080     }
02081 
02082     return E_INVALIDARG;
02083 }
02084 
02085 
02086 static HRESULT WINAPI HTMLStyle_get_overflow(IHTMLStyle *iface, BSTR *p)
02087 {
02088     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02089 
02090     TRACE("(%p)->(%p)\n", This, p);
02091 
02092     if(!p)
02093        return E_INVALIDARG;
02094 
02095     return get_style_attr(This, STYLEID_OVERFLOW, p);
02096 }
02097 
02098 static HRESULT WINAPI HTMLStyle_put_pageBreakBefore(IHTMLStyle *iface, BSTR v)
02099 {
02100     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02101     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
02102     return E_NOTIMPL;
02103 }
02104 
02105 static HRESULT WINAPI HTMLStyle_get_pageBreakBefore(IHTMLStyle *iface, BSTR *p)
02106 {
02107     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02108     FIXME("(%p)->(%p)\n", This, p);
02109     return E_NOTIMPL;
02110 }
02111 
02112 static HRESULT WINAPI HTMLStyle_put_pageBreakAfter(IHTMLStyle *iface, BSTR v)
02113 {
02114     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02115     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
02116     return E_NOTIMPL;
02117 }
02118 
02119 static HRESULT WINAPI HTMLStyle_get_pageBreakAfter(IHTMLStyle *iface, BSTR *p)
02120 {
02121     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02122     FIXME("(%p)->(%p)\n", This, p);
02123     return E_NOTIMPL;
02124 }
02125 
02126 static HRESULT WINAPI HTMLStyle_put_cssText(IHTMLStyle *iface, BSTR v)
02127 {
02128     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02129     nsAString text_str;
02130     nsresult nsres;
02131 
02132     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
02133 
02134     nsAString_InitDepend(&text_str, v);
02135     nsres = nsIDOMCSSStyleDeclaration_SetCssText(This->nsstyle, &text_str);
02136     nsAString_Finish(&text_str);
02137     if(NS_FAILED(nsres)) {
02138         FIXME("SetCssStyle failed: %08x\n", nsres);
02139         return E_FAIL;
02140     }
02141 
02142     return S_OK;
02143 }
02144 
02145 static HRESULT WINAPI HTMLStyle_get_cssText(IHTMLStyle *iface, BSTR *p)
02146 {
02147     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02148     nsAString text_str;
02149     nsresult nsres;
02150 
02151     TRACE("(%p)->(%p)\n", This, p);
02152 
02153     /* FIXME: Gecko style formatting is different than IE (uppercase). */
02154     nsAString_Init(&text_str, NULL);
02155     nsres = nsIDOMCSSStyleDeclaration_GetCssText(This->nsstyle, &text_str);
02156     if(NS_SUCCEEDED(nsres)) {
02157         const PRUnichar *text;
02158 
02159         nsAString_GetData(&text_str, &text);
02160         *p = *text ? SysAllocString(text) : NULL;
02161     }else {
02162         FIXME("GetCssStyle failed: %08x\n", nsres);
02163         *p = NULL;
02164     }
02165 
02166     nsAString_Finish(&text_str);
02167     return S_OK;
02168 }
02169 
02170 static HRESULT WINAPI HTMLStyle_put_pixelTop(IHTMLStyle *iface, LONG v)
02171 {
02172     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02173     FIXME("(%p)->()\n", This);
02174     return E_NOTIMPL;
02175 }
02176 
02177 static HRESULT WINAPI HTMLStyle_get_pixelTop(IHTMLStyle *iface, LONG *p)
02178 {
02179     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02180     FIXME("(%p)->()\n", This);
02181     return E_NOTIMPL;
02182 }
02183 
02184 static HRESULT WINAPI HTMLStyle_put_pixelLeft(IHTMLStyle *iface, LONG v)
02185 {
02186     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02187     FIXME("(%p)->()\n", This);
02188     return E_NOTIMPL;
02189 }
02190 
02191 static HRESULT WINAPI HTMLStyle_get_pixelLeft(IHTMLStyle *iface, LONG *p)
02192 {
02193     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02194     FIXME("(%p)->()\n", This);
02195     return E_NOTIMPL;
02196 }
02197 
02198 static HRESULT WINAPI HTMLStyle_put_pixelWidth(IHTMLStyle *iface, LONG v)
02199 {
02200     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02201     FIXME("(%p)->()\n", This);
02202     return E_NOTIMPL;
02203 }
02204 
02205 static HRESULT WINAPI HTMLStyle_get_pixelWidth(IHTMLStyle *iface, LONG *p)
02206 {
02207     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02208     FIXME("(%p)->()\n", This);
02209     return E_NOTIMPL;
02210 }
02211 
02212 static HRESULT WINAPI HTMLStyle_put_pixelHeight(IHTMLStyle *iface, LONG v)
02213 {
02214     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02215     FIXME("(%p)->()\n", This);
02216     return E_NOTIMPL;
02217 }
02218 
02219 static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, LONG *p)
02220 {
02221     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02222     FIXME("(%p)->()\n", This);
02223     return E_NOTIMPL;
02224 }
02225 
02226 static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v)
02227 {
02228     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02229 
02230     TRACE("(%p)->(%f)\n", This, v);
02231 
02232     return set_style_pos(This, STYLEID_TOP, v);
02233 }
02234 
02235 static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p)
02236 {
02237     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02238 
02239     TRACE("(%p)->(%p)\n", This, p);
02240 
02241     if(!p)
02242         return E_POINTER;
02243 
02244     return get_nsstyle_pos(This, STYLEID_TOP, p);
02245 }
02246 
02247 static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v)
02248 {
02249     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02250 
02251     TRACE("(%p)->(%f)\n", This, v);
02252 
02253     return set_style_pos(This, STYLEID_LEFT, v);
02254 }
02255 
02256 static HRESULT WINAPI HTMLStyle_get_posLeft(IHTMLStyle *iface, float *p)
02257 {
02258     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02259 
02260     TRACE("(%p)->(%p)\n", This, p);
02261 
02262     if(!p)
02263         return E_POINTER;
02264 
02265     return get_nsstyle_pos(This, STYLEID_LEFT, p);
02266 }
02267 
02268 static HRESULT WINAPI HTMLStyle_put_posWidth(IHTMLStyle *iface, float v)
02269 {
02270     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02271 
02272     TRACE("(%p)->(%f)\n", This, v);
02273 
02274     return set_style_pos(This, STYLEID_WIDTH, v);
02275 }
02276 
02277 static HRESULT WINAPI HTMLStyle_get_posWidth(IHTMLStyle *iface, float *p)
02278 {
02279     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02280 
02281     TRACE("(%p)->(%p)\n", This, p);
02282 
02283     if(!p)
02284         return E_POINTER;
02285 
02286     if(get_nsstyle_pos(This, STYLEID_WIDTH, p) != S_OK)
02287         *p = 0.0f;
02288 
02289     return S_OK;
02290 }
02291 
02292 static HRESULT WINAPI HTMLStyle_put_posHeight(IHTMLStyle *iface, float v)
02293 {
02294     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02295 
02296     TRACE("(%p)->(%f)\n", This, v);
02297 
02298     return set_style_pos(This, STYLEID_HEIGHT, v);
02299 }
02300 
02301 static HRESULT WINAPI HTMLStyle_get_posHeight(IHTMLStyle *iface, float *p)
02302 {
02303     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02304 
02305     TRACE("(%p)->(%p)\n", This, p);
02306 
02307     if(!p)
02308         return E_POINTER;
02309 
02310     if(get_nsstyle_pos(This, STYLEID_HEIGHT, p) != S_OK)
02311         *p = 0.0f;
02312 
02313     return S_OK;
02314 }
02315 
02316 static HRESULT WINAPI HTMLStyle_put_cursor(IHTMLStyle *iface, BSTR v)
02317 {
02318     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02319 
02320     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
02321 
02322     return set_style_attr(This, STYLEID_CURSOR, v, 0);
02323 }
02324 
02325 static HRESULT WINAPI HTMLStyle_get_cursor(IHTMLStyle *iface, BSTR *p)
02326 {
02327     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02328 
02329     TRACE("(%p)->(%p)\n", This, p);
02330 
02331     return get_style_attr(This, STYLEID_CURSOR, p);
02332 }
02333 
02334 static HRESULT WINAPI HTMLStyle_put_clip(IHTMLStyle *iface, BSTR v)
02335 {
02336     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02337     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
02338     return E_NOTIMPL;
02339 }
02340 
02341 static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
02342 {
02343     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02344     FIXME("(%p)->(%p)\n", This, p);
02345     return E_NOTIMPL;
02346 }
02347 
02348 static HRESULT WINAPI HTMLStyle_put_filter(IHTMLStyle *iface, BSTR v)
02349 {
02350     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02351 
02352     WARN("(%p)->(%s)\n", This, debugstr_w(v));
02353 
02354     /* FIXME: Handle MS-style filters */
02355     return set_style_attr(This, STYLEID_FILTER, v, 0);
02356 }
02357 
02358 static HRESULT WINAPI HTMLStyle_get_filter(IHTMLStyle *iface, BSTR *p)
02359 {
02360     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02361 
02362     WARN("(%p)->(%p)\n", This, p);
02363 
02364     /* FIXME: Handle MS-style filters */
02365     return get_style_attr(This, STYLEID_FILTER, p);
02366 }
02367 
02368 static HRESULT WINAPI HTMLStyle_setAttribute(IHTMLStyle *iface, BSTR strAttributeName,
02369         VARIANT AttributeValue, LONG lFlags)
02370 {
02371     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02372     HRESULT hres;
02373     DISPID dispid;
02374 
02375     TRACE("(%p)->(%s v%d %08x)\n", This, debugstr_w(strAttributeName),
02376            V_VT(&AttributeValue), lFlags);
02377 
02378     if(!strAttributeName)
02379         return E_INVALIDARG;
02380 
02381     if(lFlags == 1)
02382         FIXME("Parameter lFlags ignored\n");
02383 
02384     hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
02385                         LOCALE_USER_DEFAULT, &dispid);
02386     if(hres == S_OK)
02387     {
02388         VARIANT ret;
02389         DISPID dispidNamed = DISPID_PROPERTYPUT;
02390         DISPPARAMS params;
02391 
02392         params.cArgs = 1;
02393         params.rgvarg = &AttributeValue;
02394         params.cNamedArgs = 1;
02395         params.rgdispidNamedArgs = &dispidNamed;
02396 
02397         hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
02398             DISPATCH_PROPERTYPUT, &params, &ret, NULL, NULL);
02399     }
02400     else
02401     {
02402         FIXME("Custom attributes not supported.\n");
02403     }
02404 
02405     TRACE("ret: %08x\n", hres);
02406 
02407     return hres;
02408 }
02409 
02410 static HRESULT WINAPI HTMLStyle_getAttribute(IHTMLStyle *iface, BSTR strAttributeName,
02411         LONG lFlags, VARIANT *AttributeValue)
02412 {
02413     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02414     HRESULT hres;
02415     DISPID dispid;
02416 
02417     TRACE("(%p)->(%s v%p %08x)\n", This, debugstr_w(strAttributeName),
02418           AttributeValue, lFlags);
02419 
02420     if(!AttributeValue || !strAttributeName)
02421         return E_INVALIDARG;
02422 
02423     if(lFlags == 1)
02424         FIXME("Parameter lFlags ignored\n");
02425 
02426     hres = HTMLStyle_GetIDsOfNames(iface, &IID_NULL, &strAttributeName, 1,
02427                         LOCALE_USER_DEFAULT, &dispid);
02428     if(hres == S_OK)
02429     {
02430         DISPPARAMS params = {NULL, NULL, 0, 0 };
02431 
02432         hres = HTMLStyle_Invoke(iface, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
02433             DISPATCH_PROPERTYGET, &params, AttributeValue, NULL, NULL);
02434     }
02435     else
02436     {
02437         FIXME("Custom attributes not supported.\n");
02438     }
02439 
02440     return hres;
02441 }
02442 
02443 static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttributeName,
02444                                                 LONG lFlags, VARIANT_BOOL *pfSuccess)
02445 {
02446     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02447     FIXME("(%p)->(%s %08x %p)\n", This, debugstr_w(strAttributeName),
02448          lFlags, pfSuccess);
02449     return E_NOTIMPL;
02450 }
02451 
02452 static HRESULT WINAPI HTMLStyle_toString(IHTMLStyle *iface, BSTR *String)
02453 {
02454     HTMLStyle *This = HTMLSTYLE_THIS(iface);
02455     FIXME("(%p)->(%p)\n", This, String);
02456     return E_NOTIMPL;
02457 }
02458 
02459 static HRESULT HTMLStyle_get_dispid(IUnknown *iface, BSTR name, DWORD flags, DISPID *dispid)
02460 {
02461     int c, i, min=0, max = sizeof(style_tbl)/sizeof(*style_tbl)-1;
02462 
02463     while(min <= max) {
02464         i = (min+max)/2;
02465 
02466         c = strcmpW(style_tbl[i].name, name);
02467         if(!c) {
02468             *dispid = style_tbl[i].dispid;
02469             return S_OK;
02470         }
02471 
02472         if(c > 0)
02473             max = i-1;
02474         else
02475             min = i+1;
02476     }
02477 
02478     return DISP_E_UNKNOWNNAME;
02479 }
02480 
02481 static const IHTMLStyleVtbl HTMLStyleVtbl = {
02482     HTMLStyle_QueryInterface,
02483     HTMLStyle_AddRef,
02484     HTMLStyle_Release,
02485     HTMLStyle_GetTypeInfoCount,
02486     HTMLStyle_GetTypeInfo,
02487     HTMLStyle_GetIDsOfNames,
02488     HTMLStyle_Invoke,
02489     HTMLStyle_put_fontFamily,
02490     HTMLStyle_get_fontFamily,
02491     HTMLStyle_put_fontStyle,
02492     HTMLStyle_get_fontStyle,
02493     HTMLStyle_put_fontVariant,
02494     HTMLStyle_get_fontVariant,
02495     HTMLStyle_put_fontWeight,
02496     HTMLStyle_get_fontWeight,
02497     HTMLStyle_put_fontSize,
02498     HTMLStyle_get_fontSize,
02499     HTMLStyle_put_font,
02500     HTMLStyle_get_font,
02501     HTMLStyle_put_color,
02502     HTMLStyle_get_color,
02503     HTMLStyle_put_background,
02504     HTMLStyle_get_background,
02505     HTMLStyle_put_backgroundColor,
02506     HTMLStyle_get_backgroundColor,
02507     HTMLStyle_put_backgroundImage,
02508     HTMLStyle_get_backgroundImage,
02509     HTMLStyle_put_backgroundRepeat,
02510     HTMLStyle_get_backgroundRepeat,
02511     HTMLStyle_put_backgroundAttachment,
02512     HTMLStyle_get_backgroundAttachment,
02513     HTMLStyle_put_backgroundPosition,
02514     HTMLStyle_get_backgroundPosition,
02515     HTMLStyle_put_backgroundPositionX,
02516     HTMLStyle_get_backgroundPositionX,
02517     HTMLStyle_put_backgroundPositionY,
02518     HTMLStyle_get_backgroundPositionY,
02519     HTMLStyle_put_wordSpacing,
02520     HTMLStyle_get_wordSpacing,
02521     HTMLStyle_put_letterSpacing,
02522     HTMLStyle_get_letterSpacing,
02523     HTMLStyle_put_textDecoration,
02524     HTMLStyle_get_textDecoration,
02525     HTMLStyle_put_textDecorationNone,
02526     HTMLStyle_get_textDecorationNone,
02527     HTMLStyle_put_textDecorationUnderline,
02528     HTMLStyle_get_textDecorationUnderline,
02529     HTMLStyle_put_textDecorationOverline,
02530     HTMLStyle_get_textDecorationOverline,
02531     HTMLStyle_put_textDecorationLineThrough,
02532     HTMLStyle_get_textDecorationLineThrough,
02533     HTMLStyle_put_textDecorationBlink,
02534     HTMLStyle_get_textDecorationBlink,
02535     HTMLStyle_put_verticalAlign,
02536     HTMLStyle_get_verticalAlign,
02537     HTMLStyle_put_textTransform,
02538     HTMLStyle_get_textTransform,
02539     HTMLStyle_put_textAlign,
02540     HTMLStyle_get_textAlign,
02541     HTMLStyle_put_textIndent,
02542     HTMLStyle_get_textIndent,
02543     HTMLStyle_put_lineHeight,
02544     HTMLStyle_get_lineHeight,
02545     HTMLStyle_put_marginTop,
02546     HTMLStyle_get_marginTop,
02547     HTMLStyle_put_marginRight,
02548     HTMLStyle_get_marginRight,
02549     HTMLStyle_put_marginBottom,
02550     HTMLStyle_get_marginBottom,
02551     HTMLStyle_put_marginLeft,
02552     HTMLStyle_get_marginLeft,
02553     HTMLStyle_put_margin,
02554     HTMLStyle_get_margin,
02555     HTMLStyle_put_paddingTop,
02556     HTMLStyle_get_paddingTop,
02557     HTMLStyle_put_paddingRight,
02558     HTMLStyle_get_paddingRight,
02559     HTMLStyle_put_paddingBottom,
02560     HTMLStyle_get_paddingBottom,
02561     HTMLStyle_put_paddingLeft,
02562     HTMLStyle_get_paddingLeft,
02563     HTMLStyle_put_padding,
02564     HTMLStyle_get_padding,
02565     HTMLStyle_put_border,
02566     HTMLStyle_get_border,
02567     HTMLStyle_put_borderTop,
02568     HTMLStyle_get_borderTop,
02569     HTMLStyle_put_borderRight,
02570     HTMLStyle_get_borderRight,
02571     HTMLStyle_put_borderBottom,
02572     HTMLStyle_get_borderBottom,
02573     HTMLStyle_put_borderLeft,
02574     HTMLStyle_get_borderLeft,
02575     HTMLStyle_put_borderColor,
02576     HTMLStyle_get_borderColor,
02577     HTMLStyle_put_borderTopColor,
02578     HTMLStyle_get_borderTopColor,
02579     HTMLStyle_put_borderRightColor,
02580     HTMLStyle_get_borderRightColor,
02581     HTMLStyle_put_borderBottomColor,
02582     HTMLStyle_get_borderBottomColor,
02583     HTMLStyle_put_borderLeftColor,
02584     HTMLStyle_get_borderLeftColor,
02585     HTMLStyle_put_borderWidth,
02586     HTMLStyle_get_borderWidth,
02587     HTMLStyle_put_borderTopWidth,
02588     HTMLStyle_get_borderTopWidth,
02589     HTMLStyle_put_borderRightWidth,
02590     HTMLStyle_get_borderRightWidth,
02591     HTMLStyle_put_borderBottomWidth,
02592     HTMLStyle_get_borderBottomWidth,
02593     HTMLStyle_put_borderLeftWidth,
02594     HTMLStyle_get_borderLeftWidth,
02595     HTMLStyle_put_borderStyle,
02596     HTMLStyle_get_borderStyle,
02597     HTMLStyle_put_borderTopStyle,
02598     HTMLStyle_get_borderTopStyle,
02599     HTMLStyle_put_borderRightStyle,
02600     HTMLStyle_get_borderRightStyle,
02601     HTMLStyle_put_borderBottomStyle,
02602     HTMLStyle_get_borderBottomStyle,
02603     HTMLStyle_put_borderLeftStyle,
02604     HTMLStyle_get_borderLeftStyle,
02605     HTMLStyle_put_width,
02606     HTMLStyle_get_width,
02607     HTMLStyle_put_height,
02608     HTMLStyle_get_height,
02609     HTMLStyle_put_styleFloat,
02610     HTMLStyle_get_styleFloat,
02611     HTMLStyle_put_clear,
02612     HTMLStyle_get_clear,
02613     HTMLStyle_put_display,
02614     HTMLStyle_get_display,
02615     HTMLStyle_put_visibility,
02616     HTMLStyle_get_visibility,
02617     HTMLStyle_put_listStyleType,
02618     HTMLStyle_get_listStyleType,
02619     HTMLStyle_put_listStylePosition,
02620     HTMLStyle_get_listStylePosition,
02621     HTMLStyle_put_listStyleImage,
02622     HTMLStyle_get_listStyleImage,
02623     HTMLStyle_put_listStyle,
02624     HTMLStyle_get_listStyle,
02625     HTMLStyle_put_whiteSpace,
02626     HTMLStyle_get_whiteSpace,
02627     HTMLStyle_put_top,
02628     HTMLStyle_get_top,
02629     HTMLStyle_put_left,
02630     HTMLStyle_get_left,
02631     HTMLStyle_get_position,
02632     HTMLStyle_put_zIndex,
02633     HTMLStyle_get_zIndex,
02634     HTMLStyle_put_overflow,
02635     HTMLStyle_get_overflow,
02636     HTMLStyle_put_pageBreakBefore,
02637     HTMLStyle_get_pageBreakBefore,
02638     HTMLStyle_put_pageBreakAfter,
02639     HTMLStyle_get_pageBreakAfter,
02640     HTMLStyle_put_cssText,
02641     HTMLStyle_get_cssText,
02642     HTMLStyle_put_pixelTop,
02643     HTMLStyle_get_pixelTop,
02644     HTMLStyle_put_pixelLeft,
02645     HTMLStyle_get_pixelLeft,
02646     HTMLStyle_put_pixelWidth,
02647     HTMLStyle_get_pixelWidth,
02648     HTMLStyle_put_pixelHeight,
02649     HTMLStyle_get_pixelHeight,
02650     HTMLStyle_put_posTop,
02651     HTMLStyle_get_posTop,
02652     HTMLStyle_put_posLeft,
02653     HTMLStyle_get_posLeft,
02654     HTMLStyle_put_posWidth,
02655     HTMLStyle_get_posWidth,
02656     HTMLStyle_put_posHeight,
02657     HTMLStyle_get_posHeight,
02658     HTMLStyle_put_cursor,
02659     HTMLStyle_get_cursor,
02660     HTMLStyle_put_clip,
02661     HTMLStyle_get_clip,
02662     HTMLStyle_put_filter,
02663     HTMLStyle_get_filter,
02664     HTMLStyle_setAttribute,
02665     HTMLStyle_getAttribute,
02666     HTMLStyle_removeAttribute,
02667     HTMLStyle_toString
02668 };
02669 
02670 static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl = {
02671     NULL,
02672     HTMLStyle_get_dispid,
02673     NULL
02674 };
02675 
02676 static const tid_t HTMLStyle_iface_tids[] = {
02677     IHTMLStyle_tid,
02678     IHTMLStyle2_tid,
02679     IHTMLStyle3_tid,
02680     IHTMLStyle4_tid,
02681     0
02682 };
02683 static dispex_static_data_t HTMLStyle_dispex = {
02684     &HTMLStyle_dispex_vtbl,
02685     DispHTMLStyle_tid,
02686     NULL,
02687     HTMLStyle_iface_tids
02688 };
02689 
02690 IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration *nsstyle)
02691 {
02692     HTMLStyle *ret = heap_alloc_zero(sizeof(HTMLStyle));
02693 
02694     ret->lpHTMLStyleVtbl = &HTMLStyleVtbl;
02695     ret->ref = 1;
02696     ret->nsstyle = nsstyle;
02697     HTMLStyle2_Init(ret);
02698     HTMLStyle3_Init(ret);
02699 
02700     nsIDOMCSSStyleDeclaration_AddRef(nsstyle);
02701 
02702     init_dispex(&ret->dispex, (IUnknown*)HTMLSTYLE(ret),  &HTMLStyle_dispex);
02703 
02704     return HTMLSTYLE(ret);
02705 }

Generated on Sun May 27 2012 04:24:59 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.