Source/WebCore: <rdar://problem/7337717> Add an option to automatically show tooltips...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 Aug 2011 06:25:30 +0000 (06:25 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 Aug 2011 06:25:30 +0000 (06:25 +0000)
commit0601660053f02df1f7d4b5fbd9ae0c26faa5e39e
treeca811c787ea0288957e4ce366ac5aae5348807e1
parent88e95e337658c93a8f0f07b1423912d3442465b0
Source/WebCore: <rdar://problem/7337717> Add an option to automatically show tooltips (with the full text) over truncated text
https://bugs.webkit.org/show_bug.cgi?id=66178

Reviewed by Simon Fraser.

* WebCore.exp.in: Export setShowsToolTipOverTruncatedText().
* page/Chrome.cpp:
(WebCore::Chrome::setToolTip): If no title is found, and the page is set to show tooltips over
truncated text, try to set the tooltip to the full text of the truncated text, if any.
* page/Settings.cpp:
(WebCore::Settings::Settings): Initialize new member variable.
(WebCore::Settings::setShowsToolTipOverTruncatedText): Added this setter.
* page/Settings.h:
(WebCore::Settings::showsToolTipOverTruncatedText): Added this getter.
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::innerTextIfTruncated): Added. If the inner node or its nearest enclosing
block has text-overflow: ellipsis and has truncated lines, return the node’s (full) inner text.
* rendering/HitTestResult.h:
* rendering/RootInlineBox.h:
(WebCore::RootInlineBox::hasEllipsisBox): Made this public.

Source/WebKit/mac: Add an option to automatically show tooltips (with the full text) over truncated text
https://bugs.webkit.org/show_bug.cgi?id=66178

Reviewed by Simon Fraser.

* WebView/WebPreferenceKeysPrivate.h: Defined a preference key.
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]): Added a default value of NO for the
ShowsToolTipOverTruncatedText preference.
(-[WebPreferences showsToolTipOverTruncatedText]): Added this getter.
(-[WebPreferences setShowsToolTipOverTruncatedText:]): Added this setter.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]): Added call to Settings::setShowsToolTipOverTruncatedText().

Source/WebKit/win: Add an option to automatically show tooltips (with the full text) over truncated text
https://bugs.webkit.org/show_bug.cgi?id=66178

Reviewed by Simon Fraser.

* Interfaces/IWebPreferencesPrivate.idl: Added accessors.
* WebPreferenceKeysPrivate.h: Defined a preference key.
* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings): Added a default value of
false for the ShowsToolTipOverTruncatedText preference.
(WebPreferences::showsToolTipOverTruncatedText): Added this getter.
(WebPreferences::setShowsToolTipOverTruncatedText): Added this setter.
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged): Added call to Settings::setShowsToolTipOverTruncatedText().

Source/WebKit2: <rdar://problem/7337717> Add an option to automatically show tooltips (with the full text) over truncated text
https://bugs.webkit.org/show_bug.cgi?id=66178

Reviewed by Simon Fraser.

* Shared/WebPreferencesStore.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetShowsToolTipOverTruncatedText): Added this setter.
(WKPreferencesGetShowsToolTipOverTruncatedText): Added this getter.
* UIProcess/API/C/WKPreferencesPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Handle the showsToolTipOverTruncatedText preference.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@93014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/page/Chrome.cpp
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/rendering/HitTestResult.cpp
Source/WebCore/rendering/HitTestResult.h
Source/WebCore/rendering/RootInlineBox.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebPreferencesPrivate.h
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
Source/WebKit/win/Interfaces/WebKit.idl
Source/WebKit/win/WebPreferenceKeysPrivate.h
Source/WebKit/win/WebPreferences.cpp
Source/WebKit/win/WebPreferences.h
Source/WebKit/win/WebView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesStore.h
Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp