- Revision
- 107350
- Author
- [email protected]
- Date
- 2012-02-09 20:30:52 -0800 (Thu, 09 Feb 2012)
Log Message
[Gtk] security/set-form-autocomplete-attribute.html fails
https://bugs.webkit.org/show_bug.cgi?id=78261
Patch by Zan Dobersek <[email protected]> on 2012-02-09
Reviewed by Martin Robinson.
Source/WebKit/gtk:
Add a helper function to DumpRenderTreeSupportGtk, returning
whether or not an element does perform autocompletion.
* WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
(DumpRenderTreeSupportGtk::elementDoesAutoCompleteForElementWithId):
* WebCoreSupport/DumpRenderTreeSupportGtk.h:
(DumpRenderTreeSupportGtk):
Tools:
Use the new helper in DumpRenderTreeSupportGtk to properly
test whether an element performs autocompletion.
* DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
(LayoutTestController::elementDoesAutoCompleteForElementWithId):
LayoutTests:
Unskip the newly-passing test
* platform/gtk/Skipped:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (107349 => 107350)
--- trunk/LayoutTests/ChangeLog 2012-02-10 04:14:57 UTC (rev 107349)
+++ trunk/LayoutTests/ChangeLog 2012-02-10 04:30:52 UTC (rev 107350)
@@ -1,3 +1,14 @@
+2012-02-09 Zan Dobersek <[email protected]>
+
+ [Gtk] security/set-form-autocomplete-attribute.html fails
+ https://bugs.webkit.org/show_bug.cgi?id=78261
+
+ Reviewed by Martin Robinson.
+
+ Unskip the newly-passing test
+
+ * platform/gtk/Skipped:
+
2012-02-09 MORITA Hajime <[email protected]>
Unreviewed attempt to fix a test flakiness.
Modified: trunk/LayoutTests/platform/gtk/Skipped (107349 => 107350)
--- trunk/LayoutTests/platform/gtk/Skipped 2012-02-10 04:14:57 UTC (rev 107349)
+++ trunk/LayoutTests/platform/gtk/Skipped 2012-02-10 04:30:52 UTC (rev 107350)
@@ -619,10 +619,6 @@
# Need to implement getFormValue().
plugins/form-value.html
-# Tests in security/ directory
-# Tests failing
-security/set-form-autocomplete-attribute.html
-
# Tests that failed because we don't have an eventSender implementation
http/tests/plugins/plugin-document-has-focus.html
Modified: trunk/Source/WebKit/gtk/ChangeLog (107349 => 107350)
--- trunk/Source/WebKit/gtk/ChangeLog 2012-02-10 04:14:57 UTC (rev 107349)
+++ trunk/Source/WebKit/gtk/ChangeLog 2012-02-10 04:30:52 UTC (rev 107350)
@@ -1,3 +1,18 @@
+2012-02-09 Zan Dobersek <[email protected]>
+
+ [Gtk] security/set-form-autocomplete-attribute.html fails
+ https://bugs.webkit.org/show_bug.cgi?id=78261
+
+ Reviewed by Martin Robinson.
+
+ Add a helper function to DumpRenderTreeSupportGtk, returning
+ whether or not an element does perform autocompletion.
+
+ * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
+ (DumpRenderTreeSupportGtk::elementDoesAutoCompleteForElementWithId):
+ * WebCoreSupport/DumpRenderTreeSupportGtk.h:
+ (DumpRenderTreeSupportGtk):
+
2012-02-09 Martin Robinson <[email protected]>
Build fix for GTK+ 2.x after my previous commit.
Modified: trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp (107349 => 107350)
--- trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp 2012-02-10 04:14:57 UTC (rev 107349)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp 2012-02-10 04:30:52 UTC (rev 107350)
@@ -913,3 +913,26 @@
UNUSED_PARAM(enabled);
#endif
}
+
+bool DumpRenderTreeSupportGtk::elementDoesAutoCompleteForElementWithId(WebKitWebFrame* frame, JSStringRef id)
+{
+ Frame* coreFrame = core(frame);
+ if (!coreFrame)
+ return false;
+
+ Document* document = coreFrame->document();
+ ASSERT(document);
+
+ size_t bufferSize = JSStringGetMaximumUTF8CStringSize(id);
+ GOwnPtr<gchar> idBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
+ JSStringGetUTF8CString(id, idBuffer.get(), bufferSize);
+ Node* coreNode = document->getElementById(String::fromUTF8(idBuffer.get()));
+ if (!coreNode || !coreNode->renderer())
+ return false;
+
+ HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(coreNode);
+ if (!inputElement)
+ return false;
+
+ return inputElement->isTextField() && !inputElement->isPasswordField() && inputElement->shouldAutocomplete();
+}
Modified: trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h (107349 => 107350)
--- trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h 2012-02-10 04:14:57 UTC (rev 107349)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h 2012-02-10 04:30:52 UTC (rev 107350)
@@ -87,6 +87,7 @@
static void setAutofilled(JSContextRef, JSValueRef, bool);
static void setValueForUser(JSContextRef, JSValueRef, JSStringRef);
static bool shouldClose(WebKitWebFrame*);
+ static bool elementDoesAutoCompleteForElementWithId(WebKitWebFrame*, JSStringRef);
// WebKitWebView
static void executeCoreCommandByName(WebKitWebView*, const gchar* name, const gchar* value);
Modified: trunk/Tools/ChangeLog (107349 => 107350)
--- trunk/Tools/ChangeLog 2012-02-10 04:14:57 UTC (rev 107349)
+++ trunk/Tools/ChangeLog 2012-02-10 04:30:52 UTC (rev 107350)
@@ -1,3 +1,16 @@
+2012-02-09 Zan Dobersek <[email protected]>
+
+ [Gtk] security/set-form-autocomplete-attribute.html fails
+ https://bugs.webkit.org/show_bug.cgi?id=78261
+
+ Reviewed by Martin Robinson.
+
+ Use the new helper in DumpRenderTreeSupportGtk to properly
+ test whether an element performs autocompletion.
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::elementDoesAutoCompleteForElementWithId):
+
2012-02-09 James Robinson <[email protected]>
[chromium] Enable mock scrollbars for compositing layout tests
Modified: trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp (107349 => 107350)
--- trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp 2012-02-10 04:14:57 UTC (rev 107349)
+++ trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp 2012-02-10 04:30:52 UTC (rev 107350)
@@ -585,8 +585,7 @@
bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id)
{
- // FIXME: implement
- return false;
+ return DumpRenderTreeSupportGtk::elementDoesAutoCompleteForElementWithId(mainFrame, id);
}
void LayoutTestController::execCommand(JSStringRef name, JSStringRef value)