Skip to content

Commit

Permalink
Merge pull request #21 from dglazkov/prototype-walk
Browse files Browse the repository at this point in the history
Bug 27261 - [Custom]: definition construction algorithm step 6 makes no ...
  • Loading branch information
hayatoito committed Nov 12, 2014
2 parents 98da55b + 486eb72 commit be908b0
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion spec/custom/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ <h2 id="registering-custom-elements">Registering Custom Elements</h2>
<li>If <var>DOCUMENT</var> is an <a href="http://dom.spec.whatwg.org/#html-document">HTML document</a>, <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#converted-to-ascii-lowercase">convert</a> <var>NAME</var> to ASCII lowercase</li>
<li>If <var>TYPE</var> is an invalid <a href="#dfn-custom-element-type">custom element type</a>, set <var>ERROR</var> to <code>InvalidType</code> and <strong>stop</strong>.</li>
<li>Let <var>NAMESPACE</var> be <a href="http://www.w3.org/1999/xhtml/">HTML Namespace</a></li>
<li>If <var>PROTOTYPE</var>'s <a href="http://www.w3.org/TR/WebIDL/#dfn-interface">interface</a> <a href="http://www.w3.org/TR/WebIDL/#dfn-inherit">inherits</a> from <a href="http://www.w3.org/TR/SVG/types.html#InterfaceSVGElement"><code>SVGElement</code></a>, set <var>NAMESPACE</var> to <a href="http://www.w3.org/2000/svg">SVG Namespace</a></li>
<li>Let <var>IS-SVG</var> be the result of running <a href="#dfn-inheritance-detection-algorithm">inheritance detection algorithm</a> with <var>PROTOTYPE</var> and <a href="http://www.w3.org/TR/SVG/types.html#InterfaceSVGElement"><code>SVGElement</code></a> as arguments</li>
<li>If <var>IS-SVG</var> is <strong>true</strong>, set <var>NAMESPACE</var> to <a href="http://www.w3.org/2000/svg">SVG Namespace</a></li>
<li>If there already exists a <a href="#dfn-element-definition">definition</a> with the same <var>TYPE</var>, set <var>ERROR</var> to <code>DuplicateDefinition</code> and <strong>stop</strong>.</li>
<li>If <var>NAME</var> was provided and is not <strong>null</strong>:
<ol>
Expand All @@ -458,6 +459,30 @@ <h2 id="registering-custom-elements">Registering Custom Elements</h2>
</ol>
</div>

<p>The <dfn id="dfn-inheritance-detection-algorithm">inheritance detection algorithm</dfn> <strong>must</strong> be <a href="#dfn-processing-equivalence">equivalent</a> to running these steps:</p>

<div class="algorithm">
<dl>
<dt>Input</dt>
<dd><var>DESCENDANT</var>, an object whose inheritance is being detected</dd>
<dd><var>ANCESTOR</var>, an object from which <var>DESCENDANT</var> may or may not inherit</dd>
<dt>Output</dt>
<dd><var>RESULT</var>, <strong>true</strong>, if <var>DESCENDANT</var> inherits from <var>ANCESTOR</var> or <strong>false</strong> otherwise</dd>
</dl>
<ol>
<li>Set <var>RESULT</var> to <strong>true</strong></li>
<li>Let <var>ANCESTOR-PROTOTYPE</var> be the result of <a href="http://es5.github.io/#x8.12.3">getting</a> a property named <code>prototype</code> of <var>ANCESTOR</var></li>
<li>Let <var>PROTOTYPE</var> be <var>DESCENDANT</var></li>
<li>Repeat until <var>PROTOTYPE</var> is <code>undefined</code>:
<ol>
<li>If <var>PROTOTYPE</var> <a href="http://es5.github.io/#x11.9.4">strictly equals</a> <var>ANCESTOR-PROTOTYPE</var>, <strong>stop</strong> and return <var>RESULT</var>.</li>
<li>Let <var>PROTOTYPE</var> be the result of <a href="http://es5.github.io/#x15.2.3.2">getting a prototype of</a> <var>PROTOTYPE</var></li>
</ol>
<li>Return <var>RESULT</var>.</li>
</ol>
</div>


<p>The <dfn id="dfn-element-upgrade-algorithm">element upgrade algorithm</dfn> upgrades <a href="#dfn-unresolved-element">unresolved elements</a> whose definition is now <a href="#dfn-element-registration">registered</a> and <strong>must</strong> be <a href="#dfn-processing-equivalence">equivalent</a> to running these steps:</p>

<div class="algorithm">
Expand Down

0 comments on commit be908b0

Please sign in to comment.