Bug 198989 - [Win] Multiline mode of tooltip control does word-wrapping very slowly
Summary: [Win] Multiline mode of tooltip control does word-wrapping very slowly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-06-18 21:01 PDT by Fujii Hironori
Modified: 2019-06-30 19:33 PDT (History)
7 users (show)

See Also:


Attachments
test case with data: URL (14.48 KB, text/html)
2019-06-18 22:29 PDT, Fujii Hironori
no flags Details
test case with long title attribute links (9.17 KB, text/html)
2019-06-18 23:55 PDT, Fujii Hironori
no flags Details
Patch (4.68 KB, patch)
2019-06-25 22:07 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2019-06-18 21:01:05 PDT
[WinCairo] SendMessage in WebKit::WebView::setToolTip often doen't return while using Web Inspector

I'd know how to reproduce this issue, but it's easy to reproduce by using Web Inspector for a while.

SendMessage is blocking.

> [External Code]	
> WebKit2.dll!WebKit::WebView::setToolTip(const WTF::String & toolTip) Line 885	C++
> WebKit2.dll!WebKit::WebPageProxy::setToolTip(const WTF::String & toolTip) Line 6279	C++
> [Inline Frame] WebKit2.dll!IPC::callMemberFunctionImpl(WebKit::WebPageProxy *)	C++
> [Inline Frame] WebKit2.dll!IPC::callMemberFunction(std::tuple<WTF::String> &&)	C++
> [Inline Frame] WebKit2.dll!IPC::handleMessage(IPC::Decoder &)	C++
> WebKit2.dll!WebKit::WebPageProxy::didReceiveMessage(IPC::Connection & connection, IPC::Decoder & decoder) Line 728	C++
> WebKit2.dll!IPC::MessageReceiverMap::dispatchMessage(IPC::Connection & connection, IPC::Decoder & decoder) Line 128	C++
> WebKit2.dll!WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection & connection, IPC::Decoder & decoder) Line 628	C++
> WebKit2.dll!IPC::Connection::dispatchMessage(IPC::Decoder & decoder) Line 983	C++
> WebKit2.dll!IPC::Connection::dispatchMessage(std::unique_ptr<IPC::Decoder,std::default_delete<IPC::Decoder> > message) Line 1012	C++
> WebKit2.dll!IPC::Connection::dispatchIncomingMessages() Line 1116	C++
> [Inline Frame] WTF.dll!WTF::Function<void __cdecl(void)>::operator()()	C++
> WTF.dll!WTF::RunLoop::performWork() Line 107	C++
> [Inline Frame] WTF.dll!WTF::RunLoop::wndProc(HWND__ *) Line 57	C++
> WTF.dll!WTF::RunLoop::RunLoopWndProc(HWND__ * hWnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 39	C++
> [External Code]	
> WebKit.dll!WebKitMessageLoop::run(HACCEL__ * hAccelTable) Line 89	C++
> MiniBrowserLib.dll!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpstrCmdLine, int nCmdShow) Line 99	C++
> MiniBrowser.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpstrCmdLine, int nCmdShow) Line 232	C++
> [External Code]
Comment 1 Fujii Hironori 2019-06-18 22:29:03 PDT
Created attachment 372435 [details]
test case with data: URL
Comment 2 Fujii Hironori 2019-06-18 22:52:11 PDT
winforms - ToolTip works very slow for long text (2000+ chars) - Stack Overflow
https://stackoverflow.com/q/17877009

Tooltip rendering extremely slow on Vista, due to word-wrap
https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/a5a95763-9f10-4640-9d32-afd050a60bb3/tooltip-rendering-extremely-slow-on-vista-due-to-wordwrap
Comment 3 Fujii Hironori 2019-06-18 23:55:22 PDT
Created attachment 372440 [details]
test case with long title attribute links
Comment 4 Fujii Hironori 2019-06-19 00:29:50 PDT
Both WK1 and WK2 have this issue.
Comment 5 Fujii Hironori 2019-06-25 22:07:59 PDT
Created attachment 372905 [details]
Patch
Comment 6 Ross Kirsling 2019-06-26 09:58:29 PDT
Comment on attachment 372905 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=372905&action=review

> Source/WebKit/UIProcess/win/WebView.cpp:875
> +    auto maxLength = 1024;

Seems that if we really wanted to avoid multiline text and the noticeable delay between tooltip display and tooltip *content* display, we would need to set this maximum to 41. That's really short though... :(
Comment 7 Fujii Hironori 2019-06-27 22:08:30 PDT
The problem is, the longer a line is, the unreasonably longer to process the line.
1000 chars length seems reasonable. See also comment 2.
Comment 8 Ross Kirsling 2019-06-28 10:19:38 PDT
(In reply to Fujii Hironori from comment #7)
> The problem is, the longer a line is, the unreasonably longer to process the
> line.
> 1000 chars length seems reasonable. See also comment 2.

Yeah, I saw your link, but a commenter in there mentions:
> I ... saw the behavior you describe after the tooltip went beyond 16 lines. There was way less than 1024 characters.

Anyway, I do agree that we ought to truncate to *some* value and I don't really have a specific countersuggestion, so r=me.
Comment 9 Fujii Hironori 2019-06-30 19:32:44 PDT
Comment on attachment 372905 [details]
Patch

Clearing flags on attachment: 372905

Committed r246960: <https://trac.webkit.org/changeset/246960>
Comment 10 Fujii Hironori 2019-06-30 19:32:47 PDT
All reviewed patches have been landed.  Closing bug.
Comment 11 Radar WebKit Bug Importer 2019-06-30 19:33:57 PDT
<rdar://problem/52435721>