<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - AX: Media controls accessibility improvement"
   href="https://bugs.webkit.org/show_bug.cgi?id=160223#c27">Comment # 27</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - AX: Media controls accessibility improvement"
   href="https://bugs.webkit.org/show_bug.cgi?id=160223">bug 160223</a>
              from <span class="vcard"><a class="email" href="mailto:eric.carlson&#64;apple.com" title="Eric Carlson &lt;eric.carlson&#64;apple.com&gt;"> <span class="fn">Eric Carlson</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=284866&amp;action=diff" name="attach_284866" title="Patch">attachment 284866</a> <a href="attachment.cgi?id=284866&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

I will be happy to r+ this  with the minor nits noted. Thanks for keeping at this Nan!

<span class="quote">&gt; Source/WebCore/Modules/mediacontrols/mediaControlsApple.js:892
&gt; +        var current = this.video.currentTime;
&gt; +        var step = this.timelineStepFromVideoDuration();</span >

Nit: both of these variables are unnecessary, each is only used once

<span class="quote">&gt; Source/WebCore/Modules/mediacontrols/mediaControlsApple.js:900
&gt; +        var current = this.video.currentTime;
&gt; +        var step = this.timelineStepFromVideoDuration();</span >

Ditto.

<span class="quote">&gt; Source/WebCore/Modules/mediacontrols/mediaControlsApple.js:1178
&gt; +        var value = this.controls.timeline.value;
&gt; +        switch(event.keyCode) {
&gt; +        case this.KeyCodes.left:
&gt; +                value = this.decrementTimelineValue();
&gt; +            break;
&gt; +        case this.KeyCodes.right:
&gt; +                value = this.incrementTimelineValue();
&gt; +            break;
&gt; +        case this.KeyCodes.up:
&gt; +        case this.KeyCodes.down:
&gt; +            break;
&gt; +        }
&gt; +        this.controls.timeline.value = value;</span >

As structured, this sets &quot;this.controls.timeline.value = this.controls.timeline.value&quot; for every keydown except left and right arrows. It will be more efficient with a simple if..else, something like:

    if (event.keyCode == this.KeyCodes.left) {
        this.controls.timeline.value = this.decrementTimelineValue();
    else if (event.keyCode == this.KeyCodes.right) {
        this.controls.timeline.value = this.incrementTimelineValue();

<span class="quote">&gt; LayoutTests/media/media-controls-accessibility.html:45
&gt; +            checkTimeLineValue();
&gt; +            
&gt; +            endTest();</span >

To make this test slightly more complete, you could a add 'seeked' event handler and call endTest from that to ensure that the arrow key actually results in a media timeline change.

<span class="quote">&gt; LayoutTests/media/media-controls-accessibility.html:60
&gt; +        debug(&quot;timeline.value: &quot; + timeline.value);
&gt; +        eventSender.keyDown(&quot;leftArrow&quot;);
&gt; +        debug(&quot;timeline.value: &quot;+ timeline.value + &quot;\n&quot;);</span >

Because timeline.value is a floating point number, this is likely to print slightly different values on different versions of the OS. I recommend printing it with one digit of precision: timeline.value.toFixed(1).</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>