<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - AX: Implement paragraph related text marker functions using TextIterator"
   href="https://bugs.webkit.org/show_bug.cgi?id=154098#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - AX: Implement paragraph related text marker functions using TextIterator"
   href="https://bugs.webkit.org/show_bug.cgi?id=154098">bug 154098</a>
              from <span class="vcard"><a class="email" href="mailto:n_wang&#64;apple.com" title="Nan Wang &lt;n_wang&#64;apple.com&gt;"> <span class="fn">Nan Wang</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=271042&amp;action=diff" name="attach_271042" title="patch">attachment 271042</a> <a href="attachment.cgi?id=271042&amp;action=edit" title="patch">[details]</a></span>
patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=271042&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=271042&amp;action=review</a>

<span class="quote">&gt;&gt; Source/WebCore/accessibility/AXObjectCache.cpp:1882
&gt;&gt; +    // Sometimes a text node's character count doesn't include characters before a line break,
&gt; 
&gt; do you have a test for this case?</span >

Yes, it's covered in the test.

<span class="quote">&gt;&gt; Source/WebCore/accessibility/AXObjectCache.cpp:2177
&gt;&gt; +        return characterOffsetForNodeAndOffset(*node, offset, false, false);
&gt; 
&gt; we should add enums for these two bool parameters so its clear in the code why you're passing what you're passing</span >

Ok

<span class="quote">&gt;&gt; Source/WebCore/accessibility/AXObjectCache.cpp:2201
&gt;&gt; +    return endCharacterOffsetOfParagraph(next);
&gt; 
&gt; can nextCharacterOffset and endCharacterOffsetOfParagraph hand the isNull() case so that this method can be collapsed to
&gt; 
&gt; return endCharacterOffsetOfParagraph(nextCharacterOffset(characterOffset))</span >

Ok

<span class="quote">&gt;&gt; Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:2434
&gt;&gt; +        textMarker = [self nextMarkerForCharacterOffset:next];
&gt; 
&gt; i feel like this recursive formulation wastes cycles, because at the minimum it has to pull the axObjectCache() each time
&gt; 
&gt; can we write this like
&gt; 
&gt; while (textMarker &amp;&amp; textMarker.isIgnored)
&gt;    characterOffset = cache-&gt;nextCharacterOffset(characterOffset)
&gt;    textMarker = [self nextMarkerForCharacterOffset: characterOffset];</span >

Ok

<span class="quote">&gt;&gt; Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:851
&gt;&gt; +        textMarker = nextTextMarkerForCharacterOffset(cache, next);
&gt; 
&gt; looks like we have basically the same code in iOS and Mac. Can you put this in the Base object</span >

The problem is that iOS and Mac don't use the same TextMarker wrapper, I'll try to figure something out.

<span class="quote">&gt;&gt; LayoutTests/accessibility/mac/text-marker-paragraph-nav.html:12
&gt;&gt; +&lt;div id=&quot;text1&quot; tabindex=&quot;0&quot;&gt;
&gt; 
&gt; can you also add a test that does something like
&gt; 
&gt; &lt;div&gt;this is my first paragraph. Of text. it has some text.&lt;br&gt;&lt;br&gt;
&gt; this is my second paragraph. Of text. it has some text.&lt;br&gt;
&gt; this is my second paragraph. Of text. it has some text.&lt;br&gt;&lt;br&gt;
&gt; &lt;/div&gt;
&gt; 
&gt; and verify you get the right start for each one</span >

Ok</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>