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
134dad7e
Commit
134dad7e
authored
Mar 08, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLScriptElement:get_type implementation.
parent
5ecd33e2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
3 deletions
+65
-3
htmlscript.c
dlls/mshtml/htmlscript.c
+23
-2
nsiface.idl
dlls/mshtml/nsiface.idl
+24
-0
dom.c
dlls/mshtml/tests/dom.c
+18
-1
No files found.
dlls/mshtml/htmlscript.c
View file @
134dad7e
...
...
@@ -39,6 +39,8 @@ typedef struct {
HTMLElement
element
;
const
IHTMLScriptElementVtbl
*
lpHTMLScriptElementVtbl
;
nsIDOMHTMLScriptElement
*
nsscript
;
}
HTMLScriptElement
;
#define HTMLSCRIPT(x) ((IHTMLScriptElement*) &(x)->lpHTMLScriptElementVtbl)
...
...
@@ -203,8 +205,22 @@ static HRESULT WINAPI HTMLScriptElement_put_type(IHTMLScriptElement *iface, BSTR
static
HRESULT
WINAPI
HTMLScriptElement_get_type
(
IHTMLScriptElement
*
iface
,
BSTR
*
p
)
{
HTMLScriptElement
*
This
=
HTMLSCRIPT_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
const
PRUnichar
*
nstype
;
nsAString
nstype_str
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
nstype_str
,
NULL
);
nsres
=
nsIDOMHTMLScriptElement_GetType
(
This
->
nsscript
,
&
nstype_str
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"GetType failed: %08x
\n
"
,
nsres
);
nsAString_GetData
(
&
nstype_str
,
&
nstype
);
*
p
=
*
nstype
?
SysAllocString
(
nstype
)
:
NULL
;
nsAString_Finish
(
&
nstype_str
);
return
S_OK
;
}
static
const
IHTMLScriptElementVtbl
HTMLScriptElementVtbl
=
{
...
...
@@ -277,11 +293,16 @@ static const NodeImplVtbl HTMLScriptElementImplVtbl = {
HTMLElement
*
HTMLScriptElement_Create
(
nsIDOMHTMLElement
*
nselem
)
{
HTMLScriptElement
*
ret
=
heap_alloc
(
sizeof
(
HTMLScriptElement
));
nsresult
nsres
;
HTMLElement_Init
(
&
ret
->
element
);
ret
->
lpHTMLScriptElementVtbl
=
&
HTMLScriptElementVtbl
;
ret
->
element
.
node
.
vtbl
=
&
HTMLScriptElementImplVtbl
;
nsres
=
nsIDOMHTMLElement_QueryInterface
(
nselem
,
&
IID_nsIDOMHTMLScriptElement
,
(
void
**
)
&
ret
->
nsscript
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"Could not get nsIDOMHTMLScriptElement: %08x
\n
"
,
nsres
);
return
&
ret
->
element
;
}
dlls/mshtml/nsiface.idl
View file @
134dad7e
...
...
@@ -1273,6 +1273,30 @@ interface nsIDOMHTMLTextAreaElement : nsIDOMHTMLElement
[
object,
uuid(a6cf90b1-15b3-11d2-932e-00805f8add32),
local
/* FROZEN */
]
interface nsIDOMHTMLScriptElement : nsIDOMHTMLElement
{
nsresult GetText(nsAString *aText);
nsresult SetText(const nsAString *aText);
nsresult GetHtmlFor(nsAString *aHtmlFor);
nsresult SetHtmlFor(const nsAString *aHtmlFor);
nsresult GetEvent(nsAString *aEvent);
nsresult SetEvent(const nsAString *aEvent);
nsresult GetCharset(nsAString *aCharset);
nsresult SetCharset(const nsAString *aCharset);
nsresult GetDefer(PRBool *aDefer);
nsresult SetDefer(PRBool aDefer);
nsresult GetSrc(nsAString *aSrc);
nsresult SetSrc(const nsAString *aSrc);
nsresult GetType(nsAString *aType);
nsresult SetType(const nsAString *aType);
}
[
object,
uuid(94928ab3-8b63-11d3-989d-001083010e9b),
local
/* FROZEN */
...
...
dlls/mshtml/tests/dom.c
View file @
134dad7e
...
...
@@ -43,7 +43,7 @@ static const char elem_test_str[] =
"<select id=
\"
s
\"
><option id=
\"
x
\"
>opt1</option><option id=
\"
y
\"
>opt2</option></select>"
"<textarea id=
\"
X
\"
>text text</textarea>"
"<table><tbody></tbody></table>"
"<script type=
\"
text/javascript
\"
></script>"
"<script
id=
\"
sc
\"
type=
\"
text/javascript
\"
></script>"
"</body></html>"
;
static
const
char
indent_test_str
[]
=
"<html><head><title>test</title></head><body>abc<br /><a href=
\"
about:blank
\"
>123</a></body></html>"
;
...
...
@@ -54,6 +54,8 @@ static WCHAR characterW[] = {'c','h','a','r','a','c','t','e','r',0};
static
WCHAR
texteditW
[]
=
{
't'
,
'e'
,
'x'
,
't'
,
'e'
,
'd'
,
'i'
,
't'
,
0
};
static
WCHAR
wordW
[]
=
{
'w'
,
'o'
,
'r'
,
'd'
,
0
};
static
const
WCHAR
text_javascriptW
[]
=
{
't'
,
'e'
,
'x'
,
't'
,
'/'
,
'j'
,
'a'
,
'v'
,
'a'
,
's'
,
'c'
,
'r'
,
'i'
,
'p'
,
't'
,
0
};
typedef
enum
{
ET_NONE
,
ET_HTML
,
...
...
@@ -1193,6 +1195,7 @@ static void test_elems(IHTMLDocument2 *doc)
static
const
WCHAR
xW
[]
=
{
'x'
,
0
};
static
const
WCHAR
sW
[]
=
{
's'
,
0
};
static
const
WCHAR
scW
[]
=
{
's'
,
'c'
,
0
};
static
const
WCHAR
xxxW
[]
=
{
'x'
,
'x'
,
'x'
,
0
};
static
const
elem_type_t
all_types
[]
=
{
...
...
@@ -1250,6 +1253,20 @@ static void test_elems(IHTMLDocument2 *doc)
IHTMLElement_Release
(
elem
);
}
elem
=
get_elem_by_id
(
doc
,
scW
,
TRUE
);
if
(
elem
)
{
IHTMLScriptElement
*
script
;
BSTR
type
;
hres
=
IHTMLElement_QueryInterface
(
elem
,
&
IID_IHTMLScriptElement
,
(
void
**
)
&
script
);
ok
(
hres
==
S_OK
,
"Could not get IHTMLScriptElement interface: %08x
\n
"
,
hres
);
hres
=
IHTMLScriptElement_get_type
(
script
,
&
type
);
ok
(
hres
==
S_OK
,
"get_type failed: %08x
\n
"
,
hres
);
ok
(
!
lstrcmpW
(
type
,
text_javascriptW
),
"Unexpected type %s
\n
"
,
dbgstr_w
(
type
));
SysFreeString
(
type
);
}
test_stylesheets
(
doc
);
test_create_option_elem
(
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