Updates:
Summary: Tooltip rendering performance is very poor / janky when the
tooltip contains a lot of word-wrapped text (on Windows 7 / Vista)
Status: Available
Owner: ---
Cc: [email protected]
Comment #4 on issue 24348 by [email protected]: Tooltip rendering
performance is very poor / janky when the tooltip contains a lot of
word-wrapped text (on Windows 7 / Vista)
http://code.google.com/p/chromium/issues/detail?id=24348
After spending a week on this, and going down several paths to try to solve
the problem, I'm giving up for now, as the cost/benefit ratio is just not
worth it.
Here's what I've learned:
- The cause of the slow word-wrapping is a Windows bug. It's not our fault.
It happens in any application that uses the TTM_SETMAXTIPWIDTH message to
word wrap tooltip text into many lines.
- It does NOT affect XP, only Vista and Windows 7.
- The time taken to display the text seems roughly proportional to the
number of lines-breaks that Windows inserts when word-wrapping.
I posted on the MSDN forums here:
http://social.msdn.microsoft.com/Forums/en/windowsuidevelopment/thread/a5a95763-9f10-4640-9d32-afd050a60bb3
Since we can't fix the problem directly, there are two main options for
solving it:
1. Word-wrap the text ourselves before passing it to the tooltip. If
Windows doesn't need to insert any line breaks, it's nice and fast. The
thing is: word-wrapping is tricky, much more so than you'd
think. You have to handle multiple languages, including ones with no
spaces, and RTL text, and tabs, and words and even characters that are too
big to fit on a line. We don't have a word-wrap function
already in the code base, and I can't find a good one online -- which is
surprising considering what a common thing it is.
<or>
2. Draw the tooltips in a different way, perhaps by creating our own custom
tooltip window. The Windows DrawText() function allows you to draw text in
a given rectangle, word-wrapping automatically. I
*believe* that this word-wraps the text more efficiently. This would likely
involve re-implementing our tooltip behavior, which Windows currently
handles a lot of.
See render_widget_host_view_win.cc for the UI code that creates and updates
our webpage tooltips.
If we aren't going to fix it, we could reduce the problem by allowing the
tooltips to be wider, which would reduce the number of line-breaks required.
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---