[EFL][DRT] Implement setValueForUser and setAutofilled.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Feb 2012 16:33:51 +0000 (16:33 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Feb 2012 16:33:51 +0000 (16:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=79237

Patch by Grzegorz Czajkowski <g.czajkowski@samsung.com> on 2012-02-24
Reviewed by Andreas Kling.

Source/WebKit:

Adds the main directory of WebKit's source to find headers of JavaScriptCore.

* PlatformEfl.cmake:

Source/WebKit/efl:

Adds missing implementation setValueForUser and setAutofilled to EFL's DumpRenderTreeSupport.

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::setValueForUser):
(DumpRenderTreeSupportEfl::setAutofilled):
* WebCoreSupport/DumpRenderTreeSupportEfl.h:

Tools:

Adds missing implementation setValueForUser and setAutofilled to EFL's LayoutTestController.
Those implementations are related with input fields and allow to pass following tests:
fast/forms/onchange-setvalueforuser.html
fast/forms/input-autofilled.html
fast/forms/reset-autofilled.html

* DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
(LayoutTestController::setValueForUser):
(LayoutTestController::setAutofilled):

LayoutTests:

Adds missing implementation setValueForUser and setAutofilled to EFL's LayoutTestController.
Those implementations are related with input fields and allow to pass following tests:
fast/forms/onchange-setvalueforuser.html
fast/forms/input-autofilled.html
fast/forms/reset-autofilled.html

* platform/efl/Skipped:

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

LayoutTests/ChangeLog
LayoutTests/platform/efl/Skipped
Source/WebKit/ChangeLog
Source/WebKit/PlatformEfl.cmake
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h
Tools/ChangeLog
Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp

index 5da9902981788f328898e2fc771617048d987d8a..d4048b0bcc45cb9a0d45d80c9fda6e357fc109b7 100644 (file)
@@ -1,3 +1,18 @@
+2012-02-24  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
+
+        [EFL][DRT] Implement setValueForUser and setAutofilled.
+        https://bugs.webkit.org/show_bug.cgi?id=79237
+
+        Reviewed by Andreas Kling.
+
+        Adds missing implementation setValueForUser and setAutofilled to EFL's LayoutTestController.
+        Those implementations are related with input fields and allow to pass following tests:
+        fast/forms/onchange-setvalueforuser.html
+        fast/forms/input-autofilled.html
+        fast/forms/reset-autofilled.html
+
+        * platform/efl/Skipped:
+
 2012-02-24  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         [Qt] Unreviewed gardening, skip new failing tests.
index 1ca06b0189ffa529c0982075dbc2b18fe27f0842..9a5c9e10ecdc2abe44bbfdf9cfa13c881105e541 100644 (file)
@@ -494,9 +494,6 @@ svg/custom/manually-parsed-embedded-svg-disallowed-in-dashboard.html
 svg/custom/manually-parsed-svg-disallowed-in-dashboard.html
 svg/custom/svg-disallowed-in-dashboard-object.html
 
-# EFL's LayoutTestController does not implement setValueForUser
-fast/forms/onchange-setvalueforuser.html
-
 # EFL's LayoutTestController does not implement setViewModeMediaFeature
 fast/media/media-query-list-02.html
 fast/media/media-query-list-03.html
@@ -543,10 +540,6 @@ fast/xmlhttprequest/xmlhttprequest-nonexistent-file.html
 # EFL's LayoutTestController does not implement setAuthorAndUserStylesEnabled
 fast/css/disabled-author-styles.html
 
-# EFL's LayoutTestController does not implement setAutofilled
-fast/forms/input-autofilled.html
-fast/forms/reset-autofilled.html
-
 # EFL's LayoutTestController does not implement disableImageLoading
 http/tests/misc/favicon-loads-with-icon-loading-override.html
 http/tests/misc/favicon-loads-with-images-disabled.html
index c95efcf3cd647a2937dccb0e937509080dccfb0a..25d3f78a81260d934f9f298fb702ec749efd9136 100644 (file)
@@ -1,3 +1,14 @@
+2012-02-24  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
+
+        [EFL][DRT] Implement setValueForUser and setAutofilled.
+        https://bugs.webkit.org/show_bug.cgi?id=79237
+
+        Reviewed by Andreas Kling.
+
+        Adds the main directory of WebKit's source to find headers of JavaScriptCore.
+
+        * PlatformEfl.cmake:
+
 2012-02-23  Patrick Gansterer  <paroga@webkit.org>
 
         [CMake] Add WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS macro
index daf22876ea3760c60c036cd174eb82a4cdc57ba1..1debe368418b58a7637235c6a1790c43cdbecb6b 100644 (file)
@@ -6,8 +6,10 @@ LIST(APPEND WebKit_LINK_FLAGS
 )
 
 LIST(APPEND WebKit_INCLUDE_DIRECTORIES
+    "${CMAKE_SOURCE_DIR}/Source"
     "${WEBKIT_DIR}/efl/ewk"
     "${WEBKIT_DIR}/efl/WebCoreSupport"
+    "${JAVASCRIPTCORE_DIR}/ForwardingHeaders"
     "${JAVASCRIPTCORE_DIR}/wtf/gobject"
     "${WEBCORE_DIR}/platform/efl"
     "${WEBCORE_DIR}/platform/graphics/cairo"
index db22d44eb815b030fda5ab786a4776b16c0e7e49..576224ff8e6a733e254b477c848dbaa21d3b9250 100644 (file)
@@ -1,3 +1,17 @@
+2012-02-24  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
+
+        [EFL][DRT] Implement setValueForUser and setAutofilled.
+        https://bugs.webkit.org/show_bug.cgi?id=79237
+
+        Reviewed by Andreas Kling.
+
+        Adds missing implementation setValueForUser and setAutofilled to EFL's DumpRenderTreeSupport.
+
+        * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+        (DumpRenderTreeSupportEfl::setValueForUser):
+        (DumpRenderTreeSupportEfl::setAutofilled):
+        * WebCoreSupport/DumpRenderTreeSupportEfl.h:
+
 2012-02-24  Shinya Kawanaka  <shinyak@chromium.org>
 
         SpellCheckRequest needs to know the context where the spellcheck happened.
index 2a4a9fcc9216db172d3ee4caa625757b4c699874..fd3d6b50b8788f30cd7ba410c82d89cfa4a747bb 100644 (file)
 #include <FindOptions.h>
 #include <FloatSize.h>
 #include <FrameView.h>
+#include <HTMLInputElement.h>
 #include <IntRect.h>
+#include <JSElement.h>
 #include <PrintContext.h>
 #include <RenderTreeAsText.h>
 #include <Settings.h>
 #include <bindings/js/GCController.h>
 #include <history/HistoryItem.h>
 #include <workers/WorkerThread.h>
+#include <wtf/OwnArrayPtr.h>
 #include <wtf/text/AtomicString.h>
 
 unsigned DumpRenderTreeSupportEfl::activeAnimationsCount(const Evas_Object* ewkFrame)
@@ -279,6 +282,35 @@ void DumpRenderTreeSupportEfl::suspendAnimations(Evas_Object* ewkFrame)
         animationController->suspendAnimations();
 }
 
+void DumpRenderTreeSupportEfl::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value)
+{
+    JSC::ExecState* exec = toJS(context);
+    WebCore::Element* element = WebCore::toElement(toJS(exec, nodeObject));
+    if (!element)
+        return;
+    WebCore::HTMLInputElement* inputElement = element->toInputElement();
+    if (!inputElement)
+        return;
+
+    size_t bufferSize = JSStringGetMaximumUTF8CStringSize(value);
+    OwnArrayPtr<char> valueBuffer = adoptArrayPtr(new char[bufferSize]);
+    JSStringGetUTF8CString(value, valueBuffer.get(), bufferSize);
+    inputElement->setValueForUser(String::fromUTF8(valueBuffer.get()));
+}
+
+void DumpRenderTreeSupportEfl::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled)
+{
+    JSC::ExecState* exec = toJS(context);
+    WebCore::Element* element = WebCore::toElement(toJS(exec, nodeObject));
+    if (!element)
+        return;
+    WebCore::HTMLInputElement* inputElement = element->toInputElement();
+    if (!inputElement)
+        return;
+
+    inputElement->setAutofilled(autofilled);
+}
+
 bool DumpRenderTreeSupportEfl::findString(const Evas_Object* ewkView, const char* text, WebCore::FindOptions options)
 {
     WebCore::Page* page = EWKPrivate::corePage(ewkView);
index 42af811d386f4813a9e4f944f449b0ae018687a5..950a78d67ae22d01e1c507f7b082ba24cdda67c7 100644 (file)
@@ -24,6 +24,8 @@
 #include <Eina.h>
 #include <FindOptions.h>
 #include <IntRect.h>
+#include <JavaScriptCore/APICast.h>
+#include <JavaScriptCore/JSStringRef.h>
 #include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
 
@@ -60,6 +62,8 @@ public:
     static WebCore::IntRect selectionRectangle(const Evas_Object* ewkFrame);
     static String suitableDRTFrameName(const Evas_Object* ewkFrame);
     static void suspendAnimations(Evas_Object* ewkFrame);
+    static void setValueForUser(JSContextRef, JSValueRef nodeObject, JSStringRef value);
+    static void setAutofilled(JSContextRef, JSValueRef nodeObject, bool autofilled);
 
     static bool findString(const Evas_Object* ewkView, const char* text, WebCore::FindOptions);
 
index d70a96416682754925703a1d5216e384af62fc85..a2309f3ea498aba3c5af88d74135bcd7b8b14fc9 100644 (file)
@@ -1,3 +1,20 @@
+2012-02-24  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
+
+        [EFL][DRT] Implement setValueForUser and setAutofilled.
+        https://bugs.webkit.org/show_bug.cgi?id=79237
+
+        Reviewed by Andreas Kling.
+
+        Adds missing implementation setValueForUser and setAutofilled to EFL's LayoutTestController.
+        Those implementations are related with input fields and allow to pass following tests:
+        fast/forms/onchange-setvalueforuser.html
+        fast/forms/input-autofilled.html
+        fast/forms/reset-autofilled.html
+
+        * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
+        (LayoutTestController::setValueForUser):
+        (LayoutTestController::setAutofilled):
+
 2012-02-24  Zoltan Horvath  <zoltan@webkit.org>
 
         [Qt] Allow to use WebCore imagedecoders
index 1998c2eb8d54814f1121426213508e800d0a068e..da0c7ca09389f10f690edf3ecc049bdac2d5d5a1 100644 (file)
@@ -256,9 +256,9 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
         setUserStyleSheetEnabled(true);
 }
 
-void LayoutTestController::setValueForUser(JSContextRef, JSValueRef, JSStringRef)
+void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value)
 {
-    notImplemented();
+    DumpRenderTreeSupportEfl::setValueForUser(context, nodeObject, value);
 }
 
 void LayoutTestController::setViewModeMediaFeature(JSStringRef)
@@ -337,9 +337,9 @@ void LayoutTestController::setAuthorAndUserStylesEnabled(bool)
     notImplemented();
 }
 
-void LayoutTestController::setAutofilled(JSContextRef, JSValueRef, bool)
+void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled)
 {
-    notImplemented();
+    DumpRenderTreeSupportEfl::setAutofilled(context, nodeObject, autofilled);
 }
 
 void LayoutTestController::disableImageLoading()