Changeset 107350 in webkit


Ignore:
Timestamp:
Feb 9, 2012 8:30:52 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[Gtk] security/set-form-autocomplete-attribute.html fails
https://bugs.webkit.org/show_bug.cgi?id=78261

Patch by Zan Dobersek <zandobersek@gmail.com> 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:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r107349 r107350  
     12012-02-09  Zan Dobersek  <zandobersek@gmail.com>
     2
     3        [Gtk] security/set-form-autocomplete-attribute.html fails
     4        https://bugs.webkit.org/show_bug.cgi?id=78261
     5
     6        Reviewed by Martin Robinson.
     7
     8        Unskip the newly-passing test
     9
     10        * platform/gtk/Skipped:
     11
    1122012-02-09  MORITA Hajime  <morrita@google.com>
    213
  • trunk/LayoutTests/platform/gtk/Skipped

    r107202 r107350  
    619619# Need to implement getFormValue().
    620620plugins/form-value.html
    621 
    622 # Tests in security/ directory
    623 #   Tests failing
    624 security/set-form-autocomplete-attribute.html
    625621
    626622# Tests that failed because we don't have an eventSender implementation
  • trunk/Source/WebKit/gtk/ChangeLog

    r107252 r107350  
     12012-02-09  Zan Dobersek  <zandobersek@gmail.com>
     2
     3        [Gtk] security/set-form-autocomplete-attribute.html fails
     4        https://bugs.webkit.org/show_bug.cgi?id=78261
     5
     6        Reviewed by Martin Robinson.
     7
     8        Add a helper function to DumpRenderTreeSupportGtk, returning
     9        whether or not an element does perform autocompletion.
     10
     11        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
     12        (DumpRenderTreeSupportGtk::elementDoesAutoCompleteForElementWithId):
     13        * WebCoreSupport/DumpRenderTreeSupportGtk.h:
     14        (DumpRenderTreeSupportGtk):
     15
    1162012-02-09  Martin Robinson  <mrobinson@igalia.com>
    217
  • trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp

    r105607 r107350  
    914914#endif
    915915}
     916
     917bool DumpRenderTreeSupportGtk::elementDoesAutoCompleteForElementWithId(WebKitWebFrame* frame, JSStringRef id)
     918{
     919    Frame* coreFrame = core(frame);
     920    if (!coreFrame)
     921        return false;
     922
     923    Document* document = coreFrame->document();
     924    ASSERT(document);
     925
     926    size_t bufferSize = JSStringGetMaximumUTF8CStringSize(id);
     927    GOwnPtr<gchar> idBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
     928    JSStringGetUTF8CString(id, idBuffer.get(), bufferSize);
     929    Node* coreNode = document->getElementById(String::fromUTF8(idBuffer.get()));
     930    if (!coreNode || !coreNode->renderer())
     931        return false;
     932
     933    HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(coreNode);
     934    if (!inputElement)
     935        return false;
     936
     937    return inputElement->isTextField() && !inputElement->isPasswordField() && inputElement->shouldAutocomplete();
     938}
  • trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h

    r104591 r107350  
    8888    static void setValueForUser(JSContextRef, JSValueRef, JSStringRef);
    8989    static bool shouldClose(WebKitWebFrame*);
     90    static bool elementDoesAutoCompleteForElementWithId(WebKitWebFrame*, JSStringRef);
    9091
    9192    // WebKitWebView
  • trunk/Tools/ChangeLog

    r107329 r107350  
     12012-02-09  Zan Dobersek  <zandobersek@gmail.com>
     2
     3        [Gtk] security/set-form-autocomplete-attribute.html fails
     4        https://bugs.webkit.org/show_bug.cgi?id=78261
     5
     6        Reviewed by Martin Robinson.
     7
     8        Use the new helper in DumpRenderTreeSupportGtk to properly
     9        test whether an element performs autocompletion.
     10
     11        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
     12        (LayoutTestController::elementDoesAutoCompleteForElementWithId):
     13
    1142012-02-09  James Robinson  <jamesr@chromium.org>
    215
  • trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp

    r106438 r107350  
    586586bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id)
    587587{
    588     // FIXME: implement
    589     return false;
     588    return DumpRenderTreeSupportGtk::elementDoesAutoCompleteForElementWithId(mainFrame, id);
    590589}
    591590
Note: See TracChangeset for help on using the changeset viewer.