From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/htmlstylesheet.c | 23 ++++++++++++++--------- dlls/mshtml/mshtml_private.h | 2 ++ dlls/mshtml/tests/documentmode.js | 5 +++++ 3 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/dlls/mshtml/htmlstylesheet.c b/dlls/mshtml/htmlstylesheet.c index fa674f08ccf..c8928f39a3c 100644 --- a/dlls/mshtml/htmlstylesheet.c +++ b/dlls/mshtml/htmlstylesheet.c @@ -1200,23 +1200,28 @@ static void HTMLStyleSheet_init_dispex_info(dispex_data_t *info, compat_mode_t m dispex_info_add_interface(info, IHTMLStyleSheet4_tid, NULL); }
-static const dispex_static_data_vtbl_t HTMLStyleSheet_dispex_vtbl = { +dispex_static_data_t StyleSheet_dispex = { + .id = PROT_StyleSheet, +}; + +static const dispex_static_data_vtbl_t CSSStyleSheet_dispex_vtbl = { .query_interface = HTMLStyleSheet_query_interface, .destructor = HTMLStyleSheet_destructor, .traverse = HTMLStyleSheet_traverse, .unlink = HTMLStyleSheet_unlink };
-static const tid_t HTMLStyleSheet_iface_tids[] = { +static const tid_t CSSStyleSheet_iface_tids[] = { IHTMLStyleSheet_tid, 0 }; -static dispex_static_data_t HTMLStyleSheet_dispex = { - "CSSStyleSheet", - &HTMLStyleSheet_dispex_vtbl, - DispHTMLStyleSheet_tid, - HTMLStyleSheet_iface_tids, - HTMLStyleSheet_init_dispex_info +dispex_static_data_t CSSStyleSheet_dispex = { + .id = PROT_CSSStyleSheet, + .prototype_id = PROT_StyleSheet, + .vtbl = &CSSStyleSheet_dispex_vtbl, + .disp_tid = DispHTMLStyleSheet_tid, + .iface_tids = CSSStyleSheet_iface_tids, + .init_info = HTMLStyleSheet_init_dispex_info, };
HRESULT create_style_sheet(nsIDOMStyleSheet *nsstylesheet, DispatchEx *owner, IHTMLStyleSheet **ret) @@ -1231,7 +1236,7 @@ HRESULT create_style_sheet(nsIDOMStyleSheet *nsstylesheet, DispatchEx *owner, IH style_sheet->IHTMLStyleSheet4_iface.lpVtbl = &HTMLStyleSheet4Vtbl; style_sheet->nsstylesheet = NULL;
- init_dispatch_with_owner(&style_sheet->dispex, &HTMLStyleSheet_dispex, owner); + init_dispatch_with_owner(&style_sheet->dispex, &CSSStyleSheet_dispex, owner);
if(nsstylesheet) { nsres = nsIDOMStyleSheet_QueryInterface(nsstylesheet, &IID_nsIDOMCSSStyleSheet, diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index d12353ae237..943725ddf37 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -408,6 +408,7 @@ typedef struct {
#define ALL_PROTOTYPES \ X(CSSStyleDeclaration) \ + X(CSSStyleSheet) \ X(CharacterData) \ X(DOMImplementation) \ X(Document) \ @@ -454,6 +455,7 @@ typedef struct { X(SVGTextContentElement) \ X(SVGTextPositioningElement) \ X(Storage) \ + X(StyleSheet) \ X(Text) \ X(Window) \ X(XMLHttpRequest) diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index c0ae9d4473a..51b423b953d 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -3222,4 +3222,9 @@ sync_test("prototypes", function() { check(CSSStyleDeclaration.prototype, Object.prototype, "CSSStyleDeclaration"); check(document.body.currentStyle, MSCurrentStyleCSSProperties.prototype, "current style"); check(MSCurrentStyleCSSProperties.prototype, MSCSSProperties.prototype, "MSCurrentStyleCSSProperties"); + var e = document.createElement("style"); + document.body.appendChild(e); + check(e.sheet, CSSStyleSheet.prototype, "stylesheet"); + check(CSSStyleSheet.prototype, StyleSheet.prototype, "css stylesheet prototype"); + check(StyleSheet.prototype, Object.prototype, "stylesheet prototype"); });