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
620a9500
Commit
620a9500
authored
Mar 29, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 31, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added parsing inline script support.
parent
40ab8e0c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
1 deletion
+74
-1
script.c
dlls/mshtml/script.c
+74
-1
No files found.
dlls/mshtml/script.c
View file @
620a9500
...
...
@@ -452,6 +452,72 @@ static ScriptHost *create_script_host(HTMLDocument *doc, GUID *guid)
return
ret
;
}
static
void
parse_text
(
ScriptHost
*
script_host
,
LPCWSTR
text
)
{
EXCEPINFO
excepinfo
;
VARIANT
var
;
HRESULT
hres
;
static
const
WCHAR
script_endW
[]
=
{
'<'
,
'/'
,
'S'
,
'C'
,
'R'
,
'I'
,
'P'
,
'T'
,
'>'
,
0
};
TRACE
(
"%s
\n
"
,
debugstr_w
(
text
));
VariantInit
(
&
var
);
memset
(
&
excepinfo
,
0
,
sizeof
(
excepinfo
));
hres
=
IActiveScriptParse_ParseScriptText
(
script_host
->
parse
,
text
,
windowW
,
NULL
,
script_endW
,
0
,
0
,
SCRIPTTEXT_ISVISIBLE
|
SCRIPTTEXT_HOSTMANAGESSOURCE
,
&
var
,
&
excepinfo
);
if
(
FAILED
(
hres
))
WARN
(
"ParseScriptText failed: %08x
\n
"
,
hres
);
}
static
void
parse_extern_script
(
ScriptHost
*
script_host
,
LPCWSTR
src
)
{
FIXME
(
"%p %s
\n
"
,
script_host
,
debugstr_w
(
src
));
}
static
void
parse_inline_script
(
ScriptHost
*
script_host
,
nsIDOMHTMLScriptElement
*
nsscript
)
{
const
PRUnichar
*
text
;
nsAString
text_str
;
nsresult
nsres
;
nsAString_Init
(
&
text_str
,
NULL
);
nsres
=
nsIDOMHTMLScriptElement_GetText
(
nsscript
,
&
text_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsAString_GetData
(
&
text_str
,
&
text
);
parse_text
(
script_host
,
text
);
}
else
{
ERR
(
"GetText failed: %08x
\n
"
,
nsres
);
}
nsAString_Finish
(
&
text_str
);
}
static
void
parse_script_elem
(
ScriptHost
*
script_host
,
nsIDOMHTMLScriptElement
*
nsscript
)
{
const
PRUnichar
*
src
;
nsAString
src_str
;
nsresult
nsres
;
nsAString_Init
(
&
src_str
,
NULL
);
nsres
=
nsIDOMHTMLScriptElement_GetSrc
(
nsscript
,
&
src_str
);
nsAString_GetData
(
&
src_str
,
&
src
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"GetSrc failed: %08x
\n
"
,
nsres
);
else
if
(
*
src
)
parse_extern_script
(
script_host
,
src
);
else
parse_inline_script
(
script_host
,
nsscript
);
nsAString_Finish
(
&
src_str
);
}
static
BOOL
get_guid_from_type
(
LPCWSTR
type
,
GUID
*
guid
)
{
const
WCHAR
text_javascriptW
[]
=
...
...
@@ -554,7 +620,14 @@ static ScriptHost *get_script_host(HTMLDocument *doc, nsIDOMHTMLScriptElement *n
void
doc_insert_script
(
HTMLDocument
*
doc
,
nsIDOMHTMLScriptElement
*
nsscript
)
{
get_script_host
(
doc
,
nsscript
);
ScriptHost
*
script_host
;
script_host
=
get_script_host
(
doc
,
nsscript
);
if
(
!
script_host
)
return
;
if
(
script_host
->
parse
)
parse_script_elem
(
script_host
,
nsscript
);
}
void
release_script_hosts
(
HTMLDocument
*
doc
)
...
...
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