<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#c43">Comment # 43</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:d_russell&#64;apple.com" title="Doug Russell &lt;d_russell&#64;apple.com&gt;"> <span class="fn">Doug Russell</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=142719#c42">comment #42</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=250290&amp;action=diff" name="attach_250290" title="value change notifications">attachment 250290</a> <a href="attachment.cgi?id=250290&amp;action=edit" title="value change notifications">[details]</a></span>
&gt; value change notifications
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=250290&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=250290&amp;action=review</a>
&gt; 
&gt; &gt; Source/WebCore/ChangeLog:5
&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; description should go after the Reviewed by line</span >

Will do

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/accessibility/AXObjectCache.cpp:757
&gt; &gt; +        // Delegate to the right platform
&gt; 
&gt; comment is unnecessary. we only need comments generally to explain why
&gt; something is happening. what is happening should be self evident from the
&gt; code</span >

Will do

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/accessibility/AXObjectCache.cpp:874
&gt; &gt; +        text = obj.passwordFieldOrContainingPasswordField()-&gt;passwordFieldValue().substring(position.deepEquivalent().deprecatedEditingOffset(), text.length());
&gt; 
&gt; how is this sanitizing the value? is there not a method on HTMLInputType to
&gt; give you the sanitized version already?</span >

It's using passwordFieldValue() if the element is a password field or contained by a password field

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/accessibility/AXObjectCache.cpp:893
&gt; &gt; +        if (sanitizePasswordText(*obj, sanitizedText, position)) {
&gt; 
&gt; why do we have this special code for password fields?</span >

To make sure that we're not posting password characters in notifications and to make sure we're posting password notifications at regular ticks so they can't be analyzed

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/accessibility/AXObjectCache.cpp:906
&gt; &gt; +    AccessibilityObject* obj = getOrCreate(node);
&gt; 
&gt; this line is common to both platforms and can be moved above</span >

Will do

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/accessibility/AXObjectCache.cpp:924
&gt; &gt; +    if (obj) {
&gt; 
&gt; if there's no obj can we do an early return?</span >

The Mac logic handles cases where obj == nullptr

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/accessibility/AXObjectCache.cpp:938
&gt; &gt;      AccessibilityObject* obj = getOrCreate(node);
&gt; 
&gt; ditto about AXObject</span >

Will do

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/accessibility/AXObjectCache.cpp:1168
&gt; &gt; +    if (AccessibilityObject *rootObject = this-&gt;rootObject()) {
&gt; 
&gt; is the root object always a ScrollView? I think it probably is. in that case
&gt; we can cast to scroll view and call the webArea() method directly instead of
&gt; relying on that it will be the first object</span >

Sounds reasonable, I'll check.

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/accessibility/AXObjectCache.h:192
&gt; &gt; +    enum AXTextStateChangeType {
&gt; 
&gt; what other change types can you envision?</span >

One I've considered is an explicit type for find and replace, especially in the multiple find and replace case where echoing the result might be complex. To answer a later review question, possibly a move type if there's a need to discern that from a delete followed by an insert.

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/accessibility/AXObjectCache.h:201
&gt; &gt; +        AXTextEditTypeTyping, // Insert via typing
&gt; 
&gt; how is insert/delete different from typing? why would you use typing instead
&gt; of insert</span >

A good example of insert not being typing is using javascript to set a form value

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/accessibility/AXObjectCache.h:210
&gt; &gt; +    void postTextReplacementNotification(Node*, AXTextEditType, const String&amp;, AXTextEditType, const String&amp;, const VisiblePosition&amp;);
&gt; 
&gt; why are there two AXTextEditTypes?
&gt; because there are two we should name them here in the header</span >

For the deletion and insert, I'll add variable names

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/accessibility/AXObjectCache.h:240
&gt; &gt; +        AXTextDeleted,
&gt; 
&gt; can you also have a text moved type? (i.e. you can drag blocks of text on OS
&gt; X)</span >

Answered above

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/accessibility/AXObjectCache.h:290
&gt; &gt; +    Timer m_passwordNotificationPostTimer;
&gt; 
&gt; still curious why we need special timers for passwords</span >

To thwart analyzing the cadence of the notifications to narrow down possible password

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/accessibility/AccessibilityNodeObject.cpp:568
&gt; &gt; +            if (AXObjectCache *cache = axObjectCache())
&gt; 
&gt; * on wrong side
&gt; 
&gt; &gt; Source/WebCore/accessibility/AccessibilityNodeObject.h:91
&gt; &gt; +    virtual bool isContainedByPasswordField() const override;
&gt; 
&gt; i think we can move this implementation in AccessibilityObject and then we
&gt; can remove the virtual</span >

Will do

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:195
&gt; &gt; +static NSDictionary* textReplacementChangeDictionary(AccessibilityObject* obj, AXObjectCache::AXTextEditType type, const String&amp; string, const VisiblePosition&amp; position)
&gt; 
&gt; ObjcC stars should be on the other side</span >

Will do

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:197
&gt; &gt; +    NSString* text = (NSString *)string;
&gt; 
&gt; ditto about this star.</span >

Will do

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:246
&gt; &gt; +    if (!obj)
&gt; 
&gt; is it possible to combine the implementation of this method with the more
&gt; detailed one (or rather vice versa in this case)</span >

Do you mean combine postTextStateChangePlatformNotification and postTextReplacementPlatformNotification?

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/editing/CutDeleteFromTextNodeCommand.h:44
&gt; &gt; +    virtual AXObjectCache::AXTextEditType applyEditType() override;
&gt; 
&gt; should this be final override</span >

Will do

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/editing/ReplaceInsertIntoTextNodeCommand.cpp:53
&gt; &gt; +    case AXObjectCache::AXTextEditTypePaste:
&gt; 
&gt; can you just make the default: case be ASSERT_NOT_REACHED</span >

I could do that for non debug builds, but not having a default means I get warnings if I change the enum which is quite helpful</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>