From 0abe9939b8357db3612cd0eac2c526ac1e2f8223 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 12 Mar 2019 16:12:05 +0100 Subject: [PATCH] mshtml: Move SetDesignMode call to create_document_node. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/mshtml/htmldoc.c | 13 +++++++++++++ dlls/mshtml/htmlwindow.c | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 22af107d089..01598e8561b 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -5202,6 +5202,19 @@ HRESULT create_document_node(nsIDOMHTMLDocument *nsdoc, GeckoBrowser *browser, H list_add_head(&browser->document_nodes, &doc->browser_entry); doc->browser = browser; + if(browser->usermode == EDITMODE) { + nsAString mode_str; + nsresult nsres; + + static const PRUnichar onW[] = {'o','n',0}; + + nsAString_InitDepend(&mode_str, onW); + nsres = nsIDOMHTMLDocument_SetDesignMode(doc->nsdoc, &mode_str); + nsAString_Finish(&mode_str); + if(NS_FAILED(nsres)) + ERR("SetDesignMode failed: %08x\n", nsres); + } + *ret = doc; return S_OK; } diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index cd7d59ca0be..8329a3eafd9 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3641,19 +3641,6 @@ HRESULT update_window_doc(HTMLInnerWindow *window) if(FAILED(hres)) return hres; - if(outer_window->browser->usermode == EDITMODE) { - nsAString mode_str; - nsresult nsres; - - static const PRUnichar onW[] = {'o','n',0}; - - nsAString_InitDepend(&mode_str, onW); - nsres = nsIDOMHTMLDocument_SetDesignMode(window->doc->nsdoc, &mode_str); - nsAString_Finish(&mode_str); - if(NS_FAILED(nsres)) - ERR("SetDesignMode failed: %08x\n", nsres); - } - if(window != outer_window->pending_window) { ERR("not current pending window\n"); return S_OK;