Diff
Modified: trunk/Source/WebKit/efl/ChangeLog (117425 => 117426)
--- trunk/Source/WebKit/efl/ChangeLog 2012-05-17 11:03:42 UTC (rev 117425)
+++ trunk/Source/WebKit/efl/ChangeLog 2012-05-17 11:06:21 UTC (rev 117426)
@@ -1,3 +1,26 @@
+2012-05-17 Mariusz Grzegorczyk <marius...@samsung.com>
+
+ [EFL] [DRT] EFL's DumpRenderTree should support LayoutTestController's dumpEditingCallbacks()
+ https://bugs.webkit.org/show_bug.cgi?id=84835
+
+ Reviewed by Eric Seidel.
+
+ * WebCoreSupport/EditorClientEfl.cpp: Call appropriate callbacks for editing actions.
+ (WebCore::EditorClientEfl::shouldDeleteRange):
+ (WebCore::EditorClientEfl::shouldBeginEditing):
+ (WebCore::EditorClientEfl::shouldEndEditing):
+ (WebCore::EditorClientEfl::shouldInsertText):
+ (WebCore::EditorClientEfl::shouldChangeSelectedRange):
+ (WebCore::EditorClientEfl::shouldApplyStyle):
+ (WebCore::EditorClientEfl::didBeginEditing):
+ (WebCore::EditorClientEfl::didEndEditing):
+ (WebCore::EditorClientEfl::shouldInsertNode):
+ * WebCoreSupport/EditorClientEfl.h: Add structures needed by editing callbacks.
+ (Ewk_Should_Insert_Node_Event):
+ (Ewk_Should_Insert_Text_Event):
+ (Ewk_Should_Change_Selected_Range_Event):
+ (Ewk_Should_Apply_Style_Event):
+
2012-05-17 Grzegorz Czajkowski <g.czajkow...@samsung.com>
[EFL] Do not check NULL pointer allocated by new.
Modified: trunk/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp (117425 => 117426)
--- trunk/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp 2012-05-17 11:03:42 UTC (rev 117425)
+++ trunk/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp 2012-05-17 11:06:21 UTC (rev 117426)
@@ -53,9 +53,9 @@
ewk_view_input_method_state_set(m_view, active);
}
-bool EditorClientEfl::shouldDeleteRange(Range*)
+bool EditorClientEfl::shouldDeleteRange(Range* range)
{
- notImplemented();
+ evas_object_smart_callback_call(m_view, "editorclient,range,delete", range);
return true;
}
@@ -82,33 +82,36 @@
return 0;
}
-bool EditorClientEfl::shouldBeginEditing(Range*)
+bool EditorClientEfl::shouldBeginEditing(Range* range)
{
- notImplemented();
+ evas_object_smart_callback_call(m_view, "editorclient,editing,begin", range);
return true;
}
-bool EditorClientEfl::shouldEndEditing(Range*)
+bool EditorClientEfl::shouldEndEditing(Range* range)
{
- notImplemented();
+ evas_object_smart_callback_call(m_view, "editorclient,editing,end", range);
return true;
}
-bool EditorClientEfl::shouldInsertText(const String&, Range*, EditorInsertAction)
+bool EditorClientEfl::shouldInsertText(const String& text, Range* range, EditorInsertAction action)
{
- notImplemented();
+ Ewk_Should_Insert_Text_Event shouldInsertTextEvent = { text.utf8().data(), range, action };
+ evas_object_smart_callback_call(m_view, "editorclient,text,insert", &shouldInsertTextEvent);
return true;
}
-bool EditorClientEfl::shouldChangeSelectedRange(Range*, Range*, EAffinity, bool)
+bool EditorClientEfl::shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity affinity, bool stillSelecting)
{
- notImplemented();
+ Ewk_Should_Change_Selected_Range_Event shouldChangeSelectedRangeEvent = { fromRange, toRange, affinity, stillSelecting };
+ evas_object_smart_callback_call(m_view, "editorclient,selected,range,change", &shouldChangeSelectedRangeEvent);
return true;
}
-bool EditorClientEfl::shouldApplyStyle(StylePropertySet*, Range*)
+bool EditorClientEfl::shouldApplyStyle(StylePropertySet* style, Range* range)
{
- notImplemented();
+ Ewk_Should_Apply_Style_Event shouldApplyStyleEvent = { style, range };
+ evas_object_smart_callback_call(m_view, "editorclient,style,apply", &shouldApplyStyleEvent);
return true;
}
@@ -120,7 +123,7 @@
void EditorClientEfl::didBeginEditing()
{
- notImplemented();
+ evas_object_smart_callback_call(m_view, "editorclient,editing,began", 0);
}
void EditorClientEfl::respondToChangedContents()
@@ -159,7 +162,7 @@
void EditorClientEfl::didEndEditing()
{
- notImplemented();
+ evas_object_smart_callback_call(m_view, "editorclient,editing,ended", 0);
}
void EditorClientEfl::didWriteSelectionToPasteboard()
@@ -230,9 +233,10 @@
}
}
-bool EditorClientEfl::shouldInsertNode(Node*, Range*, EditorInsertAction)
+bool EditorClientEfl::shouldInsertNode(Node* node, Range* range, EditorInsertAction action)
{
- notImplemented();
+ Ewk_Should_Insert_Node_Event insertNodeEvent = { node, range, action };
+ evas_object_smart_callback_call(m_view, "editorclient,node,insert", &insertNodeEvent);
return true;
}
Modified: trunk/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.h (117425 => 117426)
--- trunk/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.h 2012-05-17 11:03:42 UTC (rev 117425)
+++ trunk/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.h 2012-05-17 11:06:21 UTC (rev 117426)
@@ -34,13 +34,39 @@
#define EditorClientEfl_h
#include "EditorClient.h"
+
+#include "EditorInsertAction.h"
+#include "TextAffinity.h"
#include "TextCheckerClient.h"
-
#include <wtf/Deque.h>
#include <wtf/Forward.h>
typedef struct _Evas_Object Evas_Object;
+struct Ewk_Should_Insert_Node_Event {
+ WebCore::Node* node;
+ WebCore::Range* range;
+ WebCore::EditorInsertAction action;
+};
+
+struct Ewk_Should_Insert_Text_Event {
+ const char* text;
+ WebCore::Range* range;
+ WebCore::EditorInsertAction action;
+};
+
+struct Ewk_Should_Change_Selected_Range_Event {
+ WebCore::Range* fromRange;
+ WebCore::Range* toRange;
+ WebCore::EAffinity affinity;
+ bool stillSelecting;
+};
+
+struct Ewk_Should_Apply_Style_Event {
+ WebCore::StylePropertySet* style;
+ WebCore::Range* range;
+};
+
namespace WebCore {
class Page;
Modified: trunk/Tools/ChangeLog (117425 => 117426)
--- trunk/Tools/ChangeLog 2012-05-17 11:03:42 UTC (rev 117425)
+++ trunk/Tools/ChangeLog 2012-05-17 11:06:21 UTC (rev 117426)
@@ -1,3 +1,34 @@
+2012-05-17 Mariusz Grzegorczyk <marius...@samsung.com>
+
+ [EFL] [DRT] EFL's DumpRenderTree should support LayoutTestController's dumpEditingCallbacks()
+ https://bugs.webkit.org/show_bug.cgi?id=84835
+
+ Reviewed by Eric Seidel.
+
+ Added editing callbacks implementation.
+
+ * DumpRenderTree/efl/CMakeLists.txt: Add EditingCallbacks.cpp to compilation.
+ * DumpRenderTree/efl/DumpRenderTreeChrome.cpp: Invoke connectEditingCallbacks.
+ (DumpRenderTreeChrome::createView):
+ * DumpRenderTree/efl/EditingCallbacks.cpp: Added. Dump editing callbacks.
+ (dumpPath):
+ (dumpRange):
+ (insertActionString):
+ (selectionAffinityString):
+ (shouldBeginEditing):
+ (shouldEndEditing):
+ (shouldInsertNode):
+ (shouldInsertText):
+ (shouldDeleteRange):
+ (shouldChangeSelectedRange):
+ (shouldApplyStyle):
+ (editingBegan):
+ (userChangedContents):
+ (editingEnded):
+ (selectionChanged):
+ (connectEditingCallbacks):
+ * DumpRenderTree/efl/EditingCallbacks.h: Added.
+
2012-05-17 Gyuyoung Kim <gyuyoung....@samsung.com>
Unreviewed. Roll out r117382 because of layout test crashes on EFL debug buildbot.
Modified: trunk/Tools/DumpRenderTree/efl/CMakeLists.txt (117425 => 117426)
--- trunk/Tools/DumpRenderTree/efl/CMakeLists.txt 2012-05-17 11:03:42 UTC (rev 117425)
+++ trunk/Tools/DumpRenderTree/efl/CMakeLists.txt 2012-05-17 11:06:21 UTC (rev 117426)
@@ -9,6 +9,7 @@
${TOOLS_DIR}/DumpRenderTree/efl/DumpRenderTree.cpp
${TOOLS_DIR}/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
${TOOLS_DIR}/DumpRenderTree/efl/DumpRenderTreeView.cpp
+ ${TOOLS_DIR}/DumpRenderTree/efl/EditingCallbacks.cpp
${TOOLS_DIR}/DumpRenderTree/efl/EventSender.cpp
${TOOLS_DIR}/DumpRenderTree/efl/FontManagement.cpp
${TOOLS_DIR}/DumpRenderTree/efl/GCControllerEfl.cpp
@@ -44,6 +45,7 @@
SET(DumpRenderTree_INCLUDE_DIRECTORIES
"${WEBKIT_DIR}/efl/ewk"
${WEBKIT_DIR}/efl
+ ${WEBKIT_DIR}/efl/WebCoreSupport
${WEBCORE_DIR}
${WEBCORE_DIR}/bridge
${WEBCORE_DIR}/bridge/jsc
Modified: trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp (117425 => 117426)
--- trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp 2012-05-17 11:03:42 UTC (rev 117425)
+++ trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp 2012-05-17 11:06:21 UTC (rev 117426)
@@ -29,6 +29,7 @@
#include "DumpRenderTree.h"
#include "DumpRenderTreeView.h"
+#include "EditingCallbacks.h"
#include "EventSender.h"
#include "GCController.h"
#include "KURL.h"
@@ -108,6 +109,8 @@
evas_object_smart_callback_add(view, "mixedcontent,displayed", onInsecureContentDisplayed, 0);
evas_object_smart_callback_add(view, "frame,created", onFrameCreated, 0);
+ connectEditingCallbacks(view);
+
Evas_Object* mainFrame = ewk_view_frame_main_get(view);
evas_object_smart_callback_add(mainFrame, "icon,changed", onFrameIconChanged, 0);
evas_object_smart_callback_add(mainFrame, "load,provisional", onFrameProvisionalLoad, 0);
Added: trunk/Tools/DumpRenderTree/efl/EditingCallbacks.cpp (0 => 117426)
--- trunk/Tools/DumpRenderTree/efl/EditingCallbacks.cpp (rev 0)
+++ trunk/Tools/DumpRenderTree/efl/EditingCallbacks.cpp 2012-05-17 11:06:21 UTC (rev 117426)
@@ -0,0 +1,187 @@
+/*
+ * Copyright (C) 2010 Igalia S.L.
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "EditingCallbacks.h"
+
+#include "DumpRenderTree.h"
+#include "EditorClientEfl.h"
+#include "EditorInsertAction.h"
+#include "LayoutTestController.h"
+#include "Node.h"
+#include "Range.h"
+#include "StylePropertySet.h"
+#include "TextAffinity.h"
+#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
+
+static WTF::String dumpPath(WebCore::Node* node)
+{
+ WebCore::Node* parent = node->parentNode();
+ WTF::String str = WTF::String::format("%s", node->nodeName().utf8().data());
+ if (parent) {
+ str.append(" > ");
+ str.append(dumpPath(parent));
+ }
+ return str;
+}
+
+static WTF::String dumpRange(WebCore::Range* range)
+{
+ if (!range)
+ return "(null)";
+ return WTF::String::format("range from %d of %s to %d of %s", range->startOffset(), dumpPath(range->startContainer()).utf8().data(), range->endOffset(), dumpPath(range->endContainer()).utf8().data());
+}
+
+static const char* insertActionString(WebCore::EditorInsertAction action)
+{
+ switch (action) {
+ case WebCore::EditorInsertActionTyped:
+ return "WebViewInsertActionTyped";
+ case WebCore::EditorInsertActionPasted:
+ return "WebViewInsertActionPasted";
+ case WebCore::EditorInsertActionDropped:
+ return "WebViewInsertActionDropped";
+ }
+ ASSERT_NOT_REACHED();
+ return "WebViewInsertActionTyped";
+}
+
+static const char* selectionAffinityString(WebCore::EAffinity affinity)
+{
+ switch (affinity) {
+ case WebCore::UPSTREAM:
+ return "NSSelectionAffinityUpstream";
+ case WebCore::DOWNSTREAM:
+ return "NSSelectionAffinityDownstream";
+ }
+ ASSERT_NOT_REACHED();
+ return "NSSelectionAffinityUpstream";
+}
+
+void shouldBeginEditing(void*, Evas_Object*, void* eventInfo)
+{
+ if (!done && gLayoutTestController->dumpEditingCallbacks()) {
+ WebCore::Range* range = static_cast<WebCore::Range*>(eventInfo);
+ printf("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n", dumpRange(range).utf8().data());
+ }
+}
+
+void shouldEndEditing(void*, Evas_Object*, void* eventInfo)
+{
+ if (!done && gLayoutTestController->dumpEditingCallbacks()) {
+ WebCore::Range* range = static_cast<WebCore::Range*>(eventInfo);
+ printf("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n", dumpRange(range).utf8().data());
+ }
+}
+
+void shouldInsertNode(void*, Evas_Object*, void* eventInfo)
+{
+ if (!done && gLayoutTestController->dumpEditingCallbacks()) {
+ Ewk_Should_Insert_Node_Event* shouldInsertNodeEvent = static_cast<Ewk_Should_Insert_Node_Event*>(eventInfo);
+ printf("EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n",
+ dumpPath(shouldInsertNodeEvent->node).utf8().data(), dumpRange(shouldInsertNodeEvent->range).utf8().data(),
+ insertActionString(shouldInsertNodeEvent->action));
+ }
+}
+
+void shouldInsertText(void*, Evas_Object*, void* eventInfo)
+{
+ if (!done && gLayoutTestController->dumpEditingCallbacks()) {
+ Ewk_Should_Insert_Text_Event* shouldInsertTextEvent = static_cast<Ewk_Should_Insert_Text_Event*>(eventInfo);
+ printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n",
+ shouldInsertTextEvent->text, dumpRange(shouldInsertTextEvent->range).utf8().data(), insertActionString(shouldInsertTextEvent->action));
+ }
+}
+
+void shouldDeleteRange(void*, Evas_Object*, void* eventInfo)
+{
+ if (!done && gLayoutTestController->dumpEditingCallbacks()) {
+ WebCore::Range* range = static_cast<WebCore::Range*>(eventInfo);
+ printf("EDITING DELEGATE: shouldDeleteDOMRange:%s\n", dumpRange(range).utf8().data());
+ }
+}
+
+void shouldChangeSelectedRange(void*, Evas_Object*, void* eventInfo)
+{
+ if (!done && gLayoutTestController->dumpEditingCallbacks()) {
+ Ewk_Should_Change_Selected_Range_Event* shouldChangeSelectedRangeEvent = static_cast<Ewk_Should_Change_Selected_Range_Event*>(eventInfo);
+ printf("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n",
+ dumpRange(shouldChangeSelectedRangeEvent->fromRange).utf8().data(), dumpRange(shouldChangeSelectedRangeEvent->toRange).utf8().data(),
+ selectionAffinityString(shouldChangeSelectedRangeEvent->affinity), shouldChangeSelectedRangeEvent->stillSelecting ? "TRUE" : "FALSE");
+ }
+}
+
+void shouldApplyStyle(void*, Evas_Object*, void* eventInfo)
+{
+ if (!done && gLayoutTestController->dumpEditingCallbacks()) {
+ Ewk_Should_Apply_Style_Event* shouldApplyStyleEvent = static_cast<Ewk_Should_Apply_Style_Event*>(eventInfo);
+ printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n",
+ shouldApplyStyleEvent->style->asText().utf8().data(), dumpRange(shouldApplyStyleEvent->range).utf8().data());
+ }
+}
+
+void editingBegan(void*, Evas_Object*, void*)
+{
+ if (!done && gLayoutTestController->dumpEditingCallbacks())
+ printf("EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification\n");
+}
+
+void userChangedContents(void*, Evas_Object*, void*)
+{
+ if (!done && gLayoutTestController->dumpEditingCallbacks())
+ printf("EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n");
+}
+
+void editingEnded(void*, Evas_Object*, void*)
+{
+ if (!done && gLayoutTestController->dumpEditingCallbacks())
+ printf("EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification\n");
+}
+
+void selectionChanged(void*, Evas_Object*, void*)
+{
+ if (!done && gLayoutTestController->dumpEditingCallbacks())
+ printf("EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n");
+}
+
+void connectEditingCallbacks(Evas_Object* webView)
+{
+ evas_object_smart_callback_add(webView, "editorclient,editing,begin", shouldBeginEditing, 0);
+ evas_object_smart_callback_add(webView, "editorclient,editing,end", shouldEndEditing, 0);
+ evas_object_smart_callback_add(webView, "editorclient,node,insert", shouldInsertNode, 0);
+ evas_object_smart_callback_add(webView, "editorclient,text,insert", shouldInsertText, 0);
+ evas_object_smart_callback_add(webView, "editorclient,range,delete", shouldDeleteRange, 0);
+ evas_object_smart_callback_add(webView, "editorclient,selected,range,change", shouldChangeSelectedRange, 0);
+ evas_object_smart_callback_add(webView, "editorclient,style,apply", shouldApplyStyle, 0);
+ evas_object_smart_callback_add(webView, "editorclient,editing,began", editingBegan, 0);
+ evas_object_smart_callback_add(webView, "editorclient,contents,changed", userChangedContents, 0);
+ evas_object_smart_callback_add(webView, "editorclient,editing,ended", editingEnded, 0);
+ evas_object_smart_callback_add(webView, "editorclient,selection,changed", selectionChanged, 0);
+}
Added: trunk/Tools/DumpRenderTree/efl/EditingCallbacks.h (0 => 117426)
--- trunk/Tools/DumpRenderTree/efl/EditingCallbacks.h (rev 0)
+++ trunk/Tools/DumpRenderTree/efl/EditingCallbacks.h 2012-05-17 11:06:21 UTC (rev 117426)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 Igalia S.L.
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef EditingCallbacks_h
+#define EditingCallbacks_h
+
+#include <Evas.h>
+
+void connectEditingCallbacks(Evas_Object*);
+
+#endif