Re: [svgwg] Update getNumberOfChars() definition

@nikosandronikos 

I did an end-to-end review of the chapter, found a couple other places
 which needed adjustments based on this decision,

For the `getNumberOfChars` method in particular, I re-factored the 
algorithm to avoid confusing DOM "text nodes" with "SVG text content 
elements".  I also switched the variable to _count_ instead of 
_length_ to be consistent with the other algorithms in the section.  
My version is:

<ol class='algorithm'>
  <li>Let <var>node</var> be the element or node upon which this 
method was called</li>
  <li>If <var>node</var> is a DOM text node, return the length of the 
text content of
    <var>node</var>, after normalizing whitespace according to the 
value of the
    <a>'white-space'</a> property on its parent element.
  </li>
  <li>If <var>node</var> is an <a>Element</a>:
  <ul>
  <li>If the element is <a>not rendered</a>
    (e.g., because the <a>'display'</a> property has the used value
    <span class='prop-value'>none</span>), then return 0;</li>
  <li>Otherwise, set <var>count</var> to 0, and for each child of 
<var>node</var>:
    <ul>
      <li>Recursively call this algorithm and add the returned value 
to <var>count</var>.</li>
    </ul>
    Return <var>count</var>.
  </li>
  </ul>
  </li>
  <li>For all other node types (e.g., DOM comments), return 0.</li>
</ol>

I was going to suggest that you review & close, but it seems you've 
already got there!

Now I just have to commit a fix for some markup errors I discovered 
when previewing this post...

-- 
GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at 
https://github.com/w3c/svgwg/issues/200#issuecomment-236471549 using 
your GitHub account

Received on Monday, 1 August 2016 01:39:15 UTC