<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - AX: richer text change notifications"
   href="https://bugs.webkit.org/show_bug.cgi?id=142719#c102">Comment # 102</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - AX: richer text change notifications"
   href="https://bugs.webkit.org/show_bug.cgi?id=142719">bug 142719</a>
              from <span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=251507&amp;action=diff" name="attach_251507" title="Update from review">attachment 251507</a> <a href="attachment.cgi?id=251507&amp;action=edit" title="Update from review">[details]</a></span>
Update from review

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

<span class="quote">&gt; Source/WebCore/ChangeLog:2238
&gt; +2015-04-14  Doug Russell  &lt;<a href="mailto:d_russell&#64;apple.com">d_russell&#64;apple.com</a>&gt;
&gt; +
&gt; +        AX: richer text change notifications
&gt; +        <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - AX: richer text change notifications"
   href="show_bug.cgi?id=142719">https://bugs.webkit.org/show_bug.cgi?id=142719</a>
&gt; +
&gt; +        Richer accessibility value change notifications. Introduce AXTextEditType, postTextStateChangeNotification and postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content. Also implement a mechanism to post value changes in password form fields in coalesced ticks to thwart analyzing the cadence of changes.
&gt; +
&gt; +2015-04-14  Doug Russell  &lt;<a href="mailto:d_russell&#64;apple.com">d_russell&#64;apple.com</a>&gt;
&gt; +
&gt; +        AX: richer text change notifications
&gt; +        <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - AX: richer text change notifications"
   href="show_bug.cgi?id=142719">https://bugs.webkit.org/show_bug.cgi?id=142719</a>
&gt; +
&gt; +        New EditCommand subclasses to give the context that accessibility needs to post more detailed value and selection change notifications. This commit is all infrastructure and doesn't contain any accessibility specific changes.
&gt; +&gt;&gt;&gt;&gt;&gt;&gt;&gt; &lt;rdar://problem/20169058&gt; AX: richer text change notifications (142719)
&gt; +</span >

Extra change log entry here due to merging problems I assume.

<span class="quote">&gt; Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:339
&gt; +    NSAccessibilityPostNotificationWithUserInfo(webArea-&gt;wrapper(), NSAccessibilityValueChangedNotification, userInfo);
&gt; +    // Used by DRT to know when notifications are posted.
&gt; +    [webArea-&gt;wrapper() accessibilityPostedNotification:NSAccessibilityValueChangedNotification userInfo:userInfo];</span >

Use AXPostNotificationWithUserInfo.

<span class="quote">&gt; Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:343
&gt; +    NSAccessibilityPostNotificationWithUserInfo(object-&gt;wrapper(), NSAccessibilityValueChangedNotification, userInfo);
&gt; +    // Used by DRT to know when notifications are posted.
&gt; +    [object-&gt;wrapper() accessibilityPostedNotification:NSAccessibilityValueChangedNotification userInfo:userInfo];</span >

Use AXPostNotificationWithUserInfo.

<span class="quote">&gt; Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm:386
&gt; +#if PLATFORM(COCOA) &amp;&amp; !PLATFORM(IOS)</span >

#if PLATFORM(MAC)

<span class="quote">&gt; Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm:400
&gt; +    NSMutableArray *mutableArray = [array mutableCopy];</span >

A shame that this function makes a mutable copy of the array in the almost 100% common case where it does contain only JSON types.

<span class="quote">&gt; Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm:419
&gt; +    NSMutableDictionary *mutableDictionary = [dictionary mutableCopy];</span >

A shame that this function makes a mutable copy of the dictionary in the almost 100% common case where it does contain only JSON types.

<span class="quote">&gt; Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.h:36
&gt; +- (id)textMarkerRangeFromVisiblePositions:(WebCore::VisiblePosition)startPosition endPosition:(WebCore::VisiblePosition)endPosition;</span >

Shouldn’t the arguments be const VisiblePosition&amp; like in the method just below?

<span class="quote">&gt; Source/WebCore/editing/CompositeEditCommand.cpp:179
&gt; +    default:
&gt; +        break;</span >

Normally we omit the default so we get a warning when we add a new enum value and don’t yet handle it in this switch statement.

<span class="quote">&gt; Source/WebCore/editing/CompositeEditCommand.h:36
&gt; +class DeleteFromTextNodeCommand;</span >

Why is this needed? I don’t see it used below.

<span class="quote">&gt; Source/WebCore/editing/CompositeEditCommand.h:63
&gt; +    AXTextEditType unapplyEditType();</span >

Should be a const member function.

<span class="quote">&gt; Source/WebCore/editing/DeleteFromTextNodeCommand.cpp:53
&gt; +const String&amp; DeleteFromTextNodeCommand::deletedText()
&gt; +{
&gt; +    return m_text;
&gt; +}</span >

Should probably be inlined in the header. Just add &quot;inline&quot; and put it at the bottom of the header.

<span class="quote">&gt; Source/WebCore/editing/EditCommand.cpp:133
&gt; +    default:
&gt; +        break;</span >

Same comment about default as above.

<span class="quote">&gt; Source/WebCore/editing/FrameSelection.cpp:1035
&gt; +AXTextStateChangeIntent inline FrameSelection::TextSelectionIntent(EAlteration alter, SelectionDirection direction, TextGranularity granularity)</span >

Why inline? That doesn’t seem like a good idea. Also, we normally put inline to the left of the type.

<span class="quote">&gt; Source/WebCore/editing/InsertIntoTextNodeCommand.cpp:56
&gt; +const String&amp; InsertIntoTextNodeCommand::insertedText()
&gt; +{
&gt; +    return m_text;
&gt; +}</span >

Inline in header?

<span class="quote">&gt; Source/WebCore/editing/InsertIntoTextNodeCommand.h:44
&gt; +    const String&amp; insertedText();
&gt; +protected:
&gt; +    InsertIntoTextNodeCommand(PassRefPtr&lt;Text&gt; node, unsigned offset, const String&amp; text, EditAction editingAction);</span >

Missing blank line before protected. Also, should just make this private again. I believe the reason to make it protected is obsolete.

<span class="quote">&gt; Source/WebCore/editing/ReplaceDeleteFromTextNodeCommand.h:33
&gt; +class Text;</span >

Not needed.

<span class="quote">&gt; Source/WebCore/editing/ReplaceDeleteFromTextNodeCommand.h:35
&gt; +class ReplaceDeleteFromTextNodeCommand : public DeleteFromTextNodeCommand {</span >

Should mark this class final.

<span class="quote">&gt; Source/WebCore/editing/ReplaceDeleteFromTextNodeCommand.h:37
&gt; +    static Ref&lt;ReplaceDeleteFromTextNodeCommand&gt; create(PassRefPtr&lt;Text&gt; node, unsigned offset, unsigned count)</span >

New code should not use PassRefPtr. See &lt;<a href="https://www.webkit.org/coding/RefPtr.html">https://www.webkit.org/coding/RefPtr.html</a>&gt;.

<span class="quote">&gt; Source/WebCore/editing/ReplaceDeleteFromTextNodeCommand.h:43
&gt; +    ReplaceDeleteFromTextNodeCommand(PassRefPtr&lt;Text&gt;, unsigned, unsigned);</span >

New code should not use PassRefPtr. See &lt;<a href="https://www.webkit.org/coding/RefPtr.html">https://www.webkit.org/coding/RefPtr.html</a>&gt;.

This should be private, not protected.

<span class="quote">&gt; Source/WebCore/editing/ReplaceInsertIntoTextNodeCommand.h:33
&gt; +class Text;</span >

Not needed.

<span class="quote">&gt; Source/WebCore/editing/ReplaceInsertIntoTextNodeCommand.h:35
&gt; +class ReplaceInsertIntoTextNodeCommand : public InsertIntoTextNodeCommand {</span >

Should mark this class final.

<span class="quote">&gt; Source/WebCore/editing/ReplaceInsertIntoTextNodeCommand.h:37
&gt; +    static Ref&lt;ReplaceInsertIntoTextNodeCommand&gt; create(PassRefPtr&lt;Text&gt; node, unsigned offset, const String&amp; text, const String&amp; deletedText, EditAction editingAction)</span >

New code should not use PassRefPtr. See &lt;<a href="https://www.webkit.org/coding/RefPtr.html">https://www.webkit.org/coding/RefPtr.html</a>&gt;.

<span class="quote">&gt; Source/WebCore/editing/ReplaceInsertIntoTextNodeCommand.h:43
&gt; +    ReplaceInsertIntoTextNodeCommand(PassRefPtr&lt;Text&gt;, unsigned, const String&amp;, const String&amp;, EditAction);</span >

New code should not use PassRefPtr. See &lt;<a href="https://www.webkit.org/coding/RefPtr.html">https://www.webkit.org/coding/RefPtr.html</a>&gt;.

This should be private, not protected.

<span class="quote">&gt; Source/WebCore/editing/ReplaceSelectionCommand.h:124
&gt; +    AXTextEditType m_applyEditType;</span >

This looks uninitialized and unused. Please omit it.</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>