- a/LayoutTests/ChangeLog +12 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2010-11-26  John Knottenbelt  <jknotten@chromium.org>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        V8 binding for DOMTimeStamp should be Number, not Date
6
        https://bugs.webkit.org/show_bug.cgi?id=49963
7
8
        * fast/dom/domtimestamp-is-number-expected.txt: Added.
9
        * fast/dom/domtimestamp-is-number.html: Added.
10
        * fast/dom/script-tests/domtimestamp-is-number.js: Added.
11
        (do_check):
12
1
2010-11-25  Yuzo Fujishima  <yuzo@google.com>
13
2010-11-25  Yuzo Fujishima  <yuzo@google.com>
2
14
3
        Unreviewed Chromium test expectaion change.
15
        Unreviewed Chromium test expectaion change.
- a/LayoutTests/fast/dom/domtimestamp-is-number-expected.txt +11 lines
Line 0 a/LayoutTests/fast/dom/domtimestamp-is-number-expected.txt_sec1
1
This tests that DOMTimeStamp is a Number (and not a Date object).
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS timestamp instanceof Date is false
7
PASS timestamp == Number(timestamp) is true
8
PASS successfullyParsed is true
9
10
TEST COMPLETE
11
- a/LayoutTests/fast/dom/domtimestamp-is-number.html +13 lines
Line 0 a/LayoutTests/fast/dom/domtimestamp-is-number.html_sec1
1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2
<html>
3
<head>
4
<link rel="stylesheet" href="../js/resources/js-test-style.css">
5
<script src="../js/resources/js-test-pre.js"></script>
6
</head>
7
<body onload="do_check(event)">
8
<p id="description"></p>
9
<div id="console"></div>
10
<script src="script-tests/domtimestamp-is-number.js"></script>
11
<script src="../js/resources/js-test-post.js"></script>
12
</body>
13
</html>
- a/LayoutTests/fast/dom/script-tests/domtimestamp-is-number.js +14 lines
Line 0 a/LayoutTests/fast/dom/script-tests/domtimestamp-is-number.js_sec1
1
description("This tests that DOMTimeStamp is a Number (and not a Date object).");
2
// See https://bugs.webkit.org/show_bug.cgi?id=49963
3
4
var timestamp = null;
5
6
function do_check(e) {
7
  timestamp = e.timeStamp;
8
  shouldBeFalse("timestamp instanceof Date");
9
  shouldBeTrue("timestamp == Number(timestamp)");
10
  finishJSTest();
11
}
12
13
window.successfullyParsed = true;
14
window.jsTestIsAsync = true;
- a/WebCore/ChangeLog +11 lines
Lines 1-3 a/WebCore/ChangeLog_sec1
1
2010-11-26  John Knottenbelt  <jknotten@chromium.org>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        V8 binding for DOMTimeStamp should be Number, not Date
6
        https://bugs.webkit.org/show_bug.cgi?id=49963
7
8
        Test: fast/dom/domtimestamp-is-number.html
9
10
        * bindings/scripts/CodeGeneratorV8.pm:
11
1
2010-11-25  Kenichi Ishibashi  <bashi@google.com>
12
2010-11-25  Kenichi Ishibashi  <bashi@google.com>
2
13
3
        Reviewed by Kent Tamura.
14
        Reviewed by Kent Tamura.
- a/WebCore/bindings/scripts/CodeGeneratorV8.pm -2 / +1 lines
Lines 3088-3094 sub ReturnNativeToJSValue a/WebCore/bindings/scripts/CodeGeneratorV8.pm_sec1
3088
    my $indent = shift;
3088
    my $indent = shift;
3089
    my $type = GetTypeFromSignature($signature);
3089
    my $type = GetTypeFromSignature($signature);
3090
3090
3091
    return "return v8::Date::New(static_cast<double>($value))" if $type eq "DOMTimeStamp";
3092
    return "return v8Boolean($value)" if $type eq "boolean";
3091
    return "return v8Boolean($value)" if $type eq "boolean";
3093
    return "return v8::Handle<v8::Value>()" if $type eq "void";     # equivalent to v8::Undefined()
3092
    return "return v8::Handle<v8::Value>()" if $type eq "void";     # equivalent to v8::Undefined()
3094
3093
Lines 3100-3106 sub ReturnNativeToJSValue a/WebCore/bindings/scripts/CodeGeneratorV8.pm_sec2
3100
3099
3101
    return "return v8DateOrNull($value)" if $type eq "Date";
3100
    return "return v8DateOrNull($value)" if $type eq "Date";
3102
    # long long and unsigned long long are not representable in ECMAScript.
3101
    # long long and unsigned long long are not representable in ECMAScript.
3103
    return "return v8::Number::New(static_cast<double>($value))" if $type eq "long long" or $type eq "unsigned long long";
3102
    return "return v8::Number::New(static_cast<double>($value))" if $type eq "long long" or $type eq "unsigned long long" or $type eq "DOMTimeStamp";
3104
    return "return v8::Number::New($value)" if $codeGenerator->IsPrimitiveType($type) or $type eq "SVGPaintType";
3103
    return "return v8::Number::New($value)" if $codeGenerator->IsPrimitiveType($type) or $type eq "SVGPaintType";
3105
    return "return $value.v8Value()" if $nativeType eq "ScriptValue";
3104
    return "return $value.v8Value()" if $nativeType eq "ScriptValue";
3106
3105

Return to Bug 49963