[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
Mon May 9 10:54:39 PDT 2011


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





--- Comment #8 from Xiaomei Ji <xji at chromium.org>  2011-05-09 10:54:38 PST ---
(In reply to comment #7)
> (From update of attachment 92380 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=92380&action=review
> 
> > Source/WebCore/editing/visible_units.cpp:1160
> > +static VisiblePosition visuallyFirstWordBreakInBoxInsideBlockWithSameDirectionality(const InlineBox* box, const VisiblePosition& wordBreak, int& offsetOfWordBreak) 
> 
> I'm not sure if "visuallyFirstWordBreak" is descriptive here.  How about something like beforeVisuallyFirstWordInBoxInsideBlockWithSameDirectionality?

It actually is the visually first word break in the box (if it is a word break inside the same box).

> 
> Also, it may not be worth adding this function at all since it's called at exactly one place.  Can we just put this all in previousWordBreakInBoxInsideBlockWithSameDirectionality?

I do not have strong objections. But separating it out seems more consistent with the current style (making functions more fine grained and more readable), for example, lastWordBreakInBox() is also only used once.

> 
> > Source/WebCore/editing/visible_units.cpp:1186
> > +        && ((box->isLeftToRightDirection() && box->nextLeafChild()) 
> > +        || (!box->isLeftToRightDirection() && box->prevLeafChild()))) {
> 
> I'm not following here.  Shouldn't we be checking box->isLeftToRightDirection() && !box->prevLeafChild() instead?
> 

The word break collecting here is actually the rightmost word break for a LTR box or leftmost word break for a RTL box.  Given LTR box as an example, we do not need to save its rightmost word break if it is the visually rightmost box (has no nextLeafChild).

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