[Webkit-unassigned] [Bug 57543] -webkit-visual-word does not work on words separated by multiple spaces

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 17 16:02:27 PDT 2011


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


Xiaomei Ji <xji at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #93675|0                           |1
        is obsolete|                            |
  Attachment #93839|                            |review?
               Flag|                            |




--- Comment #24 from Xiaomei Ji <xji at chromium.org>  2011-05-17 16:02:26 PST ---
Created an attachment (id=93839)
 --> (https://bugs.webkit.org/attachment.cgi?id=93839&action=review)
patch w/ layout test

> > Source/WebCore/editing/visible_units.cpp:1330
> > +    previousWordBreakWasAtBoxStart = false;
> > +
> > +    VisiblePosition wordBreak = (hasSeenWordBreakInThisBox && !previousWordBreakWasAtBoxStart) ? previousWordBreak : Position(box->renderer()->node(), box->caretMinOffset(), Position::PositionIsOffsetInAnchor);
> 
> Huh? Isn't previousWordBreakWasAtBoxStart always false here?  r- because of this.

Thanks for catching it!

I did not find test cases that the logic (for getting the rightmost word break in RTL box or leftmost word break in LTR box) added in nextWordBreakInBoxInsideBlockWithDifferentDirectionality() helps. And I removed the logic completely.

It was added to solve the word break separated by multiple spaces originally. But the following cases show that they are not needed (using RTL box in LTR block as example).

Case 1: in LTR block, a RTL box followed by another RTL box and are separated by multiple spaces.
logical text: ABC DEF    HIJ OPQ
visual display: QPO JIH FED CBA
there are 2 boxes: box 1 "ABC DEF", starts at 0, length is 8; box2 "HIJ OPQ", starts at 11, length is 7.
The word break between "DEF" and "HIJ" is at position 7, which belongs to box "HIJ OPQ".

Case 2: in LTR box, a RTL box followed by a LTR box and are separated by multiple spaces.
logical text "ABC DEF HIJ    abc def hij"
visual order "JIH FED CBA acb def hij".
There are 3 boxes: box 1 "ABC DEF HIJ", starts at 0, length is 11; box 2: " " (space), starts at 11, length is 1; box 3: "abc def hij", starts at 15, length is 11.
The word break between "HIJ" and "abc" falls in box 2 and is caught by the logic added in previousWordBreakInBoxInsideBlockWithSameDirectionality().

-- 
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