Changeset 94962 in webkit


Ignore:
Timestamp:
Sep 12, 2011 10:40:55 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Kentaro Hara <haraken@google.com> on 2011-09-12
Reviewed by Sam Weinig.

Source/WebCore:

The spec for the HashChangeEvent constructor is here:
http://www.whatwg.org/specs/web-apps/current-work/#hashchangeevent

Test: fast/events/constructors/hash-change-event-constructor.html

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

(WebCore::HashChangeEventInit::HashChangeEventInit):
(WebCore::HashChangeEvent::create):
(WebCore::HashChangeEvent::HashChangeEvent):

  • dom/HashChangeEvent.idl: Makes HashChangeEvent constructible.

LayoutTests:

hash-change-event-constructor.html checks the behavior of the HashChangeEvent constructor.

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

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r94959 r94962  
     12011-09-12  Kentaro Hara  <haraken@google.com>
     2
     3        Implement a HashChangeEvent constructor for JSC
     4        https://bugs.webkit.org/show_bug.cgi?id=67924
     5
     6        Reviewed by Sam Weinig.
     7
     8        hash-change-event-constructor.html checks the behavior of the HashChangeEvent constructor.
     9
     10        * fast/events/constructors/hash-change-event-constructor-expected.txt: Added.
     11        * fast/events/constructors/hash-change-event-constructor.html: Added.
     12        * platform/chromium/test_expectations.txt: Skipped hash-change-event-constructor.html, since V8 does not yet have the HashChangeEvent constructor.
     13
    1142011-09-12  Nate Chapin  <japhet@chromium.org>
    215
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r94959 r94962  
    8383BUGCR10395 SKIP : svg/custom/image-with-prefix-in-webarchive.svg = PASS FAIL
    8484BUGCR10395 SKIP : http/tests/webarchive = PASS FAIL
     85
     86// This will soon be fixed after implementing a HashChangeEvent constructor for V8.
     87BUGWK67924 : fast/events/constructors/hash-change-event-constructor.html = FAIL
    8588
    8689// According to the Chromium bug, we need to write some sort of workaround for
  • trunk/Source/WebCore/ChangeLog

    r94961 r94962  
     12011-09-12  Kentaro Hara  <haraken@google.com>
     2
     3        Implement a HashChangeEvent constructor for JSC
     4        https://bugs.webkit.org/show_bug.cgi?id=67924
     5
     6        Reviewed by Sam Weinig.
     7
     8        The spec for the HashChangeEvent constructor is here:
     9        http://www.whatwg.org/specs/web-apps/current-work/#hashchangeevent
     10
     11        Test: fast/events/constructors/hash-change-event-constructor.html
     12
     13        * bindings/generic/EventConstructors.h: Added a definition for the HashChangeEvent constructor.
     14        * bindings/js/JSEventConstructors.cpp: Added #includes for HashChangeEvent.
     15        * dom/HashChangeEvent.h: Added a definition for HashChangeEventInit.
     16        (WebCore::HashChangeEventInit::HashChangeEventInit):
     17        (WebCore::HashChangeEvent::create):
     18        (WebCore::HashChangeEvent::HashChangeEvent):
     19        * dom/HashChangeEvent.idl: Makes HashChangeEvent constructible.
     20
    1212011-09-12  Mike Reed  <reed@google.com>
    222
  • trunk/Source/WebCore/bindings/generic/EventConstructors.h

    r94861 r94962  
    6060    DICTIONARY_END(WebKitAnimationEvent)
    6161
     62#define INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_HASH_CHANGE_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     63    \
     64    DICTIONARY_START(HashChangeEvent) \
     65        FILL_PARENT_PROPERTIES(Event) \
     66        FILL_PROPERTY(oldURL) \
     67        FILL_PROPERTY(newURL) \
     68    DICTIONARY_END(HashChangeEvent)
     69
    6270
    6371#define INSTANTIATE_ALL_EVENT_INITIALIZING_CONSTRUCTORS(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     
    6674    INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_PROGRESS_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
    6775    INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_WEBKIT_ANIMATION_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     76    INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_HASH_CHANGE_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
    6877
    6978} // namespace WebCore
  • trunk/Source/WebCore/bindings/js/JSEventConstructors.cpp

    r94861 r94962  
    2929#include "CustomEvent.h"
    3030#include "Event.h"
     31#include "HashChangeEvent.h"
    3132#include "JSCustomEvent.h"
    3233#include "JSDictionary.h"
    3334#include "JSEvent.h"
     35#include "JSHashChangeEvent.h"
    3436#include "JSProgressEvent.h"
    3537#include "JSWebKitAnimationEvent.h"
  • trunk/Source/WebCore/dom/HashChangeEvent.h

    r94505 r94962  
    2727namespace WebCore {
    2828
     29struct HashChangeEventInit : public EventInit {
     30    HashChangeEventInit()
     31    {
     32    };
     33
     34    String oldURL;
     35    String newURL;
     36};
     37
    2938class HashChangeEvent : public Event {
    3039public:
     
    3948    {
    4049        return adoptRef(new HashChangeEvent(oldURL, newURL));
     50    }
     51
     52    static PassRefPtr<HashChangeEvent> create(const AtomicString& type, const HashChangeEventInit& initializer)
     53    {
     54        return adoptRef(new HashChangeEvent(type, initializer));
    4155    }
    4256
     
    6781    }
    6882
     83    HashChangeEvent(const AtomicString& type, const HashChangeEventInit& initializer)
     84        : Event(type, initializer)
     85        , m_oldURL(initializer.oldURL)
     86        , m_newURL(initializer.newURL)
     87    {
     88    }
     89
    6990    String m_oldURL;
    7091    String m_newURL;
  • trunk/Source/WebCore/dom/HashChangeEvent.idl

    r91617 r94962  
    2222    // Introduced in http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#event-hashchange
    2323    interface [
    24         GenerateConstructor
     24        CanBeConstructed,
     25        CustomConstructFunction
    2526    ] HashChangeEvent : Event {
    2627        void initHashChangeEvent(in [Optional=CallWithDefaultValue] DOMString type,
Note: See TracChangeset for help on using the changeset viewer.