<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - previousRootInlineBoxCandidatePosition &amp; nextRootInlineBoxCandidatePosition FIXME to remove duplicate code"
   href="https://bugs.webkit.org/show_bug.cgi?id=145285#c13">Comment # 13</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - previousRootInlineBoxCandidatePosition &amp; nextRootInlineBoxCandidatePosition FIXME to remove duplicate code"
   href="https://bugs.webkit.org/show_bug.cgi?id=145285">bug 145285</a>
              from <span class="vcard"><a class="email" href="mailto:rniwa&#64;webkit.org" title="Ryosuke Niwa &lt;rniwa&#64;webkit.org&gt;"> <span class="fn">Ryosuke Niwa</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=253716&amp;action=diff" name="attach_253716" title="patch">attachment 253716</a> <a href="attachment.cgi?id=253716&amp;action=edit" title="patch">[details]</a></span>
patch

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

<span class="quote">&gt; Source/WebCore/editing/VisibleUnits.cpp:86
&gt; +    Node* leaf = leafWithSameEditability(direction, node, editableType, editableType);</span >

We should be consistent with whether &quot;direction&quot; is the first argument or the last argument.

<span class="quote">&gt; Source/WebCore/editing/VisibleUnits.cpp:102
&gt; +            if (leaf-&gt;hasTagName(brTag))
&gt; +                pos = positionBeforeNode(leaf);
&gt; +            else
&gt; +                pos = createLegacyEditingPosition(leaf, caretMaxOffset(leaf));
&gt; +        } else
&gt; +            pos = createLegacyEditingPosition(leaf, caretMinOffset(leaf));</span >

Do you know why only previous direction requires a check for BR?
Not saying that you need to figure out why but it deserves a why comment.
We can add a FIXME like &quot;Why do we only do this for previous direction?&quot;</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>