Skip to content
  • tkent@chromium.org's avatar
    2009-12-20 Kent Tamura <tkent@chromium.org> · 72d02311
    tkent@chromium.org authored
            Reviewed by Darin Adler.
    
            A test for Date binding.
            https://bugs.webkit.org/show_bug.cgi?id=32698
    
            * fast/forms/input-valueasdate-expected.txt: Added.
            * fast/forms/input-valueasdate.html: Added.
            * fast/forms/script-tests/input-valueasdate.js: Added.
    
    2009-12-20  Kent Tamura  <tkent@chromium.org>
    
            Reviewed by Darin Adler.
    
            Add support for JavaScriptCore Date binding.
            https://bugs.webkit.org/show_bug.cgi?id=32698
    
            This is needed for HTMLInputElement::valueAsDate and
            HTMLTimeElement::valueAsDate.
    
            A Date instance is mapped to a double value in C++.
            - If null or undefined is set to a JavaScript property, C++ setter
              function receives NaN.
            - If a getter C++ function returns NaN or infinity, a JavaScript
              property returns null.
    
            Test: fast/forms/input-valueasdate.html
    
            * bindings/js/JSDOMBinding.cpp:
            (WebCore::jsDateOrNull): Implement the above.
            (WebCore::valueToDate): ditto.
            * bindings/js/JSDOMBinding.h: Declare them.
            * bindings/scripts/CodeGeneratorJS.pm: Produce jsDateOrNull() or
              valueToDate() for Date type.
            * html/HTMLInputElement.cpp:
            (WebCore::HTMLInputElement::valueAsDate): Temporal implementation.
            (WebCore::HTMLInputElement::setValueAsDate): ditto.
            * html/HTMLInputElement.h:
            * html/HTMLInputElement.idl: Declare valueAsDate.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52434 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    72d02311