diff options
author | xji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 00:19:52 +0000 |
---|---|---|
committer | xji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 00:19:52 +0000 |
commit | 2dde1b888f43edc846257a38da3eec5c3890c8c5 (patch) | |
tree | 1f1196fb9ca8de59845c05cfdfb63f386437a8e0 | |
parent | cb27fe7df0f1c308ea5b87c5dc42a91a960d979e (diff) | |
download | chromium_src-2dde1b888f43edc846257a38da3eec5c3890c8c5.zip chromium_src-2dde1b888f43edc846257a38da3eec5c3890c8c5.tar.gz chromium_src-2dde1b888f43edc846257a38da3eec5c3890c8c5.tar.bz2 |
This CL fixes issue 17468 - Regression: Extra white rectangle showing when mouse hovering on every web page
Should check tooltip text against empty before adding Unicode Marks for directionality.
BUG=http://crbug.com/17468
BUG=http://crbug.com/17176
BUG=http://crbug.com/5996
TEST= open a webpage, mouse over plain text area, empty square should not show up as tooltip.
Review URL: http://codereview.chromium.org/159222
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21353 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/glue/chrome_client_impl.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/webkit/glue/chrome_client_impl.cc b/webkit/glue/chrome_client_impl.cc index ac1866f..fa965ef 100644 --- a/webkit/glue/chrome_client_impl.cc +++ b/webkit/glue/chrome_client_impl.cc @@ -517,14 +517,16 @@ void ChromeClientImpl::setToolTip(const WebCore::String& tooltip_text, if (webview_->delegate()) { std::wstring tooltip_text_as_wstring = webkit_glue::StringToStdWString(tooltip_text); - if (dir == WebCore::LTR) { - // Force the tooltip to have LTR directionality. - tooltip_text_as_wstring.insert(0, 1, WebCore::leftToRightEmbed); - tooltip_text_as_wstring.push_back(WebCore::popDirectionalFormatting); - } else { - // Force the tooltip to have RTL directionality. - tooltip_text_as_wstring.insert(0, 1, WebCore::rightToLeftEmbed); - tooltip_text_as_wstring.push_back(WebCore::popDirectionalFormatting); + if (!tooltip_text_as_wstring.empty()) { + if (dir == WebCore::LTR) { + // Force the tooltip to have LTR directionality. + tooltip_text_as_wstring.insert(0, 1, WebCore::leftToRightEmbed); + tooltip_text_as_wstring.push_back(WebCore::popDirectionalFormatting); + } else { + // Force the tooltip to have RTL directionality. + tooltip_text_as_wstring.insert(0, 1, WebCore::rightToLeftEmbed); + tooltip_text_as_wstring.push_back(WebCore::popDirectionalFormatting); + } } webview_->delegate()->SetTooltipText(webview_, tooltip_text_as_wstring); } |