Last Comment Bug 375696 - Referenced SVG link with target="_top" not redirecting parent doc
: Referenced SVG link with target="_top" not redirecting parent doc
: regression
Product: Core
Classification: Components
Component: SVG (show other bugs)
: unspecified
: x86 Windows XP
: -- normal (vote)
: ---
Assigned To: Robert Longson
: Hixie (not reading bugmail)
: Jet Villegas (:jet)
Depends on:
  Show dependency treegraph
Reported: 2007-03-28 10:30 PDT by Jeff Schiller
Modified: 2007-04-03 11:43 PDT (History)
4 users (show)
jwalden+bmo: in‑testsuite?
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (1.20 KB, patch)
2007-03-29 06:35 PDT, Robert Longson
jwatt: review+
Details | Diff | Splinter Review
updated patch (1.34 KB, patch)
2007-03-30 07:59 PDT, Robert Longson
tor: superreview+
Details | Diff | Splinter Review
testcase (475 bytes, application/xhtml+xml)
2007-03-30 08:00 PDT, Robert Longson
no flags Details

Description Jeff Schiller 2007-03-28 10:30:48 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a4pre) Gecko/20070328 Minefield/3.0a4pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a4pre) Gecko/20070328 Minefield/3.0a4pre

See and the referenced SVG file (

I know jwatt recently did some re-work on SVG implementation of the a element, but I've lost track of whether this supposed to be fixed or not.  The SVG:a element has target="_top" so shouldn't it redirect the entire browser page to the link?  Instead, it nests the page inside the SVG frame.  In Fx2, I was using frame-busting scripts to handle this:  if(top != self) {...}, but looking forward to a day when I don't have to.

It works as I expect in Opera.  

WICD Core ( says that "Link activation behavior for hyperlinks within a child object is defined by the child object's relevant language specification".  The SVG link section says "For more information on targets, refer to the appropriate HTML or XHTML specifications".  The HTML spec defines _top as "the full, original window".

Reproducible: Always

Steps to Reproduce:
Comment 1 Jeff Schiller 2007-03-28 10:32:29 PDT
Error in bug description:  the SVG file used is
Comment 2 Robert Longson 2007-03-29 06:35:46 PDT
Created attachment 260011 [details] [diff] [review]
Comment 3 Robert Longson 2007-03-29 06:37:51 PDT
(In reply to comment #0)
This should work in Fx2 (although not in 1.5 IIRC). It regressed with the new a element implementation.
Comment 4 Jeff Schiller 2007-03-29 07:09:06 PDT
Robert, my apologies - I must have been using the frame-busting scripts in Fx 1.0 and 1.5 then.  I probably never did anything for Fx 2.0 because the other browsers were still relatively large percentages when this was fixed (though that is starting to change now).
Comment 5 Jonathan Watt [:jwatt] 2007-03-29 07:51:18 PDT
Comment on attachment 260011 [details] [diff] [review]

Oops. Silly of me to break things. Anyway, this'll do for now. r=jwatt
Comment 6 Jonathan Watt [:jwatt] 2007-03-29 08:28:36 PDT
As tor points out, GetLinkTarget is supposed to return the base target if it exists and a target isn't specified on the element itself. We're still taking about this, but however this patch should be adjusted, the documenting text for GetLinkTarget should be updated to make that clear:
Comment 7 Jeff Schiller 2007-03-29 08:38:04 PDT
I was going to mention this (after digging into the HTML side and discovering what that was about).  But SVG doesn't have a <base> element...
Comment 8 Jonathan Watt [:jwatt] 2007-03-29 09:05:02 PDT
No, it doesn't, but there's compound documents and to consider. Anyway, I'm personally happy to have this patch as it is and have another bug opened to consider link base(s).
Comment 9 Jeff Schiller 2007-03-29 09:23:33 PDT
Thanks for the link to xml:base, and the SVG spec does indeed mention this ( - however, looking it over, the spec doesn't mention a target attribute (i.e. XML Base is only dealing with the base URI).

I thought about CDF - but it doesn't seem to be explicitly covered here, probably something to raise with the CDF WG.  How should resolving relative URIs and link targets be handled in a compound document?

<head><base target="..." .../></head>
<svg><a ..../></svg>

Does it mean that the inner svg:a should use the parent document's base target if one isn't specified on the svg:a element directly?  Similar question for relative URIs.

I agree this should be opened as another bug once it's resolved with the CDF WG.
Comment 10 Jeff Schiller 2007-03-29 09:27:00 PDT
CDF mailing list references:
Comment 11 Robert Longson 2007-03-30 07:59:17 PDT
Created attachment 260125 [details] [diff] [review]
updated patch

Take html base target into account.
Comment 12 Robert Longson 2007-03-30 08:00:37 PDT
Created attachment 260126 [details]
Comment 13 Robert Longson 2007-04-03 02:31:35 PDT
checked in.

Note You need to log in before you can comment on or make changes to this bug.