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
130c8342
Commit
130c8342
authored
Sep 02, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Don't cache HTMLAttributesCollection results.
parent
726f0032
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
48 deletions
+31
-48
htmlelem.c
dlls/mshtml/htmlelem.c
+31
-46
mshtml_private.h
dlls/mshtml/mshtml_private.h
+0
-2
No files found.
dlls/mshtml/htmlelem.c
View file @
130c8342
...
@@ -2171,7 +2171,6 @@ static ULONG WINAPI HTMLAttributeCollection_Release(IHTMLAttributeCollection *if
...
@@ -2171,7 +2171,6 @@ static ULONG WINAPI HTMLAttributeCollection_Release(IHTMLAttributeCollection *if
if
(
!
ref
)
{
if
(
!
ref
)
{
IHTMLElement_Release
(
&
This
->
elem
->
IHTMLElement_iface
);
IHTMLElement_Release
(
&
This
->
elem
->
IHTMLElement_iface
);
heap_free
(
This
->
collection
);
heap_free
(
This
);
heap_free
(
This
);
}
}
...
@@ -2208,23 +2207,15 @@ static HRESULT WINAPI HTMLAttributeCollection_Invoke(IHTMLAttributeCollection *i
...
@@ -2208,23 +2207,15 @@ static HRESULT WINAPI HTMLAttributeCollection_Invoke(IHTMLAttributeCollection *i
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
puArgErr
);
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
puArgErr
);
}
}
static
HRESULT
WINAPI
HTMLAttributeCollection_get_length
(
IHTMLAttributeCollection
*
iface
,
LONG
*
p
)
static
HRESULT
get_attr_dispid_by_idx
(
HTMLAttributeCollection
*
This
,
LONG
*
idx
,
DISPID
*
dispid
)
{
{
HTMLAttributeCollection
*
This
=
impl_from_IHTMLAttributeCollection
(
iface
);
IDispatchEx
*
dispex
=
&
This
->
elem
->
node
.
dispex
.
IDispatchEx_iface
;
IDispatchEx
*
dispex
=
&
This
->
elem
->
node
.
dispex
.
IDispatchEx_iface
;
DISPID
id
;
DISPID
id
=
DISPID_STARTENUM
;
LONG
len
;
LONG
len
=
-
1
;
HRESULT
hres
;
HRESULT
hres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
FIXME
(
"filter non-enumerable attributes out
\n
"
);
FIXME
(
"filter non-enumerable attributes out
\n
"
);
heap_free
(
This
->
collection
);
This
->
size
=
0
;
This
->
collection
=
NULL
;
id
=
DISPID_STARTENUM
;
len
=
0
;
while
(
1
)
{
while
(
1
)
{
hres
=
IDispatchEx_GetNextDispID
(
dispex
,
fdexEnumAll
,
id
,
&
id
);
hres
=
IDispatchEx_GetNextDispID
(
dispex
,
fdexEnumAll
,
id
,
&
id
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
...
@@ -2233,41 +2224,16 @@ static HRESULT WINAPI HTMLAttributeCollection_get_length(IHTMLAttributeCollectio
...
@@ -2233,41 +2224,16 @@ static HRESULT WINAPI HTMLAttributeCollection_get_length(IHTMLAttributeCollectio
break
;
break
;
len
++
;
len
++
;
}
if
(
len
==
*
idx
)
This
->
collection
=
heap_alloc
(
len
*
sizeof
(
DISPID
));
if
(
!
This
->
collection
)
return
E_OUTOFMEMORY
;
id
=
DISPID_STARTENUM
;
len
=
0
;
while
(
1
)
{
hres
=
IDispatchEx_GetNextDispID
(
dispex
,
fdexEnumAll
,
id
,
&
id
);
if
(
FAILED
(
hres
))
return
hres
;
else
if
(
hres
==
S_FALSE
)
break
;
break
;
This
->
collection
[
len
++
]
=
id
;
}
}
*
p
=
This
->
size
=
len
;
if
(
dispid
)
{
return
S_OK
;
*
dispid
=
id
;
}
return
*
idx
==
len
?
S_OK
:
DISP_E_UNKNOWNNAME
;
}
static
HRESULT
WINAPI
HTMLAttributeCollection__newEnum
(
IHTMLAttributeCollection
*
iface
,
IUnknown
**
p
)
{
HTMLAttributeCollection
*
This
=
impl_from_IHTMLAttributeCollection
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
}
static
inline
HRESULT
get_attr_dispid_by_idx
(
HTMLAttributeCollection
*
This
,
LONG
index
,
DISPID
*
id
)
{
if
(
index
<
0
||
index
>=
This
->
size
)
return
DISP_E_UNKNOWNNAME
;
*
id
=
This
->
collection
[
index
]
;
*
id
x
=
len
+
1
;
return
S_OK
;
return
S_OK
;
}
}
...
@@ -2281,7 +2247,7 @@ static inline HRESULT get_attr_dispid_by_name(HTMLAttributeCollection *This, BST
...
@@ -2281,7 +2247,7 @@ static inline HRESULT get_attr_dispid_by_name(HTMLAttributeCollection *This, BST
idx
=
strtoulW
(
name
,
&
end_ptr
,
10
);
idx
=
strtoulW
(
name
,
&
end_ptr
,
10
);
if
(
!*
end_ptr
)
{
if
(
!*
end_ptr
)
{
hres
=
get_attr_dispid_by_idx
(
This
,
idx
,
id
);
hres
=
get_attr_dispid_by_idx
(
This
,
&
idx
,
id
);
if
(
SUCCEEDED
(
hres
))
if
(
SUCCEEDED
(
hres
))
return
hres
;
return
hres
;
}
}
...
@@ -2315,6 +2281,25 @@ static inline HRESULT get_domattr(HTMLElement *elem, DISPID id, HTMLDOMAttribute
...
@@ -2315,6 +2281,25 @@ static inline HRESULT get_domattr(HTMLElement *elem, DISPID id, HTMLDOMAttribute
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
HTMLAttributeCollection_get_length
(
IHTMLAttributeCollection
*
iface
,
LONG
*
p
)
{
HTMLAttributeCollection
*
This
=
impl_from_IHTMLAttributeCollection
(
iface
);
HRESULT
hres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
*
p
=
-
1
;
hres
=
get_attr_dispid_by_idx
(
This
,
p
,
NULL
);
return
hres
;
}
static
HRESULT
WINAPI
HTMLAttributeCollection__newEnum
(
IHTMLAttributeCollection
*
iface
,
IUnknown
**
p
)
{
HTMLAttributeCollection
*
This
=
impl_from_IHTMLAttributeCollection
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
HTMLAttributeCollection_item
(
IHTMLAttributeCollection
*
iface
,
VARIANT
*
name
,
IDispatch
**
ppItem
)
static
HRESULT
WINAPI
HTMLAttributeCollection_item
(
IHTMLAttributeCollection
*
iface
,
VARIANT
*
name
,
IDispatch
**
ppItem
)
{
{
HTMLAttributeCollection
*
This
=
impl_from_IHTMLAttributeCollection
(
iface
);
HTMLAttributeCollection
*
This
=
impl_from_IHTMLAttributeCollection
(
iface
);
...
@@ -2326,7 +2311,7 @@ static HRESULT WINAPI HTMLAttributeCollection_item(IHTMLAttributeCollection *ifa
...
@@ -2326,7 +2311,7 @@ static HRESULT WINAPI HTMLAttributeCollection_item(IHTMLAttributeCollection *ifa
switch
(
V_VT
(
name
))
{
switch
(
V_VT
(
name
))
{
case
VT_I4
:
case
VT_I4
:
hres
=
get_attr_dispid_by_idx
(
This
,
V_I4
(
name
),
&
id
);
hres
=
get_attr_dispid_by_idx
(
This
,
&
V_I4
(
name
),
&
id
);
break
;
break
;
case
VT_BSTR
:
case
VT_BSTR
:
hres
=
get_attr_dispid_by_name
(
This
,
V_BSTR
(
name
),
&
id
);
hres
=
get_attr_dispid_by_name
(
This
,
V_BSTR
(
name
),
&
id
);
...
@@ -2537,7 +2522,7 @@ static HRESULT WINAPI HTMLAttributeCollection3_item(IHTMLAttributeCollection3 *i
...
@@ -2537,7 +2522,7 @@ static HRESULT WINAPI HTMLAttributeCollection3_item(IHTMLAttributeCollection3 *i
TRACE
(
"(%p)->(%d %p)
\n
"
,
This
,
index
,
ppNodeOut
);
TRACE
(
"(%p)->(%d %p)
\n
"
,
This
,
index
,
ppNodeOut
);
hres
=
get_attr_dispid_by_idx
(
This
,
index
,
&
id
);
hres
=
get_attr_dispid_by_idx
(
This
,
&
index
,
&
id
);
if
(
hres
==
DISP_E_UNKNOWNNAME
)
if
(
hres
==
DISP_E_UNKNOWNNAME
)
return
E_INVALIDARG
;
return
E_INVALIDARG
;
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
...
...
dlls/mshtml/mshtml_private.h
View file @
130c8342
...
@@ -727,8 +727,6 @@ struct HTMLAttributeCollection {
...
@@ -727,8 +727,6 @@ struct HTMLAttributeCollection {
LONG
ref
;
LONG
ref
;
HTMLElement
*
elem
;
HTMLElement
*
elem
;
LONG
size
;
DISPID
*
collection
;
struct
list
attrs
;
struct
list
attrs
;
};
};
...
...
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