Skip to content

Commit

Permalink
Added SVGElement.dataset and allowed data-* attributes on all SVG ele…
Browse files Browse the repository at this point in the history
…ments. (ACTION-3694) (fixes #27)
  • Loading branch information
heycam committed Jan 27, 2016
1 parent 2238b95 commit 1cb4ee9
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
6 changes: 6 additions & 0 deletions master/changes.html
Expand Up @@ -157,6 +157,9 @@ <h3 id="types">Basic Data Types and Interfaces chapter</h3>
including the effect it has on SVG DOM object liveness.</li>

<li class='added-since-last-wd'>animVal IDL attributes on all interfaces now alias baseVal.</li>

<li class='added-since-last-wd'>Added the <a href='types.html#__svg__SVGElement__dataset'>dataset</a>
IDL attribute to <a>SVGElement</a>.</li>
</ul>

<h3 id="structure">Document Structure chapter</h3>
Expand Down Expand Up @@ -219,6 +222,9 @@ <h3 id="structure">Document Structure chapter</h3>

<li>Moved the <span class='element-name'>'discard'</span> element to
the split-out SVG Animations module.</li>

<li class='added-since-last-wd'>Allowed <a href='struct.html#DataAttributes'>custom data attributes</a>
on all SVG elements.</li>
</ul>

<h3 id="styling">Styling chapter</h3>
Expand Down
1 change: 1 addition & 0 deletions master/definitions.xml
Expand Up @@ -1159,6 +1159,7 @@
<interface name='DocumentCSS' href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS-DocumentCSS'/>
<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='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
14 changes: 11 additions & 3 deletions master/struct.html
Expand Up @@ -1350,8 +1350,9 @@ <h3 id="CommonAttributeDefinitions">Definitions</h3>
<dd>The core attributes are those attributes that can be specified
on any SVG element. This includes <a href="struct.html#CommonAttributes">Common attributes</a>,
and <a href="styling.html">styling attributes</a>.
The core attributes are <edit:attributecategory name='core'/> and
<edit:attributecategory name='style'/>.
The core attributes are <edit:attributecategory name='core'/>,
<edit:attributecategory name='style'/>, and all
<a href="struct.html#DataAttributes">custom data attributes</a>.
</dd>

</dl>
Expand Down Expand Up @@ -1512,8 +1513,15 @@ <h3 id="tabindexattribute">The <span class='attr-name'>'tabindex'</span> attribu
</dd>
</dl>

<div class='ready-for-wg-review'>
<h3 id="DataAttributes">The <span class='attr-name'>'data-*'</span> attributes</h3>


<p>All SVG elements support
<a href="https://www.w3.org/TR/2014/CR-html5-20140204/dom.html#custom-data-attribute">custom data attributes</a>,
which are those in no namespace whose names begin with the string "data-".
See the <a href="https://www.w3.org/TR/2014/CR-html5-20140204/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes">requirements
for custom data attributes</a> in the HTML specification.</p>
</div>


<h2 id="WAIARIAAttributes">WAI-ARIA attributes</h2>
Expand Down
9 changes: 9 additions & 0 deletions master/types.html
Expand Up @@ -223,6 +223,8 @@ <h3 id="InterfaceSVGElement">Interface SVGElement</h3>

[SameObject] readonly attribute <a>SVGAnimatedString</a> <a href="types.html#__svg__SVGElement__className">className</a>;

[SameObject] readonly attribute <a>DOMStringMap</a> <a href="types.html#__svg__SVGElement__dataset">dataset</a>;

readonly attribute <a>SVGSVGElement</a>? <a href="types.html#__svg__SVGElement__ownerSVGElement">ownerSVGElement</a>;
readonly attribute <a>SVGElement</a>? <a href="types.html#__svg__SVGElement__viewportElement">viewportElement</a>;

Expand All @@ -240,6 +242,13 @@ <h3 id="InterfaceSVGElement">Interface SVGElement</h3>
future version of this specification. Authors are advised to use
Element.classList intead.</p>

<div class='ready-for-wg-review'>
<p>The <b id="__svg__SVGElement__dataset">dataset</b> IDL attribute
provides access to <a href="struct.html#DataAttributes">custom data attributes</a>
on the element. Its behavior is the same as the corresponding IDL
member on the <a>HTMLElement</a> interface.</p>
</div>

<p>The <b id="__svg__SVGElement__ownerSVGElement">ownerSVGElement</b> IDL attribute
represents the nearest ancestor <a>'svg'</a> element. On getting
<a href="#__svg__SVGElement__ownerSVGElement">ownerSVGElement</a>,
Expand Down

0 comments on commit 1cb4ee9

Please sign in to comment.