Fixing bug 300868. The 'target' attribute is not supported on SVG's <a> element. r=bugmail@sicking.cc, sr=jst@mozilla.org

This commit is contained in:
jwatt%jwatt.org 2006-01-28 13:12:28 +00:00
parent b8a911b197
commit 6fdafae9b3
3 changed files with 6 additions and 2 deletions

View File

@ -65,6 +65,7 @@ GK_ATOM(_empty, "")
GK_ATOM(_baseHref, "_base_href")
GK_ATOM(_baseTarget, "_base_target")
GK_ATOM(mozdirty, "_moz_dirty")
GK_ATOM(_moz_target, "_moz_target")
GK_ATOM(menuactive, "_moz-menuactive")
GK_ATOM(_poundDefault, "#default")
GK_ATOM(_asterix, "*")

View File

@ -37,6 +37,7 @@
* ***** END LICENSE BLOCK ***** */
#include "nsXMLElement.h"
#include "nsGkAtoms.h"
#include "nsHTMLAtoms.h"
#include "nsLayoutAtoms.h"
#include "nsIDocument.h"
@ -328,9 +329,11 @@ nsXMLElement::HandleDOMEvent(nsPresContext* aPresContext,
verb = eLinkVerb_Embed;
}
nsAutoString target;
GetAttr(kNameSpaceID_XLink, nsGkAtoms::_moz_target, target);
nsCOMPtr<nsIURI> baseURI = GetBaseURI();
ret = TriggerLink(aPresContext, verb, baseURI, uri,
EmptyString(), PR_TRUE, PR_TRUE);
target, PR_TRUE, PR_TRUE);
*aEventStatus = nsEventStatus_eConsumeDoDefault;
}

View File

@ -50,7 +50,7 @@
<stylesheet src="data:text/css,@namespace url('http://www.w3.org/1999/xlink'); xlink { -moz-binding: url('chrome://global/content/svg/svgBindings.xml#xlink'); }"/>
</resources>
<content>
<xlink:xlink xbl:inherits="xlink:href xlink:show" xlink:type="simple">
<xlink:xlink xbl:inherits="xlink:href xlink:show xlink:_moz_target=target" xlink:type="simple">
<svg:g xbl:inherits="style fill fill-opacity fill-rule stroke stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width clip-path clip-rule cursor display filter image-rendering mask opacity pointer-events shape-rendering text-rendering visibility alignment-baseline baseline-shift direction dominant-baseline glyph-orientation-horizontal glyph-orientation-vertical kerning letter-spacing text-anchor text-decoration unicode-bidi word-spacing font-family font-size font-size-adjust font-stretch font-style font-variant font-weight transform" >
<children/>
</svg:g>