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
c6c0c6b5
Commit
c6c0c6b5
authored
Oct 10, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLElement::language property implementation.
parent
120422e9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
4 deletions
+54
-4
htmlelem.c
dlls/mshtml/htmlelem.c
+10
-4
dom.c
dlls/mshtml/tests/dom.c
+35
-0
jstest.html
dlls/mshtml/tests/jstest.html
+9
-0
No files found.
dlls/mshtml/htmlelem.c
View file @
c6c0c6b5
...
...
@@ -837,18 +837,24 @@ static HRESULT WINAPI HTMLElement_get_title(IHTMLElement *iface, BSTR *p)
return
return_nsstr
(
nsres
,
&
title_str
,
p
);
}
static
const
WCHAR
languageW
[]
=
{
'l'
,
'a'
,
'n'
,
'g'
,
'u'
,
'a'
,
'g'
,
'e'
,
0
};
static
HRESULT
WINAPI
HTMLElement_put_language
(
IHTMLElement
*
iface
,
BSTR
v
)
{
HTMLElement
*
This
=
impl_from_IHTMLElement
(
iface
);
FIXME
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
return
elem_string_attr_setter
(
This
,
languageW
,
v
);
}
static
HRESULT
WINAPI
HTMLElement_get_language
(
IHTMLElement
*
iface
,
BSTR
*
p
)
{
HTMLElement
*
This
=
impl_from_IHTMLElement
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
elem_string_attr_getter
(
This
,
languageW
,
TRUE
,
p
);
}
static
HRESULT
WINAPI
HTMLElement_put_onselectstart
(
IHTMLElement
*
iface
,
VARIANT
v
)
...
...
dlls/mshtml/tests/dom.c
View file @
c6c0c6b5
...
...
@@ -3138,6 +3138,36 @@ static void _test_elem_id(unsigned line, IUnknown *unk, const char *exid)
SysFreeString
(
id
);
}
#define test_elem_language(e,i) _test_elem_language(__LINE__,e,i)
static
void
_test_elem_language
(
unsigned
line
,
IHTMLElement
*
elem
,
const
char
*
exlang
)
{
BSTR
lang
=
(
void
*
)
0xdeadbeef
;
HRESULT
hres
;
hres
=
IHTMLElement_get_language
(
elem
,
&
lang
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"get_language failed: %08x
\n
"
,
hres
);
if
(
exlang
)
ok_
(
__FILE__
,
line
)
(
!
strcmp_wa
(
lang
,
exlang
),
"unexpected language %s
\n
"
,
wine_dbgstr_w
(
lang
));
else
ok_
(
__FILE__
,
line
)
(
!
lang
,
"language=%s
\n
"
,
wine_dbgstr_w
(
lang
));
SysFreeString
(
lang
);
}
#define set_elem_language(e,i) _set_elem_language(__LINE__,e,i)
static
void
_set_elem_language
(
unsigned
line
,
IHTMLElement
*
elem
,
const
char
*
lang
)
{
BSTR
str
=
a2bstr
(
lang
);
HRESULT
hres
;
hres
=
IHTMLElement_put_language
(
elem
,
str
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"get_language failed: %08x
\n
"
,
hres
);
SysFreeString
(
str
);
_test_elem_language
(
line
,
elem
,
lang
);
}
#define test_elem_put_id(u,i) _test_elem_put_id(__LINE__,u,i)
static
void
_test_elem_put_id
(
unsigned
line
,
IUnknown
*
unk
,
const
char
*
new_id
)
{
...
...
@@ -7135,6 +7165,8 @@ static void test_elems(IHTMLDocument2 *doc)
hres
=
IHTMLElement_QueryInterface
(
elem
,
&
IID_IHTMLScriptElement
,
(
void
**
)
&
script
);
ok
(
hres
==
S_OK
,
"Could not get IHTMLScriptElement interface: %08x
\n
"
,
hres
);
test_elem_language
(
elem
,
NULL
);
if
(
hres
==
S_OK
)
{
VARIANT_BOOL
vb
;
...
...
@@ -7174,6 +7206,9 @@ static void test_elems(IHTMLDocument2 *doc)
}
IHTMLScriptElement_Release
(
script
);
set_elem_language
(
elem
,
"vbscript"
);
set_elem_language
(
elem
,
"xxx"
);
}
elem
=
get_elem_by_id
(
doc
,
"in"
,
TRUE
);
...
...
dlls/mshtml/tests/jstest.html
View file @
c6c0c6b5
...
...
@@ -215,6 +215,14 @@ function test_whitespace_nodes() {
"t.rows[0].cells[0].childNodes.length = "
+
t
.
rows
[
0
].
cells
[
0
].
childNodes
.
length
);
}
function
test_language_attribute
()
{
document
.
body
.
innerHTML
=
'<div id="did" language="test"></div>'
;
var
elem
=
document
.
getElementById
(
"did"
);
ok
(
elem
.
language
===
"test"
,
"elem.language = "
+
elem
.
language
);
elem
.
language
=
1
;
ok
(
elem
.
language
===
"1"
,
"elem.language = "
+
elem
.
language
);
}
var
globalVar
=
false
;
function
runTests
()
{
...
...
@@ -238,6 +246,7 @@ function runTests() {
test_forin
();
test_customtag
();
test_whitespace_nodes
();
test_language_attribute
();
var
r
=
window
.
execScript
(
"globalVar = true;"
);
ok
(
r
===
undefined
,
"execScript returned "
+
r
);
...
...
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