Changeset 95262 in webkit


Ignore:
Timestamp:
Sep 15, 2011 7:45:55 PM (13 years ago)
Author:
haraken@google.com
Message:

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

Reviewed by Sam Weinig.

Source/WebCore:

Test: fast/events/constructors/pop-state-event-constructor.html

  • bindings/generic/EventConstructors.h: Added a definition for the PopStateEvent constructor.
  • bindings/js/JSEventConstructors.cpp: Added #includes for PopStateEvent.
  • dom/PopStateEvent.cpp:

(WebCore::PopStateEventInit::PopStateEventInit):
(WebCore::PopStateEvent::PopStateEvent):
(WebCore::PopStateEvent::create):

  • dom/PopStateEvent.h: Added a definition for PopStateEventInit.
  • dom/PopStateEvent.idl: Makes PopStateEvent constructible.

LayoutTests:

pop-state-event-constructor.html checks the behavior of the PopStateEvent constructor.

  • fast/events/constructors/pop-state-event-constructor-expected.txt: Added.
  • fast/events/constructors/pop-state-event-constructor.html: Added.
  • platform/chromium/test_expectations.txt: Skipped pop-state-event-constructor.html, since V8 does not yet have the PopStateEvent constructor.
Location:
trunk
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r95261 r95262  
     12011-09-15  Kentaro Hara  <haraken@google.com>
     2
     3        Implement a PopStateEvent constructor for JSC
     4        https://bugs.webkit.org/show_bug.cgi?id=67977
     5
     6        Reviewed by Sam Weinig.
     7
     8        pop-state-event-constructor.html checks the behavior of the PopStateEvent constructor.
     9
     10        * fast/events/constructors/pop-state-event-constructor-expected.txt: Added.
     11        * fast/events/constructors/pop-state-event-constructor.html: Added.
     12        * platform/chromium/test_expectations.txt: Skipped pop-state-event-constructor.html, since V8 does not yet have the PopStateEvent constructor.
     13
    1142011-09-15  Keishi Hattori  <keishi@webkit.org>
    215
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r95261 r95262  
    7878// CSS3 Selectors3 test suite
    7979BUGCR89468 : css3/selectors3 = PASS FAIL
     80
     81// This will soon be fixed after implementing a PopStateEvent constructor for V8.
     82BUGWK67977 : fast/events/constructors/pop-state-event-constructor.html = FAIL
    8083
    8184// Tests for WebVTT parser for <track>.  Feature is not yet functional.
  • trunk/Source/WebCore/ChangeLog

    r95259 r95262  
     12011-09-15  Kentaro Hara  <haraken@google.com>
     2
     3        Implement a PopStateEvent constructor for JSC
     4        https://bugs.webkit.org/show_bug.cgi?id=67977
     5
     6        Reviewed by Sam Weinig.
     7
     8        Test: fast/events/constructors/pop-state-event-constructor.html
     9
     10        * bindings/generic/EventConstructors.h: Added a definition for the PopStateEvent constructor.
     11        * bindings/js/JSEventConstructors.cpp: Added #includes for PopStateEvent.
     12        * dom/PopStateEvent.cpp:
     13        (WebCore::PopStateEventInit::PopStateEventInit):
     14        (WebCore::PopStateEvent::PopStateEvent):
     15        (WebCore::PopStateEvent::create):
     16        * dom/PopStateEvent.h: Added a definition for PopStateEventInit.
     17        * dom/PopStateEvent.idl: Makes PopStateEvent constructible.
     18
    1192011-09-15  Mihai Parparita  <mihaip@chromium.org>
    220
  • trunk/Source/WebCore/bindings/generic/EventConstructors.h

    r95079 r95262  
    7575    DICTIONARY_END(PageTransitionEvent)
    7676
     77#define INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_POP_STATE_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     78    \
     79    DICTIONARY_START(PopStateEvent) \
     80        FILL_PARENT_PROPERTIES(Event) \
     81        FILL_PROPERTY(state) \
     82    DICTIONARY_END(PopStateEvent)
     83
    7784
    7885#define INSTANTIATE_ALL_EVENT_INITIALIZING_CONSTRUCTORS(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     
    8390    INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_HASH_CHANGE_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
    8491    INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_PAGE_TRANSITION_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     92    INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_POP_STATE_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
    8593
    8694} // namespace WebCore
  • trunk/Source/WebCore/bindings/js/JSEventConstructors.cpp

    r95079 r95262  
    3535#include "JSHashChangeEvent.h"
    3636#include "JSPageTransitionEvent.h"
     37#include "JSPopStateEvent.h"
    3738#include "JSProgressEvent.h"
    3839#include "JSWebKitAnimationEvent.h"
    3940#include "PageTransitionEvent.h"
     41#include "PopStateEvent.h"
    4042#include "ProgressEvent.h"
    4143#include "WebKitAnimationEvent.h"
  • trunk/Source/WebCore/dom/PopStateEvent.cpp

    r88187 r95262  
    3232namespace WebCore {
    3333
     34PopStateEventInit::PopStateEventInit()
     35{
     36    state = SerializedScriptValue::create();
     37}
     38
    3439PopStateEvent::PopStateEvent()
    3540    : Event(eventNames().popstateEvent, false, true)
     41{
     42}
     43
     44PopStateEvent::PopStateEvent(const AtomicString& type, const PopStateEventInit& initializer)
     45    : Event(type, initializer)
     46    , m_stateObject(initializer.state)
    3647{
    3748}
     
    5768}
    5869
     70PassRefPtr<PopStateEvent> PopStateEvent::create(const AtomicString& type, const PopStateEventInit& initializer)
     71{
     72    return adoptRef(new PopStateEvent(type, initializer));
     73}
     74
    5975void PopStateEvent::initPopStateEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> stateObject)
    6076{
  • trunk/Source/WebCore/dom/PopStateEvent.h

    r88187 r95262  
    3535class SerializedScriptValue;
    3636
     37struct PopStateEventInit : public EventInit {
     38    PopStateEventInit();
     39
     40    RefPtr<SerializedScriptValue> state;
     41};
     42
    3743class PopStateEvent : public Event {
    3844public:
     
    4046    static PassRefPtr<PopStateEvent> create();
    4147    static PassRefPtr<PopStateEvent> create(PassRefPtr<SerializedScriptValue>);
     48    static PassRefPtr<PopStateEvent> create(const AtomicString&, const PopStateEventInit&);
    4249    void initPopStateEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue>);
    4350    bool isPopStateEvent() const { return true; }
     
    4754private:
    4855    PopStateEvent();
     56    PopStateEvent(const AtomicString&, const PopStateEventInit&);
    4957    explicit PopStateEvent(PassRefPtr<SerializedScriptValue>);
     58
    5059    RefPtr<SerializedScriptValue> m_stateObject;
    5160};
  • trunk/Source/WebCore/dom/PopStateEvent.idl

    r91617 r95262  
    2828
    2929#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
    30     interface PopStateEvent : Event {
     30    interface [
     31        CanBeConstructed,
     32        CustomConstructFunction
     33    ] PopStateEvent : Event {
    3134        void initPopStateEvent(in [Optional=CallWithDefaultValue] DOMString typeArg,
    3235                               in [Optional=CallWithDefaultValue] boolean canBubbleArg,
Note: See TracChangeset for help on using the changeset viewer.