Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
67f07ffb
Commit
67f07ffb
authored
Nov 08, 2022
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Nov 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Use nsIDOMDocument instead of nsIDOMHTMLDocument where possible.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
819a848a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
89 additions
and
81 deletions
+89
-81
editor.c
dlls/mshtml/editor.c
+9
-4
htmlbody.c
dlls/mshtml/htmlbody.c
+3
-3
htmlcurstyle.c
dlls/mshtml/htmlcurstyle.c
+3
-3
htmldoc.c
dlls/mshtml/htmldoc.c
+0
-0
htmlelem.c
dlls/mshtml/htmlelem.c
+22
-22
htmlevent.c
dlls/mshtml/htmlevent.c
+3
-3
htmlselect.c
dlls/mshtml/htmlselect.c
+3
-3
htmlwindow.c
dlls/mshtml/htmlwindow.c
+2
-10
mshtml_private.h
dlls/mshtml/mshtml_private.h
+5
-4
mutation.c
dlls/mshtml/mutation.c
+5
-5
navigate.c
dlls/mshtml/navigate.c
+1
-1
nsembed.c
dlls/mshtml/nsembed.c
+6
-1
nsevents.c
dlls/mshtml/nsevents.c
+3
-3
omnavigator.c
dlls/mshtml/omnavigator.c
+2
-7
persist.c
dlls/mshtml/persist.c
+3
-3
range.c
dlls/mshtml/range.c
+9
-4
script.c
dlls/mshtml/script.c
+2
-2
selection.c
dlls/mshtml/selection.c
+8
-3
No files found.
dlls/mshtml/editor.c
View file @
67f07ffb
...
...
@@ -183,8 +183,13 @@ static DWORD query_align_status(HTMLDocumentNode *doc, const WCHAR *align)
if
(
doc
->
browser
->
usermode
!=
EDITMODE
||
doc
->
outer_window
->
readystate
<
READYSTATE_INTERACTIVE
)
return
OLECMDF_SUPPORTED
;
if
(
!
doc
->
html_document
)
{
FIXME
(
"Not implemented for XML document
\n
"
);
return
E_NOTIMPL
;
}
nsAString_Init
(
&
justify_str
,
align
);
nsres
=
nsIDOMHTMLDocument_QueryCommandState
(
doc
->
nsdoc
,
&
justify_str
,
&
b
);
nsres
=
nsIDOMHTMLDocument_QueryCommandState
(
doc
->
html_document
,
&
justify_str
,
&
b
);
nsAString_Finish
(
&
justify_str
);
if
(
NS_SUCCEEDED
(
nsres
)
&&
b
)
ret
|=
OLECMDF_LATCHED
;
...
...
@@ -1081,8 +1086,8 @@ static HRESULT exec_hyperlink(HTMLDocumentNode *doc, DWORD cmdexecopt, VARIANT *
return
OLECMDERR_E_CANCELED
;
}
if
(
!
doc
->
nsdoc
)
{
WARN
(
"NULL
nsdoc
\n
"
);
if
(
!
doc
->
dom_document
)
{
WARN
(
"NULL
dom_document
\n
"
);
return
E_UNEXPECTED
;
}
...
...
@@ -1105,7 +1110,7 @@ static HRESULT exec_hyperlink(HTMLDocumentNode *doc, DWORD cmdexecopt, VARIANT *
nsIDOMNode
*
unused_node
;
nsIDOMText
*
text_node
;
nsIDOM
HTMLDocument_CreateTextNode
(
doc
->
nsdoc
,
&
ns_url
,
&
text_node
);
nsIDOM
Document_CreateTextNode
(
doc
->
dom_document
,
&
ns_url
,
&
text_node
);
/* wrap the <a> tags around the text element */
nsIDOMElement_AppendChild
(
anchor_elem
,
(
nsIDOMNode
*
)
text_node
,
&
unused_node
);
...
...
dlls/mshtml/htmlbody.c
View file @
67f07ffb
...
...
@@ -669,12 +669,12 @@ static HRESULT WINAPI HTMLBodyElement_createTextRange(IHTMLBodyElement *iface, I
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
range
);
if
(
!
This
->
element
.
node
.
doc
->
nsdoc
)
{
WARN
(
"No
nsdoc
\n
"
);
if
(
!
This
->
element
.
node
.
doc
->
dom_document
)
{
WARN
(
"No
dom_document
\n
"
);
return
E_UNEXPECTED
;
}
nsres
=
nsIDOM
HTMLDocument_CreateRange
(
This
->
element
.
node
.
doc
->
nsdoc
,
&
nsrange
);
nsres
=
nsIDOM
Document_CreateRange
(
This
->
element
.
node
.
doc
->
dom_document
,
&
nsrange
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsres
=
nsIDOMRange_SelectNodeContents
(
nsrange
,
This
->
element
.
node
.
nsnode
);
if
(
NS_FAILED
(
nsres
))
...
...
dlls/mshtml/htmlcurstyle.c
View file @
67f07ffb
...
...
@@ -1316,12 +1316,12 @@ HRESULT HTMLCurrentStyle_Create(HTMLElement *elem, IHTMLCurrentStyle **p)
HTMLCurrentStyle
*
ret
;
nsresult
nsres
;
if
(
!
elem
->
node
.
doc
->
nsdoc
)
{
WARN
(
"NULL
nsdoc
\n
"
);
if
(
!
elem
->
node
.
doc
->
dom_document
)
{
WARN
(
"NULL
dom_document
\n
"
);
return
E_UNEXPECTED
;
}
nsres
=
nsIDOM
HTMLDocument_GetDefaultView
(
elem
->
node
.
doc
->
nsdoc
,
&
nsview
);
nsres
=
nsIDOM
Document_GetDefaultView
(
elem
->
node
.
doc
->
dom_document
,
&
nsview
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetDefaultView failed: %08lx
\n
"
,
nsres
);
return
E_FAIL
;
...
...
dlls/mshtml/htmldoc.c
View file @
67f07ffb
This diff is collapsed.
Click to expand it.
dlls/mshtml/htmlelem.c
View file @
67f07ffb
...
...
@@ -181,7 +181,7 @@ static const tag_desc_t *get_tag_desc(const WCHAR *tag_name)
return
NULL
;
}
HRESULT
replace_node_by_html
(
nsIDOM
HTML
Document
*
nsdoc
,
nsIDOMNode
*
nsnode
,
const
WCHAR
*
html
)
HRESULT
replace_node_by_html
(
nsIDOMDocument
*
nsdoc
,
nsIDOMNode
*
nsnode
,
const
WCHAR
*
html
)
{
nsIDOMDocumentFragment
*
nsfragment
;
nsIDOMNode
*
nsparent
;
...
...
@@ -190,7 +190,7 @@ HRESULT replace_node_by_html(nsIDOMHTMLDocument *nsdoc, nsIDOMNode *nsnode, cons
nsresult
nsres
;
HRESULT
hres
=
S_OK
;
nsres
=
nsIDOM
HTML
Document_CreateRange
(
nsdoc
,
&
range
);
nsres
=
nsIDOMDocument_CreateRange
(
nsdoc
,
&
range
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"CreateRange failed: %08lx
\n
"
,
nsres
);
return
E_FAIL
;
...
...
@@ -410,8 +410,8 @@ static HRESULT create_nselem_parse(HTMLDocumentNode *doc, const WCHAR *tag, nsID
if
(
!
p
||
p
[
1
]
||
wcschr
(
tag
+
1
,
'<'
))
return
E_FAIL
;
if
(
!
doc
->
nsdoc
)
{
WARN
(
"NULL
nsdoc
\n
"
);
if
(
!
doc
->
dom_document
)
{
WARN
(
"NULL
dom_document
\n
"
);
return
E_UNEXPECTED
;
}
...
...
@@ -430,7 +430,7 @@ static HRESULT create_nselem_parse(HTMLDocumentNode *doc, const WCHAR *tag, nsID
size
=
(
p
+
2
-
(
tag
+
1
+
name_len
))
*
sizeof
(
WCHAR
);
/* Parse the input via a contextual fragment, using a dummy unknown tag */
nsres
=
nsIDOM
HTMLDocument_CreateRange
(
doc
->
nsdoc
,
&
nsrange
);
nsres
=
nsIDOM
Document_CreateRange
(
doc
->
dom_document
,
&
nsrange
);
if
(
NS_FAILED
(
nsres
))
return
map_nsresult
(
nsres
);
...
...
@@ -467,7 +467,7 @@ static HRESULT create_nselem_parse(HTMLDocumentNode *doc, const WCHAR *tag, nsID
p
[
name_len
]
=
'\0'
;
nsAString_InitDepend
(
&
str
,
p
);
nsres
=
nsIDOM
HTMLDocument_CreateElement
(
doc
->
nsdoc
,
&
str
,
ret
);
nsres
=
nsIDOM
Document_CreateElement
(
doc
->
dom_document
,
&
str
,
ret
);
nsAString_Finish
(
&
str
);
heap_free
(
p
);
...
...
@@ -488,13 +488,13 @@ HRESULT create_nselem(HTMLDocumentNode *doc, const WCHAR *tag, nsIDOMElement **r
nsAString
tag_str
;
nsresult
nsres
;
if
(
!
doc
->
nsdoc
)
{
WARN
(
"NULL
nsdoc
\n
"
);
if
(
!
doc
->
dom_document
)
{
WARN
(
"NULL
dom_document
\n
"
);
return
E_UNEXPECTED
;
}
nsAString_InitDepend
(
&
tag_str
,
tag
);
nsres
=
nsIDOM
HTMLDocument_CreateElement
(
doc
->
nsdoc
,
&
tag_str
,
ret
);
nsres
=
nsIDOM
Document_CreateElement
(
doc
->
dom_document
,
&
tag_str
,
ret
);
nsAString_Finish
(
&
tag_str
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"CreateElement failed: %08lx
\n
"
,
nsres
);
...
...
@@ -510,7 +510,7 @@ HRESULT create_element(HTMLDocumentNode *doc, const WCHAR *tag, HTMLElement **re
HRESULT
hres
;
/* Use owner doc if called on document fragment */
if
(
!
doc
->
nsdoc
)
if
(
!
doc
->
dom_document
)
doc
=
doc
->
node
.
doc
;
/* IE8 and below allow creating elements with attributes, such as <div class="a"> */
...
...
@@ -2223,7 +2223,7 @@ static HRESULT WINAPI HTMLElement_put_innerText(IHTMLElement *iface, BSTR v)
}
nsAString_InitDepend
(
&
text_str
,
v
);
nsres
=
nsIDOM
HTMLDocument_CreateTextNode
(
This
->
node
.
doc
->
nsdoc
,
&
text_str
,
&
text_node
);
nsres
=
nsIDOM
Document_CreateTextNode
(
This
->
node
.
doc
->
dom_document
,
&
text_str
,
&
text_node
);
nsAString_Finish
(
&
text_str
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"CreateTextNode failed: %08lx
\n
"
,
nsres
);
...
...
@@ -2255,7 +2255,7 @@ static HRESULT WINAPI HTMLElement_put_outerHTML(IHTMLElement *iface, BSTR v)
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
return
replace_node_by_html
(
This
->
node
.
doc
->
nsdoc
,
This
->
node
.
nsnode
,
v
);
return
replace_node_by_html
(
This
->
node
.
doc
->
dom_document
,
This
->
node
.
nsnode
,
v
);
}
static
HRESULT
WINAPI
HTMLElement_get_outerHTML
(
IHTMLElement
*
iface
,
BSTR
*
p
)
...
...
@@ -2298,20 +2298,20 @@ static HRESULT WINAPI HTMLElement_put_outerText(IHTMLElement *iface, BSTR v)
return
0x800a0258
;
/* undocumented error code */
}
if
(
!
This
->
node
.
doc
->
nsdoc
)
{
FIXME
(
"NULL
nsdoc
\n
"
);
if
(
!
This
->
node
.
doc
->
dom_document
)
{
FIXME
(
"NULL
dom_document
\n
"
);
return
E_FAIL
;
}
nsAString_InitDepend
(
&
nsstr
,
v
);
nsres
=
nsIDOM
HTMLDocument_CreateTextNode
(
This
->
node
.
doc
->
nsdoc
,
&
nsstr
,
&
text_node
);
nsres
=
nsIDOM
Document_CreateTextNode
(
This
->
node
.
doc
->
dom_document
,
&
nsstr
,
&
text_node
);
nsAString_Finish
(
&
nsstr
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"CreateTextNode failed
\n
"
);
return
E_FAIL
;
}
nsres
=
nsIDOM
HTMLDocument_CreateRange
(
This
->
node
.
doc
->
nsdoc
,
&
range
);
nsres
=
nsIDOM
Document_CreateRange
(
This
->
node
.
doc
->
dom_document
,
&
range
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsres
=
nsIDOMRange_SelectNode
(
range
,
This
->
node
.
nsnode
);
if
(
NS_SUCCEEDED
(
nsres
))
...
...
@@ -2422,12 +2422,12 @@ static HRESULT WINAPI HTMLElement_insertAdjacentHTML(IHTMLElement *iface, BSTR w
TRACE
(
"(%p)->(%s %s)
\n
"
,
This
,
debugstr_w
(
where
),
debugstr_w
(
html
));
if
(
!
This
->
node
.
doc
->
nsdoc
)
{
WARN
(
"NULL
nsdoc
\n
"
);
if
(
!
This
->
node
.
doc
->
dom_document
)
{
WARN
(
"NULL
dom_document
\n
"
);
return
E_UNEXPECTED
;
}
nsres
=
nsIDOM
HTMLDocument_CreateRange
(
This
->
node
.
doc
->
nsdoc
,
&
range
);
nsres
=
nsIDOM
Document_CreateRange
(
This
->
node
.
doc
->
dom_document
,
&
range
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"CreateRange failed: %08lx
\n
"
,
nsres
);
...
...
@@ -2463,14 +2463,14 @@ static HRESULT WINAPI HTMLElement_insertAdjacentText(IHTMLElement *iface, BSTR w
TRACE
(
"(%p)->(%s %s)
\n
"
,
This
,
debugstr_w
(
where
),
debugstr_w
(
text
));
if
(
!
This
->
node
.
doc
->
nsdoc
)
{
WARN
(
"NULL
nsdoc
\n
"
);
if
(
!
This
->
node
.
doc
->
dom_document
)
{
WARN
(
"NULL
dom_document
\n
"
);
return
E_UNEXPECTED
;
}
nsAString_InitDepend
(
&
ns_text
,
text
);
nsres
=
nsIDOM
HTMLDocument_CreateTextNode
(
This
->
node
.
doc
->
nsdoc
,
&
ns_text
,
(
nsIDOMText
**
)
&
nsnode
);
nsres
=
nsIDOM
Document_CreateTextNode
(
This
->
node
.
doc
->
dom_document
,
&
ns_text
,
(
nsIDOMText
**
)
&
nsnode
);
nsAString_Finish
(
&
ns_text
);
if
(
NS_FAILED
(
nsres
)
||
!
nsnode
)
...
...
dlls/mshtml/htmlevent.c
View file @
67f07ffb
...
...
@@ -3085,7 +3085,7 @@ HRESULT create_document_event_str(HTMLDocumentNode *doc, const WCHAR *type, IDOM
unsigned
i
;
nsAString_InitDepend
(
&
nsstr
,
type
);
nsres
=
nsIDOM
HTMLDocument_CreateEvent
(
doc
->
nsdoc
,
&
nsstr
,
&
nsevent
);
nsres
=
nsIDOM
Document_CreateEvent
(
doc
->
dom_document
,
&
nsstr
,
&
nsevent
);
nsAString_Finish
(
&
nsstr
);
if
(
NS_FAILED
(
nsres
))
{
FIXME
(
"CreateEvent(%s) failed: %08lx
\n
"
,
debugstr_w
(
type
),
nsres
);
...
...
@@ -3117,7 +3117,7 @@ HRESULT create_document_event(HTMLDocumentNode *doc, eventid_t event_id, DOMEven
nsresult
nsres
;
nsAString_InitDepend
(
&
nsstr
,
event_types
[
event_info
[
event_id
].
type
]);
nsres
=
nsIDOM
HTMLDocument_CreateEvent
(
doc
->
nsdoc
,
&
nsstr
,
&
nsevent
);
nsres
=
nsIDOM
Document_CreateEvent
(
doc
->
dom_document
,
&
nsstr
,
&
nsevent
);
nsAString_Finish
(
&
nsstr
);
if
(
NS_FAILED
(
nsres
))
{
FIXME
(
"CreateEvent(%s) failed: %08lx
\n
"
,
debugstr_w
(
event_types
[
event_info
[
event_id
].
type
]),
nsres
);
...
...
@@ -3665,7 +3665,7 @@ HRESULT ensure_doc_nsevent_handler(HTMLDocumentNode *doc, nsIDOMNode *nsnode, ev
{
TRACE
(
"%s
\n
"
,
debugstr_w
(
event_info
[
eid
].
name
));
if
(
!
doc
->
nsdoc
)
if
(
!
doc
->
dom_document
)
return
S_OK
;
switch
(
eid
)
{
...
...
dlls/mshtml/htmlselect.c
View file @
67f07ffb
...
...
@@ -252,8 +252,8 @@ static HRESULT WINAPI HTMLOptionElement_put_text(IHTMLOptionElement *iface, BSTR
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
if
(
!
This
->
element
.
node
.
doc
->
nsdoc
)
{
WARN
(
"NULL
nsdoc
\n
"
);
if
(
!
This
->
element
.
node
.
doc
->
dom_document
)
{
WARN
(
"NULL
dom_document
\n
"
);
return
E_UNEXPECTED
;
}
...
...
@@ -275,7 +275,7 @@ static HRESULT WINAPI HTMLOptionElement_put_text(IHTMLOptionElement *iface, BSTR
}
nsAString_InitDepend
(
&
text_str
,
v
);
nsres
=
nsIDOM
HTMLDocument_CreateTextNode
(
This
->
element
.
node
.
doc
->
nsdoc
,
&
text_str
,
&
text_node
);
nsres
=
nsIDOM
Document_CreateTextNode
(
This
->
element
.
node
.
doc
->
dom_document
,
&
text_str
,
&
text_node
);
nsAString_Finish
(
&
text_str
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"CreateTextNode failed: %08lx
\n
"
,
nsres
);
...
...
dlls/mshtml/htmlwindow.c
View file @
67f07ffb
...
...
@@ -4143,7 +4143,6 @@ HRESULT update_window_doc(HTMLInnerWindow *window)
{
HTMLOuterWindow
*
outer_window
=
window
->
base
.
outer_window
;
compat_mode_t
parent_mode
=
COMPAT_MODE_QUIRKS
;
nsIDOMHTMLDocument
*
nshtmldoc
;
nsIDOMDocument
*
nsdoc
;
nsresult
nsres
;
HRESULT
hres
;
...
...
@@ -4159,18 +4158,11 @@ HRESULT update_window_doc(HTMLInnerWindow *window)
return
E_FAIL
;
}
nsres
=
nsIDOMDocument_QueryInterface
(
nsdoc
,
&
IID_nsIDOMHTMLDocument
,
(
void
**
)
&
nshtmldoc
);
nsIDOMDocument_Release
(
nsdoc
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDOMHTMLDocument iface: %08lx
\n
"
,
nsres
);
return
E_FAIL
;
}
if
(
outer_window
->
parent
)
parent_mode
=
outer_window
->
parent
->
base
.
inner_window
->
doc
->
document_mode
;
hres
=
create_document_node
(
ns
html
doc
,
outer_window
->
browser
,
window
,
parent_mode
,
&
window
->
doc
);
nsIDOM
HTMLDocument_Release
(
nshtml
doc
);
hres
=
create_document_node
(
nsdoc
,
outer_window
->
browser
,
window
,
parent_mode
,
&
window
->
doc
);
nsIDOM
Document_Release
(
ns
doc
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/mshtml/mshtml_private.h
View file @
67f07ffb
...
...
@@ -921,7 +921,8 @@ struct HTMLDocumentNode {
compat_mode_t
document_mode
;
BOOL
document_mode_locked
;
nsIDOMHTMLDocument
*
nsdoc
;
nsIDOMDocument
*
dom_document
;
nsIDOMHTMLDocument
*
html_document
;
BOOL
content_ready
;
IHTMLDOMImplementation
*
dom_implementation
;
...
...
@@ -949,7 +950,7 @@ struct HTMLDocumentNode {
HRESULT
HTMLDocument_Create
(
IUnknown
*
,
REFIID
,
void
**
)
DECLSPEC_HIDDEN
;
HRESULT
MHTMLDocument_Create
(
IUnknown
*
,
REFIID
,
void
**
)
DECLSPEC_HIDDEN
;
HRESULT
HTMLLoadOptions_Create
(
IUnknown
*
,
REFIID
,
void
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_document_node
(
nsIDOM
HTML
Document
*
,
GeckoBrowser
*
,
HTMLInnerWindow
*
,
HRESULT
create_document_node
(
nsIDOMDocument
*
,
GeckoBrowser
*
,
HTMLInnerWindow
*
,
compat_mode_t
,
HTMLDocumentNode
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_doctype_node
(
HTMLDocumentNode
*
,
nsIDOMNode
*
,
HTMLDOMNode
**
)
DECLSPEC_HIDDEN
;
...
...
@@ -997,7 +998,7 @@ compat_mode_t lock_document_mode(HTMLDocumentNode*) DECLSPEC_HIDDEN;
void
init_mutation
(
nsIComponentManager
*
)
DECLSPEC_HIDDEN
;
void
init_document_mutation
(
HTMLDocumentNode
*
)
DECLSPEC_HIDDEN
;
void
release_document_mutation
(
HTMLDocumentNode
*
)
DECLSPEC_HIDDEN
;
JSContext
*
get_context_from_document
(
nsIDOM
HTML
Document
*
)
DECLSPEC_HIDDEN
;
JSContext
*
get_context_from_document
(
nsIDOMDocument
*
)
DECLSPEC_HIDDEN
;
void
HTMLDocument_LockContainer
(
HTMLDocumentObj
*
,
BOOL
)
DECLSPEC_HIDDEN
;
void
show_context_menu
(
HTMLDocumentObj
*
,
DWORD
,
POINT
*
,
IDispatch
*
)
DECLSPEC_HIDDEN
;
...
...
@@ -1082,7 +1083,7 @@ void detach_document_node(HTMLDocumentNode*) DECLSPEC_HIDDEN;
void
detach_selection
(
HTMLDocumentNode
*
)
DECLSPEC_HIDDEN
;
void
detach_ranges
(
HTMLDocumentNode
*
)
DECLSPEC_HIDDEN
;
HRESULT
get_node_text
(
HTMLDOMNode
*
,
BSTR
*
)
DECLSPEC_HIDDEN
;
HRESULT
replace_node_by_html
(
nsIDOM
HTML
Document
*
,
nsIDOMNode
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
HRESULT
replace_node_by_html
(
nsIDOMDocument
*
,
nsIDOMNode
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
HRESULT
create_nselem
(
HTMLDocumentNode
*
,
const
WCHAR
*
,
nsIDOMElement
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_element
(
HTMLDocumentNode
*
,
const
WCHAR
*
,
HTMLElement
**
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/mutation.c
View file @
67f07ffb
...
...
@@ -211,7 +211,7 @@ static nsresult run_insert_comment(HTMLDocumentNode *doc, nsISupports *comment_i
if
(
replace_html
)
{
HRESULT
hres
;
hres
=
replace_node_by_html
(
doc
->
nsdoc
,
(
nsIDOMNode
*
)
nscomment
,
replace_html
);
hres
=
replace_node_by_html
(
doc
->
dom_document
,
(
nsIDOMNode
*
)
nscomment
,
replace_html
);
heap_free
(
replace_html
);
if
(
FAILED
(
hres
))
nsres
=
NS_ERROR_FAILURE
;
...
...
@@ -971,7 +971,7 @@ void init_document_mutation(HTMLDocumentNode *doc)
doc
->
nsIDocumentObserver_iface
.
lpVtbl
=
&
nsDocumentObserverVtbl
;
nsres
=
nsIDOM
HTMLDocument_QueryInterface
(
doc
->
nsdoc
,
&
IID_nsIDocument
,
(
void
**
)
&
nsdoc
);
nsres
=
nsIDOM
Document_QueryInterface
(
doc
->
dom_document
,
&
IID_nsIDocument
,
(
void
**
)
&
nsdoc
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDocument: %08lx
\n
"
,
nsres
);
return
;
...
...
@@ -986,7 +986,7 @@ void release_document_mutation(HTMLDocumentNode *doc)
nsIDocument
*
nsdoc
;
nsresult
nsres
;
nsres
=
nsIDOM
HTMLDocument_QueryInterface
(
doc
->
nsdoc
,
&
IID_nsIDocument
,
(
void
**
)
&
nsdoc
);
nsres
=
nsIDOM
Document_QueryInterface
(
doc
->
dom_document
,
&
IID_nsIDocument
,
(
void
**
)
&
nsdoc
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDocument: %08lx
\n
"
,
nsres
);
return
;
...
...
@@ -996,13 +996,13 @@ void release_document_mutation(HTMLDocumentNode *doc)
nsIDocument_Release
(
nsdoc
);
}
JSContext
*
get_context_from_document
(
nsIDOM
HTML
Document
*
nsdoc
)
JSContext
*
get_context_from_document
(
nsIDOMDocument
*
nsdoc
)
{
nsIDocument
*
doc
;
JSContext
*
ctx
;
nsresult
nsres
;
nsres
=
nsIDOM
HTML
Document_QueryInterface
(
nsdoc
,
&
IID_nsIDocument
,
(
void
**
)
&
doc
);
nsres
=
nsIDOMDocument_QueryInterface
(
nsdoc
,
&
IID_nsIDocument
,
(
void
**
)
&
doc
);
assert
(
nsres
==
NS_OK
);
ctx
=
nsIContentUtils_GetContextFromDocument
(
content_utils
,
doc
);
...
...
dlls/mshtml/navigate.c
View file @
67f07ffb
...
...
@@ -2152,7 +2152,7 @@ static HRESULT navigate_fragment(HTMLOuterWindow *window, IUri *uri)
swprintf
(
selector
,
ARRAY_SIZE
(
selector_formatW
)
+
SysStringLen
(
frag
),
selector_formatW
,
frag
);
nsAString_InitDepend
(
&
selector_str
,
selector
);
/* NOTE: Gecko doesn't set result to NULL if there is no match, so nselem must be initialized */
nsres
=
nsIDOM
HTMLDocument_QuerySelector
(
window
->
base
.
inner_window
->
doc
->
nsdoc
,
&
selector_str
,
&
nselem
);
nsres
=
nsIDOM
Document_QuerySelector
(
window
->
base
.
inner_window
->
doc
->
dom_document
,
&
selector_str
,
&
nselem
);
nsAString_Finish
(
&
selector_str
);
heap_free
(
selector
);
if
(
NS_SUCCEEDED
(
nsres
)
&&
nselem
)
{
...
...
dlls/mshtml/nsembed.c
View file @
67f07ffb
...
...
@@ -1683,7 +1683,12 @@ static nsresult NSAPI nsContextMenuListener_OnShowContextMenu(nsIContextMenuList
case
CONTEXT_TEXT
:
{
nsISelection
*
selection
;
nsres
=
nsIDOMHTMLDocument_GetSelection
(
This
->
doc
->
doc_node
->
nsdoc
,
&
selection
);
if
(
!
This
->
doc
->
doc_node
->
html_document
)
{
FIXME
(
"Not implemented for XML document
\n
"
);
break
;
}
nsres
=
nsIDOMHTMLDocument_GetSelection
(
This
->
doc
->
doc_node
->
html_document
,
&
selection
);
if
(
NS_SUCCEEDED
(
nsres
)
&&
selection
)
{
cpp_bool
is_collapsed
;
...
...
dlls/mshtml/nsevents.c
View file @
67f07ffb
...
...
@@ -258,14 +258,14 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
IDocObjectService_FireDocumentComplete
(
doc_obj
->
doc_object_service
,
&
doc
->
outer_window
->
base
.
IHTMLWindow2_iface
,
0
);
if
(
doc
->
nsdoc
)
{
if
(
doc
->
dom_document
)
{
hres
=
create_document_event
(
doc
,
EVENTID_LOAD
,
&
load_event
);
if
(
SUCCEEDED
(
hres
))
{
dispatch_event
(
&
doc
->
node
.
event_target
,
load_event
);
IDOMEvent_Release
(
&
load_event
->
IDOMEvent_iface
);
}
}
else
{
WARN
(
"no
nsdoc
\n
"
);
WARN
(
"no
dom_document
\n
"
);
}
if
(
doc
->
window
)
{
...
...
@@ -383,7 +383,7 @@ static nsIDOMEventTarget *get_default_document_target(HTMLDocumentNode *doc)
nsISupports
*
target_iface
;
nsresult
nsres
;
target_iface
=
doc
->
window
?
(
nsISupports
*
)
doc
->
outer_window
->
nswindow
:
(
nsISupports
*
)
doc
->
nsdoc
;
target_iface
=
doc
->
window
?
(
nsISupports
*
)
doc
->
outer_window
->
nswindow
:
(
nsISupports
*
)
doc
->
dom_document
;
nsres
=
nsISupports_QueryInterface
(
target_iface
,
&
IID_nsIDOMEventTarget
,
(
void
**
)
&
target
);
return
NS_SUCCEEDED
(
nsres
)
?
target
:
NULL
;
}
...
...
dlls/mshtml/omnavigator.c
View file @
67f07ffb
...
...
@@ -242,7 +242,6 @@ static HRESULT WINAPI HTMLDOMImplementation2_createHTMLDocument(IHTMLDOMImplemen
{
HTMLDOMImplementation
*
This
=
impl_from_IHTMLDOMImplementation2
(
iface
);
HTMLDocumentNode
*
new_document_node
;
nsIDOMHTMLDocument
*
html_doc
;
nsIDOMDocument
*
doc
;
nsAString
title_str
;
nsresult
nsres
;
...
...
@@ -261,12 +260,8 @@ static HRESULT WINAPI HTMLDOMImplementation2_createHTMLDocument(IHTMLDOMImplemen
return
E_FAIL
;
}
nsres
=
nsIDOMDocument_QueryInterface
(
doc
,
&
IID_nsIDOMHTMLDocument
,
(
void
**
)
&
html_doc
);
hres
=
create_document_node
(
doc
,
This
->
browser
,
NULL
,
dispex_compat_mode
(
&
This
->
dispex
),
&
new_document_node
);
nsIDOMDocument_Release
(
doc
);
assert
(
nsres
==
NS_OK
);
hres
=
create_document_node
(
html_doc
,
This
->
browser
,
NULL
,
dispex_compat_mode
(
&
This
->
dispex
),
&
new_document_node
);
nsIDOMHTMLDocument_Release
(
html_doc
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -337,7 +332,7 @@ HRESULT create_dom_implementation(HTMLDocumentNode *doc_node, IHTMLDOMImplementa
init_dispatch
(
&
dom_implementation
->
dispex
,
(
IUnknown
*
)
&
dom_implementation
->
IHTMLDOMImplementation_iface
,
&
HTMLDOMImplementation_dispex
,
doc_node
->
document_mode
);
nsres
=
nsIDOM
HTMLDocument_GetImplementation
(
doc_node
->
nsdoc
,
&
dom_implementation
->
implementation
);
nsres
=
nsIDOM
Document_GetImplementation
(
doc_node
->
dom_document
,
&
dom_implementation
->
implementation
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetDOMImplementation failed: %08lx
\n
"
,
nsres
);
IHTMLDOMImplementation_Release
(
&
dom_implementation
->
IHTMLDOMImplementation_iface
);
...
...
dlls/mshtml/persist.c
View file @
67f07ffb
...
...
@@ -503,12 +503,12 @@ static HRESULT get_doc_string(HTMLDocumentNode *This, char **str)
nsresult
nsres
;
HRESULT
hres
;
if
(
!
This
->
nsdoc
)
{
WARN
(
"NULL
nsdoc
\n
"
);
if
(
!
This
->
dom_document
)
{
WARN
(
"NULL
dom_document
\n
"
);
return
E_UNEXPECTED
;
}
nsres
=
nsIDOM
HTMLDocument_QueryInterface
(
This
->
nsdoc
,
&
IID_nsIDOMNode
,
(
void
**
)
&
nsnode
);
nsres
=
nsIDOM
Document_QueryInterface
(
This
->
dom_document
,
&
IID_nsIDOMNode
,
(
void
**
)
&
nsnode
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDOMNode failed: %08lx
\n
"
,
nsres
);
return
E_FAIL
;
...
...
dlls/mshtml/range.c
View file @
67f07ffb
...
...
@@ -949,7 +949,7 @@ static HRESULT WINAPI HTMLTxtRange_put_text(IHTMLTxtRange *iface, BSTR v)
return
MSHTML_E_NODOC
;
nsAString_InitDepend
(
&
text_str
,
v
);
nsres
=
nsIDOM
HTMLDocument_CreateTextNode
(
This
->
doc
->
nsdoc
,
&
text_str
,
&
text_node
);
nsres
=
nsIDOM
Document_CreateTextNode
(
This
->
doc
->
dom_document
,
&
text_str
,
&
text_node
);
nsAString_Finish
(
&
text_str
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"CreateTextNode failed: %08lx
\n
"
,
nsres
);
...
...
@@ -1159,7 +1159,12 @@ static HRESULT WINAPI HTMLTxtRange_expand(IHTMLTxtRange *iface, BSTR Unit, VARIA
nsIDOMHTMLElement
*
nsbody
=
NULL
;
nsresult
nsres
;
nsres
=
nsIDOMHTMLDocument_GetBody
(
This
->
doc
->
nsdoc
,
&
nsbody
);
if
(
!
This
->
doc
->
html_document
)
{
FIXME
(
"Not implemented for XML document
\n
"
);
return
E_NOTIMPL
;
}
nsres
=
nsIDOMHTMLDocument_GetBody
(
This
->
doc
->
html_document
,
&
nsbody
);
if
(
NS_FAILED
(
nsres
)
||
!
nsbody
)
{
ERR
(
"Could not get body: %08lx
\n
"
,
nsres
);
break
;
...
...
@@ -1657,8 +1662,8 @@ static HRESULT exec_indent(HTMLTxtRange *This, VARIANT *in, VARIANT *out)
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
in
,
out
);
if
(
!
This
->
doc
->
nsdoc
)
{
WARN
(
"NULL
nsdoc
\n
"
);
if
(
!
This
->
doc
->
dom_document
)
{
WARN
(
"NULL
dom_document
\n
"
);
return
E_NOTIMPL
;
}
...
...
dlls/mshtml/script.c
View file @
67f07ffb
...
...
@@ -1596,11 +1596,11 @@ void bind_event_scripts(HTMLDocumentNode *doc)
TRACE
(
"%p
\n
"
,
doc
);
if
(
!
doc
->
nsdoc
)
if
(
!
doc
->
dom_document
)
return
;
nsAString_InitDepend
(
&
selector_str
,
L"script[event]"
);
nsres
=
nsIDOM
HTMLDocument_QuerySelectorAll
(
doc
->
nsdoc
,
&
selector_str
,
&
node_list
);
nsres
=
nsIDOM
Document_QuerySelectorAll
(
doc
->
dom_document
,
&
selector_str
,
&
node_list
);
nsAString_Finish
(
&
selector_str
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"QuerySelectorAll failed: %08lx
\n
"
,
nsres
);
...
...
dlls/mshtml/selection.c
View file @
67f07ffb
...
...
@@ -160,12 +160,17 @@ static HRESULT WINAPI HTMLSelectionObject_createRange(IHTMLSelectionObject *ifac
TRACE
(
"nsrange_cnt = 0
\n
"
);
if
(
!
This
->
doc
->
nsdoc
)
{
WARN
(
"
nsdoc
is NULL
\n
"
);
if
(
!
This
->
doc
->
dom_document
)
{
WARN
(
"
dom_document
is NULL
\n
"
);
return
E_UNEXPECTED
;
}
nsres
=
nsIDOMHTMLDocument_GetBody
(
This
->
doc
->
nsdoc
,
&
nsbody
);
if
(
!
This
->
doc
->
html_document
)
{
FIXME
(
"Not implemented for XML document
\n
"
);
return
E_NOTIMPL
;
}
nsres
=
nsIDOMHTMLDocument_GetBody
(
This
->
doc
->
html_document
,
&
nsbody
);
if
(
NS_FAILED
(
nsres
)
||
!
nsbody
)
{
ERR
(
"Could not get body: %08lx
\n
"
,
nsres
);
return
E_FAIL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment