Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
34dd3dd2
Commit
34dd3dd2
authored
Mar 25, 2021
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Support onload handlers in script elements.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
da30fa03
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
5 deletions
+56
-5
script.c
dlls/mshtml/script.c
+19
-5
documentmode.js
dlls/mshtml/tests/documentmode.js
+37
-0
No files found.
dlls/mshtml/script.c
View file @
34dd3dd2
...
...
@@ -723,12 +723,22 @@ static void dispatch_script_readystatechange_event(HTMLScriptElement *script)
DOMEvent
*
event
;
HRESULT
hres
;
hres
=
create_document_event
(
script
->
element
.
node
.
doc
,
EVENTID_READYSTATECHANGE
,
&
event
);
if
(
FAILED
(
hres
))
return
;
if
(
script
->
readystate
!=
READYSTATE_LOADED
||
dispex_compat_mode
(
&
script
->
element
.
node
.
event_target
.
dispex
)
<
COMPAT_MODE_IE10
)
{
hres
=
create_document_event
(
script
->
element
.
node
.
doc
,
EVENTID_READYSTATECHANGE
,
&
event
);
if
(
SUCCEEDED
(
hres
))
{
dispatch_event
(
&
script
->
element
.
node
.
event_target
,
event
);
IDOMEvent_Release
(
&
event
->
IDOMEvent_iface
);
}
}
dispatch_event
(
&
script
->
element
.
node
.
event_target
,
event
);
IDOMEvent_Release
(
&
event
->
IDOMEvent_iface
);
if
(
script
->
readystate
==
READYSTATE_LOADED
)
{
hres
=
create_document_event
(
script
->
element
.
node
.
doc
,
EVENTID_LOAD
,
&
event
);
if
(
SUCCEEDED
(
hres
))
{
dispatch_event
(
&
script
->
element
.
node
.
event_target
,
event
);
IDOMEvent_Release
(
&
event
->
IDOMEvent_iface
);
}
}
}
typedef
struct
{
...
...
@@ -758,6 +768,10 @@ static void set_script_elem_readystate(HTMLScriptElement *script_elem, READYSTAT
{
script_elem
->
readystate
=
readystate
;
if
(
readystate
!=
READYSTATE_LOADED
&&
dispex_compat_mode
(
&
script_elem
->
element
.
node
.
event_target
.
dispex
)
>=
COMPAT_MODE_IE11
)
return
;
if
(
readystate
!=
READYSTATE_INTERACTIVE
)
{
if
(
!
script_elem
->
element
.
node
.
doc
->
window
->
parser_callback_cnt
)
{
fire_readystatechange_task_t
*
task
;
...
...
dlls/mshtml/tests/documentmode.js
View file @
34dd3dd2
...
...
@@ -323,3 +323,40 @@ sync_test("conditional_comments", function() {
test_version
(
7
);
test_version
(
8
);
});
var
ready_states
;
async_test
(
"script_load"
,
function
()
{
var
v
=
document
.
documentMode
;
if
(
v
<
9
)
{
next_test
();
return
;
}
var
elem
=
document
.
createElement
(
"script"
);
ready_states
=
""
;
elem
.
onreadystatechange
=
guard
(
function
()
{
ok
(
v
<
11
,
"unexpected onreadystatechange call"
);
ready_states
+=
elem
.
readyState
+
","
;
});
elem
.
onload
=
guard
(
function
()
{
switch
(
v
)
{
case
9
:
ok
(
ready_states
===
"loading,exec,loaded,"
,
"ready_states = "
+
ready_states
);
break
;
case
10
:
ok
(
ready_states
===
"loading,exec,"
,
"ready_states = "
+
ready_states
);
break
;
case
11
:
ok
(
ready_states
===
"exec,"
,
"ready_states = "
+
ready_states
);
break
;
}
next_test
();
});
document
.
body
.
appendChild
(
elem
);
elem
.
src
=
"jsstream.php?simple"
;
external
.
writeStream
(
"simple"
,
"ready_states += 'exec,';"
);
});
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