[EFL][DRT] Implement LayoutTestController's methods related with editing.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Mar 2012 07:25:25 +0000 (07:25 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Mar 2012 07:25:25 +0000 (07:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=80136

Patch by Grzegorz Czajkowski <g.czajkowski@samsung.com> on 2012-03-23
Reviewed by Ryosuke Niwa.

Source/WebKit/efl:

Implements DumpRenderTreeSupportEfl's and EditorClientEfl's methods related with editing.

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::setSmartInsertDeleteEnabled): New function.
(DumpRenderTreeSupportEfl::setSelectTrailingWhitespaceEnabled): New function.
* WebCoreSupport/DumpRenderTreeSupportEfl.h:
* WebCoreSupport/EditorClientEfl.cpp:
(WebCore::EditorClientEfl::setSmartInsertDeleteEnabled): New function.
(WebCore):
(WebCore::EditorClientEfl::smartInsertDeleteEnabled): Add implementation.
(WebCore::EditorClientEfl::setSelectTrailingWhitespaceEnabled): New function.
(WebCore::EditorClientEfl::isSelectTrailingWhitespaceEnabled): Add implementation.
(WebCore::EditorClientEfl::EditorClientEfl):
* WebCoreSupport/EditorClientEfl.h:
(EditorClientEfl):

Tools:

Implements EFL's LayoutTestController methods e.i. setSmartInsertDeleteEnabled,
setSelectTrailingWhitespaceEnabled.

* DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
(LayoutTestController::setSmartInsertDeleteEnabled):
(LayoutTestController::setSelectTrailingWhitespaceEnabled):

LayoutTests:

Enables tests connected with setSelectTrailingWhitespaceEnabled and setSmartInsertDeleteEnabled.
Tests related with spelling can not be enabled in this patch because WebKit-Efl doesn't
support spell checking (missing TextCheckerClient implementation).

* platform/efl/Skipped:

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

LayoutTests/ChangeLog
LayoutTests/platform/efl/Skipped
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
Tools/ChangeLog
Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp

index 8788794..1c241be 100644 (file)
@@ -1,3 +1,16 @@
+2012-03-23  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
+
+        [EFL][DRT] Implement LayoutTestController's methods related with editing.
+        https://bugs.webkit.org/show_bug.cgi?id=80136
+
+        Reviewed by Ryosuke Niwa.
+
+        Enables tests connected with setSelectTrailingWhitespaceEnabled and setSmartInsertDeleteEnabled.
+        Tests related with spelling can not be enabled in this patch because WebKit-Efl doesn't
+        support spell checking (missing TextCheckerClient implementation).
+
+        * platform/efl/Skipped:
+
 2012-03-22  Dan Bernstein  <mitz@apple.com>
 
         Added fast/events/remove-target-with-shadow-in-drag.html to the Mac WebKit2 skip list, since
index 5b7b979..cc79ba5 100644 (file)
@@ -61,7 +61,8 @@ svg/W3C-SVG-1.1-SE
 svg/zoom/page/relative-sized-document-scrollbars.svg
 svg/zoom/page/zoom-zoom-coords.xhtml
 
-# EFL's EventSender needs to emit double clicks
+# EFL's EventSender needs to emit double clicks (e.g. to select text)
+editing/selection/doubleclick-inline-first-last-contenteditable.html
 fast/events/dblclick-addEventListener.html
 fast/forms/password-doubleclick-selection.html
 
@@ -441,13 +442,6 @@ fast/events/blur-focus-window-should-blur-focus-element.html
 fast/events/show-modal-dialog-onblur-onfocus.html
 plugins/netscape-plugin-setwindow-size-2.html
 
-# EFL's LayoutTestController does not implement setSmartInsertDeleteEnabled
-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
-
 # EFL's LayoutTestController does not implement setJavaScriptCanAccessClipboard
 editing/execCommand/clipboard-access.html
 
@@ -473,13 +467,6 @@ http/tests/misc/favicon-loads-with-images-disabled.html
 # EFL's LayoutTestController does not implement setJavaScriptProfilingEnabled
 fast/profiler
 
-# EFL's LayoutTestController does not implement setSelectTrailingWhitespaceEnabled
-editing/selection/doubleclick-beside-cr-span.html
-editing/selection/doubleclick-inline-first-last-contenteditable.html
-editing/selection/doubleclick-whitespace-crash.html
-editing/selection/doubleclick-whitespace-img-crash.html
-editing/selection/doubleclick-whitespace.html
-
 # EFL's LayoutTestController does not implement elementDoesAutoCompleteForElementWithId
 security/set-form-autocomplete-attribute.html
 
@@ -699,7 +686,7 @@ http/tests/xmlhttprequest/cross-origin-authorization-with-embedder.html
 fast/events/show-modal-dialog-onblur-onfocus.html
 fast/harness/show-modal-dialog.html
 
-# EFL's LayoutTestController does not implement hasSpellingMarker
+# Missing TextCheckerClient implementation (Efl's port does not support spell checking, Gtk port uses Enchant library https://bugs.webkit.org/show_bug.cgi?id=61787)
 editing/spelling/design-mode-spellcheck-off.html
 editing/spelling/spellcheck-attribute.html
 editing/spelling/spellcheck-paste.html
index fb9645b..a6a7dc7 100644 (file)
@@ -1,3 +1,26 @@
+2012-03-23  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
+
+        [EFL][DRT] Implement LayoutTestController's methods related with editing.
+        https://bugs.webkit.org/show_bug.cgi?id=80136
+
+        Reviewed by Ryosuke Niwa.
+
+        Implements DumpRenderTreeSupportEfl's and EditorClientEfl's methods related with editing.
+
+        * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+        (DumpRenderTreeSupportEfl::setSmartInsertDeleteEnabled): New function.
+        (DumpRenderTreeSupportEfl::setSelectTrailingWhitespaceEnabled): New function.
+        * WebCoreSupport/DumpRenderTreeSupportEfl.h:
+        * WebCoreSupport/EditorClientEfl.cpp:
+        (WebCore::EditorClientEfl::setSmartInsertDeleteEnabled): New function.
+        (WebCore):
+        (WebCore::EditorClientEfl::smartInsertDeleteEnabled): Add implementation.
+        (WebCore::EditorClientEfl::setSelectTrailingWhitespaceEnabled): New function.
+        (WebCore::EditorClientEfl::isSelectTrailingWhitespaceEnabled): Add implementation.
+        (WebCore::EditorClientEfl::EditorClientEfl):
+        * WebCoreSupport/EditorClientEfl.h:
+        (EditorClientEfl):
+
 2012-03-22  Sudarsana Nagineni  <sudarsana.nagineni@linux.intel.com>
 
         [EFL] [DRT] Implement LayoutTestController::markerTextForListItem()
index 222b6db..4620d16 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <AnimationController.h>
 #include <DocumentLoader.h>
+#include <EditorClientEfl.h>
 #include <Eina.h>
 #include <Evas.h>
 #include <FindOptions.h>
@@ -322,6 +323,32 @@ bool DumpRenderTreeSupportEfl::findString(const Evas_Object* ewkView, const char
     return page->findString(String::fromUTF8(text), options);
 }
 
+void DumpRenderTreeSupportEfl::setSmartInsertDeleteEnabled(Evas_Object* ewkView, bool enabled)
+{
+    WebCore::Page* page = EWKPrivate::corePage(ewkView);
+    if (!page)
+        return;
+
+    WebCore::EditorClientEfl* editorClient = static_cast<WebCore::EditorClientEfl*>(page->editorClient());
+    if (!editorClient)
+        return;
+
+    editorClient->setSmartInsertDeleteEnabled(enabled);
+}
+
+void DumpRenderTreeSupportEfl::setSelectTrailingWhitespaceEnabled(Evas_Object* ewkView, bool enabled)
+{
+    WebCore::Page* page = EWKPrivate::corePage(ewkView);
+    if (!page)
+        return;
+
+    WebCore::EditorClientEfl* editorClient = static_cast<WebCore::EditorClientEfl*>(page->editorClient());
+    if (!editorClient)
+        return;
+
+    editorClient->setSelectTrailingWhitespaceEnabled(enabled);
+}
+
 void DumpRenderTreeSupportEfl::garbageCollectorCollect()
 {
     WebCore::gcController().garbageCollectNow();
index 8177f5f..9c3df14 100644 (file)
@@ -66,6 +66,8 @@ public:
     static void setAutofilled(JSContextRef, JSValueRef nodeObject, bool autofilled);
 
     static bool findString(const Evas_Object* ewkView, const char* text, WebCore::FindOptions);
+    static void setSmartInsertDeleteEnabled(Evas_Object* ewkView, bool enabled);
+    static void setSelectTrailingWhitespaceEnabled(Evas_Object* ewkView, bool enabled);
 
     static void garbageCollectorCollect();
     static void garbageCollectorCollectOnAlternateThread(bool waitUntilDone);
index 8224155..8b9bc9f 100644 (file)
@@ -23,6 +23,7 @@
 #include "config.h"
 #include "EditorClientEfl.h"
 
+#include "DumpRenderTreeSupportEfl.h"
 #include "Editor.h"
 #include "EventNames.h"
 #include "FocusController.h"
@@ -229,16 +230,28 @@ void EditorClientEfl::pageDestroyed()
     delete this;
 }
 
+void EditorClientEfl::setSmartInsertDeleteEnabled(bool enabled)
+{
+    m_smartInsertDeleteEnabled = enabled;
+    if (enabled)
+        setSelectTrailingWhitespaceEnabled(false);
+}
+
 bool EditorClientEfl::smartInsertDeleteEnabled()
 {
-    notImplemented();
-    return false;
+    return m_smartInsertDeleteEnabled;
+}
+
+void EditorClientEfl::setSelectTrailingWhitespaceEnabled(bool enabled)
+{
+    m_selectTrailingWhitespaceEnabled = enabled;
+    if (enabled)
+        setSmartInsertDeleteEnabled(false);
 }
 
 bool EditorClientEfl::isSelectTrailingWhitespaceEnabled()
 {
-    notImplemented();
-    return false;
+    return m_selectTrailingWhitespaceEnabled;
 }
 
 void EditorClientEfl::toggleContinuousSpellChecking()
@@ -437,6 +450,8 @@ void EditorClientEfl::handleInputMethodKeydown(KeyboardEvent* event)
 EditorClientEfl::EditorClientEfl(Evas_Object* view)
     : m_isInRedo(false)
     , m_view(view)
+    , m_selectTrailingWhitespaceEnabled(false)
+    , m_smartInsertDeleteEnabled(false)
 {
     notImplemented();
 }
index 2b52e9d..407e243 100644 (file)
@@ -60,7 +60,9 @@ public:
     virtual bool shouldDeleteRange(Range*);
     virtual bool shouldShowDeleteInterface(HTMLElement*);
     virtual bool smartInsertDeleteEnabled();
+    void setSmartInsertDeleteEnabled(bool);
     virtual bool isSelectTrailingWhitespaceEnabled();
+    void setSelectTrailingWhitespaceEnabled(bool);
     virtual bool isContinuousSpellCheckingEnabled();
     virtual void toggleContinuousSpellChecking();
     virtual bool isGrammarCheckingEnabled();
@@ -125,6 +127,8 @@ public:
 
 private:
     Evas_Object *m_view;
+    bool m_selectTrailingWhitespaceEnabled;
+    bool m_smartInsertDeleteEnabled;
 };
 }
 
index 8925006..ed6f84a 100644 (file)
@@ -1,3 +1,17 @@
+2012-03-23  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
+
+        [EFL][DRT] Implement LayoutTestController's methods related with editing.
+        https://bugs.webkit.org/show_bug.cgi?id=80136
+
+        Reviewed by Ryosuke Niwa.
+
+        Implements EFL's LayoutTestController methods e.i. setSmartInsertDeleteEnabled,
+        setSelectTrailingWhitespaceEnabled.
+
+        * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
+        (LayoutTestController::setSmartInsertDeleteEnabled):
+        (LayoutTestController::setSelectTrailingWhitespaceEnabled):
+
 2012-03-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
         Convert hasGrammarMarker to use Internals interface
index a4bf8fa..d922ccb 100644 (file)
@@ -286,9 +286,9 @@ void LayoutTestController::setWindowIsKey(bool)
     notImplemented();
 }
 
-void LayoutTestController::setSmartInsertDeleteEnabled(bool)
+void LayoutTestController::setSmartInsertDeleteEnabled(bool flag)
 {
-    notImplemented();
+    DumpRenderTreeSupportEfl::setSmartInsertDeleteEnabled(browser->mainView(), flag);
 }
 
 static Eina_Bool waitToDumpWatchdogFired(void*)
@@ -446,9 +446,9 @@ void LayoutTestController::setJavaScriptProfilingEnabled(bool)
     notImplemented();
 }
 
-void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool)
+void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag)
 {
-    notImplemented();
+    DumpRenderTreeSupportEfl::setSelectTrailingWhitespaceEnabled(browser->mainView(), flag);
 }
 
 void LayoutTestController::setPopupBlockingEnabled(bool flag)