[Webkit-unassigned] [Bug 38087] Clicking below last line of right-to-left editable text that puts caret in the wrong place

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 8 22:43:59 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=38087


Ryosuke Niwa <rniwa at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rniwa at webkit.org




--- Comment #4 from Ryosuke Niwa <rniwa at webkit.org>  2010-12-08 22:43:58 PST ---
For the very simple case as in:
<div dir="rtl" contenteditable style="border: solid 1px red; width: 150px; padding: 20px;"><span>א</span><span>ב</span><span>ג</span></div>

The following change suffice to fix the bug.

--- WebCore/rendering/RenderBlock.cpp    (revision 73592)
+++ WebCore/rendering/RenderBlock.cpp    (working copy)
@@ -4016,7 +4019,8 @@
     if (lastRootBoxWithChildren) {
         // We hit this case for Mac behavior when the Y coordinate is below the last box.
         ASSERT(moveCaretToBoundary);
-        return VisiblePosition(positionForBox(lastRootBoxWithChildren->lastLeafChild(), false), DOWNSTREAM);
+        InlineBox* logicallyLastBox = style()->isLeftToRightDirection() ? lastRootBoxWithChildren->lastLeafChild() : lastRootBoxWithChildren->firstLeafChild();
+        return VisiblePosition(positionForBox(logicallyLastBox, false), DOWNSTREAM);
     }

However, when we have LTR / RTL mixed content as in below, things get a tricker.
<div style="border: solid 1px red; width: 150px; padding: 20px;">hello<span>א</span><span>ב</span><span>ג</span></div>
What should we expect to get for this case?  Should it be between hello and א, which is the logical end of the line?  Or should it be to the right of ג since we're in a LTR block?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list