[Webkit-unassigned] [Bug 57543] New: ctrl-arrow does not work on words separated by multiple spaces
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Mar 31 06:40:41 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=57543
Summary: ctrl-arrow does not work on words separated by
multiple spaces
Product: WebKit
Version: 528+ (Nightly build)
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: P2
Component: HTML Editing
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: xji at chromium.org
Blocks: 25298
the algorithm looks for words in visual order by looping though inline boxes in visual order and stops at the first word break found.
In the case of multi-spaces, word break among the collapsed spaces might not be added.
For example, "<div>abc def hij opq rst</div>", no word break is added between "hij" and "opq".
The reason is when cursor is immediately to the right of "opq", its previous word boundary's offset returned from previousWordPosition() is 15,
which is immediately to the right of "hij ", and which is not in the same box as "opq",
so, it wont be added as a word break in box "opq rst".
To solve this, we could always add the rightmost(for LTR box)/leftmost(for RTL box) boundary
as wordbreak when its inlineBox is the same as 'box'. So, a word break between "hij" and "opq" will be added when we traverse
box "def hij ". Checking that the rightmost or leftmost boundary's inlineBox get from
getInlineBoxAndOffset is the same as 'box' is important as to not break cases such as <div>he<b>llo</b> world</div>, in which
when cursor is immediately to the right of 'he', the rightmost boundary's inlineBox get from getInlineBoxAndOffset is
box 'llo', which is different from box 'he', and this rightmost boundary wont be added as a word break.
But it still might break some other cases since a boundary of a box does not necessarily mean a word break.
The ultimate solution is to provide a way not to canonicalize(upstream) VisiblePosition in its constructor,
so previousWordPosition() of "opq" could return offset 18, which is immediately to the left of "opq", instead.
--
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