⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 94038 in webkit


Ignore:
Timestamp:
Aug 29, 2011, 7:03:52 PM (15 years ago)
Author:
rniwa@webkit.org
Message:

Add a test for lastChangeWasUserEdit in HTMLInputElement and HTMLTextAreaElement
https://bugs.webkit.org/show_bug.cgi?id=67173

Reviewed by Darin Adler.

Source/WebCore:

Exposed HTMLInputElement::lastChangeWasUserEdit and HTMLTextAreaElement::lastChangeWasUserEdit
via internals.wasLastChangeUserEdit(Element*, ExceptionCode&). The first argument must be
an input element or a textarea element lastChangeWasUserEdit is called upon.

Test: fast/forms/textfield-lastchange-was-useredit.html

  • testing/Internals.cpp:

(WebCore::Internals::wasLastChangeUserEdit):

  • testing/Internals.h:
  • testing/Internals.idl:

LayoutTests:

Added some basic test for HTMLInputElement::lastChangeWasUserEdit and
HTMLTextAreaElement::lastChangeWasUserEdit.

  • fast/forms/textfield-lastchange-was-useredit-expected.txt: Added.
  • fast/forms/textfield-lastchange-was-useredit.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r94028 r94038  
     12011-08-29  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Add a test for lastChangeWasUserEdit in HTMLInputElement and HTMLTextAreaElement
     4        https://bugs.webkit.org/show_bug.cgi?id=67173
     5
     6        Reviewed by Darin Adler.
     7
     8        Added some basic test for HTMLInputElement::lastChangeWasUserEdit and
     9        HTMLTextAreaElement::lastChangeWasUserEdit.
     10
     11        * fast/forms/textfield-lastchange-was-useredit-expected.txt: Added.
     12        * fast/forms/textfield-lastchange-was-useredit.html: Added.
     13
    1142011-08-29  Kenji Imasaki  <imasaki@chromium.org>
    215
  • trunk/Source/WebCore/ChangeLog

    r94037 r94038  
     12011-08-29  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Add a test for lastChangeWasUserEdit in HTMLInputElement and HTMLTextAreaElement
     4        https://bugs.webkit.org/show_bug.cgi?id=67173
     5
     6        Reviewed by Darin Adler.
     7
     8        Exposed HTMLInputElement::lastChangeWasUserEdit and HTMLTextAreaElement::lastChangeWasUserEdit
     9        via internals.wasLastChangeUserEdit(Element*, ExceptionCode&). The first argument must be
     10        an input element or a textarea element lastChangeWasUserEdit is called upon.
     11
     12        Test: fast/forms/textfield-lastchange-was-useredit.html
     13
     14        * testing/Internals.cpp:
     15        (WebCore::Internals::wasLastChangeUserEdit):
     16        * testing/Internals.h:
     17        * testing/Internals.idl:
     18
    1192011-08-29  Luke Macpherson   <macpherson@chromium.org>
    220
  • trunk/Source/WebCore/testing/Internals.cpp

    r93656 r94038  
    3333#include "Element.h"
    3434#include "ExceptionCode.h"
     35#include "HTMLInputElement.h"
     36#include "HTMLNames.h"
     37#include "HTMLTextAreaElement.h"
    3538#include "InspectorController.h"
    3639#include "MemoryCache.h"
     
    263266}
    264267
    265 }
    266 
     268bool Internals::wasLastChangeUserEdit(Element* textField, ExceptionCode& ec)
     269{
     270    if (!textField) {
     271        ec = INVALID_ACCESS_ERR;
     272        return false;
     273    }
     274
     275    if (textField->hasTagName(HTMLNames::inputTag))
     276        return static_cast<HTMLInputElement*>(textField)->lastChangeWasUserEdit();
     277
     278    if (textField->hasTagName(HTMLNames::textareaTag))
     279        return static_cast<HTMLTextAreaElement*>(textField)->lastChangeWasUserEdit();
     280
     281    ec = INVALID_NODE_TYPE_ERR;
     282    return false;
     283}
     284
     285}
     286
  • trunk/Source/WebCore/testing/Internals.h

    r93392 r94038  
    7777    void setPasswordEchoDurationInSeconds(Document*, double durationInSeconds, ExceptionCode&);
    7878
     79    bool wasLastChangeUserEdit(Element* textField, ExceptionCode&);
     80
    7981    static const char* internalsId;
    8082
  • trunk/Source/WebCore/testing/Internals.idl

    r93392 r94038  
    5050        void setPasswordEchoEnabled(in Document document, in boolean enabled) raises(DOMException);
    5151        void setPasswordEchoDurationInSeconds(in Document document, in double durationInSeconds) raises(DOMException);
     52
     53        boolean wasLastChangeUserEdit(in Element textField) raises (DOMException);
    5254    };
    5355}
Note: See TracChangeset for help on using the changeset viewer.