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
bc69cba2
Commit
bc69cba2
authored
Jan 27, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 27, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added support for anchor targets.
parent
c5257dc1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
2 deletions
+37
-2
htmlanchor.c
dlls/mshtml/htmlanchor.c
+37
-2
No files found.
dlls/mshtml/htmlanchor.c
View file @
bc69cba2
...
...
@@ -29,6 +29,7 @@
#include "mshtml_private.h"
#include "htmlevent.h"
#include "binding.h"
#include "wine/debug.h"
...
...
@@ -42,13 +43,42 @@ typedef struct {
nsIDOMHTMLAnchorElement
*
nsanchor
;
}
HTMLAnchorElement
;
static
HRESULT
navigate_anchor_window
(
HTMLAnchorElement
*
This
,
const
WCHAR
*
target
)
{
nsAString
href_str
;
IUri
*
uri
;
nsresult
nsres
;
HRESULT
hres
;
nsAString_Init
(
&
href_str
,
NULL
);
nsres
=
nsIDOMHTMLAnchorElement_GetHref
(
This
->
nsanchor
,
&
href_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
const
PRUnichar
*
href
;
nsAString_GetData
(
&
href_str
,
&
href
);
hres
=
create_relative_uri
(
This
->
element
.
node
.
doc
->
basedoc
.
window
,
href
,
&
uri
);
}
else
{
ERR
(
"Could not get anchor href: %08x
\n
"
,
nsres
);
hres
=
E_FAIL
;
}
nsAString_Finish
(
&
href_str
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
navigate_new_window
(
This
->
element
.
node
.
doc
->
basedoc
.
window
,
uri
,
target
,
NULL
);
IUri_Release
(
uri
);
return
hres
;
}
static
HRESULT
navigate_anchor
(
HTMLAnchorElement
*
This
)
{
nsAString
href_str
,
target_str
;
nsresult
nsres
;
HRESULT
hres
=
E_FAIL
;
static
const
WCHAR
_parentW
[]
=
{
'p'
,
'a'
,
'r'
,
'e'
,
'n'
,
't'
,
0
};
static
const
WCHAR
_selfW
[]
=
{
'_'
,
's'
,
'e'
,
'l'
,
'f'
,
0
};
static
const
WCHAR
_topW
[]
=
{
'_'
,
't'
,
'o'
,
'p'
,
0
};
nsAString_Init
(
&
target_str
,
NULL
);
nsres
=
nsIDOMHTMLAnchorElement_GetTarget
(
This
->
nsanchor
,
&
target_str
);
...
...
@@ -57,9 +87,14 @@ static HRESULT navigate_anchor(HTMLAnchorElement *This)
nsAString_GetData
(
&
target_str
,
&
target
);
if
(
*
target
&&
strcmpiW
(
target
,
_selfW
))
{
FIXME
(
"Navigating to target %s is not implemented
\n
"
,
debugstr_w
(
target
));
if
(
strcmpiW
(
target
,
_parentW
)
&&
strcmpiW
(
target
,
_topW
))
{
hres
=
navigate_anchor_window
(
This
,
target
);
}
else
{
FIXME
(
"Navigating to target %s is not implemented
\n
"
,
debugstr_w
(
target
));
hres
=
S_OK
;
}
nsAString_Finish
(
&
target_str
);
return
S_OK
;
return
hres
;
}
}
nsAString_Finish
(
&
target_str
);
...
...
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