WebKit Bugzilla
Attachment 372905 Details for
Bug 198989
: [Win] Multiline mode of tooltip control does word-wrapping very slowly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198989-20190626140757.patch (text/plain), 4.68 KB, created by
Fujii Hironori
on 2019-06-25 22:07:59 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Fujii Hironori
Created:
2019-06-25 22:07:59 PDT
Size:
4.68 KB
patch
obsolete
>Subversion Revision: 246788 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 4e8cb65c9819b9e105671ae00456b75159f7caed..61f9011b6929e605b18dee7eca9bbe1e1833f22c 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,14 @@ >+2019-06-25 Fujii Hironori <Hironori.Fujii@sony.com> >+ >+ [Win] Multiline mode of tooltip control does word-wrapping very slowly >+ https://bugs.webkit.org/show_bug.cgi?id=198989 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/win/WebView.cpp: >+ (WebKit::truncatedString): Added. >+ (WebKit::WebView::setToolTip): Use truncatedString. >+ > 2019-06-24 Brady Eidson <beidson@apple.com> > > Null deref in WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad. >diff --git a/Source/WebKitLegacy/win/ChangeLog b/Source/WebKitLegacy/win/ChangeLog >index 601d76234ce6486282d5dd8801c2a891d711b722..84045094b5b0baa29b7bca9ce29390909d482d2f 100644 >--- a/Source/WebKitLegacy/win/ChangeLog >+++ b/Source/WebKitLegacy/win/ChangeLog >@@ -1,3 +1,14 @@ >+2019-06-25 Fujii Hironori <Hironori.Fujii@sony.com> >+ >+ [Win] Multiline mode of tooltip control does word-wrapping very slowly >+ https://bugs.webkit.org/show_bug.cgi?id=198989 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebView.cpp: >+ (truncatedString): Added. >+ (WebView::setToolTip): Use truncatedString. >+ > 2019-06-16 Darin Adler <darin@apple.com> > > Rename AtomicString to AtomString >diff --git a/Source/WebKit/UIProcess/win/WebView.cpp b/Source/WebKit/UIProcess/win/WebView.cpp >index 5dd305c5c6472ef86bc74f6a3bfd983255d1931f..94e389945dce1ffca9b04e36307abe698129681b 100644 >--- a/Source/WebKit/UIProcess/win/WebView.cpp >+++ b/Source/WebKit/UIProcess/win/WebView.cpp >@@ -869,6 +869,20 @@ void WebView::windowReceivedMessage(HWND, UINT message, WPARAM wParam, LPARAM) > } > } > >+static Vector<wchar_t> truncatedString(const String& string) >+{ >+ // Truncate tooltip texts because multiline mode of tooltip control does word-wrapping very slowly >+ auto maxLength = 1024; >+ auto buffer = string.wideCharacters(); >+ if (buffer.size() > maxLength) { >+ buffer[maxLength - 4] = L'.'; >+ buffer[maxLength - 3] = L'.'; >+ buffer[maxLength - 2] = L'.'; >+ buffer[maxLength - 1] = L'\0'; >+ } >+ return buffer; >+} >+ > void WebView::setToolTip(const String& toolTip) > { > if (!m_toolTipWindow) >@@ -879,8 +893,8 @@ void WebView::setToolTip(const String& toolTip) > info.cbSize = sizeof(info); > info.uFlags = TTF_IDISHWND; > info.uId = reinterpret_cast<UINT_PTR>(nativeWindow()); >- Vector<wchar_t> toolTipCharacters = toolTip.wideCharacters(); // Retain buffer long enough to make the SendMessage call >- info.lpszText = const_cast<wchar_t*>(toolTipCharacters.data()); >+ auto toolTipCharacters = truncatedString(toolTip); // Retain buffer long enough to make the SendMessage call >+ info.lpszText = toolTipCharacters.data(); > ::SendMessage(m_toolTipWindow, TTM_UPDATETIPTEXT, 0, reinterpret_cast<LPARAM>(&info)); > } > >diff --git a/Source/WebKitLegacy/win/WebView.cpp b/Source/WebKitLegacy/win/WebView.cpp >index d51aa3457145d7fa7ce6161f86093a372dd3da94..002c6ebc5bff70c68a8d59bf49a90f5ffdb7e379 100644 >--- a/Source/WebKitLegacy/win/WebView.cpp >+++ b/Source/WebKitLegacy/win/WebView.cpp >@@ -3216,6 +3216,20 @@ void WebView::initializeToolTipWindow() > ::SetWindowPos(m_toolTipHwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); > } > >+static Vector<wchar_t> truncatedString(const String& string) >+{ >+ // Truncate tooltip texts because multiline mode of tooltip control does word-wrapping very slowly >+ auto maxLength = 1024; >+ auto buffer = string.wideCharacters(); >+ if (buffer.size() > maxLength) { >+ buffer[maxLength - 4] = L'.'; >+ buffer[maxLength - 3] = L'.'; >+ buffer[maxLength - 2] = L'.'; >+ buffer[maxLength - 1] = L'\0'; >+ } >+ return buffer; >+} >+ > void WebView::setToolTip(const String& toolTip) > { > if (!m_toolTipHwnd) >@@ -3231,8 +3245,8 @@ void WebView::setToolTip(const String& toolTip) > info.cbSize = sizeof(info); > info.uFlags = TTF_IDISHWND; > info.uId = reinterpret_cast<UINT_PTR>(m_viewWindow); >- Vector<wchar_t> toolTipCharacters = m_toolTip.wideCharacters(); // Retain buffer long enough to make the SendMessage call >- info.lpszText = const_cast<wchar_t*>(toolTipCharacters.data()); >+ auto toolTipCharacters = truncatedString(m_toolTip); // Retain buffer long enough to make the SendMessage call >+ info.lpszText = toolTipCharacters.data(); > ::SendMessage(m_toolTipHwnd, TTM_UPDATETIPTEXT, 0, reinterpret_cast<LPARAM>(&info)); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198989
:
372435
|
372440
| 372905