Changeset 60841 in webkit


Ignore:
Timestamp:
Jun 8, 2010 6:18:51 AM (14 years ago)
Author:
tonikitoo@webkit.org
Message:

Refactor platform dependent editing behavior code out of Settings
https://bugs.webkit.org/show_bug.cgi?id=39854

[ Re-landing of r60816 with the m_editor initialized before m_selectionController in Frame constructor. ]

Reviewed by Ojan Vafai and Darin Adler.
Patch by Antonio Gomes <tonikitoo@webkit.org>

WebCore:

As per discussion in bug 36627, the following was suggested by Darin Adler: "before the addition of any
new EditingBehavior, I think we need 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 is a first step of an incremental approach to address this request. It does not yet replace all
direct use of Editing{Mac,Windows}Behaviors, but adds infra for that and replaces some of them.

No behavior change, so no new tests.

  • GNUmakefile.am:
  • WebCore.pro:
  • WebCore/WebCore.gypi
  • 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):
(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

WebKit:

EditingBehavior enum was renamed to EditingBehaviorTypes and moved out from Settings.h to
EditingBehaviorTypes.h . Call sites in WebKit/ adjusted accordingly.

WebKit/chromium:

  • src/WebSettingsImpl.cpp:

(WebKit::WebSettingsImpl::setEditingBehavior):

WebKit/gtk:

  • webkit/webkitprivate.cpp:

(WebKit::core):

  • webkit/webkitprivate.h:
  • webkit/webkitwebview.cpp:

(webkit_web_view_update_settings):
(webkit_web_view_settings_notify):

WebKit/mac:

  • WebView/WebFrame.mm:

(core):

  • WebView/WebFrameInternal.h:
  • WebView/WebView.mm:

(-[WebView _preferencesChangedNotification:]):

WebKit/qt:

  • WebCoreSupport/DumpRenderTreeSupportQt.cpp:

(DumpRenderTreeSupportQt::setEditingBehavior):

WebKit/win:

  • WebView.cpp:

(WebView::notifyPreferencesChanged):

Location:
trunk
Files:
2 added
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r60840 r60841  
     12010-06-08  Antonio Gomes  <tonikitoo@webkit.org>
     2
     3        Reviewed by Ojan Vafai and Darin Adler.
     4
     5        Refactor platform dependent editing behavior code out of Settings
     6        https://bugs.webkit.org/show_bug.cgi?id=39854
     7
     8        As per discussion in bug 36627, Darin Adler suggested: "before the addition of any new EditingBehavior,
     9        I think we to add functions to translate the overall behavior policy into specific behaviors rather than
     10        directly saying 'behavior == Mac' or 'behavior == Windows'. Helper functions that expression the different
     11        rules in plain language.". Patch addresses this request.
     12
     13        No behavior change, so no new tests.
     14
     15        * GNUmakefile.am:
     16        * WebCore.pro:
     17        * WebCore/WebCore.vcproj/WebCore.vcproj
     18        * WebCore/WebCore.xcodeproj/project.pbxproj
     19        * page/Settings.cpp:
     20        (WebCore::Settings::Settings):
     21        * page/Settings.h: Moved out EditingBehavior enum to WebCore/editing/EditingBehaviorTypes.h,
     22        and renamed to EditingBehaviorTypes.
     23        (WebCore::Settings::setEditingBehaviorType): Renamed from setEditingBehavior.
     24        (WebCore::Settings::editingBehaviorType): Renamed from editingBehavior.
     25        * editing/EditingBehavior.h: Added.
     26        (WebCore::EditingBehavior::EditingBehavior): Class to work as a central point for
     27        editing behavior that might have to be handled differently in the different platforms/ports.
     28        Class should be not used or instantiated directly, but rather implicitly constructed
     29        through the Editor class.
     30        (WebCore::EditingBehavior::shouldMoveCaretToHorizontalBoundaryWhenPastTopOrBottom):
     31        (WebCore::EditingBehavior::shouldConsiderSelectionAsDirectional):
     32        (WebCore::EditingBehavior::shouldCenterAlignWhenSelectionIsRevealed):
     33        * editing/EditingBehaviorTypes.h: Added.
     34        (WebCore::):
     35        * editing/Editor.cpp:
     36        (WebCore::Editor::behavior): Getter for EditingBehavior class.
     37        * editing/Editor.h:
     38        * editing/EditorCommand.cpp:
     39        (WebCore::executeToggleStyle):
     40        * editing/SelectionController.cpp:
     41        (WebCore::SelectionController::setSelection):
     42        (WebCore::SelectionController::setIsDirectional):
     43        (WebCore::SelectionController::positionForPlatform):
     44        (WebCore::SelectionController::modify):
     45        * page/EventHandler.cpp:
     46        (WebCore::EventHandler::handleMousePressEventSingleClick):
     47        * rendering/RenderBlock.cpp:
     48        (WebCore::RenderBlock::positionForPointWithInlineChildren):
     49
     50        - Call sites will look like:
     51        if (frame->editor()->behavior().shouldThisIfThat()))
     52           // do something
     53
    1542010-06-08  Steve Block  <steveblock@google.com>
    255
  • trunk/WebCore/GNUmakefile.am

    r60819 r60841  
    950950        WebCore/editing/EditCommand.cpp \
    951951        WebCore/editing/EditCommand.h \
     952        WebCore/editing/EditingBehavior.h \
     953        WebCore/editing/EditingBehaviorTypes.h \
    952954        WebCore/editing/Editor.cpp \
    953955        WebCore/editing/Editor.h \
  • trunk/WebCore/WebCore.gypi

    r60819 r60841  
    12931293            'editing/EditCommand.cpp',
    12941294            'editing/EditCommand.h',
     1295            'editing/EditingBehavior.h',
     1296            'editing/EditingBehaviorTypes.h',
    12951297            'editing/Editor.cpp',
    12961298            'editing/Editor.h',
  • trunk/WebCore/WebCore.pro

    r60819 r60841  
    12821282    editing/DeleteSelectionCommand.h \
    12831283    editing/EditCommand.h \
     1284    editing/EditingBehavior.h \
    12841285    editing/Editor.h \
    12851286    editing/FormatBlockCommand.h \
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r60819 r60841  
    3051430514                        </File>
    3051530515                        <File
     30516                                RelativePath="..\editing\EditingBehavior.h"
     30517                                >
     30518                        </File>
     30519                        <File
     30520                                RelativePath="..\editing\EditingBehaviorTypes.h"
     30521                                >
     30522                        </File>
     30523                        <File
    3051630524                                RelativePath="..\editing\Editor.cpp"
    3051730525                                >
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r60827 r60841  
    10171017                4F3289B511A42AAB005ABE7E /* InspectorValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F3289B311A42AAB005ABE7E /* InspectorValues.cpp */; };
    10181018                4F3289B611A42AAB005ABE7E /* InspectorValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F3289B411A42AAB005ABE7E /* InspectorValues.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1019                4F1534DE11B532EC0021FD86 /* EditingBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F1534DD11B532EC0021FD86 /* EditingBehavior.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1020                4F1534E011B533020021FD86 /* EditingBehaviorTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F1534DF11B533020021FD86 /* EditingBehaviorTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
    10191021                4FD8D0F2119C718B002FA825 /* ScriptGCEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FD8D0F0119C718B002FA825 /* ScriptGCEvent.cpp */; };
    10201022                4FD8D0F3119C718B002FA825 /* ScriptGCEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FD8D0F1119C718B002FA825 /* ScriptGCEvent.h */; };
     
    66456647                4F3289B311A42AAB005ABE7E /* InspectorValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorValues.cpp; sourceTree = "<group>"; };
    66466648                4F3289B411A42AAB005ABE7E /* InspectorValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorValues.h; sourceTree = "<group>"; };
     6649                4F1534DD11B532EC0021FD86 /* EditingBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditingBehavior.h; sourceTree = "<group>"; };
     6650                4F1534DF11B533020021FD86 /* EditingBehaviorTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditingBehaviorTypes.h; sourceTree = "<group>"; };
    66476651                4FD8D0F0119C718B002FA825 /* ScriptGCEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptGCEvent.cpp; sourceTree = "<group>"; };
    66486652                4FD8D0F1119C718B002FA825 /* ScriptGCEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptGCEvent.h; sourceTree = "<group>"; };
     
    1323013234                        isa = PBXGroup;
    1323113235                        children = (
     13236                                4F1534DF11B533020021FD86 /* EditingBehaviorTypes.h */,
     13237                                4F1534DD11B532EC0021FD86 /* EditingBehavior.h */,
    1323213238                                ED501DC90B249F3900AE18D9 /* mac */,
    1323313239                                93309D87099E64910056E581 /* AppendNodeCommand.cpp */,
     
    1943519441                                A7BBE26711AFB3F20005EA03 /* JSHTMLMeterElement.h in Headers */,
    1943619442                                B6B0540A11B68F10002564C5 /* IDBObjectStoreImpl.h in Headers */,
     19443                                4F1534DE11B532EC0021FD86 /* EditingBehavior.h in Headers */,
     19444                                4F1534E011B533020021FD86 /* EditingBehaviorTypes.h in Headers */,
    1943719445                        );
    1943819446                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebCore/editing/Editor.cpp

    r60819 r60841  
    6464#include "RenderPart.h"
    6565#include "ReplaceSelectionCommand.h"
     66#include "Settings.h"
    6667#include "Sound.h"
    6768#include "Text.h"
     
    9697    }
    9798    return selection;
     99}
     100
     101// Function considers Mac editing behavior a fallback when Page or Settings is not available.
     102EditingBehavior Editor::behavior() const
     103{
     104    if (!m_frame || !m_frame->settings())
     105        return EditingBehavior(EditingMacBehavior);
     106
     107    return EditingBehavior(m_frame->settings()->editingBehaviorType());
    98108}
    99109
  • trunk/WebCore/editing/Editor.h

    r60819 r60841  
    3030#include "Color.h"
    3131#include "EditAction.h"
     32#include "EditingBehavior.h"
    3233#include "EditorDeleteAction.h"
    3334#include "EditorInsertAction.h"
     
    282283    KillRing* killRing() const { return m_killRing.get(); }
    283284
     285    EditingBehavior behavior() const;
     286
    284287    PassRefPtr<Range> selectedRange();
    285288   
  • trunk/WebCore/editing/EditorCommand.cpp

    r60819 r60841  
    167167    Settings* settings = frame->document()->settings();
    168168    bool styleIsPresent;
    169     if (settings && settings->editingBehavior() == EditingMacBehavior)
     169    if (settings && settings->editingBehaviorType() == EditingMacBehavior)
    170170        styleIsPresent = frame->editor()->selectionStartHasStyle(style.get());
    171171    else
  • trunk/WebCore/editing/SelectionController.cpp

    r60819 r60841  
    165165        ScrollAlignment alignment;
    166166
    167         if (m_frame->settings() && m_frame->settings()->editingBehavior() == EditingMacBehavior)
     167        if (m_frame->editor()->behavior().shouldCenterAlignWhenSelectionIsRevealed())
    168168            alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::alignCenterAlways : ScrollAlignment::alignCenterIfNeeded;
    169169        else
     
    244244void SelectionController::setIsDirectional(bool isDirectional)
    245245{
    246     Settings* settings = m_frame ? m_frame->settings() : 0;
    247     m_isDirectional = !settings || settings->editingBehavior() != EditingMacBehavior || isDirectional;
     246    m_isDirectional = !m_frame || m_frame->editor()->behavior().shouldConsiderSelectionAsDirectional() || isDirectional;
    248247}
    249248
     
    300299    Position pos;
    301300    Settings* settings = m_frame ? m_frame->settings() : 0;
    302     if (settings && settings->editingBehavior() == EditingMacBehavior)
     301    if (settings && settings->editingBehaviorType() == EditingMacBehavior)
    303302        pos = isGetStart ? m_selection.start() : m_selection.end();
    304303    else {
     
    686685        break;
    687686    case AlterationExtend:
    688         if (!settings || settings->editingBehavior() != EditingMacBehavior || m_selection.isCaret() || !isBoundary(granularity))
     687        if (!settings || settings->editingBehaviorType() != EditingMacBehavior || m_selection.isCaret() || !isBoundary(granularity))
    689688            setExtent(position, userTriggered);
    690689        else {
  • trunk/WebCore/page/EventHandler.cpp

    r60819 r60841  
    371371       
    372372        ASSERT(m_frame->settings());
    373         if (m_frame->settings()->editingBehavior() == EditingMacBehavior) {
     373        if (m_frame->settings()->editingBehaviorType() == EditingMacBehavior) {
    374374            // See <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection
    375375            // was created right-to-left
  • trunk/WebCore/page/Frame.cpp

    r60104 r60841  
    138138    , m_ownerElement(ownerElement)
    139139    , m_script(this)
     140    , m_editor(this)
    140141    , m_selectionController(this)
    141     , m_editor(this)
    142142    , m_eventHandler(this)
    143143    , m_animationController(this)
  • trunk/WebCore/page/Frame.h

    r60104 r60841  
    340340        String m_kjsDefaultStatusBarText;
    341341
    342         mutable SelectionController m_selectionController;
    343342        mutable VisibleSelection m_mark;
    344343        mutable Editor m_editor;
     344        mutable SelectionController m_selectionController;
    345345        mutable EventHandler m_eventHandler;
    346346        mutable AnimationController m_animationController;
  • trunk/WebCore/page/Settings.cpp

    r60819 r60841  
    114114    , m_usesEncodingDetector(false)
    115115    , m_allowScriptsToCloseWindows(false)
    116     , m_editingBehavior(
     116    , m_editingBehaviorType(
    117117#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
    118118        // (PLATFORM(MAC) is always false in Chromium, hence the extra condition.)
  • trunk/WebCore/page/Settings.h

    r60819 r60841  
    2929
    3030#include "AtomicString.h"
     31#include "EditingBehaviorTypes.h"
    3132#include "FontRenderingMode.h"
    3233#include "KURL.h"
     
    5152    };
    5253
    53     // There are multiple editing details that are different on Windows than Macintosh.
    54     // We use a single switch for all of them. Some examples:
    55     //
    56     //    1) Clicking below the last line of an editable area puts the caret at the end
    57     //       of the last line on Mac, but in the middle of the last line on Windows.
    58     //    2) Pushing the down arrow key on the last line puts the caret at the end of the
    59     //       last line on Mac, but does nothing on Windows. A similar case exists on the
    60     //       top line.
    61     //
    62     // This setting is intended to control these sorts of behaviors. There are some other
    63     // behaviors with individual function calls on EditorClient (smart copy and paste and
    64     // selecting the space after a double click) that could be combined with this if
    65     // if possible in the future.
    66     enum EditingBehavior { EditingMacBehavior, EditingWindowsBehavior };
    67 
    6854    class Settings : public Noncopyable {
    6955    public:
     
    271257        bool allowScriptsToCloseWindows() const { return m_allowScriptsToCloseWindows; }
    272258
    273         void setEditingBehavior(EditingBehavior behavior) { m_editingBehavior = behavior; }
    274         EditingBehavior editingBehavior() const { return static_cast<EditingBehavior>(m_editingBehavior); }
    275        
     259        void setEditingBehaviorType(EditingBehaviorType behavior) { m_editingBehaviorType = behavior; }
     260        EditingBehaviorType editingBehaviorType() const { return static_cast<EditingBehaviorType>(m_editingBehaviorType); }
     261
    276262        void setDownloadableBinaryFontsEnabled(bool);
    277263        bool downloadableBinaryFontsEnabled() const { return m_downloadableBinaryFontsEnabled; }
     
    384370        bool m_usesEncodingDetector : 1;
    385371        bool m_allowScriptsToCloseWindows : 1;
    386         unsigned m_editingBehavior : 1;
     372        unsigned m_editingBehaviorType : 1;
    387373        bool m_downloadableBinaryFontsEnabled : 1;
    388374        bool m_xssAuditorEnabled : 1;
  • trunk/WebCore/rendering/RenderBlock.cpp

    r60819 r60841  
    39563956    }
    39573957
    3958     Settings* settings = document()->settings();
    3959     bool useWindowsBehavior = settings && settings->editingBehavior() == EditingWindowsBehavior;
    3960 
    3961     if (useWindowsBehavior && !closestBox && lastRootBoxWithChildren) {
     3958    bool moveCaretToBoundary = document()->frame()->editor()->behavior().shouldMoveCaretToHorizontalBoundaryWhenPastTopOrBottom();
     3959
     3960    if (!moveCaretToBoundary && !closestBox && lastRootBoxWithChildren) {
    39623961        // y coordinate is below last root line box, pretend we hit it
    39633962        closestBox = lastRootBoxWithChildren->closestLeafChildForXPos(pointInContents.x());
     
    39653964
    39663965    if (closestBox) {
    3967         if (!useWindowsBehavior && pointInContents.y() < firstRootBoxWithChildren->lineTop() - verticalLineClickFudgeFactor) {
     3966        if (moveCaretToBoundary && pointInContents.y() < firstRootBoxWithChildren->lineTop() - verticalLineClickFudgeFactor) {
    39683967            // y coordinate is above first root line box, so return the start of the first
    39693968            return VisiblePosition(positionForBox(firstRootBoxWithChildren->firstLeafChild(), true), DOWNSTREAM);
     
    39763975    if (lastRootBoxWithChildren) {
    39773976        // We hit this case for Mac behavior when the Y coordinate is below the last box.
    3978         ASSERT(!useWindowsBehavior);
     3977        ASSERT(moveCaretToBoundary);
    39793978        return VisiblePosition(positionForBox(lastRootBoxWithChildren->lastLeafChild(), false), DOWNSTREAM);
    39803979    }
  • trunk/WebKit/chromium/ChangeLog

    r60823 r60841  
     12010-06-08  Antonio Gomes  <tonikitoo@webkit.org>
     2
     3        Reviewed by Ojan Vafai and Darin Adler.
     4
     5        Refactor platform dependent editing behavior code out of Settings
     6        https://bugs.webkit.org/show_bug.cgi?id=39854
     7
     8        EditingBehavior enum was renamed to EditingBehaviorTypes and moved out from Settings.h to
     9        EditingBehaviorTypes.h . Call sites in WebKit/ adjusted accordingly.
     10
     11        * src/WebSettingsImpl.cpp:
     12        (WebKit::WebSettingsImpl::setEditingBehavior):
     13
    1142010-06-07  Tony Chang  <tony@chromium.org>
    215
  • trunk/WebKit/chromium/src/WebSettingsImpl.cpp

    r60819 r60841  
    272272void WebSettingsImpl::setEditingBehavior(EditingBehavior behavior)
    273273{
    274     m_settings->setEditingBehavior(static_cast<WebCore::EditingBehavior>(behavior));
     274    m_settings->setEditingBehaviorType(static_cast<WebCore::EditingBehaviorType>(behavior));
    275275}
    276276
  • trunk/WebKit/gtk/ChangeLog

    r60834 r60841  
     12010-06-08  Antonio Gomes  <tonikitoo@webkit.org>
     2
     3        Reviewed by Ojan Vafai and Darin Adler.
     4
     5        Refactor platform dependent editing behavior code out of Settings
     6        https://bugs.webkit.org/show_bug.cgi?id=39854
     7
     8        EditingBehavior enum was renamed to EditingBehaviorTypes and moved out from Settings.h to
     9        EditingBehaviorTypes.h . Call sites in WebKit/ adjusted accordingly.
     10
     11        * webkit/webkitprivate.cpp:
     12        (WebKit::core):
     13        * webkit/webkitprivate.h:
     14        * webkit/webkitwebview.cpp:
     15        (webkit_web_view_update_settings):
     16        (webkit_web_view_settings_notify):
     17
    1182010-06-08  Xan Lopez  <xlopez@igalia.com>
    219
  • trunk/WebKit/gtk/webkit/webkitprivate.cpp

    r60834 r60841  
    131131}
    132132
    133 WebCore::EditingBehavior core(WebKitEditingBehavior type)
    134 {
    135     return (WebCore::EditingBehavior)type;
     133WebCore::EditingBehaviorType core(WebKitEditingBehavior type)
     134{
     135    return (WebCore::EditingBehaviorType)type;
    136136}
    137137
  • trunk/WebKit/gtk/webkit/webkitprivate.h

    r60819 r60841  
    9696    WebCore::ResourceResponse core(WebKitNetworkResponse* response);
    9797
    98     WebCore::EditingBehavior core(WebKitEditingBehavior type);
     98    WebCore::EditingBehaviorType core(WebKitEditingBehavior type);
    9999
    100100    WebKitSecurityOrigin* kit(WebCore::SecurityOrigin*);
  • trunk/WebKit/gtk/webkit/webkitwebview.cpp

    r60819 r60841  
    27392739    settings->setJavaScriptCanAccessClipboard(javaScriptCanAccessClipboard);
    27402740    settings->setOfflineWebApplicationCacheEnabled(enableOfflineWebAppCache);
    2741     settings->setEditingBehavior(core(editingBehavior));
     2741    settings->setEditingBehaviorType(core(editingBehavior));
    27422742    settings->setAllowUniversalAccessFromFileURLs(enableUniversalAccessFromFileURI);
    27432743    settings->setAllowFileAccessFromFileURLs(enableFileAccessFromFileURI);
     
    28402840        settings->setOfflineWebApplicationCacheEnabled(g_value_get_boolean(&value));
    28412841    else if (name == g_intern_string("editing-behavior"))
    2842         settings->setEditingBehavior(core(static_cast<WebKitEditingBehavior>(g_value_get_enum(&value))));
     2842        settings->setEditingBehaviorType(core(static_cast<WebKitEditingBehavior>(g_value_get_enum(&value))));
    28432843    else if (name == g_intern_string("enable-universal-access-from-file-uris"))
    28442844        settings->setAllowUniversalAccessFromFileURLs(g_value_get_boolean(&value));
  • trunk/WebKit/mac/ChangeLog

    r60821 r60841  
     12010-06-08  Antonio Gomes  <tonikitoo@webkit.org>
     2
     3        Reviewed by Ojan Vafai and Darin Adler.
     4
     5        Refactor platform dependent editing behavior code out of Settings
     6        https://bugs.webkit.org/show_bug.cgi?id=39854
     7
     8        EditingBehavior enum was renamed to EditingBehaviorTypes and moved out from Settings.h to
     9        EditingBehaviorTypes.h . Call sites in WebKit/ adjusted accordingly.
     10
     11        * WebView/WebFrame.mm:
     12        (core):
     13        * WebView/WebFrameInternal.h:
     14        * WebView/WebView.mm:
     15        (-[WebView _preferencesChangedNotification:]):
     16
    1172010-06-06  MORITA Hajime  <morrita@google.com>
    218
  • trunk/WebKit/mac/WebView/WebFrame.mm

    r60819 r60841  
    197197}
    198198
    199 WebCore::EditingBehavior core(WebKitEditingBehavior behavior)
     199WebCore::EditingBehaviorType core(WebKitEditingBehavior behavior)
    200200{
    201201    switch (behavior) {
  • trunk/WebKit/mac/WebView/WebFrameInternal.h

    r60819 r60841  
    7272WebCore::EditableLinkBehavior core(WebKitEditableLinkBehavior);
    7373WebCore::TextDirectionSubmenuInclusionBehavior core(WebTextDirectionSubmenuInclusionBehavior);
    74 WebCore::EditingBehavior core(WebKitEditingBehavior);
     74WebCore::EditingBehaviorType core(WebKitEditingBehavior);
    7575
    7676WebView *getWebView(WebFrame *webFrame);
  • trunk/WebKit/mac/WebView/WebView.mm

    r60819 r60841  
    13701370    settings->setShrinksStandaloneImagesToFit([preferences shrinksStandaloneImagesToFit]);
    13711371    settings->setEditableLinkBehavior(core([preferences editableLinkBehavior]));
    1372     settings->setEditingBehavior(core([preferences editingBehavior]));
     1372    settings->setEditingBehaviorType(core([preferences editingBehavior]));
    13731373    settings->setTextDirectionSubmenuInclusionBehavior(core([preferences textDirectionSubmenuInclusionBehavior]));
    13741374    settings->setDOMPasteAllowed([preferences isDOMPasteAllowed]);
  • trunk/WebKit/qt/ChangeLog

    r60819 r60841  
     12010-06-08  Antonio Gomes  <tonikitoo@webkit.org>
     2
     3        Reviewed by Ojan Vafai and Darin Adler.
     4
     5        Refactor platform dependent editing behavior code out of Settings
     6        https://bugs.webkit.org/show_bug.cgi?id=39854
     7
     8        EditingBehavior enum was renamed to EditingBehaviorTypes and moved out from Settings.h to
     9        EditingBehaviorTypes.h . Call sites in WebKit/ adjusted accordingly.
     10
     11        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
     12        (DumpRenderTreeSupportQt::setEditingBehavior):
     13
    1142010-06-07  Anders Bakken  <agbakken@gmail.com>
    215
  • trunk/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp

    r60819 r60841  
    477477void DumpRenderTreeSupportQt::setEditingBehavior(QWebPage* page, const QString& editingBehavior)
    478478{
    479     WebCore::EditingBehavior coreEditingBehavior;
     479    WebCore::EditingBehaviorType coreEditingBehavior;
    480480
    481481    if (editingBehavior == "win")
     
    492492        return;
    493493
    494     corePage->settings()->setEditingBehavior(coreEditingBehavior);
     494    corePage->settings()->setEditingBehaviorType(coreEditingBehavior);
    495495}
    496496
  • trunk/WebKit/win/ChangeLog

    r60819 r60841  
     12010-06-08  Antonio Gomes  <tonikitoo@webkit.org>
     2
     3        Reviewed by Ojan Vafai and Darin Adler.
     4
     5        Refactor platform dependent editing behavior code out of Settings
     6        https://bugs.webkit.org/show_bug.cgi?id=39854
     7
     8        EditingBehavior enum was renamed to EditingBehaviorTypes and moved out from Settings.h to
     9        EditingBehaviorTypes.h . Call sites in WebKit/ adjusted accordingly.
     10
     11        * WebView.cpp:
     12        (WebView::notifyPreferencesChanged):
     13
    1142010-06-04  Alice Liu  <alice.liu@apple.com>
    215
  • trunk/WebKit/win/WebView.cpp

    r60819 r60841  
    46554655    if (FAILED(hr))
    46564656        return hr;
    4657     settings->setEditingBehavior((EditingBehavior)editingBehavior);
     4657    settings->setEditingBehaviorType((EditingBehaviorType)editingBehavior);
    46584658
    46594659    hr = preferences->usesPageCache(&enabled);
Note: See TracChangeset for help on using the changeset viewer.