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
f4b68522
Commit
f4b68522
authored
Dec 24, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Delay onreadystateevent notification if script elemenet is not added by parser.
parent
71ce8aaa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
2 deletions
+49
-2
htmlscript.h
dlls/mshtml/htmlscript.h
+1
-0
script.c
dlls/mshtml/script.c
+48
-2
No files found.
dlls/mshtml/htmlscript.h
View file @
f4b68522
...
...
@@ -24,6 +24,7 @@ typedef struct {
nsIDOMHTMLScriptElement
*
nsscript
;
BOOL
parsed
;
BOOL
parse_on_bind
;
BOOL
pending_readystatechange_event
;
READYSTATE
readystate
;
}
HTMLScriptElement
;
...
...
dlls/mshtml/script.c
View file @
f4b68522
...
...
@@ -702,12 +702,58 @@ static ScriptHost *create_script_host(HTMLInnerWindow *window, const GUID *guid)
return
ret
;
}
typedef
struct
{
task_t
header
;
HTMLScriptElement
*
elem
;
}
fire_readystatechange_task_t
;
static
void
fire_readystatechange_proc
(
task_t
*
_task
)
{
fire_readystatechange_task_t
*
task
=
(
fire_readystatechange_task_t
*
)
_task
;
if
(
!
task
->
elem
->
pending_readystatechange_event
)
return
;
task
->
elem
->
pending_readystatechange_event
=
FALSE
;
fire_event
(
task
->
elem
->
element
.
node
.
doc
,
EVENTID_READYSTATECHANGE
,
FALSE
,
task
->
elem
->
element
.
node
.
nsnode
,
NULL
,
NULL
);
}
static
void
fire_readystatechange_task_destr
(
task_t
*
_task
)
{
fire_readystatechange_task_t
*
task
=
(
fire_readystatechange_task_t
*
)
_task
;
IHTMLScriptElement_Release
(
&
task
->
elem
->
IHTMLScriptElement_iface
);
}
static
void
set_script_elem_readystate
(
HTMLScriptElement
*
script_elem
,
READYSTATE
readystate
)
{
script_elem
->
readystate
=
readystate
;
if
(
readystate
!=
READYSTATE_INTERACTIVE
)
fire_event
(
script_elem
->
element
.
node
.
doc
,
EVENTID_READYSTATECHANGE
,
FALSE
,
script_elem
->
element
.
node
.
nsnode
,
NULL
,
NULL
);
if
(
readystate
!=
READYSTATE_INTERACTIVE
)
{
if
(
!
script_elem
->
element
.
node
.
doc
->
window
->
parser_callback_cnt
)
{
fire_readystatechange_task_t
*
task
;
HRESULT
hres
;
if
(
script_elem
->
pending_readystatechange_event
)
return
;
task
=
heap_alloc
(
sizeof
(
*
task
));
if
(
!
task
)
return
;
IHTMLScriptElement_AddRef
(
&
script_elem
->
IHTMLScriptElement_iface
);
task
->
elem
=
script_elem
;
hres
=
push_task
(
&
task
->
header
,
fire_readystatechange_proc
,
fire_readystatechange_task_destr
,
script_elem
->
element
.
node
.
doc
->
window
->
task_magic
);
if
(
SUCCEEDED
(
hres
))
script_elem
->
pending_readystatechange_event
=
TRUE
;
}
else
{
script_elem
->
pending_readystatechange_event
=
FALSE
;
fire_event
(
script_elem
->
element
.
node
.
doc
,
EVENTID_READYSTATECHANGE
,
FALSE
,
script_elem
->
element
.
node
.
nsnode
,
NULL
,
NULL
);
}
}
}
static
void
parse_elem_text
(
ScriptHost
*
script_host
,
HTMLScriptElement
*
script_elem
,
LPCWSTR
text
)
...
...
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