Changeset 94147 in webkit


Ignore:
Timestamp:
Aug 30, 2011 9:04:06 PM (13 years ago)
Author:
weinig@apple.com
Message:

Add constructor for CustomEvent
https://bugs.webkit.org/show_bug.cgi?id=67248

Reviewed by Dan Bernstein.

Source/WebCore:

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

  • bindings/generic/EventConstructors.h:

Add definition for CustomEvent constructor.

  • bindings/js/JSEventConstructors.cpp:

Add CustomEvent #includes.

  • dom/CustomEvent.cpp:

(WebCore::CustomEventInit::CustomEventInit):
(WebCore::CustomEvent::CustomEvent):

  • dom/CustomEvent.h:

(WebCore::CustomEvent::create):
Add Initializer./

  • dom/CustomEvent.idl:

Make constructible.

  • page/DOMWindow.idl:

Add CustomEvent attribute.

LayoutTests:

  • fast/events/constructors/custom-event-constructor-expected.txt: Added.
  • fast/events/constructors/custom-event-constructor.html: Added.

New test.

  • fast/dom/constructed-objects-prototypes-expected.txt:
  • platform/mac/fast/dom/Window/window-properties-expected.txt:
  • platform/mac/fast/dom/Window/window-property-descriptors-expected.txt:
  • platform/mac/fast/dom/prototype-inheritance-expected.txt:
  • platform/mac/fast/js/global-constructors-expected.txt:

Updated for add window.CustomEvent.

Location:
trunk
Files:
2 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r94143 r94147  
     12011-08-30  Sam Weinig  <sam@webkit.org>
     2
     3        Add constructor for CustomEvent
     4        https://bugs.webkit.org/show_bug.cgi?id=67248
     5
     6        Reviewed by Dan Bernstein.
     7
     8        * fast/events/constructors/custom-event-constructor-expected.txt: Added.
     9        * fast/events/constructors/custom-event-constructor.html: Added.
     10        New test.
     11
     12        * fast/dom/constructed-objects-prototypes-expected.txt:
     13        * platform/mac/fast/dom/Window/window-properties-expected.txt:
     14        * platform/mac/fast/dom/Window/window-property-descriptors-expected.txt:
     15        * platform/mac/fast/dom/prototype-inheritance-expected.txt:
     16        * platform/mac/fast/js/global-constructors-expected.txt:
     17        Updated for add window.CustomEvent.
     18
    1192011-08-30  David Levin  <levin@chromium.org>
    220
  • trunk/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt

    r93994 r94147  
    66PASS (new inner.Audio()).isInner is true
    77PASS (new inner.Audio()).constructor.isInner is true
     8PASS (new inner.CustomEvent()).isInner is true
     9PASS (new inner.CustomEvent()).constructor.isInner is true
    810PASS (new inner.DOMParser()).isInner is true
    911PASS (new inner.DOMParser()).constructor.isInner is true
  • trunk/LayoutTests/platform/mac/fast/dom/Window/window-properties-expected.txt

    r93997 r94147  
    510510window.Counter [object CounterConstructor]
    511511window.Counter.prototype [object CounterPrototype]
     512window.CustomEvent [object CustomEventConstructor]
     513window.CustomEvent.prototype [object CustomEventPrototype]
     514window.CustomEvent.prototype.AT_TARGET [number]
     515window.CustomEvent.prototype.BLUR [number]
     516window.CustomEvent.prototype.BUBBLING_PHASE [number]
     517window.CustomEvent.prototype.CAPTURING_PHASE [number]
     518window.CustomEvent.prototype.CHANGE [number]
     519window.CustomEvent.prototype.CLICK [number]
     520window.CustomEvent.prototype.DBLCLICK [number]
     521window.CustomEvent.prototype.DRAGDROP [number]
     522window.CustomEvent.prototype.FOCUS [number]
     523window.CustomEvent.prototype.KEYDOWN [number]
     524window.CustomEvent.prototype.KEYPRESS [number]
     525window.CustomEvent.prototype.KEYUP [number]
     526window.CustomEvent.prototype.MOUSEDOWN [number]
     527window.CustomEvent.prototype.MOUSEDRAG [number]
     528window.CustomEvent.prototype.MOUSEMOVE [number]
     529window.CustomEvent.prototype.MOUSEOUT [number]
     530window.CustomEvent.prototype.MOUSEOVER [number]
     531window.CustomEvent.prototype.MOUSEUP [number]
     532window.CustomEvent.prototype.SELECT [number]
     533window.CustomEvent.prototype.initCustomEvent [function]
     534window.CustomEvent.prototype.initEvent [function]
     535window.CustomEvent.prototype.preventDefault [function]
     536window.CustomEvent.prototype.stopImmediatePropagation [function]
     537window.CustomEvent.prototype.stopPropagation [function]
    512538window.DOMException [object DOMExceptionConstructor]
    513539window.DOMException.ABORT_ERR [number]
  • trunk/LayoutTests/platform/mac/fast/dom/Window/window-property-descriptors-expected.txt

    r93997 r94147  
    3434PASS typeof Object.getOwnPropertyDescriptor(window, 'Comment') is 'object'
    3535PASS typeof Object.getOwnPropertyDescriptor(window, 'Counter') is 'object'
     36PASS typeof Object.getOwnPropertyDescriptor(window, 'CustomEvent') is 'object'
    3637PASS typeof Object.getOwnPropertyDescriptor(window, 'DOMException') is 'object'
    3738PASS typeof Object.getOwnPropertyDescriptor(window, 'DOMImplementation') is 'object'
  • trunk/LayoutTests/platform/mac/fast/dom/prototype-inheritance-expected.txt

    r93997 r94147  
    6464PASS inner.Counter.isInner is true
    6565PASS inner.Counter.constructor.isInner is true
     66PASS inner.CustomEvent.isInner is true
     67PASS inner.CustomEvent.constructor.isInner is true
    6668PASS inner.DOMException.isInner is true
    6769PASS inner.DOMException.constructor.isInner is true
  • trunk/LayoutTests/platform/mac/fast/js/global-constructors-expected.txt

    r93491 r94147  
    3232PASS Comment.toString() is '[object CommentConstructor]'
    3333PASS Counter.toString() is '[object CounterConstructor]'
     34PASS CustomEvent.toString() is '[object CustomEventConstructor]'
    3435PASS DOMException.toString() is '[object DOMExceptionConstructor]'
    3536PASS DOMImplementation.toString() is '[object DOMImplementationConstructor]'
  • trunk/Source/WebCore/ChangeLog

    r94142 r94147  
     12011-08-30  Sam Weinig  <sam@webkit.org>
     2
     3        Add constructor for CustomEvent
     4        https://bugs.webkit.org/show_bug.cgi?id=67248
     5
     6        Reviewed by Dan Bernstein.
     7
     8        Test: fast/events/constructors/custom-event-constructor.html
     9
     10        * bindings/generic/EventConstructors.h:
     11        Add definition for CustomEvent constructor.
     12
     13        * bindings/js/JSEventConstructors.cpp:
     14        Add CustomEvent #includes.
     15
     16        * dom/CustomEvent.cpp:
     17        (WebCore::CustomEventInit::CustomEventInit):
     18        (WebCore::CustomEvent::CustomEvent):
     19        * dom/CustomEvent.h:
     20        (WebCore::CustomEvent::create):
     21        Add Initializer./
     22
     23        * dom/CustomEvent.idl:
     24        Make constructible.
     25
     26        * page/DOMWindow.idl:
     27        Add CustomEvent attribute.
     28
    1292011-08-30  Ryosuke Niwa  <rniwa@webkit.org>
    230
  • trunk/Source/WebCore/bindings/generic/EventConstructors.h

    r93951 r94147  
    3636    DICTIONARY_END(Event)
    3737
     38#define INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_CUSTOM_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     39    \
     40    DICTIONARY_START(CustomEvent) \
     41        FILL_PARENT_PROPERTIES(Event) \
     42        FILL_PROPERTY(detail) \
     43    DICTIONARY_END(CustomEvent)
     44
    3845
    3946#define INSTANTIATE_ALL_EVENT_INITIALIZING_CONSTRUCTORS(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
    4047    INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     48    INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_CUSTOM_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
    4149
    4250} // namespace WebCore
  • trunk/Source/WebCore/bindings/js/JSEventConstructors.cpp

    r94123 r94147  
    2727#include "EventConstructors.h"
    2828
     29#include "CustomEvent.h"
    2930#include "Event.h"
     31#include "JSCustomEvent.h"
    3032#include "JSDictionary.h"
    3133#include "JSEvent.h"
  • trunk/Source/WebCore/dom/CustomEvent.cpp

    r69437 r94147  
    2727#include "CustomEvent.h"
    2828
    29 #include "EventNames.h"
    30 
    3129namespace WebCore {
    3230
     31CustomEventInit::CustomEventInit()
     32{
     33}
     34
     35
    3336CustomEvent::CustomEvent()
     37{
     38}
     39
     40CustomEvent::CustomEvent(const AtomicString& type, const CustomEventInit& initializer)
     41    : Event(type, initializer)
     42    , m_detail(initializer.detail)
    3443{
    3544}
  • trunk/Source/WebCore/dom/CustomEvent.h

    r69437 r94147  
    2929#include "Event.h"
    3030#include "ScriptValue.h"
    31 #include <wtf/text/AtomicString.h>
    3231
    3332namespace WebCore {
     33
     34struct CustomEventInit : public EventInit {
     35    CustomEventInit();
     36
     37    ScriptValue detail;
     38};
    3439
    3540class CustomEvent : public Event {
     
    4247    }
    4348
     49    static PassRefPtr<CustomEvent> create(const AtomicString& type, const CustomEventInit& initializer)
     50    {
     51        return adoptRef(new CustomEvent(type, initializer));
     52    }
     53
    4454    void initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, ScriptValue detail);
    4555
     
    5060private:
    5161    CustomEvent();
     62    CustomEvent(const AtomicString& type, const CustomEventInit& initializer);
    5263
    5364    ScriptValue m_detail;
  • trunk/Source/WebCore/dom/CustomEvent.idl

    r91617 r94147  
    2828#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
    2929    // Introduced in DOM Level 3:
    30     interface CustomEvent : Event {
     30    interface [
     31        CanBeConstructed,
     32        CustomConstructFunction
     33    ] CustomEvent : Event {
    3134
    3235       readonly attribute DOMObject detail;
  • trunk/Source/WebCore/page/DOMWindow.idl

    r93482 r94147  
    520520
    521521        attribute EventConstructor Event;
     522        attribute CustomEventConstructor CustomEvent;
     523
    522524        attribute BeforeLoadEventConstructor BeforeLoadEvent;
    523525        attribute HashChangeEventConstructor HashChangeEvent;
Note: See TracChangeset for help on using the changeset viewer.