[Webkit-unassigned] [Bug 61324] --webkit-visual-word does not work well in words separated by multiple spaces

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 25 19:13:04 PDT 2011


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





--- Comment #6 from Xiaomei Ji <xji at chromium.org>  2011-05-25 19:13:04 PST ---
(In reply to comment #5)
> (From update of attachment 94867 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=94867&action=review
> 
> > Source/WebCore/ChangeLog:10
> > +        the one at left or right of current position. It will have a performance hit. 
> 
> By will have a performance hit, do you mean that we'll have a performance regression?

Yes. I think it will have performance regression.
I think single space is more common, in which, previously, if a position is inside a box,
for half of the cases (where we have to look for the right kind of word break, in terms of before or after space,  that can not directly get from previousWordBreak or nextWordBreak), we could do nextWordPosition and previousWordPosition to find out its left or right word break.
But now, we need to find out all the word breaks inside the box and then find the left or right word break by comparing offsets.

I have not figured out a better way to solve this.

> 
> > Source/WebCore/editing/visible_units.cpp:1534
> >      if (box->direction() == blockDirection) {
> > -        if (blockDirection == RTL)
> > -            wordBreak = positionBeforeNextWord(visiblePosition);
> > -        else
> > +        if (blockDirection == LTR)
> >              wordBreak = previousWordPosition(visiblePosition);
> >      } else {
> > -        if (blockDirection == RTL)
> > -            wordBreak = positionAfterPreviousWord(visiblePosition);
> > -        else
> > +        if (blockDirection == LTR)
> >              wordBreak = nextWordPosition(visiblePosition);
> >      }
> 
> I would put if (box->direction() == blockDirection) .. else .. in if (blockDirection == LTR) instead.

Ah, you right.

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