Hello!

I have a question about how the RenderText class handles the usage of 
TextBreakIterators in RenderText::previousOffset() and 
RenderText::nextOffset(). Currently I am facing a problem where we have a 
single div with 20,000 characters in the div. When the user clicks on the text, 
the mouse down event goes into the render text code to find the position for a 
point. [RenderText::positionForPoint)] This initializes the PositionIterator to 
iterate through the text .

The problem I am seeing is this entire flow is stateless, every call to 
RenderText::previousOffset() and RenderText::nextOffset() creates a new 
textBreakIterator but with the same data. In the QtWebkit port it is using 
HarfBuzz where on initialization the TextBreakIterator parses the text entirely 
and causes performance issues because of the repeated calculations on the same 
text.

Obviously the other ports are using ICU or other algorithms and may not see 
this problem. I tried the same page on Safari and it seems to be ok.

My question is can we optimize this flow somehow? Can we re-use the 
TextBreakIterator in the render text class when performing the 
RenderText::positionForPoint() function?

I'm new to webkit so please correct me if there are any errors :) Any advice 
would be greatly appreciated.

Thank you in advanced,
David

_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to