Commit 475c5965 authored by tonikitoo@webkit.org's avatar tonikitoo@webkit.org

Revert "Refactor platform dependent editing behavior code out of Settings"

This reverts commit r60816: Crashed all bots.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60819 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 447d9f86
2010-05-31 Antonio Gomes <tonikitoo@webkit.org>
Reviewed by Ojan Vafai and Darin Adler.
Refactor platform dependent editing behavior code out of Settings
https://bugs.webkit.org/show_bug.cgi?id=39854
As per discussion in bug 36627, Darin Adler suggested: "before the addition of any new EditingBehavior,
I think we to add functions to translate the overall behavior policy into specific behaviors rather than
directly saying 'behavior == Mac' or 'behavior == Windows'. Helper functions that expression the different
rules in plain language.". Patch addresses this request.
No behavior change, so no new tests.
* GNUmakefile.am:
* WebCore.pro:
* WebCore/WebCore.vcproj/WebCore.vcproj
* WebCore/WebCore.xcodeproj/project.pbxproj
* page/Settings.cpp:
(WebCore::Settings::Settings):
* page/Settings.h: Moved out EditingBehavior enum to WebCore/editing/EditingBehaviorTypes.h,
and renamed to EditingBehaviorTypes.
(WebCore::Settings::setEditingBehaviorType): Renamed from setEditingBehavior.
(WebCore::Settings::editingBehaviorType): Renamed from editingBehavior.
* editing/EditingBehavior.h: Added.
(WebCore::EditingBehavior::EditingBehavior): Class to work as a central point for
editing behavior that might have to be handled differently in the different platforms/ports.
Class should be not used or instantiated directly, but rather implicitly constructed
through the Editor class.
(WebCore::EditingBehavior::shouldMoveCaretToHorizontalBoundaryWhenPastTopOrBottom):
(WebCore::EditingBehavior::shouldConsiderSelectionAsDirectional):
(WebCore::EditingBehavior::shouldCenterAlignWhenSelectionIsRevealed):
* editing/EditingBehaviorTypes.h: Added.
(WebCore::):
* editing/Editor.cpp:
(WebCore::Editor::behavior): Getter for EditingBehavior class.
* editing/Editor.h:
* editing/EditorCommand.cpp:
(WebCore::executeToggleStyle):
* editing/SelectionController.cpp:
(WebCore::SelectionController::setSelection):
(WebCore::SelectionController::setIsDirectional):
(WebCore::SelectionController::positionForPlatform):
(WebCore::SelectionController::modify):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEventSingleClick):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::positionForPointWithInlineChildren):
- Call sites will look like:
if (frame->editor()->behavior().shouldThisIfThat()))
// do something
2010-06-07 Eric Seidel <eric@webkit.org>
Unreviewed. Just commit an edit XCode keeps making automatically.
......
......@@ -949,8 +949,6 @@ webcore_sources += \
WebCore/editing/EditAction.h \
WebCore/editing/EditCommand.cpp \
WebCore/editing/EditCommand.h \
WebCore/editing/EditingBehavior.h \
WebCore/editing/EditingBehaviorTypes.h \
WebCore/editing/Editor.cpp \
WebCore/editing/Editor.h \
WebCore/editing/EditorCommand.cpp \
......
......@@ -1292,8 +1292,6 @@
'editing/EditAction.h',
'editing/EditCommand.cpp',
'editing/EditCommand.h',
'editing/EditingBehavior.h',
'editing/EditingBehaviorTypes.h',
'editing/Editor.cpp',
'editing/Editor.h',
'editing/EditorCommand.cpp',
......
......@@ -1281,7 +1281,6 @@ HEADERS += \
editing/DeleteFromTextNodeCommand.h \
editing/DeleteSelectionCommand.h \
editing/EditCommand.h \
editing/EditingBehavior.h \
editing/Editor.h \
editing/FormatBlockCommand.h \
editing/htmlediting.h \
......
......@@ -30512,14 +30512,6 @@
RelativePath="..\editing\EditCommand.h"
>
</File>
<File
RelativePath="..\editing\EditingBehavior.h"
>
</File>
<File
RelativePath="..\editing\EditingBehaviorTypes.h"
>
</File>
<File
RelativePath="..\editing\Editor.cpp"
>
......@@ -1016,8 +1016,6 @@
4E19592E0A39DACC00220FE5 /* MediaQueryExp.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E1959280A39DACC00220FE5 /* MediaQueryExp.h */; };
4F3289B511A42AAB005ABE7E /* InspectorValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F3289B311A42AAB005ABE7E /* InspectorValues.cpp */; };
4F3289B611A42AAB005ABE7E /* InspectorValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F3289B411A42AAB005ABE7E /* InspectorValues.h */; settings = {ATTRIBUTES = (Private, ); }; };
4F1534DE11B532EC0021FD86 /* EditingBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F1534DD11B532EC0021FD86 /* EditingBehavior.h */; settings = {ATTRIBUTES = (Private, ); }; };
4F1534E011B533020021FD86 /* EditingBehaviorTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F1534DF11B533020021FD86 /* EditingBehaviorTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
4FD8D0F2119C718B002FA825 /* ScriptGCEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FD8D0F0119C718B002FA825 /* ScriptGCEvent.cpp */; };
4FD8D0F3119C718B002FA825 /* ScriptGCEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FD8D0F1119C718B002FA825 /* ScriptGCEvent.h */; };
510184690B08602A004A825F /* CachedPage.h in Headers */ = {isa = PBXBuildFile; fileRef = 510184670B08602A004A825F /* CachedPage.h */; settings = {ATTRIBUTES = (Private, ); }; };
......@@ -6644,8 +6642,6 @@
4E1959280A39DACC00220FE5 /* MediaQueryExp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MediaQueryExp.h; sourceTree = "<group>"; };
4F3289B311A42AAB005ABE7E /* InspectorValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorValues.cpp; sourceTree = "<group>"; };
4F3289B411A42AAB005ABE7E /* InspectorValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorValues.h; sourceTree = "<group>"; };
4F1534DD11B532EC0021FD86 /* EditingBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditingBehavior.h; sourceTree = "<group>"; };
4F1534DF11B533020021FD86 /* EditingBehaviorTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditingBehaviorTypes.h; sourceTree = "<group>"; };
4FD8D0F0119C718B002FA825 /* ScriptGCEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptGCEvent.cpp; sourceTree = "<group>"; };
4FD8D0F1119C718B002FA825 /* ScriptGCEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptGCEvent.h; sourceTree = "<group>"; };
510184670B08602A004A825F /* CachedPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedPage.h; sourceTree = "<group>"; };
......@@ -13228,8 +13224,6 @@
93309D86099E64910056E581 /* editing */ = {
isa = PBXGroup;
children = (
4F1534DF11B533020021FD86 /* EditingBehaviorTypes.h */,
4F1534DD11B532EC0021FD86 /* EditingBehavior.h */,
ED501DC90B249F3900AE18D9 /* mac */,
93309D87099E64910056E581 /* AppendNodeCommand.cpp */,
93309D88099E64910056E581 /* AppendNodeCommand.h */,
......@@ -19431,8 +19425,6 @@
9FFE3EA611B5A4390037874E /* JSMemoryInfo.h in Headers */,
86243D0111BC31F700CC006A /* JSArrayBufferViewHelper.h in Headers */,
B6B0540A11B68F10002564C5 /* IDBObjectStoreImpl.h in Headers */,
4F1534DE11B532EC0021FD86 /* EditingBehavior.h in Headers */,
4F1534E011B533020021FD86 /* EditingBehaviorTypes.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/*
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef EditingBehavior_h
#define EditingBehavior_h
#include "EditingBehaviorTypes.h"
namespace WebCore {
class EditingBehavior {
public:
EditingBehavior(EditingBehaviorType type)
: m_type(type)
{
}
// Individual functions for each case where we have more than one style of editing behavior.
// Create a new function for any platform difference so we can control it here.
// When extending a selection beyond the top or bottom boundary of an editable area,
// maintain the horizontal position on Windows but extend it to the boundary of the editable
// content on Mac.
bool shouldMoveCaretToHorizontalBoundaryWhenPastTopOrBottom() const { return m_type != EditingWindowsBehavior; }
// On Windows, selections should always be considered as directional, regardless if it is
// mouse-based or keyboard-based.
bool shouldConsiderSelectionAsDirectional() const { return m_type != EditingMacBehavior; }
// On Mac, when revealing a selection (for example as a result of a Find operation on the Browser),
// content should be scrolled such that the selection gets certer aligned.
bool shouldCenterAlignWhenSelectionIsRevealed() const { return m_type == EditingMacBehavior; }
private:
EditingBehaviorType m_type;
};
} // namespace WebCore
#endif // EditingBehavior_h
/*
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef EditingBehaviorTypes_h
#define EditingBehaviorTypes_h
namespace WebCore {
// There are multiple editing details that are different on Windows than Macintosh.
// We use a single switch for all of them. Some examples:
//
// 1) Clicking below the last line of an editable area puts the caret at the end
// of the last line on Mac, but in the middle of the last line on Windows.
// 2) Pushing the down arrow key on the last line puts the caret at the end of the
// last line on Mac, but does nothing on Windows. A similar case exists on the
// top line.
//
// This setting is intended to control these sorts of behaviors. There are some other
// behaviors with individual function calls on EditorClient (smart copy and paste and
// selecting the space after a double click) that could be combined with this if
// if possible in the future.
enum EditingBehaviorType {
EditingMacBehavior,
EditingWindowsBehavior
};
} // WebCore namespace
#endif // EditingBehaviorTypes_h
......@@ -63,7 +63,6 @@
#include "RenderBlock.h"
#include "RenderPart.h"
#include "ReplaceSelectionCommand.h"
#include "Settings.h"
#include "Sound.h"
#include "Text.h"
#include "TextIterator.h"
......@@ -98,15 +97,6 @@ VisibleSelection Editor::selectionForCommand(Event* event)
return selection;
}
// Function considers Mac editing behavior a fallback when Page or Settings is not available.
EditingBehavior Editor::behavior() const
{
if (!m_frame || !m_frame->settings())
return EditingBehavior(EditingMacBehavior);
return EditingBehavior(m_frame->settings()->editingBehaviorType());
}
EditorClient* Editor::client() const
{
if (Page* page = m_frame->page())
......
......@@ -29,7 +29,6 @@
#include "ClipboardAccessPolicy.h"
#include "Color.h"
#include "EditAction.h"
#include "EditingBehavior.h"
#include "EditorDeleteAction.h"
#include "EditorInsertAction.h"
#include "SelectionController.h"
......@@ -282,8 +281,6 @@ public:
KillRing* killRing() const { return m_killRing.get(); }
EditingBehavior behavior() const;
PassRefPtr<Range> selectedRange();
// We should make these functions private when their callers in Frame are moved over here to Editor
......
......@@ -166,7 +166,7 @@ static bool executeToggleStyle(Frame* frame, EditorCommandSource source, EditAct
// other: present throughout the selection
Settings* settings = frame->document()->settings();
bool styleIsPresent;
if (settings && settings->editingBehaviorType() == EditingMacBehavior)
if (settings && settings->editingBehavior() == EditingMacBehavior)
styleIsPresent = frame->editor()->selectionStartHasStyle(style.get());
else
styleIsPresent = frame->editor()->selectionHasStyle(style.get()) == TrueTriState;
......
......@@ -164,7 +164,7 @@ void SelectionController::setSelection(const VisibleSelection& s, bool closeTypi
if (userTriggered) {
ScrollAlignment alignment;
if (m_frame->editor()->behavior().shouldCenterAlignWhenSelectionIsRevealed())
if (m_frame->settings() && m_frame->settings()->editingBehavior() == EditingMacBehavior)
alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::alignCenterAlways : ScrollAlignment::alignCenterIfNeeded;
else
alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::alignTopAlways : ScrollAlignment::alignToEdgeIfNeeded;
......@@ -243,7 +243,8 @@ void SelectionController::nodeWillBeRemoved(Node *node)
void SelectionController::setIsDirectional(bool isDirectional)
{
m_isDirectional = !m_frame || m_frame->editor()->behavior().shouldConsiderSelectionAsDirectional() || isDirectional;
Settings* settings = m_frame ? m_frame->settings() : 0;
m_isDirectional = !settings || settings->editingBehavior() != EditingMacBehavior || isDirectional;
}
void SelectionController::willBeModified(EAlteration alter, EDirection direction)
......@@ -298,7 +299,7 @@ VisiblePosition SelectionController::positionForPlatform(bool isGetStart) const
{
Position pos;
Settings* settings = m_frame ? m_frame->settings() : 0;
if (settings && settings->editingBehaviorType() == EditingMacBehavior)
if (settings && settings->editingBehavior() == EditingMacBehavior)
pos = isGetStart ? m_selection.start() : m_selection.end();
else {
// Linux and Windows always extend selections from the extent endpoint.
......@@ -684,7 +685,7 @@ bool SelectionController::modify(EAlteration alter, EDirection direction, TextGr
moveTo(position, userTriggered);
break;
case AlterationExtend:
if (!settings || settings->editingBehaviorType() != EditingMacBehavior || m_selection.isCaret() || !isBoundary(granularity))
if (!settings || settings->editingBehavior() != EditingMacBehavior || m_selection.isCaret() || !isBoundary(granularity))
setExtent(position, userTriggered);
else {
// Standard Mac behavior when extending to a boundary is grow the selection rather
......
......@@ -370,7 +370,7 @@ bool EventHandler::handleMousePressEventSingleClick(const MouseEventWithHitTestR
m_frame->selection()->setIsDirectional(false);
ASSERT(m_frame->settings());
if (m_frame->settings()->editingBehaviorType() == EditingMacBehavior) {
if (m_frame->settings()->editingBehavior() == EditingMacBehavior) {
// See <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection
// was created right-to-left
Position start = newSelection.start();
......
......@@ -113,7 +113,7 @@ Settings::Settings(Page* page)
, m_enforceCSSMIMETypeInStrictMode(true)
, m_usesEncodingDetector(false)
, m_allowScriptsToCloseWindows(false)
, m_editingBehaviorType(
, m_editingBehavior(
#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
// (PLATFORM(MAC) is always false in Chromium, hence the extra condition.)
EditingMacBehavior
......
......@@ -28,7 +28,6 @@
#define Settings_h
#include "AtomicString.h"
#include "EditingBehaviorTypes.h"
#include "FontRenderingMode.h"
#include "KURL.h"
#include "ZoomMode.h"
......@@ -51,6 +50,21 @@ namespace WebCore {
TextDirectionSubmenuAlwaysIncluded
};
// There are multiple editing details that are different on Windows than Macintosh.
// We use a single switch for all of them. Some examples:
//
// 1) Clicking below the last line of an editable area puts the caret at the end
// of the last line on Mac, but in the middle of the last line on Windows.
// 2) Pushing the down arrow key on the last line puts the caret at the end of the
// last line on Mac, but does nothing on Windows. A similar case exists on the
// top line.
//
// This setting is intended to control these sorts of behaviors. There are some other
// behaviors with individual function calls on EditorClient (smart copy and paste and
// selecting the space after a double click) that could be combined with this if
// if possible in the future.
enum EditingBehavior { EditingMacBehavior, EditingWindowsBehavior };
class Settings : public Noncopyable {
public:
Settings(Page*);
......@@ -256,9 +270,9 @@ namespace WebCore {
void setAllowScriptsToCloseWindows(bool);
bool allowScriptsToCloseWindows() const { return m_allowScriptsToCloseWindows; }
void setEditingBehaviorType(EditingBehaviorType behavior) { m_editingBehaviorType = behavior; }
EditingBehaviorType editingBehaviorType() const { return static_cast<EditingBehaviorType>(m_editingBehaviorType); }
void setEditingBehavior(EditingBehavior behavior) { m_editingBehavior = behavior; }
EditingBehavior editingBehavior() const { return static_cast<EditingBehavior>(m_editingBehavior); }
void setDownloadableBinaryFontsEnabled(bool);
bool downloadableBinaryFontsEnabled() const { return m_downloadableBinaryFontsEnabled; }
......@@ -369,7 +383,7 @@ namespace WebCore {
bool m_enforceCSSMIMETypeInStrictMode : 1;
bool m_usesEncodingDetector : 1;
bool m_allowScriptsToCloseWindows : 1;
unsigned m_editingBehaviorType : 1;
unsigned m_editingBehavior : 1;
bool m_downloadableBinaryFontsEnabled : 1;
bool m_xssAuditorEnabled : 1;
bool m_acceleratedCompositingEnabled : 1;
......
......@@ -3955,15 +3955,16 @@ VisiblePosition RenderBlock::positionForPointWithInlineChildren(const IntPoint&
}
}
bool moveCaretToBoundary = document()->frame()->editor()->behavior().shouldMoveCaretToHorizontalBoundaryWhenPastTopOrBottom();
Settings* settings = document()->settings();
bool useWindowsBehavior = settings && settings->editingBehavior() == EditingWindowsBehavior;
if (!moveCaretToBoundary && !closestBox && lastRootBoxWithChildren) {
if (useWindowsBehavior && !closestBox && lastRootBoxWithChildren) {
// y coordinate is below last root line box, pretend we hit it
closestBox = lastRootBoxWithChildren->closestLeafChildForXPos(pointInContents.x());
}
if (closestBox) {
if (moveCaretToBoundary && pointInContents.y() < firstRootBoxWithChildren->lineTop() - verticalLineClickFudgeFactor) {
if (!useWindowsBehavior && pointInContents.y() < firstRootBoxWithChildren->lineTop() - verticalLineClickFudgeFactor) {
// y coordinate is above first root line box, so return the start of the first
return VisiblePosition(positionForBox(firstRootBoxWithChildren->firstLeafChild(), true), DOWNSTREAM);
}
......@@ -3974,7 +3975,7 @@ VisiblePosition RenderBlock::positionForPointWithInlineChildren(const IntPoint&
if (lastRootBoxWithChildren) {
// We hit this case for Mac behavior when the Y coordinate is below the last box.
ASSERT(moveCaretToBoundary);
ASSERT(!useWindowsBehavior);
return VisiblePosition(positionForBox(lastRootBoxWithChildren->lastLeafChild(), false), DOWNSTREAM);
}
......
2010-05-31 Antonio Gomes <tonikitoo@webkit.org>
Reviewed by Ojan Vafai and Darin Adler.
Refactor platform dependent editing behavior code out of Settings
https://bugs.webkit.org/show_bug.cgi?id=39854
EditingBehavior enum was renamed to EditingBehaviorTypes and moved out from Settings.h to
EditingBehaviorTypes.h . Call sites in WebKit/ adjusted accordingly.
* src/WebSettingsImpl.cpp:
(WebKit::WebSettingsImpl::setEditingBehavior):
2010-06-07 Kinuko Yasuda <kinuko@chromium.org>
Reviewed by Jian Li.
......
......@@ -271,7 +271,7 @@ void WebSettingsImpl::setShowDebugBorders(bool show)
void WebSettingsImpl::setEditingBehavior(EditingBehavior behavior)
{
m_settings->setEditingBehaviorType(static_cast<WebCore::EditingBehaviorType>(behavior));
m_settings->setEditingBehavior(static_cast<WebCore::EditingBehavior>(behavior));
}
void WebSettingsImpl::setAcceleratedCompositingEnabled(bool enabled)
......
2010-05-31 Antonio Gomes <tonikitoo@webkit.org>
Reviewed by Ojan Vafai and Darin Adler.
Refactor platform dependent editing behavior code out of Settings
https://bugs.webkit.org/show_bug.cgi?id=39854
EditingBehavior enum was renamed to EditingBehaviorTypes and moved out from Settings.h to
EditingBehaviorTypes.h . Call sites in WebKit/ adjusted accordingly.
* webkit/webkitprivate.cpp:
(WebKit::core):
* webkit/webkitprivate.h:
* webkit/webkitwebview.cpp:
(webkit_web_view_update_settings):
(webkit_web_view_settings_notify):
2010-06-07 Martin Robinson <mrobinson@igalia.com>
Reviewed by Xan Lopez.
......
......@@ -129,9 +129,9 @@ WebCore::ResourceResponse core(WebKitNetworkResponse* response)
return ResourceResponse();
}
WebCore::EditingBehaviorType core(WebKitEditingBehavior type)
WebCore::EditingBehavior core(WebKitEditingBehavior type)
{
return (WebCore::EditingBehaviorType)type;
return (WebCore::EditingBehavior)type;
}
WebKitHitTestResult* kit(const WebCore::HitTestResult& result)
......
......@@ -95,7 +95,7 @@ namespace WebKit {
WebCore::ResourceResponse core(WebKitNetworkResponse* response);
WebCore::EditingBehaviorType core(WebKitEditingBehavior type);
WebCore::EditingBehavior core(WebKitEditingBehavior type);
WebKitSecurityOrigin* kit(WebCore::SecurityOrigin*);
WebCore::SecurityOrigin* core(WebKitSecurityOrigin*);
......
......@@ -2738,7 +2738,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
settings->setJavaScriptCanOpenWindowsAutomatically(javascriptCanOpenWindows);
settings->setJavaScriptCanAccessClipboard(javaScriptCanAccessClipboard);
settings->setOfflineWebApplicationCacheEnabled(enableOfflineWebAppCache);
settings->setEditingBehaviorType(core(editingBehavior));
settings->setEditingBehavior(core(editingBehavior));
settings->setAllowUniversalAccessFromFileURLs(enableUniversalAccessFromFileURI);
settings->setAllowFileAccessFromFileURLs(enableFileAccessFromFileURI);
settings->setDOMPasteAllowed(enableDOMPaste);
......@@ -2839,7 +2839,7 @@ static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GPar
else if (name == g_intern_string("enable-offline-web-application-cache"))
settings->setOfflineWebApplicationCacheEnabled(g_value_get_boolean(&value));
else if (name == g_intern_string("editing-behavior"))
settings->setEditingBehaviorType(core(static_cast<WebKitEditingBehavior>(g_value_get_enum(&value))));
settings->setEditingBehavior(core(static_cast<WebKitEditingBehavior>(g_value_get_enum(&value))));
else if (name == g_intern_string("enable-universal-access-from-file-uris"))
settings->setAllowUniversalAccessFromFileURLs(g_value_get_boolean(&value));
else if (name == g_intern_string("enable-file-access-from-file-uris"))
......
2010-05-31 Antonio Gomes <tonikitoo@webkit.org>
Reviewed by Ojan Vafai and Darin Adler.
Refactor platform dependent editing behavior code out of Settings
https://bugs.webkit.org/show_bug.cgi?id=39854
EditingBehavior enum was renamed to EditingBehaviorTypes and moved out from Settings.h to
EditingBehaviorTypes.h . Call sites in WebKit/ adjusted accordingly.
* WebView/WebFrame.mm:
(core):
* WebView/WebFrameInternal.h:
* WebView/WebView.mm:
(-[WebView _preferencesChangedNotification:]):
2010-06-06 Gavin Barraclough <barraclough@apple.com>
Reviewed by Sam Weinig.
......
......@@ -196,7 +196,7 @@ EditableLinkBehavior core(WebKitEditableLinkBehavior editableLinkBehavior)
return EditableLinkDefaultBehavior;
}
WebCore::EditingBehaviorType core(WebKitEditingBehavior behavior)
WebCore::EditingBehavior core(WebKitEditingBehavior behavior)
{
switch (behavior) {
case WebKitEditingMacBehavior:
......
......@@ -71,7 +71,7 @@ WebView *kit(WebCore::Page*);
WebCore::EditableLinkBehavior core(WebKitEditableLinkBehavior);
WebCore::TextDirectionSubmenuInclusionBehavior core(WebTextDirectionSubmenuInclusionBehavior);
WebCore::EditingBehaviorType core(WebKitEditingBehavior);
WebCore::EditingBehavior core(WebKitEditingBehavior);
WebView *getWebView(WebFrame *webFrame);
......
......@@ -1369,7 +1369,7 @@ static bool fastDocumentTeardownEnabled()
settings->setTextAreasAreResizable([preferences textAreasAreResizable]);
settings->setShrinksStandaloneImagesToFit([preferences shrinksStandaloneImagesToFit]);
settings->setEditableLinkBehavior(core([preferences editableLinkBehavior]));
settings->setEditingBehaviorType(core([preferences editingBehavior]));
settings->setEditingBehavior(core([preferences editingBehavior]));
settings->setTextDirectionSubmenuInclusionBehavior(core([preferences textDirectionSubmenuInclusionBehavior]));
settings->setDOMPasteAllowed([preferences isDOMPasteAllowed]);
settings->setUsesPageCache([self usesPageCache]);
......
2010-05-31 Antonio Gomes <tonikitoo@webkit.org>
Reviewed by Ojan Vafai and Darin Adler.
Refactor platform dependent editing behavior code out of Settings
https://bugs.webkit.org/show_bug.cgi?id=39854
EditingBehavior enum was renamed to EditingBehaviorTypes and moved out from Settings.h to
EditingBehaviorTypes.h . Call sites in WebKit/ adjusted accordingly.
* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::setEditingBehavior):
2010-06-07 Anders Bakken <agbakken@gmail.com>
Reviewed by David Levin.
......
......@@ -476,7 +476,7 @@ bool DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId(QWebFrame*
void DumpRenderTreeSupportQt::setEditingBehavior(QWebPage* page, const QString& editingBehavior)
{
WebCore::EditingBehaviorType coreEditingBehavior;
WebCore::EditingBehavior coreEditingBehavior;
if (editingBehavior == "win")
coreEditingBehavior = EditingWindowsBehavior;
......@@ -491,7 +491,7 @@ void DumpRenderTreeSupportQt::setEditingBehavior(QWebPage* page, const QString&
if (!corePage)
return;
corePage->settings()->setEditingBehaviorType(coreEditingBehavior);
corePage->settings()->setEditingBehavior(coreEditingBehavior);
}
void DumpRenderTreeSupportQt::dumpFrameLoader(bool b)
......
2010-05-31 Antonio Gomes <tonikitoo@webkit.org>
Reviewed by Ojan Vafai and Darin Adler.
Refactor platform dependent editing behavior code out of Settings
https://bugs.webkit.org/show_bug.cgi?id=39854
EditingBehavior enum was renamed to EditingBehaviorTypes and moved out from Settings.h to
EditingBehaviorTypes.h . Call sites in WebKit/ adjusted accordingly.
* WebView.cpp:
(WebView::notifyPreferencesChanged):
2010-06-04 Alice Liu <alice.liu@apple.com>
Reviewed by Jon Honeycutt.
......
......@@ -4654,7 +4654,7 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
hr = preferences->editingBehavior(&editingBehavior);
if (FAILED(hr))
return hr;
settings->setEditingBehaviorType((EditingBehaviorType)editingBehavior);
settings->setEditingBehavior((EditingBehavior)editingBehavior);
hr = preferences->usesPageCache(&enabled);
if (FAILED(hr))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment