[Webkit-unassigned] [Bug 78856] visual word movement: Using ICU break iterator to simplify implementation

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 15 14:07:47 PDT 2012


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





--- Comment #23 from Xiaomei Ji <xji at chromium.org>  2012-03-15 14:07:47 PST ---
(In reply to comment #22)
> (In reply to comment #21)
> > (In reply to comment #17)
> > > (From update of attachment 131956 [details] [details] [details])
> > > View in context: https://bugs.webkit.org/attachment.cgi?id=131956&action=review
> > > >> Source/WebCore/editing/visible_units.cpp:166
> > > >> +    root->collectLeafBoxesInLogicalOrder(leafBoxesInLogicalOrder);
> > > > 
> > > > Wait... I don't think this is right. The only time we need to clear the cache is when we move onto a new root inline box.
> > > 
> > > the function only called when we move onto a  new root inline box. And it called continuously when moving to different root inline box so need to clear the vector.
> > 
> > But visualWordPosition moves one character at the time, right? So logicallyPreviousBox/logicallyNextBox can be called for the box in the same root inline box.
> 
> The easiest way to do this is to wrap the vector in some class, and then add collectLeafBoxesInLogicalOrder(RootInlneBox*) m_rootInlineBox as members. collectLeafBoxesInLogicalOrder would then check if the new root inline box is same as m_rootInlineBox or not, and if not, clears the vector and does root->collectLeafBoxesInLogicalOrder(this);

This function will only be called when position is at box boundary.
So, the cache is only useful when a word is across multiple inline boxes.
I thought we will do it in a separate patch (see your previous comment:
"I guess we can cache these vector for the current root inline box to avoid calling collectLeafBoxesInLogicalOrder on the same root inline box repeatedly when a single word is spread across multiple inline boxes but that can probably be done in a separate patch since these functions are only used when user presses ctrl+alt+left/right, and not used by any internal functions.")

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