[webkit-reviews] review requested: [Bug 57543] -webkit-visual-word does not work on words separated by multiple spaces : [Attachment 93839] patch w/ layout test

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


Xiaomei Ji <xji at chromium.org> has asked  for review:
Bug 57543: -webkit-visual-word does not work on words separated by multiple
spaces
https://bugs.webkit.org/show_bug.cgi?id=57543

Attachment 93839: patch w/ layout test
https://bugs.webkit.org/attachment.cgi?id=93839&action=review

------- Additional Comments from Xiaomei Ji <xji at chromium.org>
> > 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().


More information about the webkit-reviews mailing list