Add selectTrailingWhitespaceEnabled setting to WebCore::Page
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Mar 2013 21:54:17 +0000 (21:54 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Mar 2013 21:54:17 +0000 (21:54 +0000)
commit1c00d493ec977f599c1a67d11c30ef8f7d9fa17a
tree818b299dc75a77422bcc50c3c0c641f4aa1eb8fe
parent7dc453b71b8d64f23a78f40896e2c258696238fb
Add selectTrailingWhitespaceEnabled setting to WebCore::Page
https://bugs.webkit.org/show_bug.cgi?id=109404

Patch by Manuel Rego Casasnovas <rego@igalia.com> on 2013-03-14
Reviewed by Tony Chang.

Source/WebCore:

Covered by
editing/selection/doubleclick-inline-first-last-contenteditable.html.

* page/Settings.cpp:
(WebCore): Configure default value for smartInsertDeleteEnabled and
selectTrailingWhitespaceEnabled seetings as they are different in
Chromium port depending on the OS.
* page/Settings.in: Add new setting.

Source/WebKit/blackberry:

Use new settings for smartInsertDeleteEnabled and
selectTrailingWhitespaceEnabled.

Remove code related to DRT as it is not needed anymore.

* Api/DumpRenderTreeClient.h:
* WebCoreSupport/EditorClientBlackBerry.cpp:
(WebCore::EditorClientBlackBerry::smartInsertDeleteEnabled):
(WebCore::EditorClientBlackBerry::isSelectTrailingWhitespaceEnabled):

Source/WebKit/chromium:

Use new Page settings for smartInsertDeleteEnabled and
selectTrailingWhitespaceEnabled and update API accordingly.

WebSettings API is required by DRT in order to set the proper default
values which are different from browser defaults.

* public/WebSettings.h: Add new API to manage smartInsertDeleteEnabled
and selectTrailingWhitespaceEnabled settings.
* public/WebViewClient.h: Remove API related to smartInsertDeleteEnabled
and selectTrailingWhitespaceEnabled as they will be managed from page
settings from now on.
* src/EditorClientImpl.cpp:
(WebKit::EditorClientImpl::smartInsertDeleteEnabled):
(WebKit::EditorClientImpl::isSelectTrailingWhitespaceEnabled): Use new
settings for smartInsertDeleteEnabled and
selectTrailingWhitespaceEnabled.
* src/WebSettingsImpl.cpp: Implement methods establishing the page
settings.
(WebKit::WebSettingsImpl::setSelectTrailingWhitespaceEnabled):
(WebKit):
(WebKit::WebSettingsImpl::setSmartInsertDeleteEnabled):
* src/WebSettingsImpl.h:
(WebSettingsImpl): Implement new API to manage the new settings.

Source/WebKit/efl:

Use new settings for smartInsertDeleteEnabled and
selectTrailingWhitespaceEnabled.

Remove code related to DRT as it is not needed anymore.

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
* WebCoreSupport/DumpRenderTreeSupportEfl.h:
* WebCoreSupport/EditorClientEfl.cpp:
(WebCore::EditorClientEfl::smartInsertDeleteEnabled):
(WebCore::EditorClientEfl::isSelectTrailingWhitespaceEnabled):
(WebCore::EditorClientEfl::EditorClientEfl):
* WebCoreSupport/EditorClientEfl.h:
(EditorClientEfl):

Source/WebKit/gtk:

Use new settings for smartInsertDeleteEnabled and
selectTrailingWhitespaceEnabled.

Remove code related to DRT as it is not needed anymore.

* WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
* WebCoreSupport/DumpRenderTreeSupportGtk.h:
(DumpRenderTreeSupportGtk):
* WebCoreSupport/EditorClientGtk.cpp:
(WebKit::EditorClient::smartInsertDeleteEnabled):
(WebKit::EditorClient::isSelectTrailingWhitespaceEnabled):
(WebKit::EditorClient::EditorClient):
* WebCoreSupport/EditorClientGtk.h:
(EditorClient):

Source/WebKit/mac:

Use new settings for smartInsertDeleteEnabled and
selectTrailingWhitespaceEnabled.

* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::smartInsertDeleteEnabled):
(WebEditorClient::isSelectTrailingWhitespaceEnabled):
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]): Initialize
settings from NSUserDefaults.
(-[WebView setSelectTrailingWhitespaceEnabled:]):
(-[WebView isSelectTrailingWhitespaceEnabled]):
(-[WebView setSmartInsertDeleteEnabled:]):
(-[WebView smartInsertDeleteEnabled]):
* WebView/WebViewData.h:
* WebView/WebViewData.mm:
(-[WebViewPrivate init]):

Source/WebKit/qt:

Use new settings for smartInsertDeleteEnabled and
selectTrailingWhitespaceEnabled.

Remove code related to DRT as it is not needed anymore.

* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
* WebCoreSupport/DumpRenderTreeSupportQt.h:
* WebCoreSupport/EditorClientQt.cpp:
(WebCore::EditorClientQt::smartInsertDeleteEnabled):
(WebCore::EditorClientQt::toggleSmartInsertDelete):
(WebCore::EditorClientQt::isSelectTrailingWhitespaceEnabled):
(WebCore::EditorClientQt::EditorClientQt):
* WebCoreSupport/EditorClientQt.h:
(EditorClientQt):

Source/WebKit/win:

Use new settings for smartInsertDeleteEnabled and
selectTrailingWhitespaceEnabled.

* WebCoreSupport/WebEditorClient.cpp:
(WebEditorClient::smartInsertDeleteEnabled):
(WebEditorClient::isSelectTrailingWhitespaceEnabled):
* WebView.cpp:
(WebView::WebView):
(WebView::setSmartInsertDeleteEnabled):
(WebView::smartInsertDeleteEnabled):
(WebView::setSelectTrailingWhitespaceEnabled):
(WebView::isSelectTrailingWhitespaceEnabled):
* WebView.h:
(WebView):

Source/WebKit/wince:

Use new settings for smartInsertDeleteEnabled and
selectTrailingWhitespaceEnabled.

* WebCoreSupport/EditorClientWinCE.cpp:
(WebKit::EditorClientWinCE::smartInsertDeleteEnabled):
(WebKit::EditorClientWinCE::isSelectTrailingWhitespaceEnabled):

Source/WebKit/wx:

Use new settings for smartInsertDeleteEnabled and
selectTrailingWhitespaceEnabled.

* WebKitSupport/EditorClientWx.cpp:
(WebCore::EditorClientWx::smartInsertDeleteEnabled):
(WebCore::EditorClientWx::isSelectTrailingWhitespaceEnabled):

Tools:

Removes all the code related to smartInsertDeleteEnabled and
selectTrailingWhitespaceEnabled settings as they will be managed from
internals from now on.

* DumpRenderTree/TestRunner.cpp:
(TestRunner::staticFunctions):
* DumpRenderTree/TestRunner.h:
(TestRunner):
* DumpRenderTree/blackberry/DumpRenderTree.cpp:
(WebKit):
(BlackBerry::WebKit::DumpRenderTree::resetToConsistentStateBeforeTesting):
* DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h:
(DumpRenderTree):
* DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp:
* DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h:
(WebTestRunner::WebTestProxy::didStopLoading):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
(WebTestRunner::TestRunner::TestRunner):
(WebTestRunner::TestRunner::reset):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
(TestRunner):
* DumpRenderTree/chromium/TestRunner/src/WebPreferences.cpp:
(WebTestRunner::WebPreferences::applyTo): Set default values for
smartInsertDeleteEnabled and selectTrailingWhitespaceEnabled settings as
Chromium DRT default values are different from Chromium browser.
* DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:
* DumpRenderTree/chromium/WebViewHost.cpp:
* DumpRenderTree/chromium/WebViewHost.h:
(WebViewHost):
* DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
(DumpRenderTreeChrome::resetDefaultsToConsistentValues):
* DumpRenderTree/efl/TestRunnerEfl.cpp:
* DumpRenderTree/gtk/DumpRenderTree.cpp:
(resetDefaultsToConsistentValues):
* DumpRenderTree/gtk/TestRunnerGtk.cpp:
* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebViewToConsistentStateBeforeTesting):
* DumpRenderTree/mac/TestRunnerMac.mm:
* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore::WebPage::resetSettings):
* DumpRenderTree/qt/TestRunnerQt.cpp:
* DumpRenderTree/qt/TestRunnerQt.h:
(TestRunnerQt):
* DumpRenderTree/win/DumpRenderTree.cpp:
(resetWebViewToConsistentStateBeforeTesting):
* DumpRenderTree/win/TestRunnerWin.cpp:
* DumpRenderTree/wx/TestRunnerWx.cpp:

LayoutTests:

Replace testRunner.setSelectTrailingWhitespaceEnabled by
internals.settings.setSelectTrailingWhitespaceEnabled in tests.

Be sure that trailingWhitespaceEnabled and
selectTrailingWhitespaceEnabled are set to opposite values as they are
mutually exclusive.

* editing/deleting/smart-editing-disabled.html:
* editing/selection/doubleclick-beside-cr-span.html:
* editing/selection/doubleclick-whitespace-crash.html:
* editing/selection/doubleclick-whitespace-img-crash.html:
* editing/selection/doubleclick-whitespace.html:
* editing/selection/script-tests/doubleclick-inline-first-last-contenteditable.js:
* editing/spelling/resources/util.js:
(initSpellTest):
* editing/spelling/spelling-double-clicked-word-with-underscores.html:
* editing/spelling/spelling-double-clicked-word.html:
* platform/wk2/TestExpectations: Unflag
editing/selection/doubleclick-inline-first-last-contenteditable.html
as it passes now.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@145849 268f45cc-cd09-0410-ab3c-d52691b4dbfc
76 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/deleting/smart-editing-disabled.html
LayoutTests/editing/selection/doubleclick-beside-cr-span.html
LayoutTests/editing/selection/doubleclick-whitespace-crash.html
LayoutTests/editing/selection/doubleclick-whitespace-img-crash.html
LayoutTests/editing/selection/doubleclick-whitespace.html
LayoutTests/editing/selection/script-tests/doubleclick-inline-first-last-contenteditable.js
LayoutTests/editing/spelling/resources/util.js
LayoutTests/editing/spelling/spelling-double-clicked-word-with-underscores.html
LayoutTests/editing/spelling/spelling-double-clicked-word.html
LayoutTests/platform/wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.in
Source/WebKit/blackberry/Api/DumpRenderTreeClient.h
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebCoreSupport/EditorClientBlackBerry.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebSettings.h
Source/WebKit/chromium/public/WebViewClient.h
Source/WebKit/chromium/src/EditorClientImpl.cpp
Source/WebKit/chromium/src/WebSettingsImpl.cpp
Source/WebKit/chromium/src/WebSettingsImpl.h
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h
Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
Source/WebKit/efl/WebCoreSupport/EditorClientEfl.h
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h
Source/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/EditorClientGtk.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/mac/WebView/WebViewData.h
Source/WebKit/mac/WebView/WebViewData.mm
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
Source/WebKit/qt/WebCoreSupport/EditorClientQt.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebEditorClient.cpp
Source/WebKit/win/WebView.cpp
Source/WebKit/win/WebView.h
Source/WebKit/wince/ChangeLog
Source/WebKit/wince/WebCoreSupport/EditorClientWinCE.cpp
Source/WebKit/wx/ChangeLog
Source/WebKit/wx/WebKitSupport/EditorClientWx.cpp
Tools/ChangeLog
Tools/DumpRenderTree/TestRunner.cpp
Tools/DumpRenderTree/TestRunner.h
Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp
Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h
Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp
Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h
Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp
Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h
Tools/DumpRenderTree/chromium/TestRunner/src/WebPreferences.cpp
Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp
Tools/DumpRenderTree/chromium/WebViewHost.cpp
Tools/DumpRenderTree/chromium/WebViewHost.h
Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
Tools/DumpRenderTree/efl/TestRunnerEfl.cpp
Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/DumpRenderTree/mac/TestRunnerMac.mm
Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
Tools/DumpRenderTree/qt/TestRunnerQt.cpp
Tools/DumpRenderTree/qt/TestRunnerQt.h
Tools/DumpRenderTree/win/DumpRenderTree.cpp
Tools/DumpRenderTree/win/TestRunnerWin.cpp
Tools/DumpRenderTree/wx/TestRunnerWx.cpp