Title: [119237] trunk
Revision
119237
Author
[email protected]
Date
2012-06-01 08:49:03 -0700 (Fri, 01 Jun 2012)

Log Message

[EFL] EFL's LayoutTestController needs to implement deliverWebIntent
https://bugs.webkit.org/show_bug.cgi?id=86865

Patch by Christophe Dumez <[email protected]> on 2012-06-01
Reviewed by Adam Barth.

Source/WebKit:

Add "${WEBCORE_DIR}/dom/default" to include directories in
CMakeLists.txt.

* CMakeLists.txt:

Source/WebKit/efl:

Add method on Ewk_Frame to deliver an intent.
Add helper function to DumpRenderTreeSupportEfl to deliver a Web
Intent.

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::deliverWebIntent):
* WebCoreSupport/DumpRenderTreeSupportEfl.h:
* ewk/ewk_frame.cpp:
(ewk_frame_intent_deliver):
* ewk/ewk_frame.h:

Tools:

Add deliverWebIntent method to LayoutTestController and provide
implementation for EFL port.

* DumpRenderTree/LayoutTestController.cpp:
(deliverWebIntentCallback):
(LayoutTestController::staticFunctions):
* DumpRenderTree/LayoutTestController.h:
(LayoutTestController):
* DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp:
(LayoutTestController::deliverWebIntent):
* DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
(LayoutTestController::deliverWebIntent):
* DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
(LayoutTestController::deliverWebIntent):
* DumpRenderTree/mac/LayoutTestControllerMac.mm:
(LayoutTestController::deliverWebIntent):
* DumpRenderTree/win/LayoutTestControllerWin.cpp:
(LayoutTestController::deliverWebIntent):
* DumpRenderTree/wx/LayoutTestControllerWx.cpp:
(LayoutTestController::deliverWebIntent):

LayoutTests:

Unskip webintents/web-intents-delivery.html now that Web intent
delivery is implemented on EFL port.

* platform/efl/test_expectations.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (119236 => 119237)


--- trunk/LayoutTests/ChangeLog	2012-06-01 15:47:11 UTC (rev 119236)
+++ trunk/LayoutTests/ChangeLog	2012-06-01 15:49:03 UTC (rev 119237)
@@ -1,3 +1,15 @@
+2012-06-01  Christophe Dumez  <[email protected]>
+
+        [EFL] EFL's LayoutTestController needs to implement deliverWebIntent
+        https://bugs.webkit.org/show_bug.cgi?id=86865
+
+        Reviewed by Adam Barth.
+
+        Unskip webintents/web-intents-delivery.html now that Web intent
+        delivery is implemented on EFL port.
+
+        * platform/efl/test_expectations.txt:
+
 2012-06-01  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r119228.

Modified: trunk/LayoutTests/platform/efl/test_expectations.txt (119236 => 119237)


--- trunk/LayoutTests/platform/efl/test_expectations.txt	2012-06-01 15:47:11 UTC (rev 119236)
+++ trunk/LayoutTests/platform/efl/test_expectations.txt	2012-06-01 15:49:03 UTC (rev 119237)
@@ -659,7 +659,6 @@
 
 // Incomplete Web Intents support
 BUGWK86866 SKIP : webintents/intent-tag.html = TEXT
-BUGWK86865 SKIP : webintents/web-intents-delivery.html = TEXT
 
 // EFL's LayoutTestController does not implement setAutomaticLinkDetectionEnabled
 BUGWK85463 SKIP : editing/inserting/typing-space-to-trigger-smart-link.html = FAIL

Modified: trunk/Source/WebKit/CMakeLists.txt (119236 => 119237)


--- trunk/Source/WebKit/CMakeLists.txt	2012-06-01 15:47:11 UTC (rev 119236)
+++ trunk/Source/WebKit/CMakeLists.txt	2012-06-01 15:49:03 UTC (rev 119237)
@@ -11,6 +11,7 @@
     "${WEBCORE_DIR}/bridge/jsc"
     "${WEBCORE_DIR}/css"
     "${WEBCORE_DIR}/dom"
+    "${WEBCORE_DIR}/dom/default"
     "${WEBCORE_DIR}/editing"
     "${WEBCORE_DIR}/history"
     "${WEBCORE_DIR}/html"

Modified: trunk/Source/WebKit/ChangeLog (119236 => 119237)


--- trunk/Source/WebKit/ChangeLog	2012-06-01 15:47:11 UTC (rev 119236)
+++ trunk/Source/WebKit/ChangeLog	2012-06-01 15:49:03 UTC (rev 119237)
@@ -1,3 +1,15 @@
+2012-06-01  Christophe Dumez  <[email protected]>
+
+        [EFL] EFL's LayoutTestController needs to implement deliverWebIntent
+        https://bugs.webkit.org/show_bug.cgi?id=86865
+
+        Reviewed by Adam Barth.
+
+        Add "${WEBCORE_DIR}/dom/default" to include directories in
+        CMakeLists.txt.
+
+        * CMakeLists.txt:
+
 2012-06-01  Sudarsana Nagineni  <[email protected]>
 
         [EFL] Implement PlatformStrategies

Modified: trunk/Source/WebKit/efl/ChangeLog (119236 => 119237)


--- trunk/Source/WebKit/efl/ChangeLog	2012-06-01 15:47:11 UTC (rev 119236)
+++ trunk/Source/WebKit/efl/ChangeLog	2012-06-01 15:49:03 UTC (rev 119237)
@@ -1,3 +1,21 @@
+2012-06-01  Christophe Dumez  <[email protected]>
+
+        [EFL] EFL's LayoutTestController needs to implement deliverWebIntent
+        https://bugs.webkit.org/show_bug.cgi?id=86865
+
+        Reviewed by Adam Barth.
+
+        Add method on Ewk_Frame to deliver an intent.
+        Add helper function to DumpRenderTreeSupportEfl to deliver a Web
+        Intent.
+
+        * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+        (DumpRenderTreeSupportEfl::deliverWebIntent):
+        * WebCoreSupport/DumpRenderTreeSupportEfl.h:
+        * ewk/ewk_frame.cpp:
+        (ewk_frame_intent_deliver):
+        * ewk/ewk_frame.h:
+
 2012-06-01  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r119228.

Modified: trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp (119236 => 119237)


--- trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp	2012-06-01 15:47:11 UTC (rev 119236)
+++ trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp	2012-06-01 15:49:03 UTC (rev 119237)
@@ -690,6 +690,21 @@
 #endif
 }
 
+void DumpRenderTreeSupportEfl::deliverWebIntent(Evas_Object* ewkFrame, JSStringRef action, JSStringRef type, JSStringRef data)
+{
+#if ENABLE(WEB_INTENTS)
+    RefPtr<WebCore::SerializedScriptValue> serializedData = WebCore::SerializedScriptValue::create(String(data->ustring().impl()));
+    WebCore::ExceptionCode ec = 0;
+    WebCore::MessagePortArray ports;
+    RefPtr<WebCore::Intent> coreIntent = WebCore::Intent::create(String(action->ustring().impl()), String(type->ustring().impl()), serializedData.get(), ports, ec);
+    if (ec)
+        return;
+    Ewk_Intent* ewkIntent = ewk_intent_new(coreIntent.get());
+    ewk_frame_intent_deliver(ewkFrame, ewkIntent);
+    ewk_intent_free(ewkIntent);
+#endif
+}
+
 void DumpRenderTreeSupportEfl::setComposition(Evas_Object* ewkView, const char* text, int start, int length)
 {
     WebCore::Page* page = EWKPrivate::corePage(ewkView);

Modified: trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h (119236 => 119237)


--- trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h	2012-06-01 15:47:11 UTC (rev 119236)
+++ trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h	2012-06-01 15:49:03 UTC (rev 119237)
@@ -112,6 +112,7 @@
     // Web Intents
     static void sendWebIntentResponse(Ewk_Intent_Request*, JSStringRef response);
     static WebCore::MessagePortChannelArray* intentMessagePorts(const Ewk_Intent*);
+    static void deliverWebIntent(Evas_Object* ewkFrame, JSStringRef action, JSStringRef type, JSStringRef data);
 
     // TextInputController
     static void setComposition(Evas_Object*, const char*, int, int);

Modified: trunk/Source/WebKit/efl/ewk/ewk_frame.cpp (119236 => 119237)


--- trunk/Source/WebKit/efl/ewk/ewk_frame.cpp	2012-06-01 15:47:11 UTC (rev 119236)
+++ trunk/Source/WebKit/efl/ewk/ewk_frame.cpp	2012-06-01 15:49:03 UTC (rev 119237)
@@ -24,6 +24,8 @@
 #include "config.h"
 #include "ewk_frame.h"
 
+#include "DOMWindowIntents.h"
+#include "DeliveredIntent.h"
 #include "DocumentLoader.h"
 #include "DocumentMarkerController.h"
 #include "EventHandler.h"
@@ -41,6 +43,7 @@
 #include "KURL.h"
 #include "PlatformEvent.h"
 #include "PlatformKeyboardEvent.h"
+#include "PlatformMessagePortChannel.h"
 #include "PlatformMouseEvent.h"
 #include "PlatformTouchEvent.h"
 #include "PlatformWheelEvent.h"
@@ -51,6 +54,7 @@
 #include "SubstituteData.h"
 #include "WindowsKeyboardCodes.h"
 #include "ewk_frame_private.h"
+#include "ewk_intent_private.h"
 #include "ewk_private.h"
 #include "ewk_security_origin_private.h"
 #include "ewk_view_private.h"
@@ -746,6 +750,30 @@
     return hitTest;
 }
 
+void ewk_frame_intent_deliver(const Evas_Object* ewkFrame, Ewk_Intent* ewk_intent)
+{
+#if ENABLE(WEB_INTENTS)
+    EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData);
+    EINA_SAFETY_ON_NULL_RETURN(smartData->frame);
+
+    WebCore::Intent* intent = EWKPrivate::coreIntent(ewk_intent);
+
+    OwnPtr<WebCore::MessagePortChannelArray> channels;
+    WebCore::MessagePortChannelArray* origChannels = intent->messagePorts();
+    if (origChannels && origChannels->size()) {
+        channels = adoptPtr(new WebCore::MessagePortChannelArray(origChannels->size()));
+        for (size_t i = 0; i < origChannels->size(); ++i)
+            (*channels)[i] = origChannels->at(i).release();
+    }
+    OwnPtr<WebCore::MessagePortArray> ports = WebCore::MessagePort::entanglePorts(*(smartData->frame->domWindow()->scriptExecutionContext()), channels.release());
+
+    OwnPtr<WebCore::DeliveredIntentClient> dummyClient;
+    RefPtr<WebCore::DeliveredIntent> deliveredIntent = WebCore::DeliveredIntent::create(smartData->frame, dummyClient.release(), intent->action(), intent->type(), intent->data(), ports.release(), intent->extras());
+
+    WebCore::DOMWindowIntents::from(smartData->frame->domWindow())->deliver(deliveredIntent.release());
+#endif
+}
+
 Eina_Bool
 ewk_frame_scroll_add(Evas_Object* ewkFrame, int deltaX, int deltaY)
 {

Modified: trunk/Source/WebKit/efl/ewk/ewk_frame.h (119236 => 119237)


--- trunk/Source/WebKit/efl/ewk/ewk_frame.h	2012-06-01 15:47:11 UTC (rev 119236)
+++ trunk/Source/WebKit/efl/ewk/ewk_frame.h	2012-06-01 15:49:03 UTC (rev 119237)
@@ -81,6 +81,7 @@
 #ifndef ewk_frame_h
 #define ewk_frame_h
 
+#include "ewk_intent.h"
 #include "ewk_security_origin.h"
 
 #include <Evas.h>
@@ -702,6 +703,14 @@
 EAPI Ewk_Hit_Test *ewk_frame_hit_test_new(const Evas_Object *o, int x, int y);
 
 /**
+ * Delivers an intent to a target service page in the frame.
+ *
+ * @param o frame object to deliver the intent to.
+ * @param ewkIntent intent object to deliver.
+ */
+EAPI void ewk_frame_intent_deliver(const Evas_Object *o, Ewk_Intent *ewk_intent);
+
+/**
  * Sets a relative scroll of the given frame.
  *
  * This function does scroll @a dx and @a dy pixels

Modified: trunk/Tools/ChangeLog (119236 => 119237)


--- trunk/Tools/ChangeLog	2012-06-01 15:47:11 UTC (rev 119236)
+++ trunk/Tools/ChangeLog	2012-06-01 15:49:03 UTC (rev 119237)
@@ -1,3 +1,31 @@
+2012-06-01  Christophe Dumez  <[email protected]>
+
+        [EFL] EFL's LayoutTestController needs to implement deliverWebIntent
+        https://bugs.webkit.org/show_bug.cgi?id=86865
+
+        Reviewed by Adam Barth.
+
+        Add deliverWebIntent method to LayoutTestController and provide
+        implementation for EFL port.
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (deliverWebIntentCallback):
+        (LayoutTestController::staticFunctions):
+        * DumpRenderTree/LayoutTestController.h:
+        (LayoutTestController):
+        * DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp:
+        (LayoutTestController::deliverWebIntent):
+        * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
+        (LayoutTestController::deliverWebIntent):
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::deliverWebIntent):
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        (LayoutTestController::deliverWebIntent):
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::deliverWebIntent):
+        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+        (LayoutTestController::deliverWebIntent):
+
 2012-06-01  Tor Arne Vestbø  <[email protected]>
 
         [Qt] Make Qt Creator aware of files in webkitpy/perl for easy editing

Modified: trunk/Tools/DumpRenderTree/LayoutTestController.cpp (119236 => 119237)


--- trunk/Tools/DumpRenderTree/LayoutTestController.cpp	2012-06-01 15:47:11 UTC (rev 119236)
+++ trunk/Tools/DumpRenderTree/LayoutTestController.cpp	2012-06-01 15:49:03 UTC (rev 119237)
@@ -2021,6 +2021,24 @@
     return JSValueMakeUndefined(context);
 }
 
+static JSValueRef deliverWebIntentCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    if (argumentCount < 3)
+        return JSValueMakeUndefined(context);
+
+    JSRetainPtr<JSStringRef> action(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+    ASSERT(!*exception);
+    JSRetainPtr<JSStringRef> type(Adopt, JSValueToStringCopy(context, arguments[1], exception));
+    ASSERT(!*exception);
+    JSRetainPtr<JSStringRef> data(Adopt, JSValueToStringCopy(context, arguments[2], exception));
+    ASSERT(!*exception);
+
+    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+    controller->deliverWebIntent(action.get(), type.get(), data.get());
+
+    return JSValueMakeUndefined(context);
+}
+
 static JSValueRef abortModalCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
@@ -2281,6 +2299,7 @@
         { "closeWebInspector", closeWebInspectorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "computedStyleIncludingVisitedInfo", computedStyleIncludingVisitedInfoCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "decodeHostName", decodeHostNameCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "deliverWebIntent", deliverWebIntentCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "disableImageLoading", disableImageLoadingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "disallowIncreaseForApplicationCacheQuota", disallowIncreaseForApplicationCacheQuotaCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "dispatchPendingLoadRequests", dispatchPendingLoadRequestsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },

Modified: trunk/Tools/DumpRenderTree/LayoutTestController.h (119236 => 119237)


--- trunk/Tools/DumpRenderTree/LayoutTestController.h	2012-06-01 15:47:11 UTC (rev 119236)
+++ trunk/Tools/DumpRenderTree/LayoutTestController.h	2012-06-01 15:49:03 UTC (rev 119237)
@@ -57,6 +57,7 @@
     JSStringRef copyDecodedHostName(JSStringRef name);
     JSStringRef copyEncodedHostName(JSStringRef name);
     JSRetainPtr<JSStringRef> counterValueForElementById(JSStringRef id);
+    void deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data);
     void disableImageLoading();
     void dispatchPendingLoadRequests();
     void display();

Modified: trunk/Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp (119236 => 119237)


--- trunk/Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp	2012-06-01 15:47:11 UTC (rev 119236)
+++ trunk/Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp	2012-06-01 15:49:03 UTC (rev 119237)
@@ -871,3 +871,8 @@
 {
     notImplemented();
 }
+
+void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef)
+{
+    notImplemented();
+}

Modified: trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp (119236 => 119237)


--- trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp	2012-06-01 15:47:11 UTC (rev 119236)
+++ trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp	2012-06-01 15:49:03 UTC (rev 119237)
@@ -888,3 +888,8 @@
 
     DumpRenderTreeSupportEfl::sendWebIntentResponse(request, response);
 }
+
+void LayoutTestController::deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data)
+{
+    DumpRenderTreeSupportEfl::deliverWebIntent(browser->mainFrame(), action, type, data);
+}

Modified: trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp (119236 => 119237)


--- trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp	2012-06-01 15:47:11 UTC (rev 119236)
+++ trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp	2012-06-01 15:49:03 UTC (rev 119237)
@@ -1010,3 +1010,8 @@
 {
     // FIXME: Implement this.
 }
+
+void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef)
+{
+    // FIXME: Implement this.
+}

Modified: trunk/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm (119236 => 119237)


--- trunk/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm	2012-06-01 15:47:11 UTC (rev 119236)
+++ trunk/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm	2012-06-01 15:49:03 UTC (rev 119237)
@@ -1207,3 +1207,8 @@
 {
     // FIXME: Implement.
 }
+
+void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef)
+{
+    // FIXME: Implement.
+}

Modified: trunk/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp (119236 => 119237)


--- trunk/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp	2012-06-01 15:47:11 UTC (rev 119236)
+++ trunk/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp	2012-06-01 15:49:03 UTC (rev 119237)
@@ -1497,3 +1497,8 @@
 {
     // FIXME: Implement this.
 }
+
+void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef)
+{
+    // FIXME: Implement this.
+}

Modified: trunk/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp (119236 => 119237)


--- trunk/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp	2012-06-01 15:47:11 UTC (rev 119236)
+++ trunk/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp	2012-06-01 15:49:03 UTC (rev 119237)
@@ -644,3 +644,8 @@
 {
     // FIXME: Implement this.
 }
+
+void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef)
+{
+    // FIXME: Implement this.
+}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to