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
1454e302
Commit
1454e302
authored
Dec 01, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 01, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added support for flag 2 in getAttribute.
parent
71cb0cea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
4 deletions
+43
-4
htmlelem.c
dlls/mshtml/htmlelem.c
+31
-4
jstest.html
dlls/mshtml/tests/jstest.html
+12
-0
No files found.
dlls/mshtml/htmlelem.c
View file @
1454e302
...
...
@@ -606,6 +606,10 @@ static HRESULT WINAPI HTMLElement_Invoke(IHTMLElement *iface, DISPID dispIdMembe
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
puArgErr
);
}
#define ATTRFLAG_CASESENSITIVE 0x0001
#define ATTRFLAG_ASSTRING 0x0002
#define ATTRFLAG_EXPANDURL 0x0004
static
HRESULT
WINAPI
HTMLElement_setAttribute
(
IHTMLElement
*
iface
,
BSTR
strAttributeName
,
VARIANT
AttributeValue
,
LONG
lFlags
)
{
...
...
@@ -618,7 +622,7 @@ static HRESULT WINAPI HTMLElement_setAttribute(IHTMLElement *iface, BSTR strAttr
TRACE
(
"(%p)->(%s %s %08x)
\n
"
,
This
,
debugstr_w
(
strAttributeName
),
debugstr_variant
(
&
AttributeValue
),
lFlags
);
hres
=
IDispatchEx_GetDispID
(
&
This
->
node
.
dispex
.
IDispatchEx_iface
,
strAttributeName
,
(
lFlags
&
1
?
fdexNameCaseSensitive
:
fdexNameCaseInsensitive
)
|
fdexNameEnsure
,
&
dispid
);
(
lFlags
&
ATTRFLAG_CASESENSITIVE
?
fdexNameCaseSensitive
:
fdexNameCaseInsensitive
)
|
fdexNameEnsure
,
&
dispid
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -647,8 +651,11 @@ static HRESULT WINAPI HTMLElement_getAttribute(IHTMLElement *iface, BSTR strAttr
TRACE
(
"(%p)->(%s %08x %p)
\n
"
,
This
,
debugstr_w
(
strAttributeName
),
lFlags
,
AttributeValue
);
if
(
lFlags
&
~
(
ATTRFLAG_CASESENSITIVE
|
ATTRFLAG_ASSTRING
))
FIXME
(
"Unsuported flags %x
\n
"
,
lFlags
);
hres
=
IDispatchEx_GetDispID
(
&
This
->
node
.
dispex
.
IDispatchEx_iface
,
strAttributeName
,
lFlags
&
1
?
fdexNameCaseSensitive
:
fdexNameCaseInsensitive
,
&
dispid
);
lFlags
&
ATTRFLAG_CASESENSITIVE
?
fdexNameCaseSensitive
:
fdexNameCaseInsensitive
,
&
dispid
);
if
(
hres
==
DISP_E_UNKNOWNNAME
)
{
V_VT
(
AttributeValue
)
=
VT_NULL
;
return
S_OK
;
...
...
@@ -659,8 +666,28 @@ static HRESULT WINAPI HTMLElement_getAttribute(IHTMLElement *iface, BSTR strAttr
return
hres
;
}
return
IDispatchEx_InvokeEx
(
&
This
->
node
.
dispex
.
IDispatchEx_iface
,
dispid
,
LOCALE_SYSTEM_DEFAULT
,
hres
=
IDispatchEx_InvokeEx
(
&
This
->
node
.
dispex
.
IDispatchEx_iface
,
dispid
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_PROPERTYGET
,
&
dispParams
,
AttributeValue
,
&
excep
,
NULL
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
lFlags
&
ATTRFLAG_ASSTRING
)
{
switch
(
V_VT
(
AttributeValue
))
{
case
VT_BSTR
:
break
;
case
VT_DISPATCH
:
IDispatch_Release
(
V_DISPATCH
(
AttributeValue
));
V_VT
(
AttributeValue
)
=
VT_BSTR
;
V_BSTR
(
AttributeValue
)
=
SysAllocString
(
NULL
);
break
;
default:
hres
=
VariantChangeType
(
AttributeValue
,
AttributeValue
,
0
,
VT_BSTR
);
if
(
FAILED
(
hres
))
return
hres
;
}
}
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLElement_removeAttribute
(
IHTMLElement
*
iface
,
BSTR
strAttributeName
,
...
...
@@ -673,7 +700,7 @@ static HRESULT WINAPI HTMLElement_removeAttribute(IHTMLElement *iface, BSTR strA
TRACE
(
"(%p)->(%s %x %p)
\n
"
,
This
,
debugstr_w
(
strAttributeName
),
lFlags
,
pfSuccess
);
hres
=
IDispatchEx_GetDispID
(
&
This
->
node
.
dispex
.
IDispatchEx_iface
,
strAttributeName
,
lFlags
&
1
?
fdexNameCaseSensitive
:
fdexNameCaseInsensitive
,
&
id
);
lFlags
&
ATTRFLAG_CASESENSITIVE
?
fdexNameCaseSensitive
:
fdexNameCaseInsensitive
,
&
id
);
if
(
hres
==
DISP_E_UNKNOWNNAME
)
{
*
pfSuccess
=
VARIANT_FALSE
;
return
S_OK
;
...
...
dlls/mshtml/tests/jstest.html
View file @
1454e302
...
...
@@ -148,12 +148,16 @@ function test_attrs() {
x
=
input
.
getAttribute
(
"style"
);
ok
(
x
===
s
,
"getAttribute('style') = "
+
x
);
ok
(
s
.
cssText
===
""
,
"s.cssText = "
+
s
.
cssText
);
x
=
input
.
getAttribute
(
"style"
,
2
);
ok
(
x
===
""
,
"getAttribute('style') = "
+
x
);
input
.
setAttribute
(
"style"
,
"display: none"
);
x
=
input
.
getAttribute
(
"style"
);
ok
(
x
===
s
,
"getAttribute('style') = "
+
x
);
ok
(
s
.
cssText
===
""
,
"s.cssText = "
+
s
.
cssText
);
ok
(
s
.
display
===
""
,
"s.display = "
+
s
.
display
);
x
=
input
.
getAttribute
(
"style"
,
2
);
ok
(
x
===
""
,
"getAttribute('style') = "
+
x
);
s
.
display
=
"none"
;
ok
(
s
.
cssText
!=
""
,
"s.cssText = "
+
s
.
cssText
);
...
...
@@ -163,6 +167,8 @@ function test_attrs() {
ok
(
x
===
s
,
"getAttribute('style') = "
+
x
);
ok
(
s
.
cssText
!=
""
,
"s.cssText = "
+
s
.
cssText
);
ok
(
s
.
display
===
"none"
,
"s.display = "
+
s
.
display
);
x
=
input
.
getAttribute
(
"style"
,
2
);
ok
(
x
===
""
,
"getAttribute('style') = "
+
x
);
input
.
setAttribute
(
"style"
,
null
);
x
=
input
.
getAttribute
(
"style"
);
...
...
@@ -173,11 +179,15 @@ function test_attrs() {
x
=
input
.
getAttribute
(
"fireEvent"
);
ok
(
x
===
input
.
fireEvent
,
"input.getAttribute('fireEvent') = "
+
x
);
x
=
input
.
getAttribute
(
"fireEvent"
,
2
);
ok
(
x
===
""
,
"getAttribute('fireEvent') = "
+
x
);
input
.
setAttribute
(
"fireEvent"
,
3
);
ok
(
input
.
fireEvent
===
3
,
"input.fireEvent = "
+
input
.
fireEvent
);
x
=
input
.
getAttribute
(
"fireEvent"
);
ok
(
x
===
3
,
"input.getAttribute('fireEvent') = "
+
x
);
x
=
input
.
getAttribute
(
"fireEvent"
,
2
);
ok
(
x
===
"3"
,
"getAttribute('fireEvent') = "
+
x
);
b
=
input
.
removeAttribute
(
"style"
);
ok
(
b
===
true
,
"removeAttribute('style') failed"
);
...
...
@@ -186,6 +196,8 @@ function test_attrs() {
ok
(
x
===
s
,
"getAttribute('style') = "
+
x
);
ok
(
s
.
display
===
""
,
"s.display = "
+
s
.
display
);
ok
(
s
.
cssText
===
""
,
"s.cssText = "
+
s
.
cssText
);
x
=
input
.
getAttribute
(
"style"
,
2
);
ok
(
x
===
""
,
"getAttribute('style') = "
+
x
);
b
=
input
.
removeAttribute
(
"style"
);
ok
(
b
===
true
,
"removeAttribute('style') failed"
);
...
...
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