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
9608714d
Commit
9608714d
authored
Oct 15, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 15, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLLinkElement::disabled property implementation.
parent
b75e2c4d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
112 additions
and
8 deletions
+112
-8
htmllink.c
dlls/mshtml/htmllink.c
+40
-8
nsiface.idl
dlls/mshtml/nsiface.idl
+27
-0
dom.c
dlls/mshtml/tests/dom.c
+45
-0
No files found.
dlls/mshtml/htmllink.c
View file @
9608714d
...
...
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
#include <assert.h>
#define COBJMACROS
...
...
@@ -34,6 +35,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
typedef
struct
{
HTMLElement
element
;
IHTMLLinkElement
IHTMLLinkElement_iface
;
nsIDOMHTMLLinkElement
*
nslink
;
}
HTMLLinkElement
;
static
inline
HTMLLinkElement
*
impl_from_IHTMLLinkElement
(
IHTMLLinkElement
*
iface
)
...
...
@@ -214,15 +217,28 @@ static HRESULT WINAPI HTMLLinkElement_get_styleSheet(IHTMLLinkElement *iface, IH
static
HRESULT
WINAPI
HTMLLinkElement_put_disabled
(
IHTMLLinkElement
*
iface
,
VARIANT_BOOL
v
)
{
HTMLLinkElement
*
This
=
impl_from_IHTMLLinkElement
(
iface
);
FIXME
(
"(%p)->(%x)
\n
"
,
This
,
v
);
return
E_NOTIMPL
;
nsresult
nsres
;
TRACE
(
"(%p)->(%x)
\n
"
,
This
,
v
);
nsres
=
nsIDOMHTMLLinkElement_SetDisabled
(
This
->
nslink
,
!!
v
);
return
SUCCEEDED
(
nsres
)
?
S_OK
:
E_FAIL
;
}
static
HRESULT
WINAPI
HTMLLinkElement_get_disabled
(
IHTMLLinkElement
*
iface
,
VARIANT_BOOL
*
p
)
{
HTMLLinkElement
*
This
=
impl_from_IHTMLLinkElement
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
cpp_bool
ret
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsres
=
nsIDOMHTMLLinkElement_GetDisabled
(
This
->
nslink
,
&
ret
);
if
(
NS_FAILED
(
nsres
))
return
E_FAIL
;
*
p
=
ret
?
VARIANT_TRUE
:
VARIANT_FALSE
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLLinkElement_put_media
(
IHTMLLinkElement
*
iface
,
BSTR
v
)
...
...
@@ -289,19 +305,28 @@ static HRESULT HTMLLinkElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
return
S_OK
;
}
static
void
HTMLLinkElement_destructor
(
HTMLDOMNode
*
iface
)
static
HRESULT
HTMLLinkElementImpl_put_disabled
(
HTMLDOMNode
*
iface
,
VARIANT_BOOL
v
)
{
HTMLLinkElement
*
This
=
impl_from_HTMLDOMNode
(
iface
);
return
IHTMLLinkElement_put_disabled
(
&
This
->
IHTMLLinkElement_iface
,
v
);
}
HTMLElement_destructor
(
&
This
->
element
.
node
);
static
HRESULT
HTMLLinkElementImpl_get_disabled
(
HTMLDOMNode
*
iface
,
VARIANT_BOOL
*
p
)
{
HTMLLinkElement
*
This
=
impl_from_HTMLDOMNode
(
iface
);
return
IHTMLLinkElement_get_disabled
(
&
This
->
IHTMLLinkElement_iface
,
p
);
}
static
const
NodeImplVtbl
HTMLLinkElementImplVtbl
=
{
HTMLLinkElement_QI
,
HTML
Link
Element_destructor
,
HTMLElement_destructor
,
HTMLElement_clone
,
HTMLElement_handle_event
,
HTMLElement_get_attr_col
HTMLElement_get_attr_col
,
NULL
,
NULL
,
HTMLLinkElementImpl_put_disabled
,
HTMLLinkElementImpl_get_disabled
,
};
static
const
tid_t
HTMLLinkElement_iface_tids
[]
=
{
...
...
@@ -319,6 +344,7 @@ static dispex_static_data_t HTMLLinkElement_dispex = {
HRESULT
HTMLLinkElement_Create
(
HTMLDocumentNode
*
doc
,
nsIDOMHTMLElement
*
nselem
,
HTMLElement
**
elem
)
{
HTMLLinkElement
*
ret
;
nsresult
nsres
;
ret
=
heap_alloc_zero
(
sizeof
(
*
ret
));
if
(
!
ret
)
...
...
@@ -329,6 +355,12 @@ HRESULT HTMLLinkElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem,
HTMLElement_Init
(
&
ret
->
element
,
doc
,
nselem
,
&
HTMLLinkElement_dispex
);
nsres
=
nsIDOMHTMLElement_QueryInterface
(
nselem
,
&
IID_nsIDOMHTMLLinkElement
,
(
void
**
)
&
ret
->
nslink
);
/* Share nslink reference with nsnode */
assert
(
nsres
==
NS_OK
&&
(
nsIDOMNode
*
)
ret
->
nslink
==
ret
->
element
.
node
.
nsnode
);
nsIDOMNode_Release
(
ret
->
element
.
node
.
nsnode
);
*
elem
=
&
ret
->
element
;
return
S_OK
;
}
dlls/mshtml/nsiface.idl
View file @
9608714d
...
...
@@ -1902,6 +1902,33 @@ interface nsIDOMHTMLAnchorElement : nsIDOMHTMLElement
[
object
,
uuid
(
59
ae3529
-
170
a
-
41
e4
-
8
d7a
-
241
dca6b5760
),
local
]
interface
nsIDOMHTMLLinkElement
:
nsIDOMHTMLElement
{
nsresult
GetDisabled
(
bool
*
aDisabled
)
;
nsresult
SetDisabled
(
bool
aDisabled
)
;
nsresult
GetCharset
(
nsAString
*
aCharset
)
;
nsresult
SetCharset
(
const
nsAString
*
aCharset
)
;
nsresult
GetHref
(
nsAString
*
aHref
)
;
nsresult
SetHref
(
const
nsAString
*
aHref
)
;
nsresult
GetHreflang
(
nsAString
*
aHreflang
)
;
nsresult
SetHreflang
(
const
nsAString
*
aHreflang
)
;
nsresult
GetMedia
(
nsAString
*
aMedia
)
;
nsresult
SetMedia
(
const
nsAString
*
aMedia
)
;
nsresult
GetRel
(
nsAString
*
aRel
)
;
nsresult
SetRel
(
const
nsAString
*
aRel
)
;
nsresult
GetRev
(
nsAString
*
aRev
)
;
nsresult
SetRev
(
const
nsAString
*
aRev
)
;
nsresult
GetTarget
(
nsAString
*
aTarget
)
;
nsresult
SetTarget
(
const
nsAString
*
aTarget
)
;
nsresult
GetType
(
nsAString
*
aType
)
;
nsresult
SetType
(
const
nsAString
*
aType
)
;
}
[
object
,
uuid
(
ae50de74
-
bc26
-402e-85
dc
-
a980f506b655
),
local
]
...
...
dlls/mshtml/tests/dom.c
View file @
9608714d
...
...
@@ -64,6 +64,7 @@ static const char elem_test_str[] =
"</body></html>"
;
static
const
char
elem_test2_str
[]
=
"<html><head><title>test</title><style>.body { margin-right: 0px; }</style>"
"<link id=
\"
linkid
\"
rel=
\"
stylesheet
\"
href=
\"
some.css
\"
type=
\"
text/css
\"
></head>"
"<body><div id=
\"
divid
\"
emptyattr=
\"\"
onclick=
\"
parseInt();
\"
></div></body>"
"</html>"
;
...
...
@@ -866,6 +867,17 @@ static IHTMLMetaElement *_get_metaelem_iface(unsigned line, IUnknown *unk)
return
ret
;
}
#define get_link_iface(u) _get_link_iface(__LINE__,u)
static
IHTMLLinkElement
*
_get_link_iface
(
unsigned
line
,
IUnknown
*
unk
)
{
IHTMLLinkElement
*
ret
;
HRESULT
hres
;
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IHTMLLinkElement
,
(
void
**
)
&
ret
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"Could not get IHTMLLinkElement: %08x
\n
"
,
hres
);
return
ret
;
}
#define test_node_name(u,n) _test_node_name(__LINE__,u,n)
static
void
_test_node_name
(
unsigned
line
,
IUnknown
*
unk
,
const
char
*
exname
)
{
...
...
@@ -3415,6 +3427,32 @@ static void _test_meta_httpequiv(unsigned line, IUnknown *unk, const char *exval
IHTMLMetaElement_Release
(
meta
);
}
#define test_link_disabled(a,b) _test_link_disabled(__LINE__,a,b)
static
void
_test_link_disabled
(
unsigned
line
,
IHTMLElement
*
elem
,
VARIANT_BOOL
v
)
{
IHTMLLinkElement
*
link
=
_get_link_iface
(
line
,
(
IUnknown
*
)
elem
);
VARIANT_BOOL
b
=
10
;
HRESULT
hres
;
hres
=
IHTMLLinkElement_get_disabled
(
link
,
&
b
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_disabled failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
b
==
v
,
"disabled = %x, expected %x
\n
"
,
b
,
v
);
IHTMLLinkElement_Release
(
link
);
}
#define link_put_disabled(a,b) _link_put_disabled(__LINE__,a,b)
static
void
_link_put_disabled
(
unsigned
line
,
IHTMLElement
*
elem
,
VARIANT_BOOL
v
)
{
IHTMLLinkElement
*
link
=
_get_link_iface
(
line
,
(
IUnknown
*
)
elem
);
HRESULT
hres
;
hres
=
IHTMLLinkElement_put_disabled
(
link
,
v
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"put_disabled failed: %08x
\n
"
,
hres
);
IHTMLLinkElement_Release
(
link
);
_test_link_disabled
(
line
,
elem
,
v
);
}
#define get_elem_doc(e) _get_elem_doc(__LINE__,e)
static
IHTMLDocument2
*
_get_elem_doc
(
unsigned
line
,
IUnknown
*
unk
)
{
...
...
@@ -5913,6 +5951,13 @@ static void test_elems2(IHTMLDocument2 *doc)
div
=
get_doc_elem_by_id
(
doc
,
"divid"
);
elem
=
get_elem_by_id
(
doc
,
"linkid"
,
TRUE
);
if
(
elem
)
{
test_link_disabled
(
elem
,
VARIANT_FALSE
);
link_put_disabled
(
elem
,
VARIANT_TRUE
);
IHTMLElement_Release
(
elem
);
}
test_elem_set_innerhtml
((
IUnknown
*
)
div
,
"<div id=
\"
innerid
\"
></div>"
);
elem2
=
get_doc_elem_by_id
(
doc
,
"innerid"
);
ok
(
elem2
!=
NULL
,
"elem2 == NULL
\n
"
);
...
...
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