mshtml: Store style property flags in an array and use it in set_nsstyle_attr and get_nsstyle_attr_var.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2018-08-27 13:44:38 +02:00 committed by Alexandre Julliard
parent dc6f39ac29
commit c5e54a1ea1
1 changed files with 173 additions and 170 deletions

View File

@ -35,176 +35,176 @@
WINE_DEFAULT_DEBUG_CHANNEL(mshtml); WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
static const WCHAR attrBackground[] = static const WCHAR backgroundW[] =
{'b','a','c','k','g','r','o','u','n','d',0}; {'b','a','c','k','g','r','o','u','n','d',0};
static const WCHAR attrBackgroundAttachment[] = static const WCHAR background_attachmentW[] =
{'b','a','c','k','g','r','o','u','n','d','-','a','t','t','a','c','h','m','e','n','t',0}; {'b','a','c','k','g','r','o','u','n','d','-','a','t','t','a','c','h','m','e','n','t',0};
static const WCHAR attrBackgroundColor[] = static const WCHAR background_colorW[] =
{'b','a','c','k','g','r','o','u','n','d','-','c','o','l','o','r',0}; {'b','a','c','k','g','r','o','u','n','d','-','c','o','l','o','r',0};
static const WCHAR attrBackgroundImage[] = static const WCHAR background_imageW[] =
{'b','a','c','k','g','r','o','u','n','d','-','i','m','a','g','e',0}; {'b','a','c','k','g','r','o','u','n','d','-','i','m','a','g','e',0};
static const WCHAR attrBackgroundPosition[] = static const WCHAR background_positionW[] =
{'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n',0}; {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n',0};
static const WCHAR attrBackgroundPositionX[] = static const WCHAR background_position_xW[] =
{'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','x',0}; {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','x',0};
static const WCHAR attrBackgroundPositionY[] = static const WCHAR background_position_yW[] =
{'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','y',0}; {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','y',0};
static const WCHAR attrBackgroundRepeat[] = static const WCHAR background_repeatW[] =
{'b','a','c','k','g','r','o','u','n','d','-','r','e','p','e','a','t',0}; {'b','a','c','k','g','r','o','u','n','d','-','r','e','p','e','a','t',0};
static const WCHAR attrBorder[] = static const WCHAR borderW[] =
{'b','o','r','d','e','r',0}; {'b','o','r','d','e','r',0};
static const WCHAR attrBorderBottom[] = static const WCHAR border_bottomW[] =
{'b','o','r','d','e','r','-','b','o','t','t','o','m',0}; {'b','o','r','d','e','r','-','b','o','t','t','o','m',0};
static const WCHAR attrBorderBottomColor[] = static const WCHAR border_bottom_colorW[] =
{'b','o','r','d','e','r','-','b','o','t','t','o','m','-','c','o','l','o','r',0}; {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','c','o','l','o','r',0};
static const WCHAR attrBorderBottomStyle[] = static const WCHAR border_bottom_styleW[] =
{'b','o','r','d','e','r','-','b','o','t','t','o','m','-','s','t','y','l','e',0}; {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','s','t','y','l','e',0};
static const WCHAR attrBorderBottomWidth[] = static const WCHAR border_bottom_widthW[] =
{'b','o','r','d','e','r','-','b','o','t','t','o','m','-','w','i','d','t','h',0}; {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','w','i','d','t','h',0};
static const WCHAR attrBorderColor[] = static const WCHAR border_colorW[] =
{'b','o','r','d','e','r','-','c','o','l','o','r',0}; {'b','o','r','d','e','r','-','c','o','l','o','r',0};
static const WCHAR attrBorderLeft[] = static const WCHAR border_leftW[] =
{'b','o','r','d','e','r','-','l','e','f','t',0}; {'b','o','r','d','e','r','-','l','e','f','t',0};
static const WCHAR attrBorderLeftColor[] = static const WCHAR border_left_colorW[] =
{'b','o','r','d','e','r','-','l','e','f','t','-','c','o','l','o','r',0}; {'b','o','r','d','e','r','-','l','e','f','t','-','c','o','l','o','r',0};
static const WCHAR attrBorderLeftStyle[] = static const WCHAR border_left_styleW[] =
{'b','o','r','d','e','r','-','l','e','f','t','-','s','t','y','l','e',0}; {'b','o','r','d','e','r','-','l','e','f','t','-','s','t','y','l','e',0};
static const WCHAR attrBorderLeftWidth[] = static const WCHAR border_left_widthW[] =
{'b','o','r','d','e','r','-','l','e','f','t','-','w','i','d','t','h',0}; {'b','o','r','d','e','r','-','l','e','f','t','-','w','i','d','t','h',0};
static const WCHAR attrBorderRight[] = static const WCHAR border_rightW[] =
{'b','o','r','d','e','r','-','r','i','g','h','t',0}; {'b','o','r','d','e','r','-','r','i','g','h','t',0};
static const WCHAR attrBorderRightColor[] = static const WCHAR border_right_colorW[] =
{'b','o','r','d','e','r','-','r','i','g','h','t','-','c','o','l','o','r',0}; {'b','o','r','d','e','r','-','r','i','g','h','t','-','c','o','l','o','r',0};
static const WCHAR attrBorderRightStyle[] = static const WCHAR border_right_styleW[] =
{'b','o','r','d','e','r','-','r','i','g','h','t','-','s','t','y','l','e',0}; {'b','o','r','d','e','r','-','r','i','g','h','t','-','s','t','y','l','e',0};
static const WCHAR attrBorderRightWidth[] = static const WCHAR border_right_widthW[] =
{'b','o','r','d','e','r','-','r','i','g','h','t','-','w','i','d','t','h',0}; {'b','o','r','d','e','r','-','r','i','g','h','t','-','w','i','d','t','h',0};
static const WCHAR attrBorderTop[] = static const WCHAR border_topW[] =
{'b','o','r','d','e','r','-','t','o','p',0}; {'b','o','r','d','e','r','-','t','o','p',0};
static const WCHAR attrBorderTopColor[] = static const WCHAR border_top_colorW[] =
{'b','o','r','d','e','r','-','t','o','p','-','c','o','l','o','r',0}; {'b','o','r','d','e','r','-','t','o','p','-','c','o','l','o','r',0};
static const WCHAR attrBorderStyle[] = static const WCHAR border_styleW[] =
{'b','o','r','d','e','r','-','s','t','y','l','e',0}; {'b','o','r','d','e','r','-','s','t','y','l','e',0};
static const WCHAR attrBorderTopStyle[] = static const WCHAR border_top_styleW[] =
{'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e',0}; {'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e',0};
static const WCHAR attrBorderTopWidth[] = static const WCHAR border_top_widthW[] =
{'b','o','r','d','e','r','-','t','o','p','-','w','i','d','t','h',0}; {'b','o','r','d','e','r','-','t','o','p','-','w','i','d','t','h',0};
static const WCHAR attrBorderWidth[] = static const WCHAR border_widthW[] =
{'b','o','r','d','e','r','-','w','i','d','t','h',0}; {'b','o','r','d','e','r','-','w','i','d','t','h',0};
static const WCHAR attrBottom[] = static const WCHAR bottomW[] =
{'b','o','t','t','o','m',0}; {'b','o','t','t','o','m',0};
/* FIXME: Use unprefixed version (requires Gecko changes). */ /* FIXME: Use unprefixed version (requires Gecko changes). */
static const WCHAR attrBoxSizing[] = static const WCHAR box_sizingW[] =
{'-','m','o','z','-','b','o','x','-','s','i','z','i','n','g',0}; {'-','m','o','z','-','b','o','x','-','s','i','z','i','n','g',0};
static const WCHAR attrClear[] = static const WCHAR clearW[] =
{'c','l','e','a','r',0}; {'c','l','e','a','r',0};
static const WCHAR attrClip[] = static const WCHAR clipW[] =
{'c','l','i','p',0}; {'c','l','i','p',0};
static const WCHAR attrColor[] = static const WCHAR colorW[] =
{'c','o','l','o','r',0}; {'c','o','l','o','r',0};
static const WCHAR attrCursor[] = static const WCHAR cursorW[] =
{'c','u','r','s','o','r',0}; {'c','u','r','s','o','r',0};
static const WCHAR attrDirection[] = static const WCHAR directionW[] =
{'d','i','r','e','c','t','i','o','n',0}; {'d','i','r','e','c','t','i','o','n',0};
static const WCHAR attrDisplay[] = static const WCHAR displayW[] =
{'d','i','s','p','l','a','y',0}; {'d','i','s','p','l','a','y',0};
static const WCHAR attrFilter[] = static const WCHAR filterW[] =
{'f','i','l','e','t','e','r',0}; {'f','i','l','e','t','e','r',0};
static const WCHAR attrFloat[] = static const WCHAR floatW[] =
{'f','l','o','a','t',0}; {'f','l','o','a','t',0};
static const WCHAR attrFontFamily[] = static const WCHAR font_familyW[] =
{'f','o','n','t','-','f','a','m','i','l','y',0}; {'f','o','n','t','-','f','a','m','i','l','y',0};
static const WCHAR attrFontSize[] = static const WCHAR font_sizeW[] =
{'f','o','n','t','-','s','i','z','e',0}; {'f','o','n','t','-','s','i','z','e',0};
static const WCHAR attrFontStyle[] = static const WCHAR font_styleW[] =
{'f','o','n','t','-','s','t','y','l','e',0}; {'f','o','n','t','-','s','t','y','l','e',0};
static const WCHAR attrFontVariant[] = static const WCHAR font_variantW[] =
{'f','o','n','t','-','v','a','r','i','a','n','t',0}; {'f','o','n','t','-','v','a','r','i','a','n','t',0};
static const WCHAR attrFontWeight[] = static const WCHAR font_weightW[] =
{'f','o','n','t','-','w','e','i','g','h','t',0}; {'f','o','n','t','-','w','e','i','g','h','t',0};
static const WCHAR attrHeight[] = static const WCHAR heightW[] =
{'h','e','i','g','h','t',0}; {'h','e','i','g','h','t',0};
static const WCHAR attrLeft[] = static const WCHAR leftW[] =
{'l','e','f','t',0}; {'l','e','f','t',0};
static const WCHAR attrLetterSpacing[] = static const WCHAR letter_spacingW[] =
{'l','e','t','t','e','r','-','s','p','a','c','i','n','g',0}; {'l','e','t','t','e','r','-','s','p','a','c','i','n','g',0};
static const WCHAR attrLineHeight[] = static const WCHAR line_heightW[] =
{'l','i','n','e','-','h','e','i','g','h','t',0}; {'l','i','n','e','-','h','e','i','g','h','t',0};
static const WCHAR attrListStyle[] = static const WCHAR list_styleW[] =
{'l','i','s','t','-','s','t','y','l','e',0}; {'l','i','s','t','-','s','t','y','l','e',0};
static const WCHAR attrListStyleType[] = static const WCHAR list_style_typeW[] =
{'l','i','s','t','-','s','t','y','l','e','-','t','y','p','e',0}; {'l','i','s','t','-','s','t','y','l','e','-','t','y','p','e',0};
static const WCHAR attrListStylePosition[] = static const WCHAR list_style_positionW[] =
{'l','i','s','t','-','s','t','y','l','e','-','p','o','s','i','t','i','o','n',0}; {'l','i','s','t','-','s','t','y','l','e','-','p','o','s','i','t','i','o','n',0};
static const WCHAR attrMargin[] = static const WCHAR marginW[] =
{'m','a','r','g','i','n',0}; {'m','a','r','g','i','n',0};
static const WCHAR attrMarginBottom[] = static const WCHAR margin_bottomW[] =
{'m','a','r','g','i','n','-','b','o','t','t','o','m',0}; {'m','a','r','g','i','n','-','b','o','t','t','o','m',0};
static const WCHAR attrMarginLeft[] = static const WCHAR margin_leftW[] =
{'m','a','r','g','i','n','-','l','e','f','t',0}; {'m','a','r','g','i','n','-','l','e','f','t',0};
static const WCHAR attrMarginRight[] = static const WCHAR margin_rightW[] =
{'m','a','r','g','i','n','-','r','i','g','h','t',0}; {'m','a','r','g','i','n','-','r','i','g','h','t',0};
static const WCHAR attrMarginTop[] = static const WCHAR margin_topW[] =
{'m','a','r','g','i','n','-','t','o','p',0}; {'m','a','r','g','i','n','-','t','o','p',0};
static const WCHAR attrMaxHeight[] = static const WCHAR max_heightW[] =
{'m','a','x','-','h','e','i','g','h','t',0}; {'m','a','x','-','h','e','i','g','h','t',0};
static const WCHAR attrMaxWidth[] = static const WCHAR max_widthW[] =
{'m','a','x','-','w','i','d','t','h',0}; {'m','a','x','-','w','i','d','t','h',0};
static const WCHAR attrMinHeight[] = static const WCHAR min_heightW[] =
{'m','i','n','-','h','e','i','g','h','t',0}; {'m','i','n','-','h','e','i','g','h','t',0};
static const WCHAR attrMinWidth[] = static const WCHAR min_widthW[] =
{'m','i','n','-','w','i','d','t','h',0}; {'m','i','n','-','w','i','d','t','h',0};
static const WCHAR attrOutline[] = static const WCHAR outlineW[] =
{'o','u','t','l','i','n','e',0}; {'o','u','t','l','i','n','e',0};
static const WCHAR attrOverflow[] = static const WCHAR overflowW[] =
{'o','v','e','r','f','l','o','w',0}; {'o','v','e','r','f','l','o','w',0};
static const WCHAR attrOverflowX[] = static const WCHAR overflow_xW[] =
{'o','v','e','r','f','l','o','w','-','x',0}; {'o','v','e','r','f','l','o','w','-','x',0};
static const WCHAR attrOverflowY[] = static const WCHAR overflow_yW[] =
{'o','v','e','r','f','l','o','w','-','y',0}; {'o','v','e','r','f','l','o','w','-','y',0};
static const WCHAR attrPadding[] = static const WCHAR paddingW[] =
{'p','a','d','d','i','n','g',0}; {'p','a','d','d','i','n','g',0};
static const WCHAR attrPaddingBottom[] = static const WCHAR padding_bottomW[] =
{'p','a','d','d','i','n','g','-','b','o','t','t','o','m',0}; {'p','a','d','d','i','n','g','-','b','o','t','t','o','m',0};
static const WCHAR attrPaddingLeft[] = static const WCHAR padding_leftW[] =
{'p','a','d','d','i','n','g','-','l','e','f','t',0}; {'p','a','d','d','i','n','g','-','l','e','f','t',0};
static const WCHAR attrPaddingRight[] = static const WCHAR padding_rightW[] =
{'p','a','d','d','i','n','g','-','r','i','g','h','t',0}; {'p','a','d','d','i','n','g','-','r','i','g','h','t',0};
static const WCHAR attrPaddingTop[] = static const WCHAR padding_topW[] =
{'p','a','d','d','i','n','g','-','t','o','p',0}; {'p','a','d','d','i','n','g','-','t','o','p',0};
static const WCHAR attrPageBreakAfter[] = static const WCHAR page_break_afterW[] =
{'p','a','g','e','-','b','r','e','a','k','-','a','f','t','e','r',0}; {'p','a','g','e','-','b','r','e','a','k','-','a','f','t','e','r',0};
static const WCHAR attrPageBreakBefore[] = static const WCHAR page_break_beforeW[] =
{'p','a','g','e','-','b','r','e','a','k','-','b','e','f','o','r','e',0}; {'p','a','g','e','-','b','r','e','a','k','-','b','e','f','o','r','e',0};
static const WCHAR attrPosition[] = static const WCHAR positionW[] =
{'p','o','s','i','t','i','o','n',0}; {'p','o','s','i','t','i','o','n',0};
static const WCHAR attrRight[] = static const WCHAR rightW[] =
{'r','i','g','h','t',0}; {'r','i','g','h','t',0};
static const WCHAR attrTableLayout[] = static const WCHAR table_layoutW[] =
{'t','a','b','l','e','-','l','a','y','o','u','t',0}; {'t','a','b','l','e','-','l','a','y','o','u','t',0};
static const WCHAR attrTextAlign[] = static const WCHAR text_alignW[] =
{'t','e','x','t','-','a','l','i','g','n',0}; {'t','e','x','t','-','a','l','i','g','n',0};
static const WCHAR attrTextDecoration[] = static const WCHAR text_decorationW[] =
{'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0}; {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
static const WCHAR attrTextIndent[] = static const WCHAR text_indentW[] =
{'t','e','x','t','-','i','n','d','e','n','t',0}; {'t','e','x','t','-','i','n','d','e','n','t',0};
static const WCHAR attrTextTransform[] = static const WCHAR text_transformW[] =
{'t','e','x','t','-','t','r','a','n','s','f','o','r','m',0}; {'t','e','x','t','-','t','r','a','n','s','f','o','r','m',0};
static const WCHAR attrTop[] = static const WCHAR topW[] =
{'t','o','p',0}; {'t','o','p',0};
static const WCHAR attrVerticalAlign[] = static const WCHAR vertical_alignW[] =
{'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0}; {'v','e','r','t','i','c','a','l','-','a','l','i','g','n',0};
static const WCHAR attrVisibility[] = static const WCHAR visibilityW[] =
{'v','i','s','i','b','i','l','i','t','y',0}; {'v','i','s','i','b','i','l','i','t','y',0};
static const WCHAR attrWhiteSpace[] = static const WCHAR white_spaceW[] =
{'w','h','i','t','e','-','s','p','a','c','e',0}; {'w','h','i','t','e','-','s','p','a','c','e',0};
static const WCHAR attrWidth[] = static const WCHAR widthW[] =
{'w','i','d','t','h',0}; {'w','i','d','t','h',0};
static const WCHAR attrWordSpacing[] = static const WCHAR word_spacingW[] =
{'w','o','r','d','-','s','p','a','c','i','n','g',0}; {'w','o','r','d','-','s','p','a','c','i','n','g',0};
static const WCHAR attrWordWrap[] = static const WCHAR word_wrapW[] =
{'w','o','r','d','-','w','r','a','p',0}; {'w','o','r','d','-','w','r','a','p',0};
static const WCHAR attrZIndex[] = static const WCHAR z_indexW[] =
{'z','-','i','n','d','e','x',0}; {'z','-','i','n','d','e','x',0};
@ -213,94 +213,95 @@ static const WCHAR pxW[] = {'p','x',0};
typedef struct { typedef struct {
const WCHAR *name; const WCHAR *name;
DISPID dispid; DISPID dispid;
unsigned flags;
} style_tbl_entry_t; } style_tbl_entry_t;
static const style_tbl_entry_t style_tbl[] = { static const style_tbl_entry_t style_tbl[] = {
{attrBackground, DISPID_IHTMLSTYLE_BACKGROUND}, {backgroundW, DISPID_IHTMLSTYLE_BACKGROUND},
{attrBackgroundAttachment, DISPID_IHTMLSTYLE_BACKGROUNDATTACHMENT}, {background_attachmentW, DISPID_IHTMLSTYLE_BACKGROUNDATTACHMENT},
{attrBackgroundColor, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR}, {background_colorW, DISPID_IHTMLSTYLE_BACKGROUNDCOLOR, ATTR_HEX_INT},
{attrBackgroundImage, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE}, {background_imageW, DISPID_IHTMLSTYLE_BACKGROUNDIMAGE, ATTR_FIX_URL},
{attrBackgroundPosition, DISPID_IHTMLSTYLE_BACKGROUNDPOSITION}, {background_positionW, DISPID_IHTMLSTYLE_BACKGROUNDPOSITION},
{attrBackgroundPositionX, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONX}, {background_position_xW, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONX, ATTR_FIX_PX},
{attrBackgroundPositionY, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONY}, {background_position_yW, DISPID_IHTMLSTYLE_BACKGROUNDPOSITIONY, ATTR_FIX_PX},
{attrBackgroundRepeat, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT}, {background_repeatW, DISPID_IHTMLSTYLE_BACKGROUNDREPEAT},
{attrBorder, DISPID_IHTMLSTYLE_BORDER}, {borderW, DISPID_IHTMLSTYLE_BORDER},
{attrBorderBottom, DISPID_IHTMLSTYLE_BORDERBOTTOM}, {border_bottomW, DISPID_IHTMLSTYLE_BORDERBOTTOM, ATTR_FIX_PX},
{attrBorderBottomColor, DISPID_IHTMLSTYLE_BORDERBOTTOMCOLOR}, {border_bottom_colorW, DISPID_IHTMLSTYLE_BORDERBOTTOMCOLOR, ATTR_HEX_INT},
{attrBorderBottomStyle, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE}, {border_bottom_styleW, DISPID_IHTMLSTYLE_BORDERBOTTOMSTYLE},
{attrBorderBottomWidth, DISPID_IHTMLSTYLE_BORDERBOTTOMWIDTH}, {border_bottom_widthW, DISPID_IHTMLSTYLE_BORDERBOTTOMWIDTH, ATTR_FIX_PX},
{attrBorderColor, DISPID_IHTMLSTYLE_BORDERCOLOR}, {border_colorW, DISPID_IHTMLSTYLE_BORDERCOLOR},
{attrBorderLeft, DISPID_IHTMLSTYLE_BORDERLEFT}, {border_leftW, DISPID_IHTMLSTYLE_BORDERLEFT, ATTR_FIX_PX},
{attrBorderLeftColor, DISPID_IHTMLSTYLE_BORDERLEFTCOLOR}, {border_left_colorW, DISPID_IHTMLSTYLE_BORDERLEFTCOLOR, ATTR_HEX_INT},
{attrBorderLeftStyle, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE}, {border_left_styleW, DISPID_IHTMLSTYLE_BORDERLEFTSTYLE},
{attrBorderLeftWidth, DISPID_IHTMLSTYLE_BORDERLEFTWIDTH}, {border_left_widthW, DISPID_IHTMLSTYLE_BORDERLEFTWIDTH, ATTR_FIX_PX},
{attrBorderRight, DISPID_IHTMLSTYLE_BORDERRIGHT}, {border_rightW, DISPID_IHTMLSTYLE_BORDERRIGHT, ATTR_FIX_PX},
{attrBorderRightColor, DISPID_IHTMLSTYLE_BORDERRIGHTCOLOR}, {border_right_colorW, DISPID_IHTMLSTYLE_BORDERRIGHTCOLOR, ATTR_HEX_INT},
{attrBorderRightStyle, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE}, {border_right_styleW, DISPID_IHTMLSTYLE_BORDERRIGHTSTYLE},
{attrBorderRightWidth, DISPID_IHTMLSTYLE_BORDERRIGHTWIDTH}, {border_right_widthW, DISPID_IHTMLSTYLE_BORDERRIGHTWIDTH, ATTR_FIX_PX},
{attrBorderStyle, DISPID_IHTMLSTYLE_BORDERSTYLE}, {border_styleW, DISPID_IHTMLSTYLE_BORDERSTYLE},
{attrBorderTop, DISPID_IHTMLSTYLE_BORDERTOP}, {border_topW, DISPID_IHTMLSTYLE_BORDERTOP, ATTR_FIX_PX},
{attrBorderTopColor, DISPID_IHTMLSTYLE_BORDERTOPCOLOR}, {border_top_colorW, DISPID_IHTMLSTYLE_BORDERTOPCOLOR, ATTR_HEX_INT},
{attrBorderTopStyle, DISPID_IHTMLSTYLE_BORDERTOPSTYLE}, {border_top_styleW, DISPID_IHTMLSTYLE_BORDERTOPSTYLE},
{attrBorderTopWidth, DISPID_IHTMLSTYLE_BORDERTOPWIDTH}, {border_top_widthW, DISPID_IHTMLSTYLE_BORDERTOPWIDTH},
{attrBorderWidth, DISPID_IHTMLSTYLE_BORDERWIDTH}, {border_widthW, DISPID_IHTMLSTYLE_BORDERWIDTH},
{attrBottom, DISPID_IHTMLSTYLE2_BOTTOM}, {bottomW, DISPID_IHTMLSTYLE2_BOTTOM, ATTR_FIX_PX},
{attrBoxSizing, DISPID_IHTMLSTYLE6_BOXSIZING}, {box_sizingW, DISPID_IHTMLSTYLE6_BOXSIZING},
{attrClear, DISPID_IHTMLSTYLE_CLEAR}, {clearW, DISPID_IHTMLSTYLE_CLEAR},
{attrClip, DISPID_IHTMLSTYLE_CLIP}, {clipW, DISPID_IHTMLSTYLE_CLIP, ATTR_REMOVE_COMMA},
{attrColor, DISPID_IHTMLSTYLE_COLOR}, {colorW, DISPID_IHTMLSTYLE_COLOR, ATTR_HEX_INT},
{attrCursor, DISPID_IHTMLSTYLE_CURSOR}, {cursorW, DISPID_IHTMLSTYLE_CURSOR},
{attrDirection, DISPID_IHTMLSTYLE2_DIRECTION}, {directionW, DISPID_IHTMLSTYLE2_DIRECTION},
{attrDisplay, DISPID_IHTMLSTYLE_DISPLAY}, {displayW, DISPID_IHTMLSTYLE_DISPLAY},
{attrFilter, DISPID_IHTMLSTYLE_FILTER}, {filterW, DISPID_IHTMLSTYLE_FILTER},
{attrFloat, DISPID_IHTMLSTYLE_STYLEFLOAT}, {floatW, DISPID_IHTMLSTYLE_STYLEFLOAT},
{attrFontFamily, DISPID_IHTMLSTYLE_FONTFAMILY}, {font_familyW, DISPID_IHTMLSTYLE_FONTFAMILY},
{attrFontSize, DISPID_IHTMLSTYLE_FONTSIZE}, {font_sizeW, DISPID_IHTMLSTYLE_FONTSIZE, ATTR_FIX_PX},
{attrFontStyle, DISPID_IHTMLSTYLE_FONTSTYLE}, {font_styleW, DISPID_IHTMLSTYLE_FONTSTYLE},
{attrFontVariant, DISPID_IHTMLSTYLE_FONTVARIANT}, {font_variantW, DISPID_IHTMLSTYLE_FONTVARIANT},
{attrFontWeight, DISPID_IHTMLSTYLE_FONTWEIGHT}, {font_weightW, DISPID_IHTMLSTYLE_FONTWEIGHT, ATTR_STR_TO_INT},
{attrHeight, DISPID_IHTMLSTYLE_HEIGHT}, {heightW, DISPID_IHTMLSTYLE_HEIGHT, ATTR_FIX_PX},
{attrLeft, DISPID_IHTMLSTYLE_LEFT}, {leftW, DISPID_IHTMLSTYLE_LEFT},
{attrLetterSpacing, DISPID_IHTMLSTYLE_LETTERSPACING}, {letter_spacingW, DISPID_IHTMLSTYLE_LETTERSPACING},
{attrLineHeight, DISPID_IHTMLSTYLE_LINEHEIGHT}, {line_heightW, DISPID_IHTMLSTYLE_LINEHEIGHT},
{attrListStyle, DISPID_IHTMLSTYLE_LISTSTYLE}, {list_styleW, DISPID_IHTMLSTYLE_LISTSTYLE},
{attrListStylePosition, DISPID_IHTMLSTYLE_LISTSTYLEPOSITION}, {list_style_positionW, DISPID_IHTMLSTYLE_LISTSTYLEPOSITION},
{attrListStyleType, DISPID_IHTMLSTYLE_LISTSTYLETYPE}, {list_style_typeW, DISPID_IHTMLSTYLE_LISTSTYLETYPE},
{attrMargin, DISPID_IHTMLSTYLE_MARGIN}, {marginW, DISPID_IHTMLSTYLE_MARGIN},
{attrMarginBottom, DISPID_IHTMLSTYLE_MARGINBOTTOM}, {margin_bottomW, DISPID_IHTMLSTYLE_MARGINBOTTOM, ATTR_FIX_PX},
{attrMarginLeft, DISPID_IHTMLSTYLE_MARGINLEFT}, {margin_leftW, DISPID_IHTMLSTYLE_MARGINLEFT, ATTR_FIX_PX},
{attrMarginRight, DISPID_IHTMLSTYLE_MARGINRIGHT}, {margin_rightW, DISPID_IHTMLSTYLE_MARGINRIGHT, ATTR_FIX_PX},
{attrMarginTop, DISPID_IHTMLSTYLE_MARGINTOP}, {margin_topW, DISPID_IHTMLSTYLE_MARGINTOP, ATTR_FIX_PX},
{attrMaxHeight, DISPID_IHTMLSTYLE5_MAXHEIGHT}, {max_heightW, DISPID_IHTMLSTYLE5_MAXHEIGHT, ATTR_FIX_PX},
{attrMaxWidth, DISPID_IHTMLSTYLE5_MAXWIDTH}, {max_widthW, DISPID_IHTMLSTYLE5_MAXWIDTH, ATTR_FIX_PX},
{attrMinHeight, DISPID_IHTMLSTYLE4_MINHEIGHT}, {min_heightW, DISPID_IHTMLSTYLE4_MINHEIGHT},
{attrMinWidth, DISPID_IHTMLSTYLE5_MINWIDTH}, {min_widthW, DISPID_IHTMLSTYLE5_MINWIDTH, ATTR_FIX_PX},
{attrOutline, DISPID_IHTMLSTYLE6_OUTLINE}, {outlineW, DISPID_IHTMLSTYLE6_OUTLINE, ATTR_NO_NULL},
{attrOverflow, DISPID_IHTMLSTYLE_OVERFLOW}, {overflowW, DISPID_IHTMLSTYLE_OVERFLOW},
{attrOverflowX, DISPID_IHTMLSTYLE2_OVERFLOWX}, {overflow_xW, DISPID_IHTMLSTYLE2_OVERFLOWX},
{attrOverflowY, DISPID_IHTMLSTYLE2_OVERFLOWY}, {overflow_yW, DISPID_IHTMLSTYLE2_OVERFLOWY},
{attrPadding, DISPID_IHTMLSTYLE_PADDING}, {paddingW, DISPID_IHTMLSTYLE_PADDING},
{attrPaddingBottom, DISPID_IHTMLSTYLE_PADDINGBOTTOM}, {padding_bottomW, DISPID_IHTMLSTYLE_PADDINGBOTTOM, ATTR_FIX_PX},
{attrPaddingLeft, DISPID_IHTMLSTYLE_PADDINGLEFT}, {padding_leftW, DISPID_IHTMLSTYLE_PADDINGLEFT, ATTR_FIX_PX},
{attrPaddingRight, DISPID_IHTMLSTYLE_PADDINGRIGHT}, {padding_rightW, DISPID_IHTMLSTYLE_PADDINGRIGHT, ATTR_FIX_PX},
{attrPaddingTop, DISPID_IHTMLSTYLE_PADDINGTOP}, {padding_topW, DISPID_IHTMLSTYLE_PADDINGTOP, ATTR_FIX_PX},
{attrPageBreakAfter, DISPID_IHTMLSTYLE_PAGEBREAKAFTER}, {page_break_afterW, DISPID_IHTMLSTYLE_PAGEBREAKAFTER},
{attrPageBreakBefore, DISPID_IHTMLSTYLE_PAGEBREAKBEFORE}, {page_break_beforeW, DISPID_IHTMLSTYLE_PAGEBREAKBEFORE},
{attrPosition, DISPID_IHTMLSTYLE2_POSITION}, {positionW, DISPID_IHTMLSTYLE2_POSITION},
{attrRight, DISPID_IHTMLSTYLE2_RIGHT}, {rightW, DISPID_IHTMLSTYLE2_RIGHT},
{attrTableLayout, DISPID_IHTMLSTYLE2_TABLELAYOUT}, {table_layoutW, DISPID_IHTMLSTYLE2_TABLELAYOUT},
{attrTextAlign, DISPID_IHTMLSTYLE_TEXTALIGN}, {text_alignW, DISPID_IHTMLSTYLE_TEXTALIGN},
{attrTextDecoration, DISPID_IHTMLSTYLE_TEXTDECORATION}, {text_decorationW, DISPID_IHTMLSTYLE_TEXTDECORATION},
{attrTextIndent, DISPID_IHTMLSTYLE_TEXTINDENT}, {text_indentW, DISPID_IHTMLSTYLE_TEXTINDENT, ATTR_FIX_PX},
{attrTextTransform, DISPID_IHTMLSTYLE_TEXTTRANSFORM}, {text_transformW, DISPID_IHTMLSTYLE_TEXTTRANSFORM},
{attrTop, DISPID_IHTMLSTYLE_TOP}, {topW, DISPID_IHTMLSTYLE_TOP},
{attrVerticalAlign, DISPID_IHTMLSTYLE_VERTICALALIGN}, {vertical_alignW, DISPID_IHTMLSTYLE_VERTICALALIGN, ATTR_FIX_PX},
{attrVisibility, DISPID_IHTMLSTYLE_VISIBILITY}, {visibilityW, DISPID_IHTMLSTYLE_VISIBILITY},
{attrWhiteSpace, DISPID_IHTMLSTYLE_WHITESPACE}, {white_spaceW, DISPID_IHTMLSTYLE_WHITESPACE},
{attrWidth, DISPID_IHTMLSTYLE_WIDTH}, {widthW, DISPID_IHTMLSTYLE_WIDTH, ATTR_FIX_PX},
{attrWordSpacing, DISPID_IHTMLSTYLE_WORDSPACING}, {word_spacingW, DISPID_IHTMLSTYLE_WORDSPACING},
{attrWordWrap, DISPID_IHTMLSTYLE3_WORDWRAP}, {word_wrapW, DISPID_IHTMLSTYLE3_WORDWRAP},
{attrZIndex, DISPID_IHTMLSTYLE_ZINDEX} {z_indexW, DISPID_IHTMLSTYLE_ZINDEX, ATTR_STR_TO_INT}
}; };
C_ASSERT(ARRAY_SIZE(style_tbl) == STYLEID_MAX_VALUE); C_ASSERT(ARRAY_SIZE(style_tbl) == STYLEID_MAX_VALUE);
@ -408,6 +409,7 @@ static HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t si
nsresult nsres; nsresult nsres;
if(value) { if(value) {
flags = style_tbl[sid].flags;
if(flags & ATTR_FIX_PX) if(flags & ATTR_FIX_PX)
val = fix_px_value(value); val = fix_px_value(value);
else if(flags & ATTR_FIX_URL) else if(flags & ATTR_FIX_URL)
@ -571,6 +573,7 @@ HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid,
BOOL set = FALSE; BOOL set = FALSE;
HRESULT hres = S_OK; HRESULT hres = S_OK;
flags = style_tbl[sid].flags;
nsAString_Init(&str_value, NULL); nsAString_Init(&str_value, NULL);
get_nsstyle_attr_nsval(nsstyle, sid, &str_value); get_nsstyle_attr_nsval(nsstyle, sid, &str_value);