-- v3: mshtml: Get rid of unused HTMLElement_toString_dispids. mshtml: Expose respective props from StyleSheetPrototype. mshtml: Don't expose toString from styles in IE9+ modes. mshtml: Don't expose the *Expression methods from styles in IE9+ modes. mshtml: Don't expose the clip* props from style declaration or properties mshtml: Don't expose 'behavior' prop from styles in IE11 mode. mshtml: Move 'filter' prop to MSCSSPropertiesPrototype in IE9 mode. mshtml: Prefer builtins for style aliases that have the same name. mshtml: Expose respective props from MSCSSPropertiesPrototype. mshtml/tests: Add more tests for the style aliased prop names.
From: Gabriel Ivăncescu gabrielopcode@gmail.com
They're part of the objects themselves (not prototypes) and are props with values, not accessors, even though they change based on the underlying style.
They are also not enumerated by getOwnPropertyNames, while hasOwnProperty returns true, but in one case (getComputedStyle) it also can't retrieve a descriptor for some.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/tests/documentmode.js | 93 ++++++++++++++++++++++++------- 1 file changed, 74 insertions(+), 19 deletions(-)
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 672b8d92bd4..8ff988ee4f4 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -815,42 +815,97 @@ sync_test("xhr open", function() { });
sync_test("style_props", function() { - var style = document.body.style, currentStyle = document.body.currentStyle, computedStyle = window.getComputedStyle ? window.getComputedStyle(document.body) : undefined; - - function test_exposed(prop, expect_style, expect_currentStyle, expect_computedStyle) { - if(expect_style) - ok(prop in style, prop + " not found in style object."); - else - ok(!(prop in style), prop + " found in style object."); - if(expect_currentStyle) - ok(prop in currentStyle, prop + " not found in currentStyle object."); - else - ok(!(prop in currentStyle), prop + " found in currentStyle object."); - if(computedStyle) { - if(expect_computedStyle) - ok(prop in computedStyle, prop + " not found in computedStyle object."); - else - ok(!(prop in computedStyle), prop + " found in computedStyle object."); + var r, style = document.body.style, currentStyle = document.body.currentStyle, computedStyle = window.getComputedStyle ? window.getComputedStyle(document.body) : undefined; + + function test_exposed(prop, expect_style, expect_currentStyle, expect_computedStyle, own_prop) { + if(own_prop === undefined) + own_prop = (v < 9); + function test(prop, obj, expect, name) { + if(!expect) + ok(!(prop in obj), prop + " found in " + name + " object."); + else { + ok(prop in obj, prop + " not found in " + name + " object."); + if(own_prop) { + ok(Object.prototype.hasOwnProperty.call(obj, prop), prop + " not prop of " + name + " object."); + if(Object.getOwnPropertyDescriptor) { + var desc = Object.getOwnPropertyDescriptor(obj, prop); + if(name === "computedStyle" && prop.indexOf("-") === -1) { + todo_wine. + ok(desc === undefined, prop + " of " + name + " object is not undefined."); + return; + } + ok(desc.value === obj[prop], prop + " of " + name + " object value = ." + desc.value + ", expected " + obj[prop]); + ok(!("get" in desc), prop + " of " + name + " object has a getter."); + ok(!("set" in desc), prop + " of " + name + " object has a setter."); + ok(desc.writable === true, prop + " of " + name + " object not writable."); + ok(desc.enumerable === true, prop + " of " + name + " object not enumerable."); + ok(desc.configurable === true, prop + " of " + name + " object not configurable."); + } + } + } } + + test(prop, style, expect_style, "style"); + test(prop, currentStyle, expect_currentStyle, "currentStyle"); + if(computedStyle) + test(prop, computedStyle, expect_computedStyle, "computedStyle"); }
var v = document.documentMode;
test_exposed("removeAttribute", true, broken(true) ? v >= 9 : false /* todo_wine */, false); test_exposed("zIndex", true, true, true); - test_exposed("z-index", true, true, true); + test_exposed("z-index", true, true, true, true); test_exposed("filter", true, true, broken(true) ? v >= 10 : v >= 9 /* todo_wine */); test_exposed("pixelTop", true, false, false); - test_exposed("float", true, true, true); + test_exposed("float", true, true, true, true); test_exposed("css-float", false, false, false); test_exposed("style-float", false, false, false); test_exposed("setProperty", v >= 9, v >= 9, v >= 9); test_exposed("removeProperty", v >= 9, v >= 9, v >= 9); - test_exposed("background-clip", v >= 9, v >= 9, v >= 9); + test_exposed("background-clip", v >= 9, v >= 9, v >= 9, true); test_exposed("msTransform", v >= 9, v >= 9, v >= 9); test_exposed("msTransition", v >= 10, v >= 10, v >= 10); test_exposed("transform", v >= 10, v >= 10, v >= 10); test_exposed("transition", v >= 10, v >= 10, v >= 10); + + if(Object.getOwnPropertyNames) { + r = Object.getOwnPropertyNames(style); + todo_wine. + ok(!r.length, "style has own props: " + r); + r = Object.getOwnPropertyNames(currentStyle); + todo_wine. + ok(!r.length, "currentStyle has own props: " + r); + r = Object.getOwnPropertyNames(computedStyle); + todo_wine. + ok(!r.length, "computedStyle has own props: " + r); + + r = Object.getOwnPropertyDescriptor(style, "z-index"); + ok(r.value === "", "style z-index value = " + r.value); + style.zIndex = 1; + r = Object.getOwnPropertyDescriptor(style, "z-index"); + ok(r.value === 1, "style z-index value after set = " + r.value); + + Object.defineProperty(style, "z-index", { get: function() { return "42"; }, configurable: true }); + todo_wine. + ok(style.zIndex === 1, "style zIndex after defineProperty = " + style.zIndex); + todo_wine. + ok(style["z-index"] === "42", "style z-index after defineProperty = " + style["z-index"]); + + r = Object.getOwnPropertyDescriptor(style, "z-index"); + todo_wine. + ok(!("value" in r), "style z-index after defineProperty still has value"); + todo_wine. + ok(typeof(r.get) === "function", "style z-index after defineProperty not a getter"); + + r = delete style["z-index"]; + ok(r === true, "delete style z-index returned " + r); + ok(style["z-index"] === 1, "style z-index after delete = " + style["z-index"]); + + r = Object.getOwnPropertyNames(style); + todo_wine. + ok(!r.length, "style has own props after delete: " + r); + } });
sync_test("createElement_inline_attr", function() {
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlcurstyle.c | 46 ++++++++++++- dlls/mshtml/htmlstyle.c | 98 ++++++++++++++++++++++++++-- dlls/mshtml/htmlstyle.h | 3 +- dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/mshtml_private_iface.idl | 17 +++++ dlls/mshtml/tests/documentmode.js | 68 ++++++++++++++++++- dlls/mshtml/tests/dom.js | 27 +++++++- 7 files changed, 249 insertions(+), 11 deletions(-)
diff --git a/dlls/mshtml/htmlcurstyle.c b/dlls/mshtml/htmlcurstyle.c index f54879fb729..0d80381b986 100644 --- a/dlls/mshtml/htmlcurstyle.c +++ b/dlls/mshtml/htmlcurstyle.c @@ -38,6 +38,7 @@ struct HTMLCurrentStyle { IHTMLCurrentStyle2 IHTMLCurrentStyle2_iface; IHTMLCurrentStyle3 IHTMLCurrentStyle3_iface; IHTMLCurrentStyle4 IHTMLCurrentStyle4_iface; + IWineCSSProperties IWineCSSProperties_iface;
HTMLElement *elem; }; @@ -1086,6 +1087,46 @@ static const IHTMLCurrentStyle4Vtbl HTMLCurrentStyle4Vtbl = { HTMLCurrentStyle4_get_maxWidth };
+static inline HTMLCurrentStyle *impl_from_IWineCSSProperties(IWineCSSProperties *iface) +{ + return CONTAINING_RECORD(iface, HTMLCurrentStyle, IWineCSSProperties_iface); +} + +DISPEX_IDISPATCH_IMPL(HTMLCurrentStyle_CSSProperties, IWineCSSProperties, impl_from_IWineCSSProperties(iface)->css_style.dispex) + +static HRESULT WINAPI HTMLCurrentStyle_CSSProperties_getAttribute(IWineCSSProperties *iface, BSTR name, LONG flags, VARIANT *p) +{ + HTMLCurrentStyle *This = impl_from_IWineCSSProperties(iface); + return HTMLCurrentStyle_getAttribute(&This->IHTMLCurrentStyle_iface, name, flags, p); +} + +static HRESULT WINAPI HTMLCurrentStyle_CSSProperties_setAttribute(IWineCSSProperties *iface, BSTR name, VARIANT value, LONG flags) +{ + HTMLCurrentStyle *This = impl_from_IWineCSSProperties(iface); + FIXME("(%p)->(%s %s %08lx)\n", This, debugstr_w(name), debugstr_variant(&value), flags); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLCurrentStyle_CSSProperties_removeAttribute(IWineCSSProperties *iface, BSTR name, LONG flags, VARIANT_BOOL *p) +{ + HTMLCurrentStyle *This = impl_from_IWineCSSProperties(iface); + FIXME("(%p)->(%s %08lx %p)\n", This, debugstr_w(name), flags, p); + return E_NOTIMPL; +} + +static const IWineCSSPropertiesVtbl HTMLCurrentStyle_CSSPropertiesVtbl = { + HTMLCurrentStyle_CSSProperties_QueryInterface, + HTMLCurrentStyle_CSSProperties_AddRef, + HTMLCurrentStyle_CSSProperties_Release, + HTMLCurrentStyle_CSSProperties_GetTypeInfoCount, + HTMLCurrentStyle_CSSProperties_GetTypeInfo, + HTMLCurrentStyle_CSSProperties_GetIDsOfNames, + HTMLCurrentStyle_CSSProperties_Invoke, + HTMLCurrentStyle_CSSProperties_setAttribute, + HTMLCurrentStyle_CSSProperties_getAttribute, + HTMLCurrentStyle_CSSProperties_removeAttribute +}; + static inline HTMLCurrentStyle *impl_from_DispatchEx(DispatchEx *dispex) { return CONTAINING_RECORD(dispex, HTMLCurrentStyle, css_style.dispex); @@ -1103,6 +1144,8 @@ static void *HTMLCurrentStyle_query_interface(DispatchEx *dispex, REFIID riid) return &This->IHTMLCurrentStyle3_iface; if(IsEqualGUID(&IID_IHTMLCurrentStyle4, riid)) return &This->IHTMLCurrentStyle4_iface; + if(IsEqualGUID(&IID_IWineCSSProperties, riid)) + return &This->IWineCSSProperties_iface; return CSSStyle_query_interface(&This->css_style.dispex, riid); }
@@ -1147,7 +1190,7 @@ dispex_static_data_t MSCurrentStyleCSSProperties_dispex = { .vtbl = &MSCurrentStyleCSSProperties_dispex_vtbl, .disp_tid = DispHTMLCurrentStyle_tid, .iface_tids = MSCurrentStyleCSSProperties_iface_tids, - .init_info = CSSStyle_init_dispex_info, + .init_info = MSCSSProperties_init_dispex_info, };
HRESULT HTMLCurrentStyle_Create(HTMLElement *elem, IHTMLCurrentStyle **p) @@ -1198,6 +1241,7 @@ HRESULT HTMLCurrentStyle_Create(HTMLElement *elem, IHTMLCurrentStyle **p) ret->IHTMLCurrentStyle2_iface.lpVtbl = &HTMLCurrentStyle2Vtbl; ret->IHTMLCurrentStyle3_iface.lpVtbl = &HTMLCurrentStyle3Vtbl; ret->IHTMLCurrentStyle4_iface.lpVtbl = &HTMLCurrentStyle4Vtbl; + ret->IWineCSSProperties_iface.lpVtbl = &HTMLCurrentStyle_CSSPropertiesVtbl;
init_css_style(&ret->css_style, nsstyle, &MSCurrentStyleCSSProperties_dispex, &elem->node.event_target.dispex); nsIDOMCSSStyleDeclaration_Release(nsstyle); diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 92dd9f853be..91fc2befe20 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -4437,6 +4437,44 @@ static const IHTMLStyle6Vtbl HTMLStyle6Vtbl = { HTMLStyle6_get_quotes };
+static inline HTMLStyle *impl_from_IWineCSSProperties(IWineCSSProperties *iface) +{ + return CONTAINING_RECORD(iface, HTMLStyle, IWineCSSProperties_iface); +} + +DISPEX_IDISPATCH_IMPL(HTMLStyle_CSSProperties, IWineCSSProperties, impl_from_IWineCSSProperties(iface)->css_style.dispex) + +static HRESULT WINAPI HTMLStyle_CSSProperties_getAttribute(IWineCSSProperties *iface, BSTR name, LONG flags, VARIANT *p) +{ + HTMLStyle *This = impl_from_IWineCSSProperties(iface); + return HTMLStyle_getAttribute(&This->IHTMLStyle_iface, name, flags, p); +} + +static HRESULT WINAPI HTMLStyle_CSSProperties_setAttribute(IWineCSSProperties *iface, BSTR name, VARIANT value, LONG flags) +{ + HTMLStyle *This = impl_from_IWineCSSProperties(iface); + return HTMLStyle_setAttribute(&This->IHTMLStyle_iface, name, value, flags); +} + +static HRESULT WINAPI HTMLStyle_CSSProperties_removeAttribute(IWineCSSProperties *iface, BSTR name, LONG flags, VARIANT_BOOL *p) +{ + HTMLStyle *This = impl_from_IWineCSSProperties(iface); + return HTMLStyle_removeAttribute(&This->IHTMLStyle_iface, name, flags, p); +} + +static const IWineCSSPropertiesVtbl HTMLStyle_CSSPropertiesVtbl = { + HTMLStyle_CSSProperties_QueryInterface, + HTMLStyle_CSSProperties_AddRef, + HTMLStyle_CSSProperties_Release, + HTMLStyle_CSSProperties_GetTypeInfoCount, + HTMLStyle_CSSProperties_GetTypeInfo, + HTMLStyle_CSSProperties_GetIDsOfNames, + HTMLStyle_CSSProperties_Invoke, + HTMLStyle_CSSProperties_setAttribute, + HTMLStyle_CSSProperties_getAttribute, + HTMLStyle_CSSProperties_removeAttribute +}; + static inline CSSStyle *impl_from_IHTMLCSSStyleDeclaration(IHTMLCSSStyleDeclaration *iface) { return CONTAINING_RECORD(iface, CSSStyle, IHTMLCSSStyleDeclaration_iface); @@ -9623,6 +9661,8 @@ static void *HTMLStyle_query_interface(DispatchEx *dispex, REFIID riid) return &This->IHTMLStyle5_iface; if(IsEqualGUID(&IID_IHTMLStyle6, riid)) return &This->IHTMLStyle6_iface; + if(IsEqualGUID(&IID_IWineCSSProperties, riid)) + return &This->IWineCSSProperties_iface; return CSSStyle_query_interface(&This->css_style.dispex, riid); }
@@ -9647,10 +9687,16 @@ static void HTMLStyle_unlink(DispatchEx *dispex) } }
-void CSSStyle_init_dispex_info(dispex_data_t *info, compat_mode_t mode) +void MSCSSProperties_init_dispex_info(dispex_data_t *info, compat_mode_t mode) { - if(mode >= COMPAT_MODE_IE9) - dispex_info_add_interface(info, IHTMLCSSStyleDeclaration_tid, NULL); + static const dispex_hook_t styledecl_ie11_hooks[] = { + {DISPID_IHTMLCSSSTYLEDECLARATION_BEHAVIOR}, + {DISPID_UNKNOWN} + }; + if(mode >= COMPAT_MODE_IE9) { + dispex_info_add_interface(info, IHTMLCSSStyleDeclaration_tid, mode >= COMPAT_MODE_IE11 ? styledecl_ie11_hooks : NULL); + dispex_info_add_interface(info, IWineCSSProperties_tid, NULL); + } if(mode >= COMPAT_MODE_IE10) dispex_info_add_interface(info, IHTMLCSSStyleDeclaration2_tid, NULL); } @@ -9658,6 +9704,7 @@ void CSSStyle_init_dispex_info(dispex_data_t *info, compat_mode_t mode) dispex_static_data_t MSCSSProperties_dispex = { .id = PROT_MSCSSProperties, .prototype_id = PROT_CSSStyleDeclaration, + .init_info = MSCSSProperties_init_dispex_info, };
static const dispex_static_data_vtbl_t MSStyleCSSProperties_dispex_vtbl = { @@ -9682,7 +9729,7 @@ dispex_static_data_t MSStyleCSSProperties_dispex = { .vtbl = &MSStyleCSSProperties_dispex_vtbl, .disp_tid = DispHTMLStyle_tid, .iface_tids = MSStyleCSSProperties_iface_tids, - .init_info = CSSStyle_init_dispex_info, + .init_info = MSCSSProperties_init_dispex_info, };
static HRESULT get_style_from_elem(HTMLElement *elem, nsIDOMCSSStyleDeclaration **ret) @@ -9755,6 +9802,7 @@ HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret) style->IHTMLStyle4_iface.lpVtbl = &HTMLStyle4Vtbl; style->IHTMLStyle5_iface.lpVtbl = &HTMLStyle5Vtbl; style->IHTMLStyle6_iface.lpVtbl = &HTMLStyle6Vtbl; + style->IWineCSSProperties_iface.lpVtbl = &HTMLStyle_CSSPropertiesVtbl;
style->elem = elem; IHTMLDOMNode_AddRef(&elem->node.IHTMLDOMNode_iface); @@ -9766,6 +9814,46 @@ HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret) return S_OK; }
+static void CSSStyleDeclaration_init_dispex_info(dispex_data_t *info, compat_mode_t mode) +{ + static const dispex_hook_t styledecl_hooks[] = { + {DISPID_IHTMLCSSSTYLEDECLARATION_BACKGROUNDPOSITIONX}, + {DISPID_IHTMLCSSSTYLEDECLARATION_BACKGROUNDPOSITIONY}, + {DISPID_IHTMLCSSSTYLEDECLARATION_STYLEFLOAT}, + {DISPID_IHTMLCSSSTYLEDECLARATION_BEHAVIOR}, + {DISPID_IHTMLCSSSTYLEDECLARATION_IMEMODE}, + {DISPID_IHTMLCSSSTYLEDECLARATION_LAYOUTGRIDCHAR}, + {DISPID_IHTMLCSSSTYLEDECLARATION_LAYOUTGRIDLINE}, + {DISPID_IHTMLCSSSTYLEDECLARATION_LAYOUTGRIDMODE}, + {DISPID_IHTMLCSSSTYLEDECLARATION_LAYOUTGRIDTYPE}, + {DISPID_IHTMLCSSSTYLEDECLARATION_LAYOUTGRID}, + {DISPID_IHTMLCSSSTYLEDECLARATION_LINEBREAK}, + {DISPID_IHTMLCSSSTYLEDECLARATION_TEXTJUSTIFYTRIM}, + {DISPID_IHTMLCSSSTYLEDECLARATION_TEXTKASHIDA}, + {DISPID_IHTMLCSSSTYLEDECLARATION_TEXTAUTOSPACE}, + {DISPID_IHTMLCSSSTYLEDECLARATION_ACCELERATOR}, + {DISPID_IHTMLCSSSTYLEDECLARATION_LAYOUTFLOW}, + {DISPID_IHTMLCSSSTYLEDECLARATION_ZOOM}, + {DISPID_IHTMLCSSSTYLEDECLARATION_SCROLLBARBASECOLOR}, + {DISPID_IHTMLCSSSTYLEDECLARATION_SCROLLBARFACECOLOR}, + {DISPID_IHTMLCSSSTYLEDECLARATION_SCROLLBAR3DLIGHTCOLOR}, + {DISPID_IHTMLCSSSTYLEDECLARATION_SCROLLBARSHADOWCOLOR}, + {DISPID_IHTMLCSSSTYLEDECLARATION_SCROLLBARHIGHLIGHTCOLOR}, + {DISPID_IHTMLCSSSTYLEDECLARATION_SCROLLBARDARKSHADOWCOLOR}, + {DISPID_IHTMLCSSSTYLEDECLARATION_SCROLLBARARROWCOLOR}, + {DISPID_IHTMLCSSSTYLEDECLARATION_SCROLLBARTRACKCOLOR}, + {DISPID_IHTMLCSSSTYLEDECLARATION_WRITINGMODE}, + {DISPID_IHTMLCSSSTYLEDECLARATION_TEXTKASHIDASPACE}, + {DISPID_IHTMLCSSSTYLEDECLARATION_MSINTERPOLATIONMODE}, + {DISPID_IHTMLCSSSTYLEDECLARATION_MSBLOCKPROGRESSION}, + {DISPID_UNKNOWN} + }; + + dispex_info_add_interface(info, IHTMLCSSStyleDeclaration_tid, styledecl_hooks); + if(mode >= COMPAT_MODE_IE10) + dispex_info_add_interface(info, IHTMLCSSStyleDeclaration2_tid, NULL); +} + static const dispex_static_data_vtbl_t CSSStyleDeclaration_dispex_vtbl = { CSSSTYLE_DISPEX_VTBL_ENTRIES, .query_interface = CSSStyle_query_interface, @@ -9777,7 +9865,7 @@ dispex_static_data_t CSSStyleDeclaration_dispex = { .id = PROT_CSSStyleDeclaration, .vtbl = &CSSStyleDeclaration_dispex_vtbl, .disp_tid = DispHTMLW3CComputedStyle_tid, - .init_info = CSSStyle_init_dispex_info, + .init_info = CSSStyleDeclaration_init_dispex_info, };
HRESULT create_computed_style(nsIDOMCSSStyleDeclaration *nsstyle, DispatchEx *owner, IHTMLCSSStyleDeclaration **p) diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h index b37daf95fa6..3ce9d9d1a4a 100644 --- a/dlls/mshtml/htmlstyle.h +++ b/dlls/mshtml/htmlstyle.h @@ -34,6 +34,7 @@ struct HTMLStyle { IHTMLStyle4 IHTMLStyle4_iface; IHTMLStyle5 IHTMLStyle5_iface; IHTMLStyle6 IHTMLStyle6_iface; + IWineCSSProperties IWineCSSProperties_iface;
HTMLElement *elem; }; @@ -158,7 +159,7 @@ void CSSStyle_traverse(DispatchEx*,nsCycleCollectionTraversalCallback*); void CSSStyle_unlink(DispatchEx*); void CSSStyle_destructor(DispatchEx*); HRESULT CSSStyle_get_dispid(DispatchEx*,const WCHAR*,DWORD,DISPID*); -void CSSStyle_init_dispex_info(dispex_data_t *info, compat_mode_t mode); +void MSCSSProperties_init_dispex_info(dispex_data_t *info, compat_mode_t mode);
HRESULT get_style_property(CSSStyle*,styleid_t,BSTR*); HRESULT get_style_property_var(CSSStyle*,styleid_t,VARIANT*); diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index f3ba8f75c15..95f7a5f4941 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -304,6 +304,7 @@ typedef struct ScriptHost ScriptHost; XIID(IWineHTMLElementPrivate) \ XIID(IWineHTMLWindowPrivate) \ XIID(IWineHTMLWindowCompatPrivate) \ + XIID(IWineCSSProperties) \ XIID(IWinePageTransitionEvent) \ XIID(IWineXMLHttpRequestPrivate) \ XIID(IWineMSHTMLConsole) \ diff --git a/dlls/mshtml/mshtml_private_iface.idl b/dlls/mshtml/mshtml_private_iface.idl index 6fcf465e5be..bcaeb7f5f5c 100644 --- a/dlls/mshtml/mshtml_private_iface.idl +++ b/dlls/mshtml/mshtml_private_iface.idl @@ -204,6 +204,23 @@ interface IWineHTMLElementPrivate : IDispatch HRESULT classList([retval, out] IDispatch **class_list); }
+[ + odl, + oleautomation, + dual, + hidden, + uuid(465908fd-f394-489f-b7a3-4c00fbbe9eed) +] +interface IWineCSSProperties : IDispatch +{ + [id(DISPID_IHTMLSTYLE_SETATTRIBUTE)] + HRESULT setAttribute([in] BSTR name, [in] VARIANT value, [defaultvalue(1), in] LONG flags); + [id(DISPID_IHTMLSTYLE_GETATTRIBUTE)] + HRESULT getAttribute([in] BSTR name, [defaultvalue(0), in] LONG flags, [out, retval] VARIANT *p); + [id(DISPID_IHTMLSTYLE_REMOVEATTRIBUTE)] + HRESULT removeAttribute([in] BSTR name, [defaultvalue(1), in] LONG flags, [out, retval] VARIANT_BOOL *p); +} + [ odl, oleautomation, diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 8ff988ee4f4..18902e100a9 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -853,7 +853,7 @@ sync_test("style_props", function() {
var v = document.documentMode;
- test_exposed("removeAttribute", true, broken(true) ? v >= 9 : false /* todo_wine */, false); + test_exposed("removeAttribute", true, v >= 9, false); test_exposed("zIndex", true, true, true); test_exposed("z-index", true, true, true, true); test_exposed("filter", true, true, broken(true) ? v >= 10 : v >= 9 /* todo_wine */); @@ -877,7 +877,7 @@ sync_test("style_props", function() { todo_wine. ok(!r.length, "currentStyle has own props: " + r); r = Object.getOwnPropertyNames(computedStyle); - todo_wine. + todo_wine_if(v >= 9). ok(!r.length, "computedStyle has own props: " + r);
r = Object.getOwnPropertyDescriptor(style, "z-index"); @@ -3770,6 +3770,55 @@ sync_test("prototype props", function() {
check(CharacterData, [ "appendData", "data", "deleteData", "insertData", "length", "replaceData", "substringData" ]); check(Comment, [ "text" ]); + check(CSSStyleDeclaration, [ + ["alignContent",11], ["alignItems",11], ["alignSelf",11], "alignmentBaseline", ["animation",10], ["animationDelay",10], + ["animationDirection",10], ["animationDuration",10], ["animationFillMode",10], ["animationIterationCount",10], ["animationName",10], + ["animationPlayState",10], ["animationTimingFunction",10], ["backfaceVisibility",10], "background", "backgroundAttachment", + "backgroundClip", "backgroundColor", "backgroundImage", "backgroundOrigin", "backgroundPosition", "backgroundRepeat", "backgroundSize", + "baselineShift", "border", "borderBottom", "borderBottomColor", "borderBottomLeftRadius", "borderBottomRightRadius", "borderBottomStyle", + "borderBottomWidth", "borderCollapse", "borderColor", ["borderImage",11], ["borderImageOutset",11], ["borderImageRepeat",11], + ["borderImageSlice",11], ["borderImageSource",11], ["borderImageWidth",11], "borderLeft", "borderLeftColor", "borderLeftStyle", + "borderLeftWidth", "borderRadius", "borderRight", "borderRightColor", "borderRightStyle", "borderRightWidth", "borderSpacing", + "borderStyle", "borderTop", "borderTopColor", "borderTopLeftRadius", "borderTopRightRadius", "borderTopStyle", "borderTopWidth", + "borderWidth", "bottom", "boxShadow", "boxSizing", ["breakAfter",10], ["breakBefore",10], ["breakInside",10], "captionSide", "clear", + "clip", "clipPath", "clipRule", "color", ["colorInterpolationFilters",10], ["columnCount",10], ["columnFill",10], ["columnGap",10], + ["columnRule",10], ["columnRuleColor",10], ["columnRuleStyle",10], ["columnRuleWidth",10], ["columnSpan",10], ["columnWidth",10], + ["columns",10], "content", "counterIncrement", "counterReset", "cssFloat", "cssText", "cursor", "direction", "display", "dominantBaseline", + "emptyCells", ["enableBackground",10], "fill", "fillOpacity", "fillRule", ["filter",10], ["flex",11], ["flexBasis",11], ["flexDirection",11], + ["flexFlow",11], ["flexGrow",11], ["flexShrink",11], ["flexWrap",11], ["floodColor",10], ["floodOpacity",10], "font", "fontFamily", + ["fontFeatureSettings",10], "fontSize", "fontSizeAdjust", "fontStretch", "fontStyle", "fontVariant", "fontWeight", "getPropertyPriority", + "getPropertyValue", "glyphOrientationHorizontal", "glyphOrientationVertical", "height", "item", ["justifyContent",11], "kerning", "left", + "length", "letterSpacing", ["lightingColor",10], "lineHeight", "listStyle", "listStyleImage", "listStylePosition", "listStyleType", "margin", + "marginBottom", "marginLeft", "marginRight", "marginTop", "marker", "markerEnd", "markerMid", "markerStart", "mask", "maxHeight", "maxWidth", + "minHeight", "minWidth", ["msAnimation",10], ["msAnimationDelay",10], ["msAnimationDirection",10], ["msAnimationDuration",10], + ["msAnimationFillMode",10], ["msAnimationIterationCount",10], ["msAnimationName",10], ["msAnimationPlayState",10], ["msAnimationTimingFunction",10], + ["msBackfaceVisibility",10], ["msContentZoomChaining",10], ["msContentZoomLimit",10], ["msContentZoomLimitMax",10], ["msContentZoomLimitMin",10], + ["msContentZoomSnap",10], ["msContentZoomSnapPoints",10], ["msContentZoomSnapType",10], ["msContentZooming",10], ["msFlex",10], ["msFlexAlign",10], + ["msFlexDirection",10], ["msFlexFlow",10], ["msFlexItemAlign",10], ["msFlexLinePack",10], ["msFlexNegative",10], ["msFlexOrder",10], + ["msFlexPack",10], ["msFlexPositive",10], ["msFlexPreferredSize",10], ["msFlexWrap",10], ["msFlowFrom",10], ["msFlowInto",10], + ["msFontFeatureSettings",10], ["msGridColumn",10], ["msGridColumnAlign",10], ["msGridColumnSpan",10], ["msGridColumns",10], ["msGridRow",10], + ["msGridRowAlign",10], ["msGridRowSpan",10], ["msGridRows",10], ["msHighContrastAdjust",10], ["msHyphenateLimitChars",10], + ["msHyphenateLimitLines",10], ["msHyphenateLimitZone",10], ["msHyphens",10], ["msImeAlign",11], ["msOverflowStyle",10], ["msPerspective",10], + ["msPerspectiveOrigin",10], ["msScrollChaining",10], ["msScrollLimit",10], ["msScrollLimitXMax",10], ["msScrollLimitXMin",10], + ["msScrollLimitYMax",10], ["msScrollLimitYMin",10], ["msScrollRails",10], ["msScrollSnapPointsX",10], ["msScrollSnapPointsY",10], + ["msScrollSnapType",10], ["msScrollSnapX",10], ["msScrollSnapY",10], ["msScrollTranslation",10], ["msTextCombineHorizontal",11], + ["msTextSizeAdjust",11], ["msTouchAction",10], ["msTouchSelect",10], "msTransform", "msTransformOrigin", ["msTransformStyle",10], ["msTransition",10], + ["msTransitionDelay",10], ["msTransitionDuration",10], ["msTransitionProperty",10], ["msTransitionTimingFunction",10], ["msUserSelect",10], + ["msWrapFlow",10], ["msWrapMargin",10], ["msWrapThrough",10], "opacity", ["order",11], "orphans", "outline", "outlineColor", "outlineStyle", + "outlineWidth", "overflow", "overflowX", "overflowY", "padding", "paddingBottom", "paddingLeft", "paddingRight", "paddingTop", "pageBreakAfter", + "pageBreakBefore", "pageBreakInside", "parentRule", ["perspective",10], ["perspectiveOrigin",10], "pointerEvents", "position", "quotes", + "removeProperty", "right", "rubyAlign", "rubyOverhang", "rubyPosition", "setProperty", "stopColor", "stopOpacity", "stroke", "strokeDasharray", + "strokeDashoffset", "strokeLinecap", "strokeLinejoin", "strokeMiterlimit", "strokeOpacity", "strokeWidth", "tableLayout", "textAlign", "textAlignLast", + "textAnchor", "textDecoration", "textIndent", "textJustify", "textOverflow", ["textShadow",10], "textTransform", "textUnderlinePosition", "top", + ["touchAction",11], ["transform",10], ["transformOrigin",10], ["transformStyle",10], ["transition",10], ["transitionDelay",10], ["transitionDuration",10], + ["transitionProperty",10], ["transitionTimingFunction",10], "unicodeBidi", "verticalAlign", "visibility", "whiteSpace", "widows", "width", "wordBreak", + "wordSpacing", "wordWrap", "zIndex" + ], [ + ["alignContent",11], ["alignItems",11], ["alignSelf",11], ["borderImage",11], ["borderImageOutset",11], ["borderImageRepeat",11], ["borderImageSlice",11], + ["borderImageSource",11], ["borderImageWidth",11], "clipBottom", "clipLeft", "clipRight", "clipTop", ["filter",9,9], ["flex",11], ["flexBasis",11], ["flexDirection",11], + ["flexFlow",11], ["flexGrow",11], ["flexShrink",11], ["flexWrap",11], ["justifyContent",11], ["msImeAlign",11], ["msTextCombineHorizontal",11], + ["msTextSizeAdjust",11], ["order",11], ["touchAction",11] + ]); check(CSSStyleRule, [ "readOnly", "selectorText", "style" ]); check(CustomEvent, [ "detail", "initCustomEvent" ]); check(Document, [ @@ -3892,6 +3941,21 @@ sync_test("prototype props", function() { "initMouseEvent", "layerX", "layerY", "metaKey", "offsetX", "offsetY", "pageX", "pageY", "relatedTarget", "screenX", "screenY", "shiftKey", "toElement", "which", "x", "y" ]); + check(MSCSSProperties, [ + "accelerator", "backgroundPositionX", "backgroundPositionY", ["behavior",9,10], ["filter",9,9], "getAttribute", + "imeMode", "layoutFlow", "layoutGrid", "layoutGridChar", "layoutGridLine", "layoutGridMode", "layoutGridType", + "lineBreak", "msBlockProgression", "msInterpolationMode", "removeAttribute", "scrollbar3dLightColor", + "scrollbarArrowColor", "scrollbarBaseColor", "scrollbarDarkShadowColor", "scrollbarFaceColor", + "scrollbarHighlightColor", "scrollbarShadowColor", "scrollbarTrackColor", "setAttribute", "styleFloat", + "textAutospace", "textJustifyTrim", "textKashida", "textKashidaSpace", "writingMode", "zoom" + ], [ ["filter",9,9] ]); + check(MSCurrentStyleCSSProperties, [ "blockDirection", "clipBottom", "clipLeft", "clipRight", "clipTop", "hasLayout" ], + [ ["behavior",11], "clipBottom", "clipLeft", "clipRight", "clipTop"]); + check(MSStyleCSSProperties, [ + "pixelBottom", "pixelHeight", "pixelLeft", "pixelRight", "pixelTop", "pixelWidth", "posBottom", + "posHeight", "posLeft", "posRight", "posTop", "posWidth", "textDecorationBlink", "textDecorationLineThrough", + "textDecorationNone", "textDecorationOverline", "textDecorationUnderline" + ], [ ["behavior",11], "getExpression", "removeExpression", "setExpression", "toString" ]); check(Node, [ "ATTRIBUTE_NODE", "CDATA_SECTION_NODE", "COMMENT_NODE", "DOCUMENT_FRAGMENT_NODE", "DOCUMENT_NODE", "DOCUMENT_POSITION_CONTAINED_BY", "DOCUMENT_POSITION_CONTAINS", "DOCUMENT_POSITION_DISCONNECTED", diff --git a/dlls/mshtml/tests/dom.js b/dlls/mshtml/tests/dom.js index 5ee5a788c90..256cab60d7c 100644 --- a/dlls/mshtml/tests/dom.js +++ b/dlls/mshtml/tests/dom.js @@ -470,12 +470,35 @@ sync_test("style_properties", function() { try { current_style.zIndex = 1; ok(false, "expected exception"); - }catch(e) {} + }catch(e) { + todo_wine. + ok(e.name === "NoModificationAllowedError", "setting current_style.zIndex threw " + e.name); + }
try { computed_style.zIndex = 1; ok(false, "expected exception"); - }catch(e) {} + }catch(e) { + todo_wine. + ok(e.name === "NoModificationAllowedError", "setting computed_style.zIndex threw " + e.name); + } + + /* prop not found in any IHTMLCurrentStyle* interfaces, but exposed from common CSSStyleDeclarationPrototype */ + try { + current_style.perspective = 1; + ok(false, "expected exception"); + }catch(e) { + todo_wine. + ok(e.name === "NoModificationAllowedError", "setting current_style.perspective threw " + e.name); + } + + try { + computed_style.perspective = 1; + ok(false, "expected exception"); + }catch(e) { + todo_wine. + ok(e.name === "NoModificationAllowedError", "setting computed_style.perspective threw " + e.name); + }
elem = elem.nextSibling; computed_style = window.getComputedStyle(elem);
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlstyle.c | 84 +++++++++++++++++++------------ dlls/mshtml/tests/documentmode.js | 3 -- 2 files changed, 52 insertions(+), 35 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 91fc2befe20..764750c4823 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -109,6 +109,7 @@ static const WCHAR *overflow_values[] = { #define ATTR_REMOVE_COMMA 0x0010 #define ATTR_NO_NULL 0x0020 #define ATTR_COMPAT_IE10 0x0040 +#define ATTR_BUILTIN_NAME 0x0080
typedef struct { const WCHAR *name; @@ -134,7 +135,7 @@ static const style_tbl_entry_t style_tbl[] = { L"animation", DISPID_IHTMLCSSSTYLEDECLARATION2_ANIMATION, DISPID_UNKNOWN, - ATTR_COMPAT_IE10 + ATTR_COMPAT_IE10 | ATTR_BUILTIN_NAME, }, { L"animation-name", @@ -145,7 +146,8 @@ static const style_tbl_entry_t style_tbl[] = { { L"background", DISPID_IHTMLCSSSTYLEDECLARATION_BACKGROUND, - DISPID_A_BACKGROUND + DISPID_A_BACKGROUND, + ATTR_BUILTIN_NAME }, { L"background-attachment", @@ -200,7 +202,8 @@ static const style_tbl_entry_t style_tbl[] = { { L"border", DISPID_IHTMLCSSSTYLEDECLARATION_BORDER, - DISPID_A_BORDER + DISPID_A_BORDER, + ATTR_BUILTIN_NAME }, { L"border-bottom", @@ -326,7 +329,7 @@ static const style_tbl_entry_t style_tbl[] = { L"bottom", DISPID_IHTMLCSSSTYLEDECLARATION_BOTTOM, STDPROPID_XOBJ_BOTTOM, - ATTR_FIX_PX + ATTR_FIX_PX | ATTR_BUILTIN_NAME, }, { L"box-sizing", @@ -336,19 +339,20 @@ static const style_tbl_entry_t style_tbl[] = { { L"clear", DISPID_IHTMLCSSSTYLEDECLARATION_CLEAR, - DISPID_A_CLEAR + DISPID_A_CLEAR, + ATTR_BUILTIN_NAME }, { L"clip", DISPID_IHTMLCSSSTYLEDECLARATION_CLIP, DISPID_A_CLIP, - ATTR_REMOVE_COMMA + ATTR_REMOVE_COMMA | ATTR_BUILTIN_NAME }, { L"color", DISPID_IHTMLCSSSTYLEDECLARATION_COLOR, DISPID_A_COLOR, - ATTR_HEX_INT + ATTR_HEX_INT | ATTR_BUILTIN_NAME }, { L"column-count", @@ -407,22 +411,26 @@ static const style_tbl_entry_t style_tbl[] = { { L"cursor", DISPID_IHTMLCSSSTYLEDECLARATION_CURSOR, - DISPID_A_CURSOR + DISPID_A_CURSOR, + ATTR_BUILTIN_NAME }, { L"direction", DISPID_IHTMLCSSSTYLEDECLARATION_DIRECTION, - DISPID_A_DIRECTION + DISPID_A_DIRECTION, + ATTR_BUILTIN_NAME }, { L"display", DISPID_IHTMLCSSSTYLEDECLARATION_DISPLAY, - DISPID_A_DISPLAY + DISPID_A_DISPLAY, + ATTR_BUILTIN_NAME }, { L"filter", DISPID_IHTMLCSSSTYLEDECLARATION_FILTER, - DISPID_A_FILTER + DISPID_A_FILTER, + ATTR_BUILTIN_NAME }, { L"float", @@ -462,12 +470,13 @@ static const style_tbl_entry_t style_tbl[] = { L"height", DISPID_IHTMLCSSSTYLEDECLARATION_HEIGHT, STDPROPID_XOBJ_HEIGHT, - ATTR_FIX_PX + ATTR_FIX_PX | ATTR_BUILTIN_NAME }, { L"left", DISPID_IHTMLCSSSTYLEDECLARATION_LEFT, - STDPROPID_XOBJ_LEFT + STDPROPID_XOBJ_LEFT, + ATTR_BUILTIN_NAME }, { L"letter-spacing", @@ -497,7 +506,8 @@ static const style_tbl_entry_t style_tbl[] = { { L"margin", DISPID_IHTMLCSSSTYLEDECLARATION_MARGIN, - DISPID_A_MARGIN + DISPID_A_MARGIN, + ATTR_BUILTIN_NAME }, { L"margin-bottom", @@ -549,19 +559,21 @@ static const style_tbl_entry_t style_tbl[] = { { L"opacity", DISPID_IHTMLCSSSTYLEDECLARATION_OPACITY, - DISPID_UNKNOWN + DISPID_UNKNOWN, + ATTR_BUILTIN_NAME }, { L"outline", DISPID_IHTMLCSSSTYLEDECLARATION_OUTLINE, DISPID_A_OUTLINE, - ATTR_NO_NULL + ATTR_NO_NULL | ATTR_BUILTIN_NAME }, { L"overflow", DISPID_IHTMLCSSSTYLEDECLARATION_OVERFLOW, DISPID_A_OVERFLOW, - 0, overflow_values + ATTR_BUILTIN_NAME, + overflow_values }, { L"overflow-x", @@ -576,7 +588,8 @@ static const style_tbl_entry_t style_tbl[] = { { L"padding", DISPID_IHTMLCSSSTYLEDECLARATION_PADDING, - DISPID_A_PADDING + DISPID_A_PADDING, + ATTR_BUILTIN_NAME }, { L"padding-bottom", @@ -615,17 +628,20 @@ static const style_tbl_entry_t style_tbl[] = { { L"perspective", DISPID_IHTMLCSSSTYLEDECLARATION2_PERSPECTIVE, - DISPID_UNKNOWN + DISPID_UNKNOWN, + ATTR_BUILTIN_NAME }, { L"position", DISPID_IHTMLCSSSTYLEDECLARATION_POSITION, - DISPID_A_POSITION + DISPID_A_POSITION, + ATTR_BUILTIN_NAME }, { L"right", DISPID_IHTMLCSSSTYLEDECLARATION_RIGHT, - STDPROPID_XOBJ_RIGHT + STDPROPID_XOBJ_RIGHT, + ATTR_BUILTIN_NAME }, { L"table-layout", @@ -657,19 +673,20 @@ static const style_tbl_entry_t style_tbl[] = { { L"top", DISPID_IHTMLCSSSTYLEDECLARATION_TOP, - STDPROPID_XOBJ_TOP + STDPROPID_XOBJ_TOP, + ATTR_BUILTIN_NAME }, { L"transform", DISPID_IHTMLCSSSTYLEDECLARATION2_TRANSFORM, DISPID_UNKNOWN, - ATTR_COMPAT_IE10 + ATTR_COMPAT_IE10 | ATTR_BUILTIN_NAME }, { L"transition", DISPID_IHTMLCSSSTYLEDECLARATION2_TRANSITION, DISPID_UNKNOWN, - ATTR_COMPAT_IE10 + ATTR_COMPAT_IE10 | ATTR_BUILTIN_NAME }, { L"vertical-align", @@ -680,7 +697,8 @@ static const style_tbl_entry_t style_tbl[] = { { L"visibility", DISPID_IHTMLCSSSTYLEDECLARATION_VISIBILITY, - DISPID_A_VISIBILITY + DISPID_A_VISIBILITY, + ATTR_BUILTIN_NAME }, { L"white-space", @@ -691,7 +709,7 @@ static const style_tbl_entry_t style_tbl[] = { L"width", DISPID_IHTMLCSSSTYLEDECLARATION_WIDTH, STDPROPID_XOBJ_WIDTH, - ATTR_FIX_PX + ATTR_FIX_PX | ATTR_BUILTIN_NAME }, { L"word-spacing", @@ -725,7 +743,7 @@ static const WCHAR *get_style_prop_nsname(const style_tbl_entry_t *style_entry, return style_entry ? get_style_nsname(style_entry) : orig_name; }
-static const style_tbl_entry_t *lookup_style_tbl(CSSStyle *style, const WCHAR *name) +static const style_tbl_entry_t *lookup_style_tbl(CSSStyle *style, const WCHAR *name, unsigned exclude_mask) { int c, i, min = 0, max = ARRAY_SIZE(style_tbl)-1;
@@ -734,6 +752,8 @@ static const style_tbl_entry_t *lookup_style_tbl(CSSStyle *style, const WCHAR *n
c = wcscmp(style_tbl[i].name, name); if(!c) { + if(style_tbl[i].flags & exclude_mask) + return NULL; if((style_tbl[i].flags & ATTR_COMPAT_IE10) && dispex_compat_mode(&style->dispex) < COMPAT_MODE_IE10) return NULL; return style_tbl+i; @@ -2934,7 +2954,7 @@ static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttri
TRACE("(%p)->(%s %08lx %p)\n", This, debugstr_w(strAttributeName), lFlags, pfSuccess);
- style_entry = lookup_style_tbl(&This->css_style, strAttributeName); + style_entry = lookup_style_tbl(&This->css_style, strAttributeName, 0); if(!style_entry) { DWORD fdex = (lFlags & 1) ? fdexNameCaseSensitive : fdexNameCaseInsensitive; compat_mode_t compat_mode = dispex_compat_mode(&This->css_style.dispex); @@ -4506,7 +4526,7 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_getPropertyValue(IHTMLCSSStyleDecl
TRACE("(%p)->(%s %p)\n", This, debugstr_w(name), value);
- style_entry = lookup_style_tbl(This, name); + style_entry = lookup_style_tbl(This, name, 0); 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); @@ -4530,7 +4550,7 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_removeProperty(IHTMLCSSStyleDeclar
TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrPropertyName), pbstrPropertyValue);
- style_entry = lookup_style_tbl(This, bstrPropertyName); + style_entry = lookup_style_tbl(This, bstrPropertyName, 0); 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); @@ -4548,7 +4568,7 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_setProperty(IHTMLCSSStyleDeclarati
TRACE("(%p)->(%s %s %s)\n", This, debugstr_w(name), debugstr_variant(value), debugstr_variant(priority));
- style_entry = lookup_style_tbl(This, name); + style_entry = lookup_style_tbl(This, name, 0); hres = var_to_styleval(This, value, style_entry, &value_str); if(FAILED(hres)) return hres; @@ -9626,7 +9646,7 @@ HRESULT CSSStyle_get_dispid(DispatchEx *dispex, const WCHAR *name, DWORD flags, CSSStyle *This = impl_from_DispatchEx(dispex); const style_tbl_entry_t *style_entry;
- style_entry = lookup_style_tbl(This, name); + style_entry = lookup_style_tbl(This, name, ATTR_BUILTIN_NAME); if(style_entry) { DISPID id = dispex_compat_mode(dispex) >= COMPAT_MODE_IE9 ? style_entry->dispid : style_entry->compat_dispid; diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 18902e100a9..c07444c8e56 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -871,13 +871,10 @@ sync_test("style_props", function() {
if(Object.getOwnPropertyNames) { r = Object.getOwnPropertyNames(style); - todo_wine. ok(!r.length, "style has own props: " + r); r = Object.getOwnPropertyNames(currentStyle); - todo_wine. ok(!r.length, "currentStyle has own props: " + r); r = Object.getOwnPropertyNames(computedStyle); - todo_wine_if(v >= 9). ok(!r.length, "computedStyle has own props: " + r);
r = Object.getOwnPropertyDescriptor(style, "z-index");
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlstyle.c | 6 +++++- dlls/mshtml/tests/documentmode.js | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 764750c4823..10c0ca3a604 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -9837,6 +9837,9 @@ HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret) static void CSSStyleDeclaration_init_dispex_info(dispex_data_t *info, compat_mode_t mode) { static const dispex_hook_t styledecl_hooks[] = { + {DISPID_IHTMLCSSSTYLEDECLARATION_FILTER}, + + /* IE10+ */ {DISPID_IHTMLCSSSTYLEDECLARATION_BACKGROUNDPOSITIONX}, {DISPID_IHTMLCSSSTYLEDECLARATION_BACKGROUNDPOSITIONY}, {DISPID_IHTMLCSSSTYLEDECLARATION_STYLEFLOAT}, @@ -9868,8 +9871,9 @@ static void CSSStyleDeclaration_init_dispex_info(dispex_data_t *info, compat_mod {DISPID_IHTMLCSSSTYLEDECLARATION_MSBLOCKPROGRESSION}, {DISPID_UNKNOWN} }; + const dispex_hook_t *const styledecl_ie10_hooks = styledecl_hooks + 1;
- dispex_info_add_interface(info, IHTMLCSSStyleDeclaration_tid, styledecl_hooks); + dispex_info_add_interface(info, IHTMLCSSStyleDeclaration_tid, mode >= COMPAT_MODE_IE10 ? styledecl_ie10_hooks : styledecl_hooks); if(mode >= COMPAT_MODE_IE10) dispex_info_add_interface(info, IHTMLCSSStyleDeclaration2_tid, NULL); } diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index c07444c8e56..715baa36f75 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -856,7 +856,7 @@ sync_test("style_props", function() { test_exposed("removeAttribute", true, v >= 9, false); test_exposed("zIndex", true, true, true); test_exposed("z-index", true, true, true, true); - test_exposed("filter", true, true, broken(true) ? v >= 10 : v >= 9 /* todo_wine */); + test_exposed("filter", true, true, v >= 10); test_exposed("pixelTop", true, false, false); test_exposed("float", true, true, true, true); test_exposed("css-float", false, false, false); @@ -3812,7 +3812,7 @@ sync_test("prototype props", function() { "wordSpacing", "wordWrap", "zIndex" ], [ ["alignContent",11], ["alignItems",11], ["alignSelf",11], ["borderImage",11], ["borderImageOutset",11], ["borderImageRepeat",11], ["borderImageSlice",11], - ["borderImageSource",11], ["borderImageWidth",11], "clipBottom", "clipLeft", "clipRight", "clipTop", ["filter",9,9], ["flex",11], ["flexBasis",11], ["flexDirection",11], + ["borderImageSource",11], ["borderImageWidth",11], "clipBottom", "clipLeft", "clipRight", "clipTop", ["flex",11], ["flexBasis",11], ["flexDirection",11], ["flexFlow",11], ["flexGrow",11], ["flexShrink",11], ["flexWrap",11], ["justifyContent",11], ["msImeAlign",11], ["msTextCombineHorizontal",11], ["msTextSizeAdjust",11], ["order",11], ["touchAction",11] ]); @@ -3945,7 +3945,7 @@ sync_test("prototype props", function() { "scrollbarArrowColor", "scrollbarBaseColor", "scrollbarDarkShadowColor", "scrollbarFaceColor", "scrollbarHighlightColor", "scrollbarShadowColor", "scrollbarTrackColor", "setAttribute", "styleFloat", "textAutospace", "textJustifyTrim", "textKashida", "textKashidaSpace", "writingMode", "zoom" - ], [ ["filter",9,9] ]); + ]); check(MSCurrentStyleCSSProperties, [ "blockDirection", "clipBottom", "clipLeft", "clipRight", "clipTop", "hasLayout" ], [ ["behavior",11], "clipBottom", "clipLeft", "clipRight", "clipTop"]); check(MSStyleCSSProperties, [
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlcurstyle.c | 14 ++++++++++++-- dlls/mshtml/htmlstyle.c | 13 +++++++++++-- dlls/mshtml/tests/documentmode.js | 4 ++-- 3 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/dlls/mshtml/htmlcurstyle.c b/dlls/mshtml/htmlcurstyle.c index 0d80381b986..ffccceb2457 100644 --- a/dlls/mshtml/htmlcurstyle.c +++ b/dlls/mshtml/htmlcurstyle.c @@ -24,6 +24,7 @@ #include "winbase.h" #include "winuser.h" #include "ole2.h" +#include "mshtmdid.h"
#include "mshtml_private.h" #include "htmlstyle.h" @@ -1170,6 +1171,16 @@ static void HTMLCurrentStyle_unlink(DispatchEx *dispex) } }
+static void MSCurrentStyleCSSProperties_init_dispex_info(dispex_data_t *info, compat_mode_t mode) +{ + static const dispex_hook_t currentstyle_ie11_hooks[] = { + {DISPID_IHTMLCURRENTSTYLE_BEHAVIOR}, + {DISPID_UNKNOWN} + }; + MSCSSProperties_init_dispex_info(info, mode); + dispex_info_add_interface(info, IHTMLCurrentStyle_tid, mode >= COMPAT_MODE_IE11 ? currentstyle_ie11_hooks : NULL); +} + static const dispex_static_data_vtbl_t MSCurrentStyleCSSProperties_dispex_vtbl = { CSSSTYLE_DISPEX_VTBL_ENTRIES, .query_interface = HTMLCurrentStyle_query_interface, @@ -1178,7 +1189,6 @@ static const dispex_static_data_vtbl_t MSCurrentStyleCSSProperties_dispex_vtbl = };
static const tid_t MSCurrentStyleCSSProperties_iface_tids[] = { - IHTMLCurrentStyle_tid, IHTMLCurrentStyle2_tid, IHTMLCurrentStyle3_tid, IHTMLCurrentStyle4_tid, @@ -1190,7 +1200,7 @@ dispex_static_data_t MSCurrentStyleCSSProperties_dispex = { .vtbl = &MSCurrentStyleCSSProperties_dispex_vtbl, .disp_tid = DispHTMLCurrentStyle_tid, .iface_tids = MSCurrentStyleCSSProperties_iface_tids, - .init_info = MSCSSProperties_init_dispex_info, + .init_info = MSCurrentStyleCSSProperties_init_dispex_info, };
HRESULT HTMLCurrentStyle_Create(HTMLElement *elem, IHTMLCurrentStyle **p) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 10c0ca3a604..d59757c62ac 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -9727,6 +9727,16 @@ dispex_static_data_t MSCSSProperties_dispex = { .init_info = MSCSSProperties_init_dispex_info, };
+static void MSStyleCSSProperties_init_dispex_info(dispex_data_t *info, compat_mode_t mode) +{ + static const dispex_hook_t style2_ie11_hooks[] = { + {DISPID_IHTMLSTYLE2_BEHAVIOR}, + {DISPID_UNKNOWN} + }; + MSCSSProperties_init_dispex_info(info, mode); + dispex_info_add_interface(info, IHTMLStyle2_tid, mode >= COMPAT_MODE_IE11 ? style2_ie11_hooks : NULL); +} + static const dispex_static_data_vtbl_t MSStyleCSSProperties_dispex_vtbl = { CSSSTYLE_DISPEX_VTBL_ENTRIES, .query_interface = HTMLStyle_query_interface, @@ -9739,7 +9749,6 @@ static const tid_t MSStyleCSSProperties_iface_tids[] = { IHTMLStyle5_tid, IHTMLStyle4_tid, IHTMLStyle3_tid, - IHTMLStyle2_tid, IHTMLStyle_tid, 0 }; @@ -9749,7 +9758,7 @@ dispex_static_data_t MSStyleCSSProperties_dispex = { .vtbl = &MSStyleCSSProperties_dispex_vtbl, .disp_tid = DispHTMLStyle_tid, .iface_tids = MSStyleCSSProperties_iface_tids, - .init_info = MSCSSProperties_init_dispex_info, + .init_info = MSStyleCSSProperties_init_dispex_info, };
static HRESULT get_style_from_elem(HTMLElement *elem, nsIDOMCSSStyleDeclaration **ret) diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 715baa36f75..37fcc95109a 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -3947,12 +3947,12 @@ sync_test("prototype props", function() { "textAutospace", "textJustifyTrim", "textKashida", "textKashidaSpace", "writingMode", "zoom" ]); check(MSCurrentStyleCSSProperties, [ "blockDirection", "clipBottom", "clipLeft", "clipRight", "clipTop", "hasLayout" ], - [ ["behavior",11], "clipBottom", "clipLeft", "clipRight", "clipTop"]); + [ "clipBottom", "clipLeft", "clipRight", "clipTop"]); check(MSStyleCSSProperties, [ "pixelBottom", "pixelHeight", "pixelLeft", "pixelRight", "pixelTop", "pixelWidth", "posBottom", "posHeight", "posLeft", "posRight", "posTop", "posWidth", "textDecorationBlink", "textDecorationLineThrough", "textDecorationNone", "textDecorationOverline", "textDecorationUnderline" - ], [ ["behavior",11], "getExpression", "removeExpression", "setExpression", "toString" ]); + ], [ "getExpression", "removeExpression", "setExpression", "toString" ]); check(Node, [ "ATTRIBUTE_NODE", "CDATA_SECTION_NODE", "COMMENT_NODE", "DOCUMENT_FRAGMENT_NODE", "DOCUMENT_NODE", "DOCUMENT_POSITION_CONTAINED_BY", "DOCUMENT_POSITION_CONTAINS", "DOCUMENT_POSITION_DISCONNECTED",
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlstyle.c | 13 ++++++++++++- dlls/mshtml/tests/documentmode.js | 8 +++----- 2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index d59757c62ac..af26fbf8426 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -9711,10 +9711,17 @@ void MSCSSProperties_init_dispex_info(dispex_data_t *info, compat_mode_t mode) { static const dispex_hook_t styledecl_ie11_hooks[] = { {DISPID_IHTMLCSSSTYLEDECLARATION_BEHAVIOR}, + + /* IE10 and below */ + {DISPID_IHTMLCSSSTYLEDECLARATION_CLIPTOP}, + {DISPID_IHTMLCSSSTYLEDECLARATION_CLIPRIGHT}, + {DISPID_IHTMLCSSSTYLEDECLARATION_CLIPBOTTOM}, + {DISPID_IHTMLCSSSTYLEDECLARATION_CLIPLEFT}, {DISPID_UNKNOWN} }; + const dispex_hook_t *const styledecl_hooks = styledecl_ie11_hooks + 1; if(mode >= COMPAT_MODE_IE9) { - dispex_info_add_interface(info, IHTMLCSSStyleDeclaration_tid, mode >= COMPAT_MODE_IE11 ? styledecl_ie11_hooks : NULL); + dispex_info_add_interface(info, IHTMLCSSStyleDeclaration_tid, mode >= COMPAT_MODE_IE11 ? styledecl_ie11_hooks : styledecl_hooks); dispex_info_add_interface(info, IWineCSSProperties_tid, NULL); } if(mode >= COMPAT_MODE_IE10) @@ -9878,6 +9885,10 @@ static void CSSStyleDeclaration_init_dispex_info(dispex_data_t *info, compat_mod {DISPID_IHTMLCSSSTYLEDECLARATION_TEXTKASHIDASPACE}, {DISPID_IHTMLCSSSTYLEDECLARATION_MSINTERPOLATIONMODE}, {DISPID_IHTMLCSSSTYLEDECLARATION_MSBLOCKPROGRESSION}, + {DISPID_IHTMLCSSSTYLEDECLARATION_CLIPTOP}, + {DISPID_IHTMLCSSSTYLEDECLARATION_CLIPRIGHT}, + {DISPID_IHTMLCSSSTYLEDECLARATION_CLIPBOTTOM}, + {DISPID_IHTMLCSSSTYLEDECLARATION_CLIPLEFT}, {DISPID_UNKNOWN} }; const dispex_hook_t *const styledecl_ie10_hooks = styledecl_hooks + 1; diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 37fcc95109a..efc582a6d6d 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -3812,9 +3812,8 @@ sync_test("prototype props", function() { "wordSpacing", "wordWrap", "zIndex" ], [ ["alignContent",11], ["alignItems",11], ["alignSelf",11], ["borderImage",11], ["borderImageOutset",11], ["borderImageRepeat",11], ["borderImageSlice",11], - ["borderImageSource",11], ["borderImageWidth",11], "clipBottom", "clipLeft", "clipRight", "clipTop", ["flex",11], ["flexBasis",11], ["flexDirection",11], - ["flexFlow",11], ["flexGrow",11], ["flexShrink",11], ["flexWrap",11], ["justifyContent",11], ["msImeAlign",11], ["msTextCombineHorizontal",11], - ["msTextSizeAdjust",11], ["order",11], ["touchAction",11] + ["borderImageSource",11], ["borderImageWidth",11], ["flex",11], ["flexBasis",11], ["flexDirection",11], ["flexFlow",11], ["flexGrow",11], ["flexShrink",11], + ["flexWrap",11], ["justifyContent",11], ["msImeAlign",11], ["msTextCombineHorizontal",11], ["msTextSizeAdjust",11], ["order",11], ["touchAction",11] ]); check(CSSStyleRule, [ "readOnly", "selectorText", "style" ]); check(CustomEvent, [ "detail", "initCustomEvent" ]); @@ -3946,8 +3945,7 @@ sync_test("prototype props", function() { "scrollbarHighlightColor", "scrollbarShadowColor", "scrollbarTrackColor", "setAttribute", "styleFloat", "textAutospace", "textJustifyTrim", "textKashida", "textKashidaSpace", "writingMode", "zoom" ]); - check(MSCurrentStyleCSSProperties, [ "blockDirection", "clipBottom", "clipLeft", "clipRight", "clipTop", "hasLayout" ], - [ "clipBottom", "clipLeft", "clipRight", "clipTop"]); + check(MSCurrentStyleCSSProperties, [ "blockDirection", "clipBottom", "clipLeft", "clipRight", "clipTop", "hasLayout" ]); check(MSStyleCSSProperties, [ "pixelBottom", "pixelHeight", "pixelLeft", "pixelRight", "pixelTop", "pixelWidth", "posBottom", "posHeight", "posLeft", "posRight", "posTop", "posWidth", "textDecorationBlink", "textDecorationLineThrough",
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlstyle.c | 10 +++++++++- dlls/mshtml/tests/documentmode.js | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index af26fbf8426..f032eb5791f 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -9738,10 +9738,18 @@ static void MSStyleCSSProperties_init_dispex_info(dispex_data_t *info, compat_mo { static const dispex_hook_t style2_ie11_hooks[] = { {DISPID_IHTMLSTYLE2_BEHAVIOR}, + + /* IE9+ */ + {DISPID_IHTMLSTYLE2_SETEXPRESSION}, + {DISPID_IHTMLSTYLE2_GETEXPRESSION}, + {DISPID_IHTMLSTYLE2_REMOVEEXPRESSION}, {DISPID_UNKNOWN} }; + const dispex_hook_t *const style2_ie9_hooks = style2_ie11_hooks + 1; + MSCSSProperties_init_dispex_info(info, mode); - dispex_info_add_interface(info, IHTMLStyle2_tid, mode >= COMPAT_MODE_IE11 ? style2_ie11_hooks : NULL); + dispex_info_add_interface(info, IHTMLStyle2_tid, mode >= COMPAT_MODE_IE11 ? style2_ie11_hooks : + mode >= COMPAT_MODE_IE9 ? style2_ie9_hooks : NULL); }
static const dispex_static_data_vtbl_t MSStyleCSSProperties_dispex_vtbl = { diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index efc582a6d6d..479ad441713 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -854,6 +854,7 @@ sync_test("style_props", function() { var v = document.documentMode;
test_exposed("removeAttribute", true, v >= 9, false); + test_exposed("setExpression", v < 9, false, false); test_exposed("zIndex", true, true, true); test_exposed("z-index", true, true, true, true); test_exposed("filter", true, true, v >= 10); @@ -3950,7 +3951,7 @@ sync_test("prototype props", function() { "pixelBottom", "pixelHeight", "pixelLeft", "pixelRight", "pixelTop", "pixelWidth", "posBottom", "posHeight", "posLeft", "posRight", "posTop", "posWidth", "textDecorationBlink", "textDecorationLineThrough", "textDecorationNone", "textDecorationOverline", "textDecorationUnderline" - ], [ "getExpression", "removeExpression", "setExpression", "toString" ]); + ], [ "toString" ]); check(Node, [ "ATTRIBUTE_NODE", "CDATA_SECTION_NODE", "COMMENT_NODE", "DOCUMENT_FRAGMENT_NODE", "DOCUMENT_NODE", "DOCUMENT_POSITION_CONTAINED_BY", "DOCUMENT_POSITION_CONTAINS", "DOCUMENT_POSITION_DISCONNECTED",
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlstyle.c | 6 +++++- dlls/mshtml/tests/documentmode.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index f032eb5791f..36d685bf3d1 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -9736,6 +9736,10 @@ dispex_static_data_t MSCSSProperties_dispex = {
static void MSStyleCSSProperties_init_dispex_info(dispex_data_t *info, compat_mode_t mode) { + static const dispex_hook_t style_ie9_hooks[] = { + {DISPID_IHTMLSTYLE_TOSTRING}, + {DISPID_UNKNOWN} + }; static const dispex_hook_t style2_ie11_hooks[] = { {DISPID_IHTMLSTYLE2_BEHAVIOR},
@@ -9750,6 +9754,7 @@ static void MSStyleCSSProperties_init_dispex_info(dispex_data_t *info, compat_mo MSCSSProperties_init_dispex_info(info, mode); dispex_info_add_interface(info, IHTMLStyle2_tid, mode >= COMPAT_MODE_IE11 ? style2_ie11_hooks : mode >= COMPAT_MODE_IE9 ? style2_ie9_hooks : NULL); + dispex_info_add_interface(info, IHTMLStyle_tid, mode >= COMPAT_MODE_IE9 ? style_ie9_hooks : NULL); }
static const dispex_static_data_vtbl_t MSStyleCSSProperties_dispex_vtbl = { @@ -9764,7 +9769,6 @@ static const tid_t MSStyleCSSProperties_iface_tids[] = { IHTMLStyle5_tid, IHTMLStyle4_tid, IHTMLStyle3_tid, - IHTMLStyle_tid, 0 }; dispex_static_data_t MSStyleCSSProperties_dispex = { diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 479ad441713..9cbccc922d8 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -3951,7 +3951,7 @@ sync_test("prototype props", function() { "pixelBottom", "pixelHeight", "pixelLeft", "pixelRight", "pixelTop", "pixelWidth", "posBottom", "posHeight", "posLeft", "posRight", "posTop", "posWidth", "textDecorationBlink", "textDecorationLineThrough", "textDecorationNone", "textDecorationOverline", "textDecorationUnderline" - ], [ "toString" ]); + ]); check(Node, [ "ATTRIBUTE_NODE", "CDATA_SECTION_NODE", "COMMENT_NODE", "DOCUMENT_FRAGMENT_NODE", "DOCUMENT_NODE", "DOCUMENT_POSITION_CONTAINED_BY", "DOCUMENT_POSITION_CONTAINS", "DOCUMENT_POSITION_DISCONNECTED",
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlstylesheet.c | 23 ++++++++++++++++++++++- dlls/mshtml/tests/documentmode.js | 5 +++++ 2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/dlls/mshtml/htmlstylesheet.c b/dlls/mshtml/htmlstylesheet.c index 277b2ea04d1..4b9cc3f56a6 100644 --- a/dlls/mshtml/htmlstylesheet.c +++ b/dlls/mshtml/htmlstylesheet.c @@ -24,6 +24,7 @@ #include "winbase.h" #include "winuser.h" #include "ole2.h" +#include "mshtmdid.h"
#include "wine/debug.h"
@@ -1199,6 +1200,25 @@ static void HTMLStyleSheet_destructor(DispatchEx *dispex) free(This); }
+static void StyleSheet_init_dispex_info(dispex_data_t *info, compat_mode_t mode) +{ + static const DISPID stylesheet_dispids[] = { + DISPID_IHTMLSTYLESHEET_PARENTSTYLESHEET, + DISPID_IHTMLSTYLESHEET_DISABLED, + DISPID_UNKNOWN + }; + static const DISPID stylesheet4_dispids[] = { + DISPID_IHTMLSTYLESHEET4_IE9_TYPE, + DISPID_IHTMLSTYLESHEET4_IE9_HREF, + DISPID_IHTMLSTYLESHEET4_IE9_TITLE, + DISPID_IHTMLSTYLESHEET4_OWNERNODE, + DISPID_IHTMLSTYLESHEET4_IE9_MEDIA, + DISPID_UNKNOWN + }; + dispex_info_add_dispids(info, IHTMLStyleSheet4_tid, stylesheet4_dispids); + dispex_info_add_dispids(info, IHTMLStyleSheet_tid, stylesheet_dispids); +} + static void HTMLStyleSheet_init_dispex_info(dispex_data_t *info, compat_mode_t mode) { if(mode >= COMPAT_MODE_IE9) @@ -1206,7 +1226,8 @@ static void HTMLStyleSheet_init_dispex_info(dispex_data_t *info, compat_mode_t m }
dispex_static_data_t StyleSheet_dispex = { - .id = PROT_StyleSheet, + .id = PROT_StyleSheet, + .init_info = StyleSheet_init_dispex_info, };
static const dispex_static_data_vtbl_t CSSStyleSheet_dispex_vtbl = { diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 9cbccc922d8..164f5e2bce4 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -3816,6 +3816,10 @@ sync_test("prototype props", function() { ["borderImageSource",11], ["borderImageWidth",11], ["flex",11], ["flexBasis",11], ["flexDirection",11], ["flexFlow",11], ["flexGrow",11], ["flexShrink",11], ["flexWrap",11], ["justifyContent",11], ["msImeAlign",11], ["msTextCombineHorizontal",11], ["msTextSizeAdjust",11], ["order",11], ["touchAction",11] ]); + check(CSSStyleSheet, [ + "addImport", "addPageRule", "addRule", "cssRules", "cssText", "deleteRule", "href", "id", "imports", "insertRule", + "isAlternate", "isPrefAlternate", "ownerRule", "owningElement", "pages", "readOnly", "removeImport", "removeRule", "rules" + ], [ "addPageRule", "href", "isAlternate", "isPrefAlternate", "pages" ]); check(CSSStyleRule, [ "readOnly", "selectorText", "style" ]); check(CustomEvent, [ "detail", "initCustomEvent" ]); check(Document, [ @@ -3974,6 +3978,7 @@ sync_test("prototype props", function() { if(v >= 10) check(ProgressEvent, [ "initProgressEvent", "lengthComputable", "loaded", "total" ]); check(StorageEvent, [ "initStorageEvent", "key", "newValue", "oldValue", "storageArea", "url" ]); + check(StyleSheet, [ "disabled", "href", "media", "ownerNode", "parentStyleSheet", "title", "type" ]); check(Text, [ "removeNode", "replaceNode", "replaceWholeText", "splitText", "swapNode", "wholeText" ], [ "replaceWholeText", "wholeText" ]); check(UIEvent, [ "detail", "initUIEvent", "view" ], null, [ "deviceSessionId" ]); });
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlelem.c | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 3d586db02d2..fcd8c969a01 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -6793,11 +6793,6 @@ void HTMLElement_init_dispex_info(dispex_data_t *info, compat_mode_t mode) dispex_info_add_interface(info, IHTMLUniqueName_tid, NULL); }
-const DISPID HTMLElement_toString_dispids[] = { - DISPID_IHTMLELEMENT_TOSTRING, - DISPID_UNKNOWN -}; - static const event_target_vtbl_t HTMLElement_event_target_vtbl = { { HTMLELEMENT_DISPEX_VTBL_ENTRIES,
On Wed Dec 4 17:07:43 2024 +0000, Gabriel Ivăncescu wrote:
changed this line in [version 3 of the diff](/wine/wine/-/merge_requests/6952/diffs?diff_id=147126&start_sha=e0b53a64b0c0b16d68ab50338771663d32d3d87b#eea5c25b1beb01ccf3a269f4fc7c0b1af7b4d26f_730_755)
It's not great, but I can live with it for now. And the split was possible after all ;)
This merge request was approved by Jacek Caban.