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
3c4b2a0b
Commit
3c4b2a0b
authored
Oct 18, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLDocument2::elementFromPoint implementation.
parent
c3f6f96d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
4 deletions
+52
-4
htmldoc.c
dlls/mshtml/htmldoc.c
+32
-2
htmldoc.c
dlls/mshtml/tests/htmldoc.c
+20
-2
No files found.
dlls/mshtml/htmldoc.c
View file @
3c4b2a0b
...
...
@@ -1297,8 +1297,38 @@ static HRESULT WINAPI HTMLDocument_elementFromPoint(IHTMLDocument2 *iface, LONG
IHTMLElement
**
elementHit
)
{
HTMLDocument
*
This
=
impl_from_IHTMLDocument2
(
iface
);
FIXME
(
"(%p)->(%d %d %p)
\n
"
,
This
,
x
,
y
,
elementHit
);
return
E_NOTIMPL
;
nsIDOMNSDocument
*
nsdoc
;
nsIDOMElement
*
nselem
;
HTMLDOMNode
*
node
;
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"(%p)->(%d %d %p)
\n
"
,
This
,
x
,
y
,
elementHit
);
nsres
=
nsIDOMHTMLDocument_QueryInterface
(
This
->
doc_node
->
nsdoc
,
&
IID_nsIDOMNSDocument
,
(
void
**
)
&
nsdoc
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDOMNSDocument iface: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
nsres
=
nsIDOMNSDocument_ElementFromPoint
(
nsdoc
,
x
,
y
,
&
nselem
);
nsIDOMNSDocument_Release
(
nsdoc
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"ElementFromPoint failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
if
(
!
nselem
)
{
*
elementHit
=
NULL
;
return
S_OK
;
}
hres
=
get_node
(
This
->
doc_node
,
(
nsIDOMNode
*
)
nselem
,
TRUE
,
&
node
);
nsIDOMElement_Release
(
nselem
);
if
(
FAILED
(
hres
))
return
hres
;
return
IHTMLDOMNode_QueryInterface
(
&
node
->
IHTMLDOMNode_iface
,
&
IID_IHTMLElement
,
(
void
**
)
elementHit
);
}
static
HRESULT
WINAPI
HTMLDocument_get_parentWindow
(
IHTMLDocument2
*
iface
,
IHTMLWindow2
**
p
)
...
...
dlls/mshtml/tests/htmldoc.c
View file @
3c4b2a0b
...
...
@@ -213,10 +213,10 @@ static const char *nav_url;
static
const
char
html_page
[]
=
"<html>"
"<head><link rel=
\"
stylesheet
\"
type=
\"
text/css
\"
href=
\"
test.css
\"
></head>"
"<body>
test
</body>"
"<body>
<div>test</div>
</body>"
"</html>"
;
static
const
char
css_data
[]
=
"body {color: red}"
;
static
const
char
css_data
[]
=
"body {color: red
; margin: 0
}"
;
static
const
WCHAR
http_urlW
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'w'
,
'w'
,
'w'
,
'.'
,
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
0
};
...
...
@@ -4429,6 +4429,23 @@ static void test_open_window(IHTMLDocument2 *doc)
IHTMLWindow2_Release
(
window
);
}
static
void
test_elem_from_point
(
IHTMLDocument2
*
doc
)
{
IHTMLElement
*
elem
;
BSTR
tag
;
HRESULT
hres
;
elem
=
NULL
;
hres
=
IHTMLDocument2_elementFromPoint
(
doc
,
3
,
3
,
&
elem
);
ok
(
hres
==
S_OK
,
"elementFromPoint failed: %08x
\n
"
,
hres
);
ok
(
elem
!=
NULL
,
"elem == NULL
\n
"
);
hres
=
IHTMLElement_get_tagName
(
elem
,
&
tag
);
IHTMLElement_Release
(
elem
);
ok
(
hres
==
S_OK
,
"get_tagName failed: %08x
\n
"
,
hres
);
ok
(
!
strcmp_wa
(
tag
,
"DIV"
),
"tag = %s
\n
"
,
wine_dbgstr_w
(
tag
));
}
static
void
test_clear
(
IHTMLDocument2
*
doc
)
{
HRESULT
hres
;
...
...
@@ -5526,6 +5543,7 @@ static void test_HTMLDocument(BOOL do_load)
set_custom_uihandler
(
doc
,
&
CustomDocHostUIHandler
);
test_download
(
DWL_CSS
|
DWL_TRYCSS
);
test_GetCurMoniker
((
IUnknown
*
)
doc
,
&
Moniker
,
NULL
);
test_elem_from_point
(
doc
);
}
test_MSHTML_QueryStatus
(
doc
,
OLECMDF_SUPPORTED
);
...
...
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