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
46de3fcf
Commit
46de3fcf
authored
Mar 27, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Add IHTMLRectCollection implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
454a5323
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
98 additions
and
3 deletions
+98
-3
htmlelem.c
dlls/mshtml/htmlelem.c
+80
-3
elements.js
dlls/mshtml/tests/elements.js
+18
-0
No files found.
dlls/mshtml/htmlelem.c
View file @
46de3fcf
...
...
@@ -650,8 +650,15 @@ static HRESULT WINAPI HTMLRectCollection_Invoke(IHTMLRectCollection *iface, DISP
static
HRESULT
WINAPI
HTMLRectCollection_get_length
(
IHTMLRectCollection
*
iface
,
LONG
*
p
)
{
HTMLRectCollection
*
This
=
impl_from_IHTMLRectCollection
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
UINT32
length
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsres
=
nsIDOMClientRectList_GetLength
(
This
->
rect_list
,
&
length
);
assert
(
nsres
==
NS_OK
);
*
p
=
length
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLRectCollection_get__newEnum
(
IHTMLRectCollection
*
iface
,
IUnknown
**
p
)
...
...
@@ -681,12 +688,82 @@ static const IHTMLRectCollectionVtbl HTMLRectCollectionVtbl = {
HTMLRectCollection_item
};
static
inline
HTMLRectCollection
*
HTMLRectCollection_from_DispatchEx
(
DispatchEx
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
HTMLRectCollection
,
dispex
);
}
static
HRESULT
HTMLRectCollection_get_dispid
(
DispatchEx
*
dispex
,
BSTR
name
,
DWORD
flags
,
DISPID
*
dispid
)
{
HTMLRectCollection
*
This
=
HTMLRectCollection_from_DispatchEx
(
dispex
);
UINT32
len
=
0
;
DWORD
idx
=
0
;
WCHAR
*
ptr
;
for
(
ptr
=
name
;
*
ptr
&&
isdigitW
(
*
ptr
);
ptr
++
)
idx
=
idx
*
10
+
(
*
ptr
-
'0'
);
if
(
*
ptr
)
return
DISP_E_UNKNOWNNAME
;
nsIDOMClientRectList_GetLength
(
This
->
rect_list
,
&
len
);
if
(
idx
>=
len
)
return
DISP_E_UNKNOWNNAME
;
*
dispid
=
MSHTML_DISPID_CUSTOM_MIN
+
idx
;
TRACE
(
"ret %x
\n
"
,
*
dispid
);
return
S_OK
;
}
static
HRESULT
HTMLRectCollection_invoke
(
DispatchEx
*
dispex
,
DISPID
id
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
params
,
VARIANT
*
res
,
EXCEPINFO
*
ei
,
IServiceProvider
*
caller
)
{
HTMLRectCollection
*
This
=
HTMLRectCollection_from_DispatchEx
(
dispex
);
TRACE
(
"(%p)->(%x %x %x %p %p %p %p)
\n
"
,
This
,
id
,
lcid
,
flags
,
params
,
res
,
ei
,
caller
);
switch
(
flags
)
{
case
DISPATCH_PROPERTYGET
:
{
nsIDOMClientRect
*
rect
;
IHTMLRect
*
html_rect
;
nsresult
nsres
;
HRESULT
hres
;
nsres
=
nsIDOMClientRectList_Item
(
This
->
rect_list
,
id
-
MSHTML_DISPID_CUSTOM_MIN
,
&
rect
);
if
(
NS_FAILED
(
nsres
)
||
!
rect
)
{
WARN
(
"Unknown item
\n
"
);
return
DISP_E_UNKNOWNNAME
;
}
hres
=
create_html_rect
(
rect
,
&
html_rect
);
nsIDOMClientRect_Release
(
rect
);
if
(
FAILED
(
hres
))
return
hres
;
V_VT
(
res
)
=
VT_DISPATCH
;
V_DISPATCH
(
res
)
=
(
IDispatch
*
)
html_rect
;
break
;
}
default:
FIXME
(
"unimplemented flags %x
\n
"
,
flags
);
return
E_NOTIMPL
;
}
return
S_OK
;
}
static
const
dispex_static_data_vtbl_t
HTMLRectCollection_dispex_vtbl
=
{
NULL
,
HTMLRectCollection_get_dispid
,
HTMLRectCollection_invoke
,
NULL
};
static
const
tid_t
HTMLRectCollection_iface_tids
[]
=
{
IHTMLRectCollection_tid
,
0
};
static
dispex_static_data_t
HTMLRectCollection_dispex
=
{
NULL
,
&
HTMLRectCollection_dispex_vtbl
,
IHTMLRectCollection_tid
,
HTMLRectCollection_iface_tids
};
...
...
dlls/mshtml/tests/elements.js
View file @
46de3fcf
...
...
@@ -211,6 +211,23 @@ function test_compare_position() {
next_test
();
}
function
test_rects
()
{
document
.
body
.
innerHTML
=
'<div>test</div>'
;
var
elem
=
document
.
body
.
firstChild
;
var
rects
=
elem
.
getClientRects
();
var
rect
=
elem
.
getBoundingClientRect
();
ok
(
rects
.
length
===
1
,
"rect.length = "
+
rects
.
length
);
ok
(
rects
[
0
].
top
===
rect
.
top
,
"rects[0].top = "
+
rects
[
0
].
top
+
" rect.top = "
+
rect
.
top
);
ok
(
rects
[
0
].
bottom
===
rect
.
bottom
,
"rects[0].bottom = "
+
rects
[
0
].
bottom
+
" rect.bottom = "
+
rect
.
bottom
);
elem
=
document
.
createElement
(
"style"
);
rects
=
elem
.
getClientRects
();
ok
(
rects
.
length
===
0
,
"rect.length = "
+
rects
.
length
);
next_test
();
}
function
test_document_owner
()
{
var
node
;
...
...
@@ -339,6 +356,7 @@ var tests = [
test_anchor
,
test_query_selector
,
test_compare_position
,
test_rects
,
test_document_owner
,
test_style_properties
,
test_storage
...
...
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