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
5d2ee3ee
Commit
5d2ee3ee
authored
Sep 10, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Bind events to document node instead of body element.
parent
553ba810
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
13 deletions
+20
-13
htmlevent.c
dlls/mshtml/htmlevent.c
+2
-10
events.html
dlls/mshtml/tests/events.html
+18
-3
No files found.
dlls/mshtml/htmlevent.c
View file @
5d2ee3ee
...
...
@@ -1328,16 +1328,8 @@ static HRESULT ensure_nsevent_handler(HTMLDocumentNode *doc, event_target_t *eve
return
S_OK
;
if
(
event_info
[
eid
].
flags
&
EVENT_BIND_TO_BODY
)
{
nsIDOMHTMLElement
*
nsbody
;
nsresult
nsres
;
nsres
=
nsIDOMHTMLDocument_GetBody
(
doc
->
nsdoc
,
&
nsbody
);
if
(
NS_SUCCEEDED
(
nsres
)
&&
nsbody
)
{
nsnode
=
(
nsIDOMNode
*
)
nsbody
;
}
else
{
ERR
(
"GetBody failed: %08x
\n
"
,
nsres
);
return
E_UNEXPECTED
;
}
nsnode
=
doc
->
node
.
nsnode
;
nsIDOMNode_AddRef
(
nsnode
);
}
doc
->
event_vector
[
eid
]
=
TRUE
;
...
...
dlls/mshtml/tests/events.html
View file @
5d2ee3ee
...
...
@@ -114,14 +114,16 @@ function test_handler_this() {
ok
(
calls
==
"div2,div2*,div1,div1*,body,body*"
,
"calls = "
+
calls
);
}
function
runTests
(
t
)
{
window
.
onload
=
function
(
)
{
try
{
ok
(
cnt
==
1
,
"cnt="
+
cnt
+
" exception during loading?"
);
ok
(
t
===
window
,
"t
!== window"
);
ok
(
t
his
===
window
,
"this
!== window"
);
ok
(
typeof
(
window
.
onload
)
===
"function"
,
"typeof(window.onload) = "
+
typeof
(
window
.
onload
));
ok
(
document
.
body
.
onload
===
window
.
onload
,
"document.body.onload !== window.onload"
);
ok
(
img_onload_called
,
"img.onload not called before window.onload"
);
test_scriptfor
();
ondataavailable_test
();
test_handler_this
();
...
...
@@ -132,8 +134,18 @@ function runTests(t) {
external
.
reportSuccess
();
}
</script>
<script>
var
img
=
document
.
createElement
(
"img"
);
img
.
src
=
"http://test.winehq.org/tests/winehq_snapshot/index_files/winehq_logo_glass.png"
;
var
img_onload_called
=
false
;
img
.
onload
=
function
()
{
external
.
trace
(
"img.onload"
);
img_onload_called
=
true
;
}
</script>
</head>
<body
onload=
"runTests(this)"
>
<body>
<div
id=
"divid"
></div>
<div
id=
"divid2"
></div>
<script
event=
"onclick"
for=
"divid2"
>
...
...
@@ -152,5 +164,8 @@ function runTests(t) {
cnt
++
;
})();
</script>
<script>
document
.
body
.
appendChild
(
img
);
</script>
</body>
</html>
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