[EFL] EFL's LayoutTestController does not implement elementDoesAutoCompleteForElement...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Apr 2012 16:10:37 +0000 (16:10 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Apr 2012 16:10:37 +0000 (16:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=84425

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-04-23
Reviewed by Antonio Gomes.

Source/WebKit/efl:

Add a helper function to DumpRenderTreeSupportEfl, returning
whether or not an element does perform autocompletion.

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::elementDoesAutoCompleteForElementWithId):
* WebCoreSupport/DumpRenderTreeSupportEfl.h:

Tools:

Use the new helper in DumpRenderTreeSupportEfl to properly
test whether an element performs autocompletion.

* DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
(LayoutTestController::elementDoesAutoCompleteForElementWithId):

LayoutTests:

Unskip the newly-passing test now that EFL's LayoutTestController
implements elementDoesAutoCompleteForElementWithId().

* platform/efl/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114906 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
Tools/ChangeLog
Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp

index 83930c5..9edb6dd 100644 (file)
@@ -1,3 +1,15 @@
+2012-04-23  Christophe Dumez  <christophe.dumez@intel.com>
+
+        [EFL] EFL's LayoutTestController does not implement elementDoesAutoCompleteForElementWithId
+        https://bugs.webkit.org/show_bug.cgi?id=84425
+
+        Reviewed by Antonio Gomes.
+
+        Unskip the newly-passing test now that EFL's LayoutTestController
+        implements elementDoesAutoCompleteForElementWithId().
+
+        * platform/efl/Skipped:
+
 2012-04-23  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         [Qt] Unreviewed gardening, skip new failing tests. (less tests == less problem)
index f574b5f..6fa8882 100644 (file)
@@ -409,9 +409,6 @@ fast/xmlhttprequest/xmlhttprequest-nonexistent-file.html
 # EFL's LayoutTestController does not implement setJavaScriptProfilingEnabled
 fast/profiler
 
-# EFL's LayoutTestController does not implement elementDoesAutoCompleteForElementWithId
-security/set-form-autocomplete-attribute.html
-
 # EFL's LayoutTestController does not implement execCommand
 editing/deleting
 editing/execCommand
index 62b265f..7443ff5 100644 (file)
@@ -1,3 +1,17 @@
+2012-04-23  Christophe Dumez  <christophe.dumez@intel.com>
+
+        [EFL] EFL's LayoutTestController does not implement elementDoesAutoCompleteForElementWithId
+        https://bugs.webkit.org/show_bug.cgi?id=84425
+
+        Reviewed by Antonio Gomes.
+
+        Add a helper function to DumpRenderTreeSupportEfl, returning
+        whether or not an element does perform autocompletion.
+
+        * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+        (DumpRenderTreeSupportEfl::elementDoesAutoCompleteForElementWithId):
+        * WebCoreSupport/DumpRenderTreeSupportEfl.h:
+
 2012-04-20  Thiago Marcos P. Santos  <thiago.santos@intel.com>
 
         [EFL] Add Security Origin API
index bbaeb89..6ffd9e0 100644 (file)
@@ -100,6 +100,24 @@ String DumpRenderTreeSupportEfl::counterValueByElementId(const Evas_Object* ewkF
     return WebCore::counterValueForElement(element);
 }
 
+bool DumpRenderTreeSupportEfl::elementDoesAutoCompleteForElementWithId(const Evas_Object* ewkFrame, const String& elementId)
+{
+    WebCore::Frame* frame = EWKPrivate::coreFrame(ewkFrame);
+
+    if (!frame)
+        return false;
+
+    WebCore::Document* document = frame->document();
+    ASSERT(document);
+
+    WebCore::HTMLInputElement* inputElement = static_cast<WebCore::HTMLInputElement*>(document->getElementById(elementId));
+
+    if (!inputElement)
+        return false;
+
+    return inputElement->isTextField() && !inputElement->isPasswordField() && inputElement->shouldAutocomplete();
+}
+
 Eina_List* DumpRenderTreeSupportEfl::frameChildren(const Evas_Object* ewkFrame)
 {
     WebCore::Frame* frame = EWKPrivate::coreFrame(ewkFrame);
index e68e284..ade0f8c 100644 (file)
@@ -49,6 +49,7 @@ public:
     static void clearFrameName(Evas_Object* ewkFrame);
     static void clearOpener(Evas_Object* ewkFrame);
     static String counterValueByElementId(const Evas_Object* ewkFrame, const char* elementId);
+    static bool elementDoesAutoCompleteForElementWithId(const Evas_Object* ewkFrame, const String& elementId);
     static Eina_List* frameChildren(const Evas_Object* ewkFrame);
     static WebCore::Frame* frameParent(const Evas_Object* ewkFrame);
     static bool isPageBoxVisible(const Evas_Object* ewkFrame, int pageIndex);
index 8d1aa04..4bf01d3 100644 (file)
@@ -1,3 +1,16 @@
+2012-04-23  Christophe Dumez  <christophe.dumez@intel.com>
+
+        [EFL] EFL's LayoutTestController does not implement elementDoesAutoCompleteForElementWithId
+        https://bugs.webkit.org/show_bug.cgi?id=84425
+
+        Reviewed by Antonio Gomes.
+
+        Use the new helper in DumpRenderTreeSupportEfl to properly
+        test whether an element performs autocompletion.
+
+        * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
+        (LayoutTestController::elementDoesAutoCompleteForElementWithId):
+
 2012-04-23  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         master.cfg cleanup, remove dead codes after r92792.
index 0b39d70..93a917f 100644 (file)
@@ -466,10 +466,11 @@ void LayoutTestController::setPluginsEnabled(bool flag)
     ewk_view_setting_enable_plugins_set(browser->mainView(), flag);
 }
 
-bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef)
+bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id)
 {
-    notImplemented();
-    return false;
+    const String elementId(id->ustring().impl());
+    const Evas_Object* mainFrame = browser->mainFrame();
+    return DumpRenderTreeSupportEfl::elementDoesAutoCompleteForElementWithId(mainFrame, elementId);
 }
 
 void LayoutTestController::execCommand(JSStringRef, JSStringRef)