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
39e24713
Commit
39e24713
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 getting element attribute value and use it in script.c.
parent
4745fd03
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
13 deletions
+26
-13
htmlelem.c
dlls/mshtml/htmlelem.c
+19
-0
mshtml_private.h
dlls/mshtml/mshtml_private.h
+2
-0
script.c
dlls/mshtml/script.c
+5
-13
No files found.
dlls/mshtml/htmlelem.c
View file @
39e24713
...
@@ -156,6 +156,25 @@ HRESULT replace_node_by_html(nsIDOMHTMLDocument *nsdoc, nsIDOMNode *nsnode, cons
...
@@ -156,6 +156,25 @@ HRESULT replace_node_by_html(nsIDOMHTMLDocument *nsdoc, nsIDOMNode *nsnode, cons
return
hres
;
return
hres
;
}
}
nsresult
get_elem_attr_value
(
nsIDOMHTMLElement
*
nselem
,
const
WCHAR
*
name
,
nsAString
*
val_str
,
const
PRUnichar
**
val
)
{
nsAString
name_str
;
nsresult
nsres
;
nsAString_InitDepend
(
&
name_str
,
name
);
nsAString_Init
(
val_str
,
NULL
);
nsres
=
nsIDOMHTMLElement_GetAttribute
(
nselem
,
&
name_str
,
val_str
);
nsAString_Finish
(
&
name_str
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetAttribute(%s) failed: %08x
\n
"
,
debugstr_w
(
name
),
nsres
);
nsAString_Finish
(
val_str
);
return
nsres
;
}
nsAString_GetData
(
val_str
,
val
);
return
NS_OK
;
}
typedef
struct
typedef
struct
{
{
DispatchEx
dispex
;
DispatchEx
dispex
;
...
...
dlls/mshtml/mshtml_private.h
View file @
39e24713
...
@@ -959,6 +959,8 @@ IHTMLElementCollection *create_all_collection(HTMLDOMNode*,BOOL) DECLSPEC_HIDDEN
...
@@ -959,6 +959,8 @@ IHTMLElementCollection *create_all_collection(HTMLDOMNode*,BOOL) DECLSPEC_HIDDEN
IHTMLElementCollection
*
create_collection_from_nodelist
(
HTMLDocumentNode
*
,
nsIDOMNodeList
*
)
DECLSPEC_HIDDEN
;
IHTMLElementCollection
*
create_collection_from_nodelist
(
HTMLDocumentNode
*
,
nsIDOMNodeList
*
)
DECLSPEC_HIDDEN
;
IHTMLElementCollection
*
create_collection_from_htmlcol
(
HTMLDocumentNode
*
,
nsIDOMHTMLCollection
*
)
DECLSPEC_HIDDEN
;
IHTMLElementCollection
*
create_collection_from_htmlcol
(
HTMLDocumentNode
*
,
nsIDOMHTMLCollection
*
)
DECLSPEC_HIDDEN
;
nsresult
get_elem_attr_value
(
nsIDOMHTMLElement
*
,
const
WCHAR
*
,
nsAString
*
,
const
PRUnichar
**
)
DECLSPEC_HIDDEN
;
/* commands */
/* commands */
typedef
struct
{
typedef
struct
{
DWORD
id
;
DWORD
id
;
...
...
dlls/mshtml/script.c
View file @
39e24713
...
@@ -784,7 +784,7 @@ static void parse_script_elem(ScriptHost *script_host, HTMLScriptElement *script
...
@@ -784,7 +784,7 @@ static void parse_script_elem(ScriptHost *script_host, HTMLScriptElement *script
return
;
return
;
}
}
}
else
{
}
else
{
ERR
(
"Get
Attribute(event)
failed: %08x
\n
"
,
nsres
);
ERR
(
"Get
Event
failed: %08x
\n
"
,
nsres
);
}
}
nsAString_Finish
(
&
event_str
);
nsAString_Finish
(
&
event_str
);
...
@@ -849,7 +849,8 @@ static BOOL get_guid_from_language(LPCWSTR type, GUID *guid)
...
@@ -849,7 +849,8 @@ static BOOL get_guid_from_language(LPCWSTR type, GUID *guid)
static
BOOL
get_script_guid
(
HTMLInnerWindow
*
window
,
nsIDOMHTMLScriptElement
*
nsscript
,
GUID
*
guid
)
static
BOOL
get_script_guid
(
HTMLInnerWindow
*
window
,
nsIDOMHTMLScriptElement
*
nsscript
,
GUID
*
guid
)
{
{
nsAString
attr_str
,
val_str
;
const
PRUnichar
*
language
;
nsAString
val_str
;
BOOL
ret
=
FALSE
;
BOOL
ret
=
FALSE
;
nsresult
nsres
;
nsresult
nsres
;
...
@@ -871,25 +872,16 @@ static BOOL get_script_guid(HTMLInnerWindow *window, nsIDOMHTMLScriptElement *ns
...
@@ -871,25 +872,16 @@ static BOOL get_script_guid(HTMLInnerWindow *window, nsIDOMHTMLScriptElement *ns
ERR
(
"GetType failed: %08x
\n
"
,
nsres
);
ERR
(
"GetType failed: %08x
\n
"
,
nsres
);
}
}
nsAString_InitDepend
(
&
attr_str
,
languageW
);
nsres
=
get_elem_attr_value
((
nsIDOMHTMLElement
*
)
nsscript
,
languageW
,
&
val_str
,
&
language
);
nsres
=
nsIDOMHTMLScriptElement_GetAttribute
(
nsscript
,
&
attr_str
,
&
val_str
);
nsAString_Finish
(
&
attr_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
if
(
NS_SUCCEEDED
(
nsres
))
{
const
PRUnichar
*
language
;
nsAString_GetData
(
&
val_str
,
&
language
);
if
(
*
language
)
{
if
(
*
language
)
{
ret
=
get_guid_from_language
(
language
,
guid
);
ret
=
get_guid_from_language
(
language
,
guid
);
}
else
{
}
else
{
*
guid
=
get_default_script_guid
(
window
);
*
guid
=
get_default_script_guid
(
window
);
ret
=
TRUE
;
ret
=
TRUE
;
}
}
}
else
{
ERR
(
"GetAttribute(language) failed: %08x
\n
"
,
nsres
);
}
nsAString_Finish
(
&
val_str
);
nsAString_Finish
(
&
val_str
);
}
return
ret
;
return
ret
;
}
}
...
...
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