<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#c4">Comment # 4</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:cfleizach@apple.com" title="chris fleizach <cfleizach@apple.com>"> <span class="fn">chris fleizach</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=271042&action=diff" name="attach_271042" title="patch">attachment 271042</a> <a href="attachment.cgi?id=271042&action=edit" title="patch">[details]</a></span>
patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=271042&action=review">https://bugs.webkit.org/attachment.cgi?id=271042&action=review</a>
<span class="quote">> Source/WebCore/accessibility/AXObjectCache.cpp:1882
> + // Sometimes a text node's character count doesn't include characters before a line break,</span >
do you have a test for this case?
<span class="quote">> Source/WebCore/accessibility/AXObjectCache.cpp:2177
> + return characterOffsetForNodeAndOffset(*node, offset, false, false);</span >
we should add enums for these two bool parameters so its clear in the code why you're passing what you're passing
<span class="quote">> Source/WebCore/accessibility/AXObjectCache.cpp:2201
> + return endCharacterOffsetOfParagraph(next);</span >
can nextCharacterOffset and endCharacterOffsetOfParagraph hand the isNull() case so that this method can be collapsed to
return endCharacterOffsetOfParagraph(nextCharacterOffset(characterOffset))
<span class="quote">> Source/WebCore/accessibility/AXObjectCache.cpp:2214
> + return startCharacterOffsetOfParagraph(previous);</span >
ditto
<span class="quote">> Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:2434
> + textMarker = [self nextMarkerForCharacterOffset:next];</span >
i feel like this recursive formulation wastes cycles, because at the minimum it has to pull the axObjectCache() each time
can we write this like
while (textMarker && textMarker.isIgnored)
characterOffset = cache->nextCharacterOffset(characterOffset)
textMarker = [self nextMarkerForCharacterOffset: characterOffset];
<span class="quote">> Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:2446
> + textMarker = [self previousMarkerForCharacterOffset:previous];</span >
ditto
<span class="quote">> Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:851
> + textMarker = nextTextMarkerForCharacterOffset(cache, next);</span >
looks like we have basically the same code in iOS and Mac. Can you put this in the Base object
<span class="quote">> Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:863
> + textMarker = previousTextMarkerForCharacterOffset(cache, previous);</span >
ditto
<span class="quote">> LayoutTests/accessibility/mac/text-marker-paragraph-nav.html:12
> +<div id="text1" tabindex="0"></span >
can you also add a test that does something like
<div>this is my first paragraph. Of text. it has some text.<br><br>
this is my second paragraph. Of text. it has some text.<br>
this is my second paragraph. Of text. it has some text.<br><br>
</div>
and verify you get the right start for each one</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>