2011-02-28 Chang Shu <cshu@webkit.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Mar 2011 01:47:06 +0000 (01:47 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Mar 2011 01:47:06 +0000 (01:47 +0000)
        Reviewed by Ryosuke Niwa.

        Remove the support of Frame::isContentEditable and its dependencies.
        https://bugs.webkit.org/show_bug.cgi?id=54292

        Updated expected results after the change that syncs the WebKit isEditable
        and WebCore isContentEditable.

        * platform/mac/editing/selection/designmode-no-caret-expected.txt:
2011-02-28  Chang Shu  <cshu@webkit.org>

        Reviewed by Ryosuke Niwa.

        Remove the support of Frame::isContentEditable and its dependencies.
        https://bugs.webkit.org/show_bug.cgi?id=54292

        Frame::isContentEditable is currently based on two things: Editor::clientIsEditable and
        Document::inDesignMode. In fact, it should only rely on Document::inDesignMode. As a result,
        Editor::clientIsEditable and its client-side implementation can be removed.

        * WebCore.exp.in:
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::isReadOnly):
        * editing/Editor.cpp:
        * editing/Editor.h:
        * editing/SelectionController.cpp:
        (WebCore::SelectionController::setSelectionFromNone):
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::isContentEditable):
        (WebCore::HTMLElement::isContentRichlyEditable):
        * page/DragController.cpp:
        (WebCore::DragController::operationForLoad):
        * page/EditorClient.h:
        * page/Frame.cpp:
        * page/Frame.h:
2011-02-28  Chang Shu  <cshu@webkit.org>

        Reviewed by Ryosuke Niwa.

        Remove the support of Frame::isContentEditable and its dependencies.
        https://bugs.webkit.org/show_bug.cgi?id=54292

        Remove the WebKit side implementation.

        * src/EditorClientImpl.cpp:
        * src/EditorClientImpl.h:
2011-02-28  Chang Shu  <cshu@webkit.org>

        Reviewed by Ryosuke Niwa.

        Remove the support of Frame::isContentEditable and its dependencies.
        https://bugs.webkit.org/show_bug.cgi?id=54292

        Remove the WebKit side implementation.

        * WebCoreSupport/EditorClientEfl.cpp:
        * WebCoreSupport/EditorClientEfl.h:
2011-02-28  Chang Shu  <cshu@webkit.org>

        Reviewed by Ryosuke Niwa.

        Remove the support of Frame::isContentEditable and its dependencies.
        https://bugs.webkit.org/show_bug.cgi?id=54292

        Remove the WebKit side implementation. Make WebKit support depend on Document::inDesignMode.

        * WebCoreSupport/EditorClientGtk.cpp:
        * WebCoreSupport/EditorClientGtk.h:
        * webkit/webkitwebview.cpp:
        (webkit_web_view_init):
        (webkit_web_view_get_editable):
        (webkit_web_view_set_editable):
        * webkit/webkitwebviewprivate.h:
2011-02-28  Chang Shu  <cshu@webkit.org>

        Reviewed by Ryosuke Niwa.

        Remove the support of Frame::isContentEditable and its dependencies.
        https://bugs.webkit.org/show_bug.cgi?id=54292

        Remove the WebKit side implementation.

        * WebCoreSupport/EditorClientHaiku.cpp:
        * WebCoreSupport/EditorClientHaiku.h:
2011-02-28  Chang Shu  <cshu@webkit.org>

        Reviewed by Ryosuke Niwa.

        Remove the support of Frame::isContentEditable and its dependencies.
        https://bugs.webkit.org/show_bug.cgi?id=54292

        Remove the WebKit side implementation. Make WebKit support depend on Document::inDesignMode.

        * WebCoreSupport/WebEditorClient.h:
        * WebCoreSupport/WebEditorClient.mm:
        * WebView/WebView.mm:
        (-[WebView setEditable:]):
        (-[WebView isEditable]):
        * WebView/WebViewData.h:
2011-02-28  Chang Shu  <cshu@webkit.org>

        Reviewed by Ryosuke Niwa.

        Remove the support of Frame::isContentEditable and its dependencies.
        https://bugs.webkit.org/show_bug.cgi?id=54292

        Remove the WebKit side implementation. Make WebKit support depend on Document::inDesignMode.

        * Api/qwebpage.cpp:
        (QWebPagePrivate::QWebPagePrivate):
        (QWebPage::setContentEditable):
        (QWebPage::isContentEditable):
        * Api/qwebpage_p.h:
        * WebCoreSupport/EditorClientQt.cpp:
        * WebCoreSupport/EditorClientQt.h:
2011-02-28  Chang Shu  <cshu@webkit.org>

        Reviewed by Ryosuke Niwa.

        Remove the support of Frame::isContentEditable and its dependencies.
        https://bugs.webkit.org/show_bug.cgi?id=54292

        Remove the WebKit side implementation.

        * WebCoreSupport/WebEditorClient.cpp:
        * WebCoreSupport/WebEditorClient.h:
2011-02-28  Chang Shu  <cshu@webkit.org>

        Reviewed by Ryosuke Niwa.

        Remove the support of Frame::isContentEditable and its dependencies.
        https://bugs.webkit.org/show_bug.cgi?id=54292

        Remove the WebKit side implementation.

        * WebCoreSupport/EditorClientWinCE.cpp:
        * WebCoreSupport/EditorClientWinCE.h:
2011-02-28  Chang Shu  <cshu@webkit.org>

        Reviewed by Ryosuke Niwa.

        Remove the support of Frame::isContentEditable and its dependencies.
        https://bugs.webkit.org/show_bug.cgi?id=54292

        Remove the WebKit side implementation. Make WebKit support depend on Document::inDesignMode.

        * WebFrame.cpp:
        (wxWebFrame::wxWebFrame):
        (wxWebFrame::MakeEditable):
        (wxWebFrame::IsEditable):
        * WebFrame.h:
        * WebKitSupport/EditorClientWx.cpp:
        * WebKitSupport/EditorClientWx.h:
        * WebView.cpp:
        (wxWebView::wxWebView):
        * WebView.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79953 268f45cc-cd09-0410-ab3c-d52691b4dbfc

50 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/editing/selection/designmode-no-caret-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/Editor.h
Source/WebCore/editing/SelectionController.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/page/DragController.cpp
Source/WebCore/page/EditorClient.h
Source/WebCore/page/Frame.cpp
Source/WebCore/page/Frame.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/EditorClientImpl.cpp
Source/WebKit/chromium/src/EditorClientImpl.h
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
Source/WebKit/efl/WebCoreSupport/EditorClientEfl.h
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/EditorClientGtk.h
Source/WebKit/gtk/webkit/webkitwebview.cpp
Source/WebKit/gtk/webkit/webkitwebviewprivate.h
Source/WebKit/haiku/ChangeLog
Source/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp
Source/WebKit/haiku/WebCoreSupport/EditorClientHaiku.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebEditorClient.h
Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/mac/WebView/WebViewData.h
Source/WebKit/qt/Api/qwebpage.cpp
Source/WebKit/qt/Api/qwebpage_p.h
Source/WebKit/qt/ChangeLog
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/WebCoreSupport/WebEditorClient.h
Source/WebKit/wince/ChangeLog
Source/WebKit/wince/WebCoreSupport/EditorClientWinCE.cpp
Source/WebKit/wince/WebCoreSupport/EditorClientWinCE.h
Source/WebKit/wx/ChangeLog
Source/WebKit/wx/WebFrame.cpp
Source/WebKit/wx/WebFrame.h
Source/WebKit/wx/WebKitSupport/EditorClientWx.cpp
Source/WebKit/wx/WebKitSupport/EditorClientWx.h
Source/WebKit/wx/WebView.cpp
Source/WebKit/wx/WebView.h

index 43f44e4..c325271 100644 (file)
@@ -1,3 +1,15 @@
+2011-02-28  Chang Shu  <cshu@webkit.org>
+
+        Reviewed by Ryosuke Niwa.
+
+        Remove the support of Frame::isContentEditable and its dependencies.
+        https://bugs.webkit.org/show_bug.cgi?id=54292
+
+        Updated expected results after the change that syncs the WebKit isEditable
+        and WebCore isContentEditable.
+
+        * platform/mac/editing/selection/designmode-no-caret-expected.txt:
+
 2011-02-28  Kent Tamura  <tkent@chromium.org>
 
         Reviewed by Darin Adler.
index 98cbe77..0ee5e0a 100644 (file)
@@ -9,9 +9,11 @@ layer at (0,0) size 800x600
       RenderBlock (anonymous) at (0,0) size 784x54
         RenderText {#text} at (0,0) size 784x54
           text run at (0,0) width 759: "This tests to see that a caret is placed inside an editable document that is entirely editable even when no caret is requested"
+          text run at (759,0) width 4: " "
           text run at (0,18) width 118: "programmatically. "
           text run at (118,18) width 187: "We do this as a convenience. "
           text run at (305,18) width 479: "Right now, we only do this convenience when a document's frame becomes"
+          text run at (784,18) width 0: " "
           text run at (0,36) width 378: "first responder or when a document's window becomes key."
       RenderBlock {PRE} at (0,67) size 784x15
         RenderText {#text} at (0,0) size 88x15
index 084ffc2..4d6612e 100644 (file)
@@ -1,3 +1,30 @@
+2011-02-28  Chang Shu  <cshu@webkit.org>
+
+        Reviewed by Ryosuke Niwa.
+
+        Remove the support of Frame::isContentEditable and its dependencies.
+        https://bugs.webkit.org/show_bug.cgi?id=54292
+
+        Frame::isContentEditable is currently based on two things: Editor::clientIsEditable and
+        Document::inDesignMode. In fact, it should only rely on Document::inDesignMode. As a result,
+        Editor::clientIsEditable and its client-side implementation can be removed.
+
+        * WebCore.exp.in:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::isReadOnly):
+        * editing/Editor.cpp:
+        * editing/Editor.h:
+        * editing/SelectionController.cpp:
+        (WebCore::SelectionController::setSelectionFromNone):
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::isContentEditable):
+        (WebCore::HTMLElement::isContentRichlyEditable):
+        * page/DragController.cpp:
+        (WebCore::DragController::operationForLoad):
+        * page/EditorClient.h:
+        * page/Frame.cpp:
+        * page/Frame.h:
+
 2011-02-28  Kent Tamura  <tkent@chromium.org>
 
         Reviewed by Darin Adler.
index efcb7bf..99b5e84 100644 (file)
@@ -782,6 +782,7 @@ __ZN7WebCore7cookiesEPKNS_8DocumentERKNS_4KURLE
 __ZN7WebCore7nsColorERKNS_5ColorE
 __ZN7WebCore8Document11createRangeEv
 __ZN7WebCore8Document12updateLayoutEv
+__ZN7WebCore8Document13setDesignModeENS0_13InheritedBoolE
 __ZN7WebCore8Document13svgExtensionsEv
 __ZN7WebCore8Document14setFocusedNodeEN3WTF10PassRefPtrINS_4NodeEEE
 __ZN7WebCore8Document16isPageBoxVisibleEi
@@ -1225,6 +1226,7 @@ __ZNK7WebCore7IntRectcv7_NSRectEv
 __ZNK7WebCore7IntSizecv7_NSSizeEv
 __ZNK7WebCore8Document10renderViewEv
 __ZNK7WebCore8Document11completeURLERKN3WTF6StringE
+__ZNK7WebCore8Document12inDesignModeEv
 __ZNK7WebCore8Document13axObjectCacheEv
 __ZNK7WebCore8Document13nodesFromRectEiijjjjb
 __ZNK7WebCore8Document14getElementByIdERKN3WTF12AtomicStringE
index a0792ea..a414991 100644 (file)
@@ -663,12 +663,8 @@ bool AccessibilityRenderObject::isReadOnly() const
         HTMLElement* body = document->body();
         if (body && body->isContentEditable())
             return false;
-        
-        Frame* frame = document->frame();
-        if (!frame)
-            return true;
-        
-        return !frame->isContentEditable();
+
+        return !document->inDesignMode();
     }
 
     if (m_renderer->isBoxModelObject()) {
index 2520236..bf708c2 100644 (file)
@@ -955,11 +955,6 @@ void Editor::applyParagraphStyleToSelection(CSSStyleDeclaration* style, EditActi
         applyParagraphStyle(style, editingAction);
 }
 
-bool Editor::clientIsEditable() const
-{
-    return client() && client()->isEditable();
-}
-
 // CSS properties that only has a visual difference when applied to text.
 static const int textOnlyProperties[] = {
     CSSPropertyTextDecoration,
index 6c4a737..047b384 100644 (file)
@@ -172,8 +172,6 @@ public:
 
     bool selectionStartHasStyle(CSSStyleDeclaration*) const;
 
-    bool clientIsEditable() const;
-    
     void setShouldStyleWithCSS(bool flag) { m_shouldStyleWithCSS = flag; }
     bool shouldStyleWithCSS() const { return m_shouldStyleWithCSS; }
 
index e2b59e0..5bcd31f 100644 (file)
@@ -1813,7 +1813,7 @@ void SelectionController::setSelectionFromNone()
 
     Document* document = m_frame->document();
     bool caretBrowsing = m_frame->settings() && m_frame->settings()->caretBrowsingEnabled();
-    if (!isNone() || !(m_frame->isContentEditable() || caretBrowsing))
+    if (!isNone() || !(document->inDesignMode() || caretBrowsing))
         return;
 
     Node* node = document->documentElement();
index 886f040..b3981c8 100644 (file)
@@ -659,7 +659,7 @@ bool HTMLElement::supportsFocus() const
 
 bool HTMLElement::isContentEditable() const 
 {
-    if (document()->frame() && document()->frame()->isContentEditable())
+    if (document()->inDesignMode())
         return true;
 
     // Ideally we'd call ASSERT!needsStyleRecalc()) here, but
@@ -678,7 +678,7 @@ bool HTMLElement::isContentEditable() const
 
 bool HTMLElement::isContentRichlyEditable() const
 {
-    if (document()->frame() && document()->frame()->isContentEditable())
+    if (document()->inDesignMode())
         return true;
 
     if (!renderer()) {
index be2b04c..6a4bb70 100644 (file)
@@ -353,7 +353,7 @@ DragOperation DragController::operationForLoad(DragData* dragData)
 {
     ASSERT(dragData);
     Document* doc = m_page->mainFrame()->documentAtPoint(dragData->clientPosition());
-    if (doc && (m_didInitiateDrag || doc->isPluginDocument() || (doc->frame() && doc->frame()->editor()->clientIsEditable())))
+    if (doc && (m_didInitiateDrag || doc->isPluginDocument() || doc->inDesignMode()))
         return DragOperationNone;
     return dragOperation(dragData);
 }
index 74a529d..d5de6a4 100644 (file)
@@ -87,8 +87,6 @@ public:
     virtual bool isGrammarCheckingEnabled() = 0;
     virtual void toggleGrammarChecking() = 0;
     virtual int spellCheckerDocumentTag() = 0;
-    
-    virtual bool isEditable() = 0;
 
     virtual bool shouldBeginEditing(Range*) = 0;
     virtual bool shouldEndEditing(Range*) = 0;
index 0c1a2dc..6458b93 100644 (file)
@@ -551,13 +551,6 @@ void Frame::injectUserScriptsForWorld(DOMWrapperWorld* world, const UserScriptVe
     }
 }
 
-bool Frame::isContentEditable() const
-{
-    if (m_editor.clientIsEditable())
-        return true;
-    return m_doc->inDesignMode();
-}
-
 #ifndef NDEBUG
 static HashSet<Frame*>& keepAliveSet()
 {
index a1e5c10..25f8aac 100644 (file)
@@ -182,8 +182,6 @@ namespace WebCore {
         DragImageRef nodeImage(Node*);
         DragImageRef dragImageForSelection();
 
-        bool isContentEditable() const; // if true, everything in frame is editable
-
         VisiblePosition visiblePositionForPoint(const IntPoint& framePoint);
         Document* documentAtPoint(const IntPoint& windowPoint);
 
index 1108aae..1fdb85b 100644 (file)
@@ -1,3 +1,15 @@
+2011-02-28  Chang Shu  <cshu@webkit.org>
+
+        Reviewed by Ryosuke Niwa.
+
+        Remove the support of Frame::isContentEditable and its dependencies.
+        https://bugs.webkit.org/show_bug.cgi?id=54292
+
+        Remove the WebKit side implementation.
+
+        * src/EditorClientImpl.cpp:
+        * src/EditorClientImpl.h:
+
 2011-02-28  Avi Drissman  <avi@google.com>
 
         Reviewed by James Robinson.
index f5b2974..38d4f5e 100644 (file)
@@ -187,11 +187,6 @@ int EditorClientImpl::spellCheckerDocumentTag()
     return 0;
 }
 
-bool EditorClientImpl::isEditable()
-{
-    return false;
-}
-
 bool EditorClientImpl::shouldBeginEditing(Range* range)
 {
     if (m_webView->client())
index 8b39a38..b81fb56 100644 (file)
@@ -59,7 +59,6 @@ public:
     virtual bool isGrammarCheckingEnabled();
     virtual void toggleGrammarChecking();
     virtual int spellCheckerDocumentTag();
-    virtual bool isEditable();
     virtual bool shouldBeginEditing(WebCore::Range*);
     virtual bool shouldEndEditing(WebCore::Range*);
     virtual bool shouldInsertNode(WebCore::Node*, WebCore::Range*, WebCore::EditorInsertAction);
index dedda96..3e76be1 100644 (file)
@@ -1,3 +1,15 @@
+2011-02-28  Chang Shu  <cshu@webkit.org>
+
+        Reviewed by Ryosuke Niwa.
+
+        Remove the support of Frame::isContentEditable and its dependencies.
+        https://bugs.webkit.org/show_bug.cgi?id=54292
+
+        Remove the WebKit side implementation.
+
+        * WebCoreSupport/EditorClientEfl.cpp:
+        * WebCoreSupport/EditorClientEfl.h:
+
 2011-02-27  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
         Reviewed by Kent Tamura.
index 708e813..c86c924 100644 (file)
@@ -145,12 +145,6 @@ void EditorClientEfl::didSetSelectionTypesForPasteboard()
     notImplemented();
 }
 
-bool EditorClientEfl::isEditable()
-{
-    notImplemented();
-    return false;
-}
-
 void EditorClientEfl::registerCommandForUndo(WTF::PassRefPtr<EditCommand>)
 {
     notImplemented();
index 6e79d44..575a50d 100644 (file)
@@ -61,8 +61,6 @@ public:
     virtual void toggleGrammarChecking();
     virtual int spellCheckerDocumentTag();
 
-    virtual bool isEditable();
-
     virtual bool shouldBeginEditing(Range*);
     virtual bool shouldEndEditing(Range*);
     virtual bool shouldInsertNode(Node*, Range*, EditorInsertAction);
index e01bf44..0854505 100644 (file)
@@ -1,3 +1,20 @@
+2011-02-28  Chang Shu  <cshu@webkit.org>
+
+        Reviewed by Ryosuke Niwa.
+
+        Remove the support of Frame::isContentEditable and its dependencies.
+        https://bugs.webkit.org/show_bug.cgi?id=54292
+
+        Remove the WebKit side implementation. Make WebKit support depend on Document::inDesignMode.
+
+        * WebCoreSupport/EditorClientGtk.cpp:
+        * WebCoreSupport/EditorClientGtk.h:
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_init):
+        (webkit_web_view_get_editable):
+        (webkit_web_view_set_editable):
+        * webkit/webkitwebviewprivate.h:
+
 2011-02-26  Lukasz Slachciak  <l.slachciak@samsung.com>
 
         Reviewed by Xan Lopez.
index 91269a3..33fafaa 100644 (file)
@@ -481,11 +481,6 @@ void EditorClient::didSetSelectionTypesForPasteboard()
     notImplemented();
 }
 
-bool EditorClient::isEditable()
-{
-    return webkit_web_view_get_editable(m_webView);
-}
-
 void EditorClient::registerCommandForUndo(WTF::PassRefPtr<WebCore::EditCommand> command)
 {
     if (undoStack.size() == maximumUndoStackDepth)
index d83a7d2..8aafe45 100644 (file)
@@ -87,8 +87,6 @@ class EditorClient : public WebCore::EditorClient {
         virtual void toggleGrammarChecking();
         virtual int spellCheckerDocumentTag();
 
-        virtual bool isEditable();
-
         virtual bool shouldBeginEditing(WebCore::Range*);
         virtual bool shouldEndEditing(WebCore::Range*);
         virtual bool shouldInsertNode(WebCore::Node*, WebCore::Range*, WebCore::EditorInsertAction);
index 6a856b4..4c00ac0 100644 (file)
@@ -3545,7 +3545,6 @@ static void webkit_web_view_init(WebKitWebView* webView)
     gtk_widget_set_can_focus(GTK_WIDGET(webView), TRUE);
     priv->mainFrame = WEBKIT_WEB_FRAME(webkit_web_frame_new(webView));
     priv->lastPopupXPosition = priv->lastPopupYPosition = -1;
-    priv->editable = false;
 
     priv->backForwardList = adoptGRef(webkit_web_back_forward_list_new_with_web_view(webView));
 
@@ -4339,9 +4338,8 @@ gboolean webkit_web_view_get_editable(WebKitWebView* webView)
 {
     g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE);
 
-    WebKitWebViewPrivate* priv = webView->priv;
-
-    return priv->editable;
+    Frame* frame = core(webView)->mainFrame();
+    return frame && frame->document()->inDesignMode();
 }
 
 /**
@@ -4366,17 +4364,15 @@ void webkit_web_view_set_editable(WebKitWebView* webView, gboolean flag)
 {
     g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
 
-    WebKitWebViewPrivate* priv = webView->priv;
-
     Frame* frame = core(webView)->mainFrame();
     g_return_if_fail(frame);
 
     // TODO: What happens when the frame is replaced?
     flag = flag != FALSE;
-    if (flag == priv->editable)
+    if (flag == webkit_web_view_get_editable(webView))
         return;
 
-    priv->editable = flag;
+    frame->document()->setDesignMode(flag ? WebCore::Document::on : WebCore::Document::off);
 
     if (flag) {
         frame->editor()->applyEditingStyleToBodyElement();
index 03e632a..a355a53 100644 (file)
@@ -65,7 +65,6 @@ struct _WebKitWebViewPrivate {
     gint lastPopupYPosition;
 
     HashSet<GtkWidget*> children;
-    bool editable;
     GRefPtr<GtkIMContext> imContext;
 
     gboolean transparent;
index 0fe54ef..ce84a1f 100644 (file)
@@ -1,3 +1,15 @@
+2011-02-28  Chang Shu  <cshu@webkit.org>
+
+        Reviewed by Ryosuke Niwa.
+
+        Remove the support of Frame::isContentEditable and its dependencies.
+        https://bugs.webkit.org/show_bug.cgi?id=54292
+
+        Remove the WebKit side implementation.
+
+        * WebCoreSupport/EditorClientHaiku.cpp:
+        * WebCoreSupport/EditorClientHaiku.h:
+
 2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
 
         Reviewed by Kent Tamura.
index 85d2513..5c1b13f 100644 (file)
@@ -113,12 +113,6 @@ int EditorClientHaiku::spellCheckerDocumentTag()
     return 0;
 }
 
-bool EditorClientHaiku::isEditable()
-{
-    // FIXME: should be controllable
-    return false;
-}
-
 bool EditorClientHaiku::shouldBeginEditing(WebCore::Range*)
 {
     notImplemented();
index fc7cfa4..bb0d8ac 100644 (file)
@@ -58,8 +58,6 @@ class EditorClientHaiku : public EditorClient, public TextCheckerClient {
         virtual void toggleGrammarChecking();
         virtual int spellCheckerDocumentTag();
 
-        virtual bool isEditable();
-
         virtual bool shouldBeginEditing(Range*);
         virtual bool shouldEndEditing(Range*);
         virtual bool shouldInsertNode(Node*, Range*, EditorInsertAction);
index 53429e7..e0914b6 100644 (file)
@@ -1,3 +1,19 @@
+2011-02-28  Chang Shu  <cshu@webkit.org>
+
+        Reviewed by Ryosuke Niwa.
+
+        Remove the support of Frame::isContentEditable and its dependencies.
+        https://bugs.webkit.org/show_bug.cgi?id=54292
+
+        Remove the WebKit side implementation. Make WebKit support depend on Document::inDesignMode.
+
+        * WebCoreSupport/WebEditorClient.h:
+        * WebCoreSupport/WebEditorClient.mm:
+        * WebView/WebView.mm:
+        (-[WebView setEditable:]):
+        (-[WebView isEditable]):
+        * WebView/WebViewData.h:
+
 2011-02-28  Oliver Hunt  <oliver@apple.com>
 
         Reviewed by Gavin Barraclough.
index c6a7851..1fa132a 100644 (file)
@@ -51,7 +51,6 @@ public:
 
     virtual bool smartInsertDeleteEnabled();
     virtual bool isSelectTrailingWhitespaceEnabled();
-    virtual bool isEditable();
 
     virtual bool shouldDeleteRange(WebCore::Range*);    
     virtual bool shouldShowDeleteInterface(WebCore::HTMLElement*);
index f7ab1c2..81c3d24 100644 (file)
@@ -246,11 +246,6 @@ int WebEditorClient::spellCheckerDocumentTag()
     return [m_webView spellCheckerDocumentTag];
 }
 
-bool WebEditorClient::isEditable()
-{
-    return [m_webView isEditable];
-}
-
 bool WebEditorClient::shouldDeleteRange(Range* range)
 {
     return [[m_webView _editingDelegateForwarder] webView:m_webView
index 27b6476..8fb06d6 100644 (file)
@@ -4988,12 +4988,12 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue jsValu
 
 - (void)setEditable:(BOOL)flag
 {
-    if (_private->editable != flag) {
-        _private->editable = flag;
+    if ([self isEditable] != flag) {
         if (!_private->tabKeyCyclesThroughElementsChanged && _private->page)
             _private->page->setTabKeyCyclesThroughElements(!flag);
         Frame* mainFrame = [self _mainCoreFrame];
         if (mainFrame) {
+            mainFrame->document()->setDesignMode(flag ? WebCore::Document::on : WebCore::Document::off);
             if (flag) {
                 mainFrame->editor()->applyEditingStyleToBodyElement();
                 // If the WebView is made editable and the selection is empty, set it to something.
@@ -5006,7 +5006,10 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue jsValu
 
 - (BOOL)isEditable
 {
-    return _private->editable;
+    Frame* mainFrame = [self _mainCoreFrame];
+    if (mainFrame)
+        return mainFrame->document()->inDesignMode();
+    return false;
 }
 
 - (void)setTypingStyle:(DOMCSSStyleDeclaration *)style
index 97d0fc3..e22bccd 100644 (file)
@@ -105,7 +105,6 @@ extern int pluginDatabaseClientCount;
     BOOL shouldCloseWithWindow;
     BOOL mainFrameDocumentReady;
     BOOL drawsBackground;
-    BOOL editable;
     BOOL tabKeyCyclesThroughElementsChanged;
     BOOL becomingFirstResponder;
     BOOL becomingFirstResponderFromOutside;
index 3b22618..f4d2631 100644 (file)
@@ -301,7 +301,6 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
     , currentContextMenu(0)
 #endif
     , settings(0)
-    , editable(false)
     , useFixedLayout(false)
     , pluginFactory(0)
     , inspectorFrontend(0)
@@ -3160,11 +3159,11 @@ bool QWebPage::focusNextPrevChild(bool next)
 */
 void QWebPage::setContentEditable(bool editable)
 {
-    if (d->editable != editable) {
-        d->editable = editable;
+    if (isContentEditable() != editable) {
         d->page->setTabKeyCyclesThroughElements(!editable);
         if (d->mainFrame) {
             WebCore::Frame* frame = d->mainFrame->d->frame;
+            frame->document()->setDesignMode(editable ? WebCore::Document::on : WebCore::Document::off);
             if (editable) {
                 frame->editor()->applyEditingStyleToBodyElement();
                 // FIXME: mac port calls this if there is no selectedDOMRange
@@ -3178,7 +3177,7 @@ void QWebPage::setContentEditable(bool editable)
 
 bool QWebPage::isContentEditable() const
 {
-    return d->editable;
+    return d->mainFrame && d->mainFrame->d->frame->document()->inDesignMode();
 }
 
 /*!
index 7bd1252..86f54b7 100644 (file)
@@ -200,7 +200,6 @@ public:
 #endif
     QWebSettings *settings;
     QPalette palette;
-    bool editable;
     bool useFixedLayout;
 
     QAction *actions[QWebPage::WebActionCount];
index ed1d728..25b92dd 100644 (file)
@@ -1,3 +1,20 @@
+2011-02-28  Chang Shu  <cshu@webkit.org>
+
+        Reviewed by Ryosuke Niwa.
+
+        Remove the support of Frame::isContentEditable and its dependencies.
+        https://bugs.webkit.org/show_bug.cgi?id=54292
+
+        Remove the WebKit side implementation. Make WebKit support depend on Document::inDesignMode.
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::QWebPagePrivate):
+        (QWebPage::setContentEditable):
+        (QWebPage::isContentEditable):
+        * Api/qwebpage_p.h:
+        * WebCoreSupport/EditorClientQt.cpp:
+        * WebCoreSupport/EditorClientQt.h:
+
 2011-02-28  Alexis Menard  <alexis.menard@openbossa.org>
 
         Reviewed by Oliver Hunt.
index 90c9fb4..cf2fa41 100644 (file)
@@ -238,11 +238,6 @@ bool EditorClientQt::selectWordBeforeMenuEvent()
     return false;
 }
 
-bool EditorClientQt::isEditable()
-{ 
-    return m_page->isContentEditable();
-}
-
 void EditorClientQt::registerCommandForUndo(WTF::PassRefPtr<WebCore::EditCommand> cmd)
 {
 #ifndef QT_NO_UNDOSTACK
index 8d960aa..0450603 100644 (file)
@@ -57,7 +57,6 @@ public:
     virtual void toggleGrammarChecking();
     virtual int spellCheckerDocumentTag();
     virtual bool selectWordBeforeMenuEvent();
-    virtual bool isEditable();
 
     virtual bool shouldBeginEditing(Range*);
     virtual bool shouldEndEditing(Range*);
index 5216174..1a6fdac 100644 (file)
@@ -1,3 +1,15 @@
+2011-02-28  Chang Shu  <cshu@webkit.org>
+
+        Reviewed by Ryosuke Niwa.
+
+        Remove the support of Frame::isContentEditable and its dependencies.
+        https://bugs.webkit.org/show_bug.cgi?id=54292
+
+        Remove the WebKit side implementation.
+
+        * WebCoreSupport/WebEditorClient.cpp:
+        * WebCoreSupport/WebEditorClient.h:
+
 2011-02-28  Adam Roben  <aroben@apple.com>
 
         Build TestWebKitAPIInjectedBundle on Windows
index dddc410..9f08087 100644 (file)
@@ -629,11 +629,6 @@ void WebEditorClient::handleInputMethodKeydown(KeyboardEvent* )
 {
 }
 
-bool WebEditorClient::isEditable()
-{
-    return false;
-}
-
 void WebEditorClient::ignoreWordInSpellDocument(const String& word)
 {
     COMPtr<IWebEditingDelegate> ed;
index 8de8bf0..18be400 100644 (file)
@@ -50,8 +50,6 @@ public:
     virtual void toggleContinuousSpellChecking();
     virtual int spellCheckerDocumentTag();
 
-    virtual bool isEditable();
-
     virtual bool shouldBeginEditing(WebCore::Range*);
     virtual bool shouldEndEditing(WebCore::Range*);
     virtual bool shouldInsertText(const WTF::String&, WebCore::Range*, WebCore::EditorInsertAction);
index 8f77677..64939b3 100644 (file)
@@ -1,3 +1,15 @@
+2011-02-28  Chang Shu  <cshu@webkit.org>
+
+        Reviewed by Ryosuke Niwa.
+
+        Remove the support of Frame::isContentEditable and its dependencies.
+        https://bugs.webkit.org/show_bug.cgi?id=54292
+
+        Remove the WebKit side implementation.
+
+        * WebCoreSupport/EditorClientWinCE.cpp:
+        * WebCoreSupport/EditorClientWinCE.h:
+
 2011-02-19  Charlie Reis  <creis@chromium.org>
 
         Reviewed by Mihai Parparita.
index 30afe26..0811c50 100644 (file)
@@ -144,12 +144,6 @@ void EditorClientWinCE::didSetSelectionTypesForPasteboard()
     notImplemented();
 }
 
-bool EditorClientWinCE::isEditable()
-{
-    notImplemented();
-    return false;
-}
-
 void EditorClientWinCE::registerCommandForUndo(WTF::PassRefPtr<WebCore::EditCommand> command)
 {
     notImplemented();
index 6122822..d93ecc5 100644 (file)
@@ -49,8 +49,6 @@ public:
     virtual void toggleGrammarChecking();
     virtual int spellCheckerDocumentTag();
 
-    virtual bool isEditable();
-
     virtual bool shouldBeginEditing(WebCore::Range*);
     virtual bool shouldEndEditing(WebCore::Range*);
     virtual bool shouldInsertNode(WebCore::Node*, WebCore::Range*, WebCore::EditorInsertAction);
index 7b31a94..b3a991d 100644 (file)
@@ -1,3 +1,23 @@
+2011-02-28  Chang Shu  <cshu@webkit.org>
+
+        Reviewed by Ryosuke Niwa.
+
+        Remove the support of Frame::isContentEditable and its dependencies.
+        https://bugs.webkit.org/show_bug.cgi?id=54292
+
+        Remove the WebKit side implementation. Make WebKit support depend on Document::inDesignMode.
+
+        * WebFrame.cpp:
+        (wxWebFrame::wxWebFrame):
+        (wxWebFrame::MakeEditable):
+        (wxWebFrame::IsEditable):
+        * WebFrame.h:
+        * WebKitSupport/EditorClientWx.cpp:
+        * WebKitSupport/EditorClientWx.h:
+        * WebView.cpp:
+        (wxWebView::wxWebView):
+        * WebView.h:
+
 2011-02-24  Peter Kasting  <pkasting@google.com>
 
         Reviewed by Eric Seidel.
index 1d5f03a..dbb9457 100644 (file)
@@ -77,7 +77,6 @@
 
 wxWebFrame::wxWebFrame(wxWebView* container, wxWebFrame* parent, WebViewFrameData* data) :
     m_textMagnifier(1.0),
-    m_isEditable(false),
     m_isInitialized(false),
     m_beingDestroyed(false)
 {
@@ -403,10 +402,16 @@ void wxWebFrame::ResetTextSize()
 
 void wxWebFrame::MakeEditable(bool enable)
 {
-    m_isEditable = enable;
+    if (enable != IsEditable() && m_impl->frame && m_impl->frame->document())
+        m_impl->frame->document()->setDesignMode(enable ? WebCore::Document::on : WebCore::Document::off);
 }
 
-
+bool wxWebFrame::IsEditable()
+{
+    if (m_impl->frame && m_impl->frame->document())
+        return m_impl->frame->document()->inDesignMode();
+    return false;
+}
 
 bool wxWebFrame::CanCopy()
 {
index 3e9355a..9b331c0 100644 (file)
@@ -159,7 +159,7 @@ public:
     void DecreaseTextSize();
     void ResetTextSize();
     void MakeEditable(bool enable);
-    bool IsEditable() const { return m_isEditable; }
+    bool IsEditable() const;
     
     WebCore::Frame* GetFrame();
 
@@ -173,7 +173,6 @@ public:
     
 private:
     float m_textMagnifier;
-    bool m_isEditable;
     bool m_isInitialized;
     bool m_beingDestroyed;
     WebFramePrivate* m_impl;
index 52b2032..a7e324d 100644 (file)
@@ -197,18 +197,6 @@ bool EditorClientWx::selectWordBeforeMenuEvent()
     return false;
 }
 
-bool EditorClientWx::isEditable()
-{
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
-
-    if (frame) {
-        wxWebView* webKitWin = dynamic_cast<wxWebView*>(frame->view()->hostWindow()->platformPageClient());
-        if (webKitWin) 
-            return webKitWin->IsEditable();
-    }
-    return false;
-}
-
 bool EditorClientWx::shouldBeginEditing(Range*)
 {
     notImplemented();
index d23345b..d1d3597 100644 (file)
@@ -57,7 +57,6 @@ public:
     virtual int spellCheckerDocumentTag();
 
     virtual bool selectWordBeforeMenuEvent();
-    virtual bool isEditable();
 
     virtual bool shouldBeginEditing(Range*);
     virtual bool shouldEndEditing(Range*);
index 0df3879..3215b7a 100644 (file)
@@ -327,7 +327,6 @@ const wxChar* wxWebViewNameStr = wxT("webView");
 
 wxWebView::wxWebView() :
     m_textMagnifier(1.0),
-    m_isEditable(false),
     m_isInitialized(false),
     m_beingDestroyed(false),
     m_mouseWheelZooms(false),
@@ -338,7 +337,6 @@ wxWebView::wxWebView() :
 wxWebView::wxWebView(wxWindow* parent, int id, const wxPoint& position, 
                      const wxSize& size, long style, const wxString& name) :
     m_textMagnifier(1.0),
-    m_isEditable(false),
     m_isInitialized(false),
     m_beingDestroyed(false),
     m_mouseWheelZooms(false),
index 4a6b081..fc80bf4 100644 (file)
@@ -249,7 +249,6 @@ private:
     DECLARE_DYNAMIC_CLASS(wxWebView)
 #endif
     float m_textMagnifier;
-    bool m_isEditable;
     bool m_isInitialized;
     bool m_beingDestroyed;
     bool m_mouseWheelZooms;