Changeset 95079 in webkit


Ignore:
Timestamp:
Sep 14, 2011 12:40:25 AM (13 years ago)
Author:
haraken@google.com
Message:

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

Reviewed by Sam Weinig.

Source/WebCore:

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

Test: fast/events/constructors/page-transition-event-constructor.html

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

(WebCore::PageTransitionEventInit::PageTransitionEventInit):
(WebCore::PageTransitionEvent::PageTransitionEvent):
(WebCore::PageTransitionEvent::initPageTransitionEvent):

  • dom/PageTransitionEvent.h: Added a definition for PageTransitionEventInit.

(WebCore::PageTransitionEvent::create):
(WebCore::PageTransitionEvent::isPageTransitionEvent):
(WebCore::PageTransitionEvent::persisted):

  • dom/PageTransitionEvent.idl: Makes PageTransitionEvent constructible.

LayoutTests:

page-transition-event-constructor.html checks the behavior of the PageTransitionEvent constructor.

  • fast/dom/constructed-objects-prototypes-expected.txt: Added PageTransitionEvent.
  • fast/events/constructors/page-transition-event-constructor-expected.txt: Added.
  • fast/events/constructors/page-transition-event-constructor.html: Added.
  • platform/chromium/test_expectations.txt: Skipped page-transition-event-constructor.html, since V8 does not yet have the PageTransitionEvent constructor.
Location:
trunk
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r95077 r95079  
     12011-09-14  Kentaro Hara  <haraken@google.com>
     2
     3        Implement a PageTransitionEvent constructor for JSC
     4        https://bugs.webkit.org/show_bug.cgi?id=68048
     5
     6        Reviewed by Sam Weinig.
     7
     8        page-transition-event-constructor.html checks the behavior of the PageTransitionEvent constructor.
     9
     10        * fast/dom/constructed-objects-prototypes-expected.txt: Added PageTransitionEvent.
     11        * fast/events/constructors/page-transition-event-constructor-expected.txt: Added.
     12        * fast/events/constructors/page-transition-event-constructor.html: Added.
     13        * platform/chromium/test_expectations.txt: Skipped page-transition-event-constructor.html, since V8 does not yet have the PageTransitionEvent constructor.
     14
    1152011-09-13  Sheriff Bot  <webkit.review.bot@gmail.com>
    216
  • trunk/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt

    r94970 r95079  
    2222PASS (new inner.Option()).isInner is true
    2323PASS (new inner.Option()).constructor.isInner is true
     24PASS (new inner.PageTransitionEvent()).isInner is true
     25PASS (new inner.PageTransitionEvent()).constructor.isInner is true
    2426PASS (new inner.ProgressEvent()).isInner is true
    2527PASS (new inner.ProgressEvent()).constructor.isInner is true
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r95073 r95079  
    6464// to re-enable these "in the next few weeks".
    6565BUGPKASTING SKIP : animations/animation-api-1.html = TEXT
     66
     67// This will soon be fixed after implementing a PageTransitionEvent constructor for V8.
     68BUGWK68048 : fast/events/constructors/page-transition-event-constructor.html = FAIL
    6669
    6770// Unskip after implementing DRT support for setDefersLoading and goBack.
  • trunk/Source/WebCore/ChangeLog

    r95077 r95079  
     12011-09-14  Kentaro Hara  <haraken@google.com>
     2
     3        Implement a PageTransitionEvent constructor for JSC
     4        https://bugs.webkit.org/show_bug.cgi?id=68048
     5
     6        Reviewed by Sam Weinig.
     7
     8        The spec for the PageTransitionEvent constructor is here:
     9        http://www.whatwg.org/specs/web-apps/current-work/#pagetransitionevent
     10
     11        Test: fast/events/constructors/page-transition-event-constructor.html
     12
     13        * bindings/generic/EventConstructors.h: Added a definition for the PageTransitionEvent constructor.
     14        * bindings/js/JSEventConstructors.cpp: Added #includes for PageTransitionEvent.
     15        * dom/PageTransitionEvent.cpp:
     16        (WebCore::PageTransitionEventInit::PageTransitionEventInit):
     17        (WebCore::PageTransitionEvent::PageTransitionEvent):
     18        (WebCore::PageTransitionEvent::initPageTransitionEvent):
     19        * dom/PageTransitionEvent.h: Added a definition for PageTransitionEventInit.
     20        (WebCore::PageTransitionEvent::create):
     21        (WebCore::PageTransitionEvent::isPageTransitionEvent):
     22        (WebCore::PageTransitionEvent::persisted):
     23        * dom/PageTransitionEvent.idl: Makes PageTransitionEvent constructible.
     24
    1252011-09-13  Sheriff Bot  <webkit.review.bot@gmail.com>
    226
  • trunk/Source/WebCore/bindings/generic/EventConstructors.h

    r94962 r95079  
    6868    DICTIONARY_END(HashChangeEvent)
    6969
     70#define INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_PAGE_TRANSITION_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     71    \
     72    DICTIONARY_START(PageTransitionEvent) \
     73        FILL_PARENT_PROPERTIES(Event) \
     74        FILL_PROPERTY(persisted) \
     75    DICTIONARY_END(PageTransitionEvent)
     76
    7077
    7178#define INSTANTIATE_ALL_EVENT_INITIALIZING_CONSTRUCTORS(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     
    7582    INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_WEBKIT_ANIMATION_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
    7683    INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_HASH_CHANGE_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     84    INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_PAGE_TRANSITION_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
    7785
    7886} // namespace WebCore
  • trunk/Source/WebCore/bindings/js/JSEventConstructors.cpp

    r94962 r95079  
    3434#include "JSEvent.h"
    3535#include "JSHashChangeEvent.h"
     36#include "JSPageTransitionEvent.h"
    3637#include "JSProgressEvent.h"
    3738#include "JSWebKitAnimationEvent.h"
     39#include "PageTransitionEvent.h"
    3840#include "ProgressEvent.h"
    3941#include "WebKitAnimationEvent.h"
  • trunk/Source/WebCore/dom/PageTransitionEvent.cpp

    r47824 r95079  
    3030
    3131namespace WebCore {
    32        
     32
     33PageTransitionEventInit::PageTransitionEventInit()
     34    : persisted(false)
     35{
     36}
     37
    3338PageTransitionEvent::PageTransitionEvent()
    3439    : m_persisted(false)
     
    3944    : Event(type, true, true)
    4045    , m_persisted(persisted)
     46{
     47}
     48
     49PageTransitionEvent::PageTransitionEvent(const AtomicString& type, const PageTransitionEventInit& initializer)
     50    : Event(type, initializer)
     51    , m_persisted(initializer.persisted)
    4152{
    4253}
     
    5364    if (dispatched())
    5465        return;
    55    
     66
    5667    initEvent(type, canBubbleArg, cancelableArg);
    57    
     68
    5869    m_persisted = persisted;
    5970}
  • trunk/Source/WebCore/dom/PageTransitionEvent.h

    r47824 r95079  
    3131namespace WebCore {
    3232
    33     class PageTransitionEvent : public Event {
    34     public:
    35         static PassRefPtr<PageTransitionEvent> create()
    36         {
    37             return adoptRef(new PageTransitionEvent);
    38         }
    39         static PassRefPtr<PageTransitionEvent> create(const AtomicString& type, bool persisted)
    40         {
    41             return adoptRef(new PageTransitionEvent(type, persisted));
    42         }
     33struct PageTransitionEventInit : public EventInit {
     34    PageTransitionEventInit();
    4335
    44         virtual ~PageTransitionEvent();
     36    bool persisted;
     37};
    4538
    46         void initPageTransitionEvent(const AtomicString& type,
    47                                 bool canBubbleArg,
    48                                 bool cancelableArg,
    49                                 bool persisted);
     39class PageTransitionEvent : public Event {
     40public:
     41    static PassRefPtr<PageTransitionEvent> create()
     42    {
     43        return adoptRef(new PageTransitionEvent);
     44    }
     45    static PassRefPtr<PageTransitionEvent> create(const AtomicString& type, bool persisted)
     46    {
     47        return adoptRef(new PageTransitionEvent(type, persisted));
     48    }
     49    static PassRefPtr<PageTransitionEvent> create(const AtomicString& type, const PageTransitionEventInit& initializer)
     50    {
     51        return adoptRef(new PageTransitionEvent(type, initializer));
     52    }
    5053
    51         virtual bool isPageTransitionEvent() const { return true; }
     54    virtual ~PageTransitionEvent();
    5255
    53         bool persisted() const { return m_persisted; }
     56    void initPageTransitionEvent(const AtomicString& type,
     57                                 bool canBubbleArg,
     58                                 bool cancelableArg,
     59                                 bool persisted);
    5460
    55     private:
    56         PageTransitionEvent();
    57         PageTransitionEvent(const AtomicString& type, bool persisted);
     61    virtual bool isPageTransitionEvent() const { return true; }
    5862
    59         bool m_persisted;
    60     };
     63    bool persisted() const { return m_persisted; }
     64
     65private:
     66    PageTransitionEvent();
     67    PageTransitionEvent(const AtomicString& type, bool persisted);
     68    PageTransitionEvent(const AtomicString&, const PageTransitionEventInit&);
     69
     70    bool m_persisted;
     71};
    6172
    6273} // namespace WebCore
  • trunk/Source/WebCore/dom/PageTransitionEvent.idl

    r91617 r95079  
    2626module events {
    2727
    28     interface PageTransitionEvent : Event {
     28    interface [
     29        CanBeConstructed,
     30        CustomConstructFunction
     31    ] PageTransitionEvent : Event {
    2932
    3033        readonly attribute boolean persisted;
Note: See TracChangeset for help on using the changeset viewer.