Changeset 95931 in webkit


Ignore:
Timestamp:
Sep 25, 2011 8:30:34 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Kentaro Hara <haraken@chromium.org> on 2011-09-25
Reviewed by Oliver Hunt.

Source/WebCore:

The spec of the CloseEvent constructor is here:
http://dev.w3.org/html5/websockets/#closeevent

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

  • bindings/generic/EventConstructors.h: Added a definition for the CloseEvent constructor.
  • bindings/js/JSEventConstructors.cpp: Added #includes for CloseEvent.
  • websockets/CloseEvent.h: Added a definition for CloseEventInit.

(WebCore::CloseEventInit::CloseEventInit):
(WebCore::CloseEvent::create):
(WebCore::CloseEvent::CloseEvent):

  • websockets/CloseEvent.idl: Makes CloseEvent constructible.

LayoutTests:

  • fast/dom/constructed-objects-prototypes-expected.txt: Now window has CloseEvent.
  • fast/events/constructors/close-event-constructor-expected.txt: Added.
  • fast/events/constructors/close-event-constructor.html: Added.
  • platform/chromium/test_expectations.txt: Skipped close-event-constructor.html, since V8 does not yet have the CloseEvent constructor.
Location:
trunk
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r95926 r95931  
     12011-09-25  Kentaro Hara  <haraken@chromium.org>
     2
     3        Implement a CloseEvent constructor for JSC
     4        https://bugs.webkit.org/show_bug.cgi?id=68340
     5
     6        Reviewed by Oliver Hunt.
     7
     8        * fast/dom/constructed-objects-prototypes-expected.txt: Now window has CloseEvent.
     9        * fast/events/constructors/close-event-constructor-expected.txt: Added.
     10        * fast/events/constructors/close-event-constructor.html: Added.
     11        * platform/chromium/test_expectations.txt: Skipped close-event-constructor.html, since V8 does not yet have the CloseEvent constructor.
     12
    1132011-09-25  Dan Bernstein  <mitz@apple.com>
    214
  • trunk/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt

    r95352 r95931  
    66PASS (new inner.Audio()).isInner is true
    77PASS (new inner.Audio()).constructor.isInner is true
     8PASS (new inner.CloseEvent()).isInner is true
     9PASS (new inner.CloseEvent()).constructor.isInner is true
    810PASS (new inner.CustomEvent()).isInner is true
    911PASS (new inner.CustomEvent()).constructor.isInner is true
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

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

    r95929 r95931  
     12011-09-25  Kentaro Hara  <haraken@chromium.org>
     2
     3        Implement a CloseEvent constructor for JSC
     4        https://bugs.webkit.org/show_bug.cgi?id=68340
     5
     6        Reviewed by Oliver Hunt.
     7
     8        The spec of the CloseEvent constructor is here:
     9        http://dev.w3.org/html5/websockets/#closeevent
     10
     11        Test: fast/events/constructors/close-event-constructor.html
     12
     13        * bindings/generic/EventConstructors.h: Added a definition for the CloseEvent constructor.
     14        * bindings/js/JSEventConstructors.cpp: Added #includes for CloseEvent.
     15        * websockets/CloseEvent.h: Added a definition for CloseEventInit.
     16        (WebCore::CloseEventInit::CloseEventInit):
     17        (WebCore::CloseEvent::create):
     18        (WebCore::CloseEvent::CloseEvent):
     19        * websockets/CloseEvent.idl: Makes CloseEvent constructible.
     20
    1212011-09-25  Mark Rowe  <mrowe@apple.com>
    222
  • trunk/Source/WebCore/bindings/generic/EventConstructors.h

    r95901 r95931  
    9191    DICTIONARY_END(ErrorEvent)
    9292
     93#define INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_CLOSE_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     94    \
     95    DICTIONARY_START(CloseEvent) \
     96        FILL_PARENT_PROPERTIES(Event) \
     97        FILL_PROPERTY(wasClean) \
     98        FILL_PROPERTY(code) \
     99        FILL_PROPERTY(reason) \
     100    DICTIONARY_END(CloseEvent)
     101
    93102
    94103#define INSTANTIATE_ALL_EVENT_INITIALIZING_CONSTRUCTORS(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     
    101110    INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_POP_STATE_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
    102111    INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_ERROR_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     112    INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_CLOSE_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
    103113
    104114} // namespace WebCore
  • trunk/Source/WebCore/bindings/js/JSEventConstructors.cpp

    r95901 r95931  
    2727#include "EventConstructors.h"
    2828
     29#include "CloseEvent.h"
    2930#include "CustomEvent.h"
    3031#include "ErrorEvent.h"
    3132#include "Event.h"
    3233#include "HashChangeEvent.h"
     34#include "JSCloseEvent.h"
    3335#include "JSCustomEvent.h"
    3436#include "JSDictionary.h"
  • trunk/Source/WebCore/websockets/CloseEvent.h

    r95901 r95931  
    3737namespace WebCore {
    3838
     39struct CloseEventInit : public EventInit {
     40    CloseEventInit()
     41        : wasClean(false)
     42        , code(0)
     43    {
     44    };
     45
     46    bool wasClean;
     47    unsigned short code;
     48    String reason;
     49};
     50
    3951class CloseEvent : public Event {
    4052public:
     
    4456    {
    4557        return adoptRef(new CloseEvent());
     58    }
     59
     60    static PassRefPtr<CloseEvent> create(const AtomicString& type, const CloseEventInit& initializer)
     61    {
     62        return adoptRef(new CloseEvent(type, initializer));
    4663    }
    4764
     
    6784        , m_wasClean(false)
    6885        , m_code(0)
    69     { }
     86    {
     87    }
     88    CloseEvent(const AtomicString& type, const CloseEventInit& initializer)
     89        : Event(type, initializer)
     90        , m_wasClean(initializer.wasClean)
     91        , m_code(initializer.code)
     92        , m_reason(initializer.reason)
     93    {
     94    }
    7095
    7196    bool m_wasClean;
  • trunk/Source/WebCore/websockets/CloseEvent.idl

    r93393 r95931  
    3232
    3333    interface [
    34         NoStaticTables
     34        NoStaticTables,
     35        CanBeConstructed,
     36        CustomConstructFunction
    3537    ] CloseEvent : Event {
    3638        readonly attribute boolean wasClean;
Note: See TracChangeset for help on using the changeset viewer.