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
a9136b56
Commit
a9136b56
authored
Feb 20, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Addeed IHTMLDocument5::createAttribute implementation.
parent
2a0fd1c9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
20 deletions
+49
-20
htmlattr.c
dlls/mshtml/htmlattr.c
+33
-15
htmldoc5.c
dlls/mshtml/htmldoc5.c
+11
-2
htmlelem.c
dlls/mshtml/htmlelem.c
+1
-1
mshtml_private.h
dlls/mshtml/mshtml_private.h
+4
-2
No files found.
dlls/mshtml/htmlattr.c
View file @
a9136b56
...
...
@@ -81,6 +81,7 @@ static ULONG WINAPI HTMLDOMAttribute_Release(IHTMLDOMAttribute *iface)
if
(
!
ref
)
{
assert
(
!
This
->
elem
);
release_dispex
(
&
This
->
dispex
);
heap_free
(
This
->
name
);
heap_free
(
This
);
}
...
...
@@ -124,6 +125,11 @@ static HRESULT WINAPI HTMLDOMAttribute_get_nodeName(IHTMLDOMAttribute *iface, BS
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
This
->
elem
)
{
FIXME
(
"NULL This->elem
\n
"
);
return
E_UNEXPECTED
;
}
return
IDispatchEx_GetMemberName
(
&
This
->
elem
->
node
.
dispex
.
IDispatchEx_iface
,
This
->
dispid
,
p
);
}
...
...
@@ -163,16 +169,16 @@ static HRESULT WINAPI HTMLDOMAttribute_get_specified(IHTMLDOMAttribute *iface, V
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
get_dispid_type
(
This
->
dispid
)
!=
DISPEXPROP_BUILTIN
)
{
*
p
=
VARIANT_TRUE
;
return
S_OK
;
}
if
(
!
This
->
elem
||
!
This
->
elem
->
nselem
)
{
FIXME
(
"NULL This->elem
\n
"
);
return
E_UNEXPECTED
;
}
if
(
get_dispid_type
(
This
->
dispid
)
!=
DISPEXPROP_BUILTIN
)
{
*
p
=
VARIANT_TRUE
;
return
S_OK
;
}
hres
=
IDispatchEx_GetMemberName
(
&
This
->
elem
->
node
.
dispex
.
IDispatchEx_iface
,
This
->
dispid
,
&
name
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -221,7 +227,7 @@ static dispex_static_data_t HTMLDOMAttribute_dispex = {
HTMLDOMAttribute_iface_tids
};
HRESULT
HTMLDOMAttribute_Create
(
HTMLElement
*
elem
,
DISPID
dispid
,
HTMLDOMAttribute
**
attr
)
HRESULT
HTMLDOMAttribute_Create
(
const
WCHAR
*
name
,
HTMLElement
*
elem
,
DISPID
dispid
,
HTMLDOMAttribute
**
attr
)
{
HTMLAttributeCollection
*
col
;
HTMLDOMAttribute
*
ret
;
...
...
@@ -231,23 +237,35 @@ HRESULT HTMLDOMAttribute_Create(HTMLElement *elem, DISPID dispid, HTMLDOMAttribu
if
(
!
ret
)
return
E_OUTOFMEMORY
;
hres
=
HTMLElement_get_attr_col
(
&
elem
->
node
,
&
col
);
if
(
FAILED
(
hres
))
{
heap_free
(
ret
);
return
hres
;
}
IHTMLAttributeCollection_Release
(
&
col
->
IHTMLAttributeCollection_iface
);
ret
->
IHTMLDOMAttribute_iface
.
lpVtbl
=
&
HTMLDOMAttributeVtbl
;
ret
->
ref
=
1
;
ret
->
dispid
=
dispid
;
ret
->
elem
=
elem
;
list_add_tail
(
&
elem
->
attrs
->
attrs
,
&
ret
->
entry
);
init_dispex
(
&
ret
->
dispex
,
(
IUnknown
*
)
&
ret
->
IHTMLDOMAttribute_iface
,
&
HTMLDOMAttribute_dispex
);
/* For attributes attached to an element, (elem,dispid) pair should be valid used for its operation. */
if
(
elem
)
{
hres
=
HTMLElement_get_attr_col
(
&
elem
->
node
,
&
col
);
if
(
FAILED
(
hres
))
{
IHTMLDOMAttribute_Release
(
&
ret
->
IHTMLDOMAttribute_iface
);
return
hres
;
}
IHTMLAttributeCollection_Release
(
&
col
->
IHTMLAttributeCollection_iface
);
list_add_tail
(
&
elem
->
attrs
->
attrs
,
&
ret
->
entry
);
}
/* For detached attributes we may still do most operations if we have its name available. */
if
(
name
)
{
ret
->
name
=
heap_strdupW
(
name
);
if
(
!
ret
->
name
)
{
IHTMLDOMAttribute_Release
(
&
ret
->
IHTMLDOMAttribute_iface
);
return
E_OUTOFMEMORY
;
}
}
*
attr
=
ret
;
return
S_OK
;
}
dlls/mshtml/htmldoc5.c
View file @
a9136b56
...
...
@@ -120,8 +120,17 @@ static HRESULT WINAPI HTMLDocument5_createAttribute(IHTMLDocument5 *iface, BSTR
IHTMLDOMAttribute
**
ppattribute
)
{
HTMLDocument
*
This
=
impl_from_IHTMLDocument5
(
iface
);
FIXME
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
bstrattrName
),
ppattribute
);
return
E_NOTIMPL
;
HTMLDOMAttribute
*
attr
;
HRESULT
hres
;
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_w
(
bstrattrName
),
ppattribute
);
hres
=
HTMLDOMAttribute_Create
(
bstrattrName
,
NULL
,
0
,
&
attr
);
if
(
FAILED
(
hres
))
return
hres
;
*
ppattribute
=
&
attr
->
IHTMLDOMAttribute_iface
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLDocument5_createComment
(
IHTMLDocument5
*
iface
,
BSTR
bstrdata
,
...
...
dlls/mshtml/htmlelem.c
View file @
a9136b56
...
...
@@ -2246,7 +2246,7 @@ static inline HRESULT get_domattr(HTMLAttributeCollection *This, DISPID id, LONG
return
E_UNEXPECTED
;
}
hres
=
HTMLDOMAttribute_Create
(
This
->
elem
,
id
,
attr
);
hres
=
HTMLDOMAttribute_Create
(
NULL
,
This
->
elem
,
id
,
attr
);
if
(
FAILED
(
hres
))
return
hres
;
}
...
...
dlls/mshtml/mshtml_private.h
View file @
a9136b56
...
...
@@ -852,12 +852,14 @@ typedef struct {
LONG
ref
;
DISPID
dispid
;
WCHAR
*
name
;
HTMLElement
*
elem
;
DISPID
dispid
;
struct
list
entry
;
}
HTMLDOMAttribute
;
HRESULT
HTMLDOMAttribute_Create
(
HTMLElement
*
,
DISPID
,
HTMLDOMAttribute
**
)
DECLSPEC_HIDDEN
;
HRESULT
HTMLDOMAttribute_Create
(
const
WCHAR
*
,
HTMLElement
*
,
DISPID
,
HTMLDOMAttribute
**
)
DECLSPEC_HIDDEN
;
HRESULT
HTMLElement_Create
(
HTMLDocumentNode
*
,
nsIDOMNode
*
,
BOOL
,
HTMLElement
**
)
DECLSPEC_HIDDEN
;
HRESULT
HTMLCommentElement_Create
(
HTMLDocumentNode
*
,
nsIDOMNode
*
,
HTMLElement
**
)
DECLSPEC_HIDDEN
;
...
...
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