Changeset 96061 in webkit


Ignore:
Timestamp:
Sep 26, 2011 6:36:08 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Implement a CloseEvent constructor for V8
https://bugs.webkit.org/show_bug.cgi?id=68793

Patch by Kentaro Hara <haraken@chromium.org> on 2011-09-26
Reviewed by Adam Barth.

Source/WebCore:

Test: fast/events/constructors/close-event-constructor.html

  • bindings/v8/OptionsObject.cpp:

(WebCore::OptionsObject::getKey): Just removed an extra space.
(WebCore::OptionsObject::getKeyValue): Returns an unsigned short value corresponding to the given key.

  • bindings/v8/OptionsObject.h:
  • bindings/v8/custom/V8EventConstructors.cpp: Added the CloseEvent constructor.
  • websockets/CloseEvent.idl: Added a 'V8CustomConstructor' attribute.

LayoutTests:

Enabled close-event-constructor.html, since now V8 has the CloseEvent constructor.

  • platform/chromium/test_expectations.txt:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r96058 r96061  
     12011-09-26  Kentaro Hara  <haraken@chromium.org>
     2
     3        Implement a CloseEvent constructor for V8
     4        https://bugs.webkit.org/show_bug.cgi?id=68793
     5
     6        Reviewed by Adam Barth.
     7
     8        Enabled close-event-constructor.html, since now V8 has the CloseEvent constructor.
     9
     10        * platform/chromium/test_expectations.txt:
     11
    1122011-09-26  Mihai Parparita  <mihaip@chromium.org>
    213
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r96058 r96061  
    7070BUGCR84572 SKIP : storage/storageinfo-request-quota.html = FAIL
    7171BUGCR84572 SKIP : storage/storageinfo-no-callbacks.html = FAIL
    72 
    73 // This will soon be fixed after implementing a CloseEvent constructor for V8.
    74 BUGWK68340 : fast/events/constructors/close-event-constructor.html = FAIL
    7572
    7673// Animation API is disabled.  Dean Jackson has promised (as of Aug. 25, 2011)
  • trunk/Source/WebCore/ChangeLog

    r96060 r96061  
     12011-09-26  Kentaro Hara  <haraken@chromium.org>
     2
     3        Implement a CloseEvent constructor for V8
     4        https://bugs.webkit.org/show_bug.cgi?id=68793
     5
     6        Reviewed by Adam Barth.
     7
     8        Test: fast/events/constructors/close-event-constructor.html
     9
     10        * bindings/v8/OptionsObject.cpp:
     11        (WebCore::OptionsObject::getKey): Just removed an extra space.
     12        (WebCore::OptionsObject::getKeyValue): Returns an unsigned short value corresponding to the given key.
     13        * bindings/v8/OptionsObject.h:
     14        * bindings/v8/custom/V8EventConstructors.cpp: Added the CloseEvent constructor.
     15        * websockets/CloseEvent.idl: Added a 'V8CustomConstructor' attribute.
     16
    1172011-09-26  Nate Chapin  <japhet@chromium.org>
    218
  • trunk/Source/WebCore/bindings/v8/OptionsObject.cpp

    r95901 r96061  
    176176        return false;
    177177    value = options->Get(v8Key);
    178     if (value.IsEmpty())
    179         return false;
     178    if (value.IsEmpty())
     179        return false;
     180    return true;
     181}
     182
     183bool OptionsObject::getKeyValue(const String& key, unsigned short& value) const
     184{
     185    v8::Local<v8::Value> v8Value;
     186    if (!getKey(key, v8Value))
     187        return false;
     188
     189    v8::Local<v8::Int32> v8Int32 = v8Value->ToInt32();
     190    if (v8Int32.IsEmpty())
     191        return false;
     192    value = static_cast<unsigned short>(v8Int32->Value());
    180193    return true;
    181194}
  • trunk/Source/WebCore/bindings/v8/OptionsObject.h

    r95901 r96061  
    7878        return true;
    7979    }
     80    bool getKeyValue(const String& key, unsigned short& value) const;
    8081    bool getKeyValue(const String& key, unsigned long long& value) const;
    8182
  • trunk/Source/WebCore/bindings/v8/custom/V8EventConstructors.cpp

    r95901 r96061  
    3232#include "EventConstructors.h"
    3333
     34#include "CloseEvent.h"
    3435#include "CustomEvent.h"
    3536#include "Document.h"
     
    4344#include "V8Binding.h"
    4445#include "V8BindingMacros.h"
     46#include "V8CloseEvent.h"
    4547#include "V8CustomEvent.h"
    4648#include "V8Document.h"
     
    109111INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_WEBKIT_ANIMATION_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY)
    110112INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_HASH_CHANGE_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY)
     113INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_CLOSE_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY)
    111114
    112115
  • trunk/Source/WebCore/websockets/CloseEvent.idl

    r95931 r96061  
    3434        NoStaticTables,
    3535        CanBeConstructed,
    36         CustomConstructFunction
     36        CustomConstructFunction,
     37        V8CustomConstructor
    3738    ] CloseEvent : Event {
    3839        readonly attribute boolean wasClean;
Note: See TracChangeset for help on using the changeset viewer.