Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
3742a184
Commit
3742a184
authored
Aug 02, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added default click handler for anchor element.
parent
6d766789
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
3 deletions
+57
-3
htmlanchor.c
dlls/mshtml/htmlanchor.c
+57
-3
No files found.
dlls/mshtml/htmlanchor.c
View file @
3742a184
...
...
@@ -26,9 +26,10 @@
#include "winuser.h"
#include "ole2.h"
#include "wine/debug.h"
#include "mshtml_private.h"
#include "htmlevent.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
mshtml
);
...
...
@@ -40,6 +41,43 @@ typedef struct {
nsIDOMHTMLAnchorElement
*
nsanchor
;
}
HTMLAnchorElement
;
static
HRESULT
navigate_anchor
(
HTMLAnchorElement
*
This
)
{
nsAString
href_str
,
target_str
;
const
PRUnichar
*
href
,
*
target
;
nsresult
nsres
;
HRESULT
hres
;
nsres
=
nsIDOMHTMLAnchorElement_GetTarget
(
This
->
nsanchor
,
&
target_str
);
if
(
NS_FAILED
(
nsres
))
return
E_FAIL
;
nsAString_GetData
(
&
target_str
,
&
target
);
if
(
*
target
)
{
FIXME
(
"Navigating to target %s is not implemented
\n
"
,
debugstr_w
(
target
));
nsAString_Finish
(
&
target_str
);
return
S_OK
;
}
nsAString_Finish
(
&
target_str
);
nsres
=
nsIDOMHTMLAnchorElement_GetHref
(
This
->
nsanchor
,
&
href_str
);
if
(
NS_FAILED
(
nsres
))
return
E_FAIL
;
nsAString_GetData
(
&
href_str
,
&
href
);
if
(
*
href
)
{
HTMLWindow
*
window
=
This
->
element
.
node
.
doc
->
basedoc
.
window
;
hres
=
navigate_url
(
window
,
href
,
window
->
url
);
}
else
{
TRACE
(
"empty href
\n
"
);
hres
=
S_OK
;
}
nsAString_Finish
(
&
href_str
);
return
hres
;
}
static
inline
HTMLAnchorElement
*
impl_from_IHTMLAnchorElement
(
IHTMLAnchorElement
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
HTMLAnchorElement
,
IHTMLAnchorElement_iface
);
...
...
@@ -542,10 +580,26 @@ static void HTMLAnchorElement_destructor(HTMLDOMNode *iface)
HTMLElement_destructor
(
&
This
->
element
.
node
);
}
static
HRESULT
HTMLAnchorElement_handle_event
(
HTMLDOMNode
*
iface
,
eventid_t
eid
,
BOOL
*
prevent_default
)
{
HTMLAnchorElement
*
This
=
impl_from_HTMLDOMNode
(
iface
);
if
(
eid
==
EVENTID_CLICK
)
{
TRACE
(
"CLICK
\n
"
);
*
prevent_default
=
TRUE
;
return
navigate_anchor
(
This
);
}
return
S_OK
;
}
static
const
NodeImplVtbl
HTMLAnchorElementImplVtbl
=
{
HTMLAnchorElement_QI
,
HTMLAnchorElement_destructor
,
HTMLElement_clone
HTMLElement_clone
,
NULL
,
NULL
,
HTMLAnchorElement_handle_event
};
static
const
tid_t
HTMLAnchorElement_iface_tids
[]
=
{
...
...
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