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
cb7b58c5
Commit
cb7b58c5
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 external scripts support.
parent
620a9500
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
136 additions
and
1 deletion
+136
-1
navigate.c
dlls/mshtml/navigate.c
+111
-0
script.c
dlls/mshtml/script.c
+25
-1
No files found.
dlls/mshtml/navigate.c
View file @
cb7b58c5
...
@@ -718,6 +718,117 @@ HRESULT start_binding(HTMLDocument *doc, BSCallback *bscallback, IBindCtx *bctx)
...
@@ -718,6 +718,117 @@ HRESULT start_binding(HTMLDocument *doc, BSCallback *bscallback, IBindCtx *bctx)
return
S_OK
;
return
S_OK
;
}
}
typedef
struct
{
BSCallback
bsc
;
DWORD
size
;
BYTE
*
buf
;
HRESULT
hres
;
}
BufferBSC
;
#define BUFFERBSC_THIS(bsc) ((BufferBSC*) bsc)
static
void
BufferBSC_destroy
(
BSCallback
*
bsc
)
{
BufferBSC
*
This
=
BUFFERBSC_THIS
(
bsc
);
heap_free
(
This
->
buf
);
heap_free
(
This
);
}
static
HRESULT
BufferBSC_start_binding
(
BSCallback
*
bsc
)
{
return
S_OK
;
}
static
HRESULT
BufferBSC_stop_binding
(
BSCallback
*
bsc
,
HRESULT
result
)
{
BufferBSC
*
This
=
BUFFERBSC_THIS
(
bsc
);
This
->
hres
=
result
;
if
(
FAILED
(
result
))
{
heap_free
(
This
->
buf
);
This
->
buf
=
NULL
;
This
->
size
=
0
;
}
return
S_OK
;
}
static
HRESULT
BufferBSC_read_data
(
BSCallback
*
bsc
,
IStream
*
stream
)
{
BufferBSC
*
This
=
BUFFERBSC_THIS
(
bsc
);
DWORD
readed
;
HRESULT
hres
;
if
(
!
This
->
buf
)
{
This
->
size
=
128
;
This
->
buf
=
heap_alloc
(
This
->
size
);
}
do
{
if
(
This
->
bsc
.
readed
==
This
->
size
)
{
This
->
size
<<=
1
;
This
->
buf
=
heap_realloc
(
This
->
buf
,
This
->
size
);
}
readed
=
0
;
hres
=
IStream_Read
(
stream
,
This
->
buf
+
This
->
bsc
.
readed
,
This
->
size
-
This
->
bsc
.
readed
,
&
readed
);
This
->
bsc
.
readed
+=
readed
;
}
while
(
hres
==
S_OK
);
return
S_OK
;
}
static
HRESULT
BufferBSC_on_progress
(
BSCallback
*
bsc
,
ULONG
status_code
,
LPCWSTR
status_text
)
{
return
S_OK
;
}
#undef BUFFERBSC_THIS
static
const
BSCallbackVtbl
BufferBSCVtbl
=
{
BufferBSC_destroy
,
BufferBSC_start_binding
,
BufferBSC_stop_binding
,
BufferBSC_read_data
,
BufferBSC_on_progress
,
};
static
BufferBSC
*
create_bufferbsc
(
IMoniker
*
mon
)
{
BufferBSC
*
ret
=
heap_alloc_zero
(
sizeof
(
*
ret
));
init_bscallback
(
&
ret
->
bsc
,
&
BufferBSCVtbl
,
mon
,
0
);
ret
->
hres
=
E_FAIL
;
return
ret
;
}
HRESULT
bind_mon_to_buffer
(
HTMLDocument
*
doc
,
IMoniker
*
mon
,
void
**
buf
)
{
BufferBSC
*
bsc
=
create_bufferbsc
(
mon
);
HRESULT
hres
;
*
buf
=
NULL
;
hres
=
start_binding
(
doc
,
&
bsc
->
bsc
,
NULL
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
bsc
->
hres
;
if
(
SUCCEEDED
(
hres
))
{
*
buf
=
bsc
->
buf
;
bsc
->
buf
=
NULL
;
bsc
->
size
=
0
;
}
}
IBindStatusCallback_Release
(
STATUSCLB
(
&
bsc
->
bsc
));
return
hres
;
}
struct
nsChannelBSC
{
struct
nsChannelBSC
{
BSCallback
bsc
;
BSCallback
bsc
;
...
...
dlls/mshtml/script.c
View file @
cb7b58c5
...
@@ -474,7 +474,31 @@ static void parse_text(ScriptHost *script_host, LPCWSTR text)
...
@@ -474,7 +474,31 @@ static void parse_text(ScriptHost *script_host, LPCWSTR text)
static
void
parse_extern_script
(
ScriptHost
*
script_host
,
LPCWSTR
src
)
static
void
parse_extern_script
(
ScriptHost
*
script_host
,
LPCWSTR
src
)
{
{
FIXME
(
"%p %s
\n
"
,
script_host
,
debugstr_w
(
src
));
IMoniker
*
mon
;
char
*
buf
;
WCHAR
*
text
;
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
=
CreateURLMoniker
(
NULL
,
src
,
&
mon
);
if
(
FAILED
(
hres
))
return
;
hres
=
bind_mon_to_buffer
(
script_host
->
doc
,
mon
,
(
void
**
)
&
buf
);
IMoniker_Release
(
mon
);
if
(
FAILED
(
hres
))
return
;
text
=
heap_strdupAtoW
(
buf
);
heap_free
(
buf
);
parse_text
(
script_host
,
text
);
heap_free
(
text
);
}
}
static
void
parse_inline_script
(
ScriptHost
*
script_host
,
nsIDOMHTMLScriptElement
*
nsscript
)
static
void
parse_inline_script
(
ScriptHost
*
script_host
,
nsIDOMHTMLScriptElement
*
nsscript
)
...
...
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