Re: [webcomponents] added guts of custom elements semantics section (#26)

> +<!-- taco-button represents focusable span with a fancy name, a text label and button like event handling -->
> +&lt;taco-button tabindex=&quot;0&quot; <mark>onclick=&quot;alert('tasty eh?');&quot;</mark> 
> +<mark>onkeypress=&quot;if(event.keyCode==32||event.keyCode==13){alert('tasty eh?');};&quot;</mark>&gt;Eat Me&lt;/taco-button&gt;
> +</pre>
> +<p>The addition of  an ARIA <a href="http://rawgit.com/w3c/aria/master/aria/aria.html#button"><code>role="button"</code></a> conveys the <em>taco-button</em> element's role semantics, which enables users to successfully interact with the control using the expected <code>button</code> interaction behaviours (pressing the <kbd>space</kbd> or <code>enter</code> keys to activate).</p>
> +<pre>
> +&lt;!-- taco-button represents a focusable button with a text label and button like event handling -->
> +&lt;taco-button <mark>role=&quot;button&quot;</mark> tabindex=&quot;0&quot; onclick=&quot;alert('tasty eh?');&quot; 
> +onkeypress=&quot;if(event.keyCode==32||event.keyCode==13){alert('tasty eh?');};&quot;&gt;Eat Me&lt;/taco-button&gt;</pre>
> +<h3>Type Extension Semantics </h3>
> +<p>By default a <a href="#dfn-type-extension">type extension</a> inherits the semantics of the element type it extends.</p>
> +<p>For example a type extension, could extend the HTML  <a href="http://www.w3.org/TR/html/forms.html#the-button-element"><code>button</code></a> element. As instaniated it would inherit the <code>button</code> element's name, role, states and properties, built in focus and keyboard interaction behaviours. </p>
> +<pre>&lt;!-- taco-button represents a button with an accesssible name of &quot;Eat Me!&quot; -->
> +&lt;button <mark>is=&quot;taco-button&quot;</mark>&gt;Eat Me!&lt;/taco-button&gt;
> +</pre>
> +<p>To provide the desired <em>taco-button</em> feature, all that is required is the addition of an event handler. The rest of the semantics and interaction behaviour are provided by the browser as part of its implementation of the <a href="http://www.w3.org/TR/html/forms.html#the-button-element"><code>button</code></a> element.</p>

Is this informative content? Maybe mark it as such? I am not sure, this is necessary. The event handlers could be added by the lifecycle callbacks imperatively, or maybe even not used at all.

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/pull/26/files#r21466564

Received on Monday, 8 December 2014 16:56:06 UTC