<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_ASSIGNED "
   title="ASSIGNED - For keyboard users, activating a fragment URL should transfer focus and caret to the destination"
   href="https://bugs.webkit.org/show_bug.cgi?id=116046#c36">Comment # 36</a>
              on <a class="bz_bug_link 
          bz_status_ASSIGNED "
   title="ASSIGNED - For keyboard users, activating a fragment URL should transfer focus and caret to the destination"
   href="https://bugs.webkit.org/show_bug.cgi?id=116046">bug 116046</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=277305&amp;action=diff" name="attach_277305" title="patch">attachment 277305</a> <a href="attachment.cgi?id=277305&amp;action=edit" title="patch">[details]</a></span>
patch

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

Will address other issues.

<span class="quote">&gt;&gt; Source/WebCore/dom/Document.cpp:3934
&gt;&gt; +        return downcast&lt;Element&gt;(node);
&gt; 
&gt; Step 2 checks of <a href="https://html.spec.whatwg.org/multipage/interaction.html#sequential-focus-navigation-starting-point">https://html.spec.whatwg.org/multipage/interaction.html#sequential-focus-navigation-starting-point</a> says:</span >

We always return the m_focusedElement when it's not null. m_focusableElement will be set to null if we are trying to focus on unfocusable element, and m_focusNavigationStartingPoint will take place.

<span class="quote">&gt;&gt; Source/WebCore/dom/Document.cpp:3936
&gt;&gt; +        return sibling;
&gt; 
&gt; Isn't this backwards?</span >

Here we are using the sibling as a search starting point to find the next focusable element. So when going forward, next element might be the one we want to focus on when hitting tab. We use previous here to make sure we won't skip the next Element. Same goes for the going backwards case.</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>