Diff
Modified: trunk/LayoutTests/ChangeLog (95078 => 95079)
--- trunk/LayoutTests/ChangeLog 2011-09-14 06:58:10 UTC (rev 95078)
+++ trunk/LayoutTests/ChangeLog 2011-09-14 07:40:25 UTC (rev 95079)
@@ -1,3 +1,17 @@
+2011-09-14 Kentaro Hara <hara...@google.com>
+
+ Implement a PageTransitionEvent constructor for JSC
+ https://bugs.webkit.org/show_bug.cgi?id=68048
+
+ Reviewed by Sam Weinig.
+
+ 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.
+
2011-09-13 Sheriff Bot <webkit.review....@gmail.com>
Unreviewed, rolling out r95058.
Modified: trunk/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt (95078 => 95079)
--- trunk/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt 2011-09-14 06:58:10 UTC (rev 95078)
+++ trunk/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt 2011-09-14 07:40:25 UTC (rev 95079)
@@ -21,6 +21,8 @@
PASS (new inner.MessageChannel()).constructor.isInner is true
PASS (new inner.Option()).isInner is true
PASS (new inner.Option()).constructor.isInner is true
+PASS (new inner.PageTransitionEvent()).isInner is true
+PASS (new inner.PageTransitionEvent()).constructor.isInner is true
PASS (new inner.ProgressEvent()).isInner is true
PASS (new inner.ProgressEvent()).constructor.isInner is true
PASS (new inner.WebKitAnimationEvent()).isInner is true
Added: trunk/LayoutTests/fast/events/constructors/page-transition-event-constructor.html (0 => 95079)
--- trunk/LayoutTests/fast/events/constructors/page-transition-event-constructor.html (rev 0)
+++ trunk/LayoutTests/fast/events/constructors/page-transition-event-constructor.html 2011-09-14 07:40:25 UTC (rev 95079)
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("This tests the constructor for the PageTransitionEvent DOM class.");
+
+// No initializer is passed.
+shouldBe("new PageTransitionEvent('eventType').bubbles", "false");
+shouldBe("new PageTransitionEvent('eventType').cancelable", "false");
+shouldBe("new PageTransitionEvent('eventType').persisted", "false");
+
+// bubbles is passed.
+shouldBe("new PageTransitionEvent('eventType', { bubbles: false }).bubbles", "false");
+shouldBe("new PageTransitionEvent('eventType', { bubbles: true }).bubbles", "true");
+
+// cancelable is passed.
+shouldBe("new PageTransitionEvent('eventType', { cancelable: false }).cancelable", "false");
+shouldBe("new PageTransitionEvent('eventType', { cancelable: true }).cancelable", "true");
+
+// persisted is passed.
+shouldBe("new PageTransitionEvent('eventType', { persisted: false }).persisted", "false");
+shouldBe("new PageTransitionEvent('eventType', { persisted: true }).persisted", "true");
+
+// All initializers are passed.
+shouldBe("new PageTransitionEvent('eventType', { bubbles: true, cancelable: true, persisted: true }).bubbles", "true");
+shouldBe("new PageTransitionEvent('eventType', { bubbles: true, cancelable: true, persisted: true }).cancelable", "true");
+shouldBe("new PageTransitionEvent('eventType', { bubbles: true, cancelable: true, persisted: true }).persisted", "true");
+
+var successfullyParsed = true;
+</script>
+<script src=""
+</body>
+</html>
Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (95078 => 95079)
--- trunk/LayoutTests/platform/chromium/test_expectations.txt 2011-09-14 06:58:10 UTC (rev 95078)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt 2011-09-14 07:40:25 UTC (rev 95079)
@@ -64,6 +64,9 @@
// to re-enable these "in the next few weeks".
BUGPKASTING SKIP : animations/animation-api-1.html = TEXT
+// This will soon be fixed after implementing a PageTransitionEvent constructor for V8.
+BUGWK68048 : fast/events/constructors/page-transition-event-constructor.html = FAIL
+
// Unskip after implementing DRT support for setDefersLoading and goBack.
BUGWK60877 SKIP : loader/navigation-while-deferring-loads.html = FAIL
BUGWK60877 SKIP : loader/load-defer-resume-crash.html = FAIL
Modified: trunk/Source/WebCore/ChangeLog (95078 => 95079)
--- trunk/Source/WebCore/ChangeLog 2011-09-14 06:58:10 UTC (rev 95078)
+++ trunk/Source/WebCore/ChangeLog 2011-09-14 07:40:25 UTC (rev 95079)
@@ -1,3 +1,27 @@
+2011-09-14 Kentaro Hara <hara...@google.com>
+
+ Implement a PageTransitionEvent constructor for JSC
+ https://bugs.webkit.org/show_bug.cgi?id=68048
+
+ Reviewed by Sam Weinig.
+
+ 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.
+
2011-09-13 Sheriff Bot <webkit.review....@gmail.com>
Unreviewed, rolling out r95058.
Modified: trunk/Source/WebCore/bindings/generic/EventConstructors.h (95078 => 95079)
--- trunk/Source/WebCore/bindings/generic/EventConstructors.h 2011-09-14 06:58:10 UTC (rev 95078)
+++ trunk/Source/WebCore/bindings/generic/EventConstructors.h 2011-09-14 07:40:25 UTC (rev 95079)
@@ -67,13 +67,21 @@
FILL_PROPERTY(newURL) \
DICTIONARY_END(HashChangeEvent)
+#define INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_PAGE_TRANSITION_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
+ \
+ DICTIONARY_START(PageTransitionEvent) \
+ FILL_PARENT_PROPERTIES(Event) \
+ FILL_PROPERTY(persisted) \
+ DICTIONARY_END(PageTransitionEvent)
+
#define INSTANTIATE_ALL_EVENT_INITIALIZING_CONSTRUCTORS(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_CUSTOM_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_PROGRESS_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_WEBKIT_ANIMATION_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_HASH_CHANGE_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
+ INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_PAGE_TRANSITION_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/js/JSEventConstructors.cpp (95078 => 95079)
--- trunk/Source/WebCore/bindings/js/JSEventConstructors.cpp 2011-09-14 06:58:10 UTC (rev 95078)
+++ trunk/Source/WebCore/bindings/js/JSEventConstructors.cpp 2011-09-14 07:40:25 UTC (rev 95079)
@@ -33,8 +33,10 @@
#include "JSDictionary.h"
#include "JSEvent.h"
#include "JSHashChangeEvent.h"
+#include "JSPageTransitionEvent.h"
#include "JSProgressEvent.h"
#include "JSWebKitAnimationEvent.h"
+#include "PageTransitionEvent.h"
#include "ProgressEvent.h"
#include "WebKitAnimationEvent.h"
#include <runtime/Error.h>
Modified: trunk/Source/WebCore/dom/PageTransitionEvent.cpp (95078 => 95079)
--- trunk/Source/WebCore/dom/PageTransitionEvent.cpp 2011-09-14 06:58:10 UTC (rev 95078)
+++ trunk/Source/WebCore/dom/PageTransitionEvent.cpp 2011-09-14 07:40:25 UTC (rev 95079)
@@ -29,7 +29,12 @@
#include "EventNames.h"
namespace WebCore {
-
+
+PageTransitionEventInit::PageTransitionEventInit()
+ : persisted(false)
+{
+}
+
PageTransitionEvent::PageTransitionEvent()
: m_persisted(false)
{
@@ -41,6 +46,12 @@
{
}
+PageTransitionEvent::PageTransitionEvent(const AtomicString& type, const PageTransitionEventInit& initializer)
+ : Event(type, initializer)
+ , m_persisted(initializer.persisted)
+{
+}
+
PageTransitionEvent::~PageTransitionEvent()
{
}
@@ -52,9 +63,9 @@
{
if (dispatched())
return;
-
+
initEvent(type, canBubbleArg, cancelableArg);
-
+
m_persisted = persisted;
}
Modified: trunk/Source/WebCore/dom/PageTransitionEvent.h (95078 => 95079)
--- trunk/Source/WebCore/dom/PageTransitionEvent.h 2011-09-14 06:58:10 UTC (rev 95078)
+++ trunk/Source/WebCore/dom/PageTransitionEvent.h 2011-09-14 07:40:25 UTC (rev 95079)
@@ -30,35 +30,46 @@
namespace WebCore {
- class PageTransitionEvent : public Event {
- public:
- static PassRefPtr<PageTransitionEvent> create()
- {
- return adoptRef(new PageTransitionEvent);
- }
- static PassRefPtr<PageTransitionEvent> create(const AtomicString& type, bool persisted)
- {
- return adoptRef(new PageTransitionEvent(type, persisted));
- }
+struct PageTransitionEventInit : public EventInit {
+ PageTransitionEventInit();
- virtual ~PageTransitionEvent();
+ bool persisted;
+};
- void initPageTransitionEvent(const AtomicString& type,
- bool canBubbleArg,
- bool cancelableArg,
- bool persisted);
+class PageTransitionEvent : public Event {
+public:
+ static PassRefPtr<PageTransitionEvent> create()
+ {
+ return adoptRef(new PageTransitionEvent);
+ }
+ static PassRefPtr<PageTransitionEvent> create(const AtomicString& type, bool persisted)
+ {
+ return adoptRef(new PageTransitionEvent(type, persisted));
+ }
+ static PassRefPtr<PageTransitionEvent> create(const AtomicString& type, const PageTransitionEventInit& initializer)
+ {
+ return adoptRef(new PageTransitionEvent(type, initializer));
+ }
- virtual bool isPageTransitionEvent() const { return true; }
+ virtual ~PageTransitionEvent();
- bool persisted() const { return m_persisted; }
+ void initPageTransitionEvent(const AtomicString& type,
+ bool canBubbleArg,
+ bool cancelableArg,
+ bool persisted);
- private:
- PageTransitionEvent();
- PageTransitionEvent(const AtomicString& type, bool persisted);
+ virtual bool isPageTransitionEvent() const { return true; }
- bool m_persisted;
- };
+ bool persisted() const { return m_persisted; }
+private:
+ PageTransitionEvent();
+ PageTransitionEvent(const AtomicString& type, bool persisted);
+ PageTransitionEvent(const AtomicString&, const PageTransitionEventInit&);
+
+ bool m_persisted;
+};
+
} // namespace WebCore
#endif // PageTransitionEvent_h
Modified: trunk/Source/WebCore/dom/PageTransitionEvent.idl (95078 => 95079)
--- trunk/Source/WebCore/dom/PageTransitionEvent.idl 2011-09-14 06:58:10 UTC (rev 95078)
+++ trunk/Source/WebCore/dom/PageTransitionEvent.idl 2011-09-14 07:40:25 UTC (rev 95079)
@@ -25,7 +25,10 @@
module events {
- interface PageTransitionEvent : Event {
+ interface [
+ CanBeConstructed,
+ CustomConstructFunction
+ ] PageTransitionEvent : Event {
readonly attribute boolean persisted;