Skip to content

Commit

Permalink
Linking: borrow HTML attributes, explicitly allow nested links, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
AmeliaBR committed Jun 22, 2016
1 parent ccb73a5 commit 33f85d2
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 23 deletions.
3 changes: 2 additions & 1 deletion master/Overview.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional+edit//EN" "xhtml1-transitional+edit.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:edit="http://xmlns.grorg.org/SVGT12NG/">
<head>
Expand Down Expand Up @@ -165,6 +165,7 @@ <h2 id="status">Status of This Document</h2>
<li>More than one <a>'title'</a> or <a>'desc'</a> to provide localisation</li>
<li><a href="paths.html#PathDataBearingCommands">The bearing commands</a></li>
<li><a>'zoomAndPan'</a></li>
<li><a href="linking.html#Links">Nested links</a></li>
<li><a>'unknown'</a> elements and the <a>SVGUnknownElement</a> interface.</li>
</ul>

Expand Down
12 changes: 9 additions & 3 deletions master/definitions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@
<element
name='a'
href='linking.html#AElement'
contentmodel='textoranyof'
elementcategories='animation, descriptive, shape, structural, paint server'
elements='a, clipPath, cursor, filter, foreignObject, image, marker, mask, script, style, switch, view, text'
attributecategories='aria, conditional processing, core, global event, graphical event, presentation, style, deprecated xlink'
interfaces='SVGAElement'>
<x:contentmodel xmlns='http://www.w3.org/1999/xhtml'>Text and any element allowed by its parent's content model.</x:contentmodel>
<attribute name='href' href='linking.html#AElementHrefAttribute' animatable='yes'/>
<attribute name='target' href='linking.html#AElementTargetAttribute' animatable='yes'/>
<attribute name='download' href='linking.html#AElementDownloadAttribute' animatable='yes'/>
<attribute name='rel' href='linking.html#AElementRelAttribute' animatable='yes'/>
<attribute name='rev' href='linking.html#AElementRevAttribute' animatable='yes'/>
<attribute name='hreflang' href='linking.html#AElementHreflangAttribute' animatable='yes'/>
<attribute name='type' href='linking.html#AElementTypeAttribute' animatable='yes'/>
</element>

<element
Expand Down Expand Up @@ -983,6 +986,8 @@
<interface name='SVGSolidcolorElement' href='pservers.html#InterfaceSVGSolidcolorElement'/>
<interface name='SVGBoundingBoxOptions' href='types.html#SVGBoundingBoxOptions'/>
<interface name='SVGNameList' href='types.html#ListInterfaces'/> <!-- not a real interface -->

<interface name='HTMLHyperlinkElementUtils' href='https://www.w3.org/TR/html51/links.html#htmlhyperlinkelementutils-htmlhyperlinkelementutils'/>

<!-- ... grammar symbols ................................................ -->
<symbol name='align' href='coords.html#DataTypeAlign'/>
Expand Down Expand Up @@ -1231,6 +1236,7 @@
<interface name='DOMImplementation' href='http://www.w3.org/TR/2014/WD-dom-20140204/#domimplementation'/>
<interface name='DOMException' href='http://www.w3.org/TR/2014/WD-dom-20140204/#exception-domexception'/>
<interface name='DOMStringMap' href='http://www.w3.org/TR/2014/CR-html5-20140204/infrastructure.html#domstringmap'/>
<interface name='DOMTokenList' href='https://www.w3.org/TR/dom/#domtokenlist'/>
<interface name='Element' href='http://www.w3.org/TR/2014/WD-dom-20140204/#element'/>
<interface name='EventHandler' href='http://www.w3.org/TR/2014/CR-html5-20140204/webappapis.html#event-handlers'/>
<interface name='EventListener' href='http://www.w3.org/TR/2014/WD-dom-20140204/#eventlistener'/>
Expand Down
100 changes: 81 additions & 19 deletions master/linking.html
Original file line number Diff line number Diff line change
Expand Up @@ -347,23 +347,24 @@ <h2 id="Links">Links out of SVG content: the <span class="element-name">'a'</spa

<p>SVG provides an <a>'a'</a> element, to indicate links (also known
as <em>hyperlinks</em> or <em>Web links</em>). The <a>'a'</a> element may
contain any element that its parent may contain, except itself.</p>

<p>SVG uses XLink ([<a href="http://www.w3.org/TR/2001/REC-xlink-20010627/">XLink</a>])
for all link definitions. SVG 1.1 only requires
that user agents support XLink's notion of
<a href="http://www.w3.org/TR/2001/REC-xlink-20010627/#simple-links">simple links</a>.
Each simple link associates exactly two resources, one
local and one remote, with an arc going from the former to the latter.</p>

<p>A simple link is defined for each separate rendered element contained
within the <a>'a'</a> element; thus, if the <a>'a'</a> element contains
three <a>'circle'</a> elements, a link is created for each circle. For
each rendered element within an <a>'a'</a> element, the given rendered
element is the local resource (the source anchor for the link).</p>
contain any element that its parent may contain; the same element is used for both graphical and textual linked content.</p>

<p class="note">SVG 1.1 defined links in terms of the XLink specification ([<a href="http://www.w3.org/TR/2001/REC-xlink-20010627/">XLink</a>]),
using attributes defined in the XLink namespace.
SVG 2 uses an alternative set of attributes in the default namespace that are consistent with HTML links, and <a href="#XLinkRefAttrs">deprecates the XLink attributes</a>.</p>

<p>For pointer events processing,
a linked hit region is defined for each separate rendered element contained
within the <a>'a'</a> element (according to the value of their <a>'pointer-events'</a> property),
rather than for the bounding box of the <a>'a'</a> element itself.
When links are nested one inside the other, the innermost link takes precedence for processing pointer events on its child content;
user agents must allow the nested link element to process the activation event before allowing events to bubble to outer elements.
User agents must ensure that all links are <a>focusable</a> and can be activated by keyboard commands.</p>

<p class="issue">The ability to nest links is at risk, pending feedback on the accessibility of the resulting document.</p>

<p>The remote resource (the destination for the link) is defined by
an <a>URL</a> specified by the <a>'href'</a> attribute on the <a>'a'</a>
a <a>URL</a> specified by the <a>'href'</a> attribute on the <a>'a'</a>
element. The remote resource may be any Web resource (e.g., an image, a video
clip, a sound bite, a program, another SVG document, an HTML document, an
element within the current document, an element within a different document, etc.).
Expand Down Expand Up @@ -487,6 +488,51 @@ <h2 id="Links">Links out of SVG content: the <span class="element-name">'a'</spa
to open a document in a new tab/window.</p>
</div>
</dd>
<dt>
<table class="attrdef def">
<tr>
<th>Name</th>
<th>Value</th>
<th>Initial value</th>
<th>Animatable</th>
</tr>
<tr>
<td><dfn id="AElementDownloadAttribute">download</dfn></td>
<td>any value (meaning is conveyed by presence or absence of attribute)</td>
<td>(none)</td>
<td>no</td>
</tr>
<tr>
<td><dfn id="AElementRelAttribute">rel</dfn></td>
<td>space-separated keyword tokens <a href="https://html.spec.whatwg.org/multipage/infrastructure.html#set-of-space-separated-tokens" class="syntax">[HTML]</a></td>
<td>(none)</td>
<td>yes</td>
</tr>
<tr>
<td><dfn id="AElementRevAttribute">rev</dfn></td>
<td>space-separated keyword tokens <a href="https://html.spec.whatwg.org/multipage/infrastructure.html#set-of-space-separated-tokens" class="syntax">[HTML]</a></td>
<td>(none)</td>
<td>yes</td>
</tr>
<tr>
<td><dfn id="AElementHreflangAttribute">hreflang</dfn></td>
<td>A BCP 47 language tag string <a href="https://html.spec.whatwg.org/multipage/semantics.html#attr-hyperlink-hreflang" class="syntax">[HTML]</a></td>
<td>(none)</td>
<td>yes</td>
</tr>
<tr>
<td><dfn id="AElementTypeAttribute">type</dfn></td>
<td>A MIME type string <a href="https://html.spec.whatwg.org/multipage/infrastructure.html#mime-type" class="syntax">[HTML]</a></td>
<td>(none)</td>
<td>yes</td>
</tr>
</table>
</dt>
<dd>
These attributes further describe the targetted resource
and its relationship to the current document.
Allowed values and meaning are <a href="https://www.w3.org/TR/html51/textlevel-semantics.html#the-a-element">as defined for the <code>a</code> element in HTML</a>.
</dd>
</dl>

</edit:with>
Expand Down Expand Up @@ -717,12 +763,28 @@ <h3 id="InterfaceSVGAElement">Interface SVGAElement</h3>

<pre class="idl">interface <b>SVGAElement</b> : <a>SVGGraphicsElement</a> {
[SameObject] readonly attribute <a>SVGAnimatedString</a> <a href="linking.html#__svg__SVGAElement__target">target</a>;
[SameObject] readonly attribute <a>SVGAnimatedString</a> <a href="linking.html#__svg__SVGAElement__download">download</a>;
[SameObject] readonly attribute <a>SVGAnimatedString</a> <a href="linking.html#__svg__SVGAElement__rel">rel</a>;
[SameObject] readonly attribute <a>SVGAnimatedString</a> <a href="linking.html#__svg__SVGAElement__rel">relList</a>;
[SameObject] readonly attribute <a>DOMTokenList</a> <a href="linking.html#__svg__SVGAElement__rev">rev</a>;
[SameObject] readonly attribute <a>SVGAnimatedString</a> <a href="linking.html#__svg__SVGAElement__hreflang">hreflang</a>;
[SameObject] readonly attribute <a>SVGAnimatedString</a> <a href="linking.html#__svg__SVGAElement__type">type</a>;
};

<a>SVGAElement</a> implements <a>SVGURIReference</a>;</pre>

<p>The <b id="__svg__SVGAElement__target">target</b> IDL attribute
<a>reflects</a> the <a>'target'</a> content attribute.</p>
<a>SVGAElement</a> implements <a>SVGURIReference</a>;
<a>SVGAElement</a> implements <a>HTMLHyperlinkElementUtils</a>;</pre>

<p>The <b id="__svg__SVGAElement__target">target</b>,
<b id="__svg__SVGAElement__download">download</b>,
<b id="__svg__SVGAElement__rel">rel</b>,
<b id="__svg__SVGAElement__rev">rev</b>,
<b id="__svg__SVGAElement__hreflang">hreflang</b>,
<b id="__svg__SVGAElement__type">type</b>,
IDL attributes
<a>reflect</a> the content attributes of the same name.</p>
<p>The <b id="__svg__SVGAElement__target">relList</b>
IDL attribute
<a>reflects</a> the <a>'rel'</a> content attribute as a token list.</p>

</edit:with>

Expand Down

0 comments on commit 33f85d2

Please sign in to comment.