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
eeb075dd
Commit
eeb075dd
authored
Jul 19, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 20, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Merge parse_extern_script and bind_script.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f73f8848
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
script.c
dlls/mshtml/script.c
+20
-20
No files found.
dlls/mshtml/script.c
View file @
eeb075dd
...
@@ -997,12 +997,30 @@ static const BSCallbackVtbl ScriptBSCVtbl = {
...
@@ -997,12 +997,30 @@ static const BSCallbackVtbl ScriptBSCVtbl = {
};
};
static
HRESULT
bind_script
(
HTMLInnerWindow
*
window
,
IUri
*
uri
,
HTMLScriptElement
*
script_elem
)
static
HRESULT
load_script
(
HTMLScriptElement
*
script_elem
,
const
WCHAR
*
src
)
{
{
HTMLInnerWindow
*
window
;
ScriptBSC
*
bsc
;
ScriptBSC
*
bsc
;
IMoniker
*
mon
;
IMoniker
*
mon
;
IUri
*
uri
;
HRESULT
hres
;
HRESULT
hres
;
static
const
WCHAR
wine_schemaW
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
':'
};
if
(
strlenW
(
src
)
>
sizeof
(
wine_schemaW
)
/
sizeof
(
WCHAR
)
&&
!
memcmp
(
src
,
wine_schemaW
,
sizeof
(
wine_schemaW
)))
src
+=
sizeof
(
wine_schemaW
)
/
sizeof
(
WCHAR
);
TRACE
(
"(%p %s)
\n
"
,
script_elem
,
debugstr_w
(
src
));
if
(
!
script_elem
->
element
.
node
.
doc
||
!
(
window
=
script_elem
->
element
.
node
.
doc
->
window
))
{
ERR
(
"no window
\n
"
);
return
E_UNEXPECTED
;
}
hres
=
create_uri
(
src
,
0
,
&
uri
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
CreateURLMonikerEx2
(
NULL
,
uri
,
&
mon
,
URL_MK_UNIFORM
);
hres
=
CreateURLMonikerEx2
(
NULL
,
uri
,
&
mon
,
URL_MK_UNIFORM
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
...
@@ -1029,24 +1047,6 @@ static HRESULT bind_script(HTMLInnerWindow *window, IUri *uri, HTMLScriptElement
...
@@ -1029,24 +1047,6 @@ static HRESULT bind_script(HTMLInnerWindow *window, IUri *uri, HTMLScriptElement
return
hres
;
return
hres
;
}
}
static
void
parse_extern_script
(
ScriptHost
*
script_host
,
HTMLScriptElement
*
script_elem
,
LPCWSTR
src
)
{
IUri
*
uri
;
HRESULT
hres
;
static
const
WCHAR
wine_schemaW
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
':'
};
if
(
strlenW
(
src
)
>
sizeof
(
wine_schemaW
)
/
sizeof
(
WCHAR
)
&&
!
memcmp
(
src
,
wine_schemaW
,
sizeof
(
wine_schemaW
)))
src
+=
sizeof
(
wine_schemaW
)
/
sizeof
(
WCHAR
);
hres
=
create_uri
(
src
,
0
,
&
uri
);
if
(
FAILED
(
hres
))
return
;
hres
=
bind_script
(
script_host
->
window
,
uri
,
script_elem
);
IUri_Release
(
uri
);
}
static
void
parse_inline_script
(
ScriptHost
*
script_host
,
HTMLScriptElement
*
script_elem
)
static
void
parse_inline_script
(
ScriptHost
*
script_host
,
HTMLScriptElement
*
script_elem
)
{
{
const
PRUnichar
*
text
;
const
PRUnichar
*
text
;
...
@@ -1095,7 +1095,7 @@ static void parse_script_elem(ScriptHost *script_host, HTMLScriptElement *script
...
@@ -1095,7 +1095,7 @@ static void parse_script_elem(ScriptHost *script_host, HTMLScriptElement *script
if
(
NS_FAILED
(
nsres
))
{
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetSrc failed: %08x
\n
"
,
nsres
);
ERR
(
"GetSrc failed: %08x
\n
"
,
nsres
);
}
else
if
(
*
src
)
{
}
else
if
(
*
src
)
{
parse_extern_script
(
script_host
,
script_elem
,
src
);
load_script
(
script_elem
,
src
);
}
else
{
}
else
{
parse_inline_script
(
script_host
,
script_elem
);
parse_inline_script
(
script_host
,
script_elem
);
}
}
...
...
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