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
b79ef676
Commit
b79ef676
authored
May 27, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added new helper for GetAttribute based getters and use it in…
mshtml: Added new helper for GetAttribute based getters and use it in IHTMLMetaElement implementation.
parent
39e24713
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
27 deletions
+21
-27
htmlelem.c
dlls/mshtml/htmlelem.c
+17
-0
htmlmeta.c
dlls/mshtml/htmlmeta.c
+3
-27
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
No files found.
dlls/mshtml/htmlelem.c
View file @
b79ef676
...
...
@@ -175,6 +175,23 @@ nsresult get_elem_attr_value(nsIDOMHTMLElement *nselem, const WCHAR *name, nsASt
return
NS_OK
;
}
HRESULT
elem_string_attr_getter
(
HTMLElement
*
elem
,
const
WCHAR
*
name
,
BSTR
*
p
)
{
const
PRUnichar
*
val
;
nsAString
val_str
;
nsresult
nsres
;
nsres
=
get_elem_attr_value
(
elem
->
nselem
,
name
,
&
val_str
,
&
val
);
if
(
NS_FAILED
(
nsres
))
return
E_FAIL
;
TRACE
(
"%s: returning %s
\n
"
,
debugstr_w
(
name
),
debugstr_w
(
val
));
*
p
=
SysAllocString
(
val
);
nsAString_Finish
(
&
val_str
);
return
*
p
?
S_OK
:
E_OUTOFMEMORY
;
}
typedef
struct
{
DispatchEx
dispex
;
...
...
dlls/mshtml/htmlmeta.c
View file @
b79ef676
...
...
@@ -104,19 +104,11 @@ static HRESULT WINAPI HTMLMetaElement_put_httpEquiv(IHTMLMetaElement *iface, BST
static
HRESULT
WINAPI
HTMLMetaElement_get_httpEquiv
(
IHTMLMetaElement
*
iface
,
BSTR
*
p
)
{
HTMLMetaElement
*
This
=
impl_from_IHTMLMetaElement
(
iface
);
nsAString
httpequiv_str
,
val_str
;
nsresult
nsres
;
static
const
PRUnichar
httpEquivW
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
'-'
,
'e'
,
'q'
,
'u'
,
'i'
,
'v'
,
0
};
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_InitDepend
(
&
httpequiv_str
,
httpEquivW
);
nsAString_Init
(
&
val_str
,
NULL
);
nsres
=
nsIDOMHTMLElement_GetAttribute
(
This
->
element
.
nselem
,
&
httpequiv_str
,
&
val_str
);
nsAString_Finish
(
&
httpequiv_str
);
return
return_nsstr
(
nsres
,
&
val_str
,
p
);
return
elem_string_attr_getter
(
&
This
->
element
,
httpEquivW
,
p
);
}
static
HRESULT
WINAPI
HTMLMetaElement_put_content
(
IHTMLMetaElement
*
iface
,
BSTR
v
)
...
...
@@ -129,19 +121,11 @@ static HRESULT WINAPI HTMLMetaElement_put_content(IHTMLMetaElement *iface, BSTR
static
HRESULT
WINAPI
HTMLMetaElement_get_content
(
IHTMLMetaElement
*
iface
,
BSTR
*
p
)
{
HTMLMetaElement
*
This
=
impl_from_IHTMLMetaElement
(
iface
);
nsAString
content_str
,
val_str
;
nsresult
nsres
;
static
const
PRUnichar
contentW
[]
=
{
'c'
,
'o'
,
'n'
,
't'
,
'e'
,
'n'
,
't'
,
0
};
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_InitDepend
(
&
content_str
,
contentW
);
nsAString_Init
(
&
val_str
,
NULL
);
nsres
=
nsIDOMHTMLElement_GetAttribute
(
This
->
element
.
nselem
,
&
content_str
,
&
val_str
);
nsAString_Finish
(
&
content_str
);
return
return_nsstr
(
nsres
,
&
val_str
,
p
);
return
elem_string_attr_getter
(
&
This
->
element
,
contentW
,
p
);
}
static
HRESULT
WINAPI
HTMLMetaElement_put_name
(
IHTMLMetaElement
*
iface
,
BSTR
v
)
...
...
@@ -154,19 +138,11 @@ static HRESULT WINAPI HTMLMetaElement_put_name(IHTMLMetaElement *iface, BSTR v)
static
HRESULT
WINAPI
HTMLMetaElement_get_name
(
IHTMLMetaElement
*
iface
,
BSTR
*
p
)
{
HTMLMetaElement
*
This
=
impl_from_IHTMLMetaElement
(
iface
);
nsAString
name_str
,
val_str
;
nsresult
nsres
;
static
const
PRUnichar
nameW
[]
=
{
'n'
,
'a'
,
'm'
,
'e'
,
0
};
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_InitDepend
(
&
name_str
,
nameW
);
nsAString_Init
(
&
val_str
,
NULL
);
nsres
=
nsIDOMHTMLElement_GetAttribute
(
This
->
element
.
nselem
,
&
name_str
,
&
val_str
);
nsAString_Finish
(
&
name_str
);
return
return_nsstr
(
nsres
,
&
val_str
,
p
);
return
elem_string_attr_getter
(
&
This
->
element
,
nameW
,
p
);
}
static
HRESULT
WINAPI
HTMLMetaElement_put_url
(
IHTMLMetaElement
*
iface
,
BSTR
v
)
...
...
dlls/mshtml/mshtml_private.h
View file @
b79ef676
...
...
@@ -960,6 +960,7 @@ IHTMLElementCollection *create_collection_from_nodelist(HTMLDocumentNode*,nsIDOM
IHTMLElementCollection
*
create_collection_from_htmlcol
(
HTMLDocumentNode
*
,
nsIDOMHTMLCollection
*
)
DECLSPEC_HIDDEN
;
nsresult
get_elem_attr_value
(
nsIDOMHTMLElement
*
,
const
WCHAR
*
,
nsAString
*
,
const
PRUnichar
**
)
DECLSPEC_HIDDEN
;
HRESULT
elem_string_attr_getter
(
HTMLElement
*
,
const
WCHAR
*
,
BSTR
*
)
DECLSPEC_HIDDEN
;
/* commands */
typedef
struct
{
...
...
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