From: Gabriel Ivăncescu gabrielopcode@gmail.com
First of all it was already pretty much broken because the table must be sorted, and '-' comes first. And secondly, IE uses the unprefixed box-sizing property, not -moz-box-sizing, although we do have to convert it for wine-gecko.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlstyle.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index cfc50f150ba..0e2c2a2407c 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -116,6 +116,7 @@ typedef struct { DISPID compat_dispid; unsigned flags; const WCHAR **allowed_values; + const WCHAR *nsname; } style_tbl_entry_t;
static const style_tbl_entry_t style_tbl[] = { @@ -318,9 +319,11 @@ static const style_tbl_entry_t style_tbl[] = { ATTR_FIX_PX }, { - L"-moz-box-sizing", + L"box-sizing", DISPID_IHTMLCSSSTYLEDECLARATION_BOXSIZING, - DISPID_A_BOXSIZING + DISPID_A_BOXSIZING, + 0, NULL, + L"-moz-box-sizing" }, { L"clear", @@ -702,6 +705,16 @@ static const style_tbl_entry_t style_tbl[] = {
C_ASSERT(ARRAY_SIZE(style_tbl) == STYLEID_MAX_VALUE);
+static const WCHAR *get_style_nsname(const style_tbl_entry_t *style_entry) +{ + return style_entry->nsname ? style_entry->nsname : style_entry->name; +} + +static const WCHAR *get_style_prop_nsname(const style_tbl_entry_t *style_entry, const WCHAR *orig_name) +{ + return style_entry ? get_style_nsname(style_entry) : orig_name; +} + static const style_tbl_entry_t *lookup_style_tbl(CSSStyle *style, const WCHAR *name) { int c, i, min = 0, max = ARRAY_SIZE(style_tbl)-1; @@ -788,7 +801,7 @@ static HRESULT set_nsstyle_property(nsIDOMCSSStyleDeclaration *nsstyle, styleid_ nsAString str_name, str_empty; nsresult nsres;
- nsAString_InitDepend(&str_name, style_tbl[sid].name); + nsAString_InitDepend(&str_name, get_style_nsname(&style_tbl[sid])); nsAString_InitDepend(&str_empty, L""); nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, value, &str_empty); nsAString_Finish(&str_name); @@ -867,7 +880,7 @@ static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, stylei nsAString str_name; nsresult nsres;
- nsAString_InitDepend(&str_name, style_tbl[sid].name); + nsAString_InitDepend(&str_name, get_style_nsname(&style_tbl[sid])); nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle, &str_name, value); nsAString_Finish(&str_name); if(NS_FAILED(nsres)) @@ -2946,7 +2959,7 @@ static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttri return S_OK; }
- nsAString_InitDepend(&name_str, style_entry->name); + nsAString_InitDepend(&name_str, get_style_nsname(style_entry)); nsAString_Init(&ret_str, NULL); nsres = nsIDOMCSSStyleDeclaration_RemoveProperty(This->css_style.nsstyle, &name_str, &ret_str); if(NS_SUCCEEDED(nsres)) { @@ -4443,7 +4456,7 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_getPropertyValue(IHTMLCSSStyleDecl TRACE("(%p)->(%s %p)\n", This, debugstr_w(name), value);
style_entry = lookup_style_tbl(This, name); - nsAString_InitDepend(&name_str, style_entry ? style_entry->name : name); + nsAString_InitDepend(&name_str, get_style_prop_nsname(style_entry, name)); nsAString_InitDepend(&value_str, NULL); nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(This->nsstyle, &name_str, &value_str); nsAString_Finish(&name_str); @@ -4467,7 +4480,7 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_removeProperty(IHTMLCSSStyleDeclar TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrPropertyName), pbstrPropertyValue);
style_entry = lookup_style_tbl(This, bstrPropertyName); - nsAString_InitDepend(&name_str, style_entry ? style_entry->name : bstrPropertyName); + nsAString_InitDepend(&name_str, get_style_prop_nsname(style_entry, bstrPropertyName)); nsAString_Init(&ret_str, NULL); nsres = nsIDOMCSSStyleDeclaration_RemoveProperty(This->nsstyle, &name_str, &ret_str); nsAString_Finish(&name_str); @@ -4500,7 +4513,7 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_setProperty(IHTMLCSSStyleDeclarati nsAString_InitDepend(&priority_str, NULL); }
- nsAString_InitDepend(&name_str, style_entry ? style_entry->name : name); + nsAString_InitDepend(&name_str, get_style_prop_nsname(style_entry, name)); nsres = nsIDOMCSSStyleDeclaration_SetProperty(This->nsstyle, &name_str, &value_str, &priority_str); nsAString_Finish(&name_str); nsAString_Finish(&value_str);