Implement an OverflowEvent constructor for JSC
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Oct 2011 09:13:47 +0000 (09:13 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Oct 2011 09:13:47 +0000 (09:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=69907

Reviewed by Adam Barth.

Source/WebCore:

There is no spec for the OverflowEvent constructor
since it is WebKit-specific. However, judging from the current
IDL of initOverflowEvent(), the constructor IDL should be as follows.

[Constructor(DOMString type, optional OverflowEventInit eventInitDict)]
interface OverflowEvent : Event {
    ...;
}

dictionary OverflowEventInit : EventInit {
    unsigned short orient;
    boolean horizontalOverflow;
    boolean verticalOverflow;
}

Note: In initOverflowEvent(), we cannot specify |bubbles| and |cancelable|.
I do not know why, but we can find a comment in fast/events/script-tests/init-events.js
that says "initOverflowEvent has an interface that has a design that's
inconsistent with the init functions from other events".
On the other hand, the above constructor enables to specify |bubbles| and |cancelable|,
which is consistent with other constructors.

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

* bindings/generic/EventConstructors.h: Added a definition for the OverflowEvent constructor.
* bindings/js/JSEventConstructors.cpp: Added #includes for OverflowEvent.
* dom/OverflowEvent.cpp:
(WebCore::OverflowEventInit::OverflowEventInit):
(WebCore::OverflowEvent::OverflowEvent):
(WebCore::OverflowEvent::initOverflowEvent):
* dom/OverflowEvent.h: Added a definition for OverflowEventInit.
(WebCore::OverflowEvent::create):
(WebCore::OverflowEvent::orient):
(WebCore::OverflowEvent::horizontalOverflow):
(WebCore::OverflowEvent::verticalOverflow):
* dom/OverflowEvent.idl: Makes OverflowEvent constructible.

LayoutTests:

overflow-event-constructor.html checks the behavior of the OverflowEvent constructor.

* fast/dom/constructed-objects-prototypes-expected.txt: Added inner.OverflowEvent().
* fast/dom/dom-constructors-expected.txt: Updated the test result.
* fast/dom/dom-constructors.html: Removed OverflowEvent from test cases, since now OverflowEvent has a constructor.
* fast/events/constructors/overflow-event-constructor-expected.txt: Added.
* fast/events/constructors/overflow-event-constructor.html: Added.
* platform/chromium/test_expectations.txt: Skipped overflow-event-constructor.html, since V8 does not yet have the OverflowEvent constructor.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97356 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt
LayoutTests/fast/dom/dom-constructors-expected.txt
LayoutTests/fast/dom/dom-constructors.html
LayoutTests/fast/events/constructors/overflow-event-constructor-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/constructors/overflow-event-constructor.html [new file with mode: 0644]
LayoutTests/platform/chromium/test_expectations.txt
Source/WebCore/ChangeLog
Source/WebCore/bindings/generic/EventConstructors.h
Source/WebCore/bindings/js/JSEventConstructors.cpp
Source/WebCore/dom/OverflowEvent.cpp
Source/WebCore/dom/OverflowEvent.h
Source/WebCore/dom/OverflowEvent.idl

index f3933bc..2fe0792 100644 (file)
@@ -1,3 +1,19 @@
+2011-10-13  Kentaro Hara  <haraken@chromium.org>
+
+        Implement an OverflowEvent constructor for JSC
+        https://bugs.webkit.org/show_bug.cgi?id=69907
+
+        Reviewed by Adam Barth.
+
+        overflow-event-constructor.html checks the behavior of the OverflowEvent constructor.
+
+        * fast/dom/constructed-objects-prototypes-expected.txt: Added inner.OverflowEvent().
+        * fast/dom/dom-constructors-expected.txt: Updated the test result.
+        * fast/dom/dom-constructors.html: Removed OverflowEvent from test cases, since now OverflowEvent has a constructor.
+        * fast/events/constructors/overflow-event-constructor-expected.txt: Added.
+        * fast/events/constructors/overflow-event-constructor.html: Added.
+        * platform/chromium/test_expectations.txt: Skipped overflow-event-constructor.html, since V8 does not yet have the OverflowEvent constructor.
+
 2011-10-13  Adam Barth  <abarth@webkit.org>
 
         DOMWindow subobjects can be re-created after navigation
index 04be03c..731d14e 100644 (file)
@@ -29,6 +29,8 @@ PASS (new inner.MessageEvent()).isInner is true
 PASS (new inner.MessageEvent()).constructor.isInner is true
 PASS (new inner.Option()).isInner is true
 PASS (new inner.Option()).constructor.isInner is true
+PASS (new inner.OverflowEvent()).isInner is true
+PASS (new inner.OverflowEvent()).constructor.isInner is true
 PASS (new inner.PageTransitionEvent()).isInner is true
 PASS (new inner.PageTransitionEvent()).constructor.isInner is true
 PASS (new inner.PopStateEvent()).isInner is true
index 7ea227b..c43eb6d 100644 (file)
@@ -102,7 +102,6 @@ PASS TryAllocate('MutationEvent') is 'exception'
 PASS TryAllocate('NamedNodeMap') is 'exception'
 PASS TryAllocate('NodeFilter') is 'exception'
 PASS TryAllocate('NodeList') is 'exception'
-PASS TryAllocate('OverflowEvent') is 'exception'
 PASS TryAllocate('Plugin') is 'exception'
 PASS TryAllocate('PluginArray') is 'exception'
 PASS TryAllocate('Range') is 'exception'
index 645b6c0..6e9ca49 100644 (file)
@@ -47,7 +47,7 @@ var objects_exception = [
     'CSSValue', 'CSSValueList', 'DOMImplementation',
     'HTMLCollection', 'KeyboardEvent', 'MediaList', 'MimeType',
     'MimeTypeArray', 'MouseEvent', 'MutationEvent', 'NamedNodeMap',
-    'NodeFilter', 'NodeList', 'OverflowEvent', 'Plugin',
+    'NodeFilter', 'NodeList', 'Plugin',
     'PluginArray', 'Range', 'Rect', 'StyleSheet', 'StyleSheetList',
     'TextEvent', 'UIEvent', 'WheelEvent', 'XPathResult', 'BarInfo',
     'CanvasGradient', 'CanvasPattern', 'Console', 'DOMSelection',
diff --git a/LayoutTests/fast/events/constructors/overflow-event-constructor-expected.txt b/LayoutTests/fast/events/constructors/overflow-event-constructor-expected.txt
new file mode 100644 (file)
index 0000000..db13d76
--- /dev/null
@@ -0,0 +1,49 @@
+This tests the constructor for the OverflowEvent DOM class.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS new OverflowEvent('eventType').bubbles is false
+PASS new OverflowEvent('eventType').cancelable is false
+PASS new OverflowEvent('eventType').horizontalOverflow is false
+PASS new OverflowEvent('eventType').verticalOverflow is false
+PASS new OverflowEvent('eventType').orient is 0
+PASS new OverflowEvent('eventType', { bubbles: false }).bubbles is false
+PASS new OverflowEvent('eventType', { bubbles: true }).bubbles is true
+PASS new OverflowEvent('eventType', { cancelable: false }).cancelable is false
+PASS new OverflowEvent('eventType', { cancelable: true }).cancelable is true
+PASS new OverflowEvent('eventType', { horizontalOverflow: false }).horizontalOverflow is false
+PASS new OverflowEvent('eventType', { horizontalOverflow: true }).horizontalOverflow is true
+PASS new OverflowEvent('eventType', { verticalOverflow: false }).verticalOverflow is false
+PASS new OverflowEvent('eventType', { verticalOverflow: true }).verticalOverflow is true
+PASS new OverflowEvent('eventType', { orient: 0 }).orient is 0
+PASS new OverflowEvent('eventType', { orient: 1 }).orient is 1
+PASS new OverflowEvent('eventType', { orient: 65534 }).orient is 65534
+PASS new OverflowEvent('eventType', { orient: 65535 }).orient is 65535
+PASS new OverflowEvent('eventType', { orient: 9007199254740991 }).orient is 65535
+PASS new OverflowEvent('eventType', { orient: 18446744073709551615 }).orient is 0
+PASS new OverflowEvent('eventType', { orient: 12345678901234567890 }).orient is 2048
+PASS new OverflowEvent('eventType', { orient: -1 }).orient is 65535
+PASS new OverflowEvent('eventType', { orient: 123.45 }).orient is 123
+PASS new OverflowEvent('eventType', { orient: NaN }).orient is 0
+PASS new OverflowEvent('eventType', { orient: undefined }).orient is 0
+PASS new OverflowEvent('eventType', { orient: null }).orient is 0
+PASS new OverflowEvent('eventType', { orient: '' }).orient is 0
+PASS new OverflowEvent('eventType', { orient: '12345' }).orient is 12345
+PASS new OverflowEvent('eventType', { orient: '12345a' }).orient is 0
+PASS new OverflowEvent('eventType', { orient: 'abc' }).orient is 0
+PASS new OverflowEvent('eventType', { orient: [] }).orient is 0
+PASS new OverflowEvent('eventType', { orient: [12345] }).orient is 12345
+PASS new OverflowEvent('eventType', { orient: [12345, 67890] }).orient is 0
+PASS new OverflowEvent('eventType', { orient: {} }).orient is 0
+PASS new OverflowEvent('eventType', { orient: {foo: 12345} }).orient is 0
+PASS new OverflowEvent('eventType', { orient: {valueOf: function () { return 12345; }} }).orient is 12345
+PASS new OverflowEvent('eventType', { bubbles: true, cancelable: true, horizontalOverflow: true, verticalOverflow: true, orient: 12345 }).bubbles is true
+PASS new OverflowEvent('eventType', { bubbles: true, cancelable: true, horizontalOverflow: true, verticalOverflow: true, orient: 12345 }).cancelable is true
+PASS new OverflowEvent('eventType', { bubbles: true, cancelable: true, horizontalOverflow: true, verticalOverflow: true, orient: 12345 }).horizontalOverflow is true
+PASS new OverflowEvent('eventType', { bubbles: true, cancelable: true, horizontalOverflow: true, verticalOverflow: true, orient: 12345 }).verticalOverflow is true
+PASS new OverflowEvent('eventType', { bubbles: true, cancelable: true, horizontalOverflow: true, verticalOverflow: true, orient: 12345 }).orient is 12345
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/constructors/overflow-event-constructor.html b/LayoutTests/fast/events/constructors/overflow-event-constructor.html
new file mode 100644 (file)
index 0000000..25fb719
--- /dev/null
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("This tests the constructor for the OverflowEvent DOM class.");
+
+// No initializer is passed.
+shouldBe("new OverflowEvent('eventType').bubbles", "false");
+shouldBe("new OverflowEvent('eventType').cancelable", "false");
+shouldBe("new OverflowEvent('eventType').horizontalOverflow", "false");
+shouldBe("new OverflowEvent('eventType').verticalOverflow", "false");
+shouldBe("new OverflowEvent('eventType').orient", "0");
+
+// bubbles, cancelable, horizontalOverflow, verticalOverflow are passed.
+["bubbles", "cancelable", "horizontalOverflow", "verticalOverflow"].forEach(function(attr) {
+    shouldBe("new OverflowEvent('eventType', { " + attr + ": false })." + attr, "false");
+    shouldBe("new OverflowEvent('eventType', { " + attr + ": true })." + attr, "true");
+});
+
+// orient is passed.
+// Numbers within the unsigned short range.
+shouldBe("new OverflowEvent('eventType', { orient: 0 }).orient", "0");
+shouldBe("new OverflowEvent('eventType', { orient: 1 }).orient", "1");
+shouldBe("new OverflowEvent('eventType', { orient: 65534 }).orient", "65534");
+shouldBe("new OverflowEvent('eventType', { orient: 65535 }).orient", "65535");
+
+// Numbers out of the unsigned short range.
+// 2^{53}-1, the largest number that can be exactly represented by double.
+shouldBe("new OverflowEvent('eventType', { orient: 9007199254740991 }).orient", "65535");
+// 2^{64}-1
+shouldBe("new OverflowEvent('eventType', { orient: 18446744073709551615 }).orient", "0");
+shouldBe("new OverflowEvent('eventType', { orient: 12345678901234567890 }).orient", "2048");
+shouldBe("new OverflowEvent('eventType', { orient: -1 }).orient", "65535");
+shouldBe("new OverflowEvent('eventType', { orient: 123.45 }).orient", "123");
+shouldBe("new OverflowEvent('eventType', { orient: NaN }).orient", "0");
+
+// Non-numeric values.
+shouldBe("new OverflowEvent('eventType', { orient: undefined }).orient", "0");
+shouldBe("new OverflowEvent('eventType', { orient: null }).orient", "0");
+shouldBe("new OverflowEvent('eventType', { orient: '' }).orient", "0");
+shouldBe("new OverflowEvent('eventType', { orient: '12345' }).orient", "12345");
+shouldBe("new OverflowEvent('eventType', { orient: '12345a' }).orient", "0");
+shouldBe("new OverflowEvent('eventType', { orient: 'abc' }).orient", "0");
+shouldBe("new OverflowEvent('eventType', { orient: [] }).orient", "0");
+shouldBe("new OverflowEvent('eventType', { orient: [12345] }).orient", "12345");
+shouldBe("new OverflowEvent('eventType', { orient: [12345, 67890] }).orient", "0");
+shouldBe("new OverflowEvent('eventType', { orient: {} }).orient", "0");
+shouldBe("new OverflowEvent('eventType', { orient: {foo: 12345} }).orient", "0");
+shouldBe("new OverflowEvent('eventType', { orient: {valueOf: function () { return 12345; }} }).orient", "12345");
+
+// All initializers are passed.
+shouldBe("new OverflowEvent('eventType', { bubbles: true, cancelable: true, horizontalOverflow: true, verticalOverflow: true, orient: 12345 }).bubbles", "true");
+shouldBe("new OverflowEvent('eventType', { bubbles: true, cancelable: true, horizontalOverflow: true, verticalOverflow: true, orient: 12345 }).cancelable", "true");
+shouldBe("new OverflowEvent('eventType', { bubbles: true, cancelable: true, horizontalOverflow: true, verticalOverflow: true, orient: 12345 }).horizontalOverflow", "true");
+shouldBe("new OverflowEvent('eventType', { bubbles: true, cancelable: true, horizontalOverflow: true, verticalOverflow: true, orient: 12345 }).verticalOverflow", "true");
+shouldBe("new OverflowEvent('eventType', { bubbles: true, cancelable: true, horizontalOverflow: true, verticalOverflow: true, orient: 12345 }).orient", "12345");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
index 7893de1..c445abc 100644 (file)
@@ -95,6 +95,9 @@ BUGCR10395 SKIP : http/tests/webarchive = PASS FAIL
 // This will soon be fixed after implementing a BeforeLoadEvent constructor for V8.
 BUGWK69893 : fast/events/constructors/before-load-event-constructor.html = FAIL
 
+// This will soon be fixed after implementing an OverflowEvent constructor for V8.
+BUGWK69907 : fast/events/constructors/overflow-event-constructor.html = FAIL
+
 // According to the Chromium bug, we need to write some sort of workaround for
 // how clipboards on Windows work, or something?  That doesn't explain why this
 // fails for other platforms...
index d1f2084..33cc697 100644 (file)
@@ -1,3 +1,47 @@
+2011-10-13  Kentaro Hara  <haraken@chromium.org>
+
+        Implement an OverflowEvent constructor for JSC
+        https://bugs.webkit.org/show_bug.cgi?id=69907
+
+        Reviewed by Adam Barth.
+
+        There is no spec for the OverflowEvent constructor
+        since it is WebKit-specific. However, judging from the current
+        IDL of initOverflowEvent(), the constructor IDL should be as follows.
+
+        [Constructor(DOMString type, optional OverflowEventInit eventInitDict)]
+        interface OverflowEvent : Event {
+            ...;
+        }
+
+        dictionary OverflowEventInit : EventInit {
+            unsigned short orient;
+            boolean horizontalOverflow;
+            boolean verticalOverflow;
+        }
+
+        Note: In initOverflowEvent(), we cannot specify |bubbles| and |cancelable|.
+        I do not know why, but we can find a comment in fast/events/script-tests/init-events.js
+        that says "initOverflowEvent has an interface that has a design that's
+        inconsistent with the init functions from other events".
+        On the other hand, the above constructor enables to specify |bubbles| and |cancelable|,
+        which is consistent with other constructors.
+
+        Test: fast/events/constructors/overflow-event-constructor.html
+
+        * bindings/generic/EventConstructors.h: Added a definition for the OverflowEvent constructor.
+        * bindings/js/JSEventConstructors.cpp: Added #includes for OverflowEvent.
+        * dom/OverflowEvent.cpp:
+        (WebCore::OverflowEventInit::OverflowEventInit):
+        (WebCore::OverflowEvent::OverflowEvent):
+        (WebCore::OverflowEvent::initOverflowEvent):
+        * dom/OverflowEvent.h: Added a definition for OverflowEventInit.
+        (WebCore::OverflowEvent::create):
+        (WebCore::OverflowEvent::orient):
+        (WebCore::OverflowEvent::horizontalOverflow):
+        (WebCore::OverflowEvent::verticalOverflow):
+        * dom/OverflowEvent.idl: Makes OverflowEvent constructible.
+
 2011-10-13  Kent Tamura  <tkent@chromium.org>
 
         Cleanup of HTMLSelectElement
index 4732096..0a2b21d 100644 (file)
@@ -125,6 +125,15 @@ namespace WebCore {
         FILL_PROPERTY(url) \
     DICTIONARY_END(BeforeLoadEvent)
 
+#define INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_OVERFLOW_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
+    \
+    DICTIONARY_START(OverflowEvent) \
+        FILL_PARENT_PROPERTIES(Event) \
+        FILL_PROPERTY(orient) \
+        FILL_PROPERTY(horizontalOverflow) \
+        FILL_PROPERTY(verticalOverflow) \
+    DICTIONARY_END(OverflowEvent)
+
 
 #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) \
@@ -139,6 +148,7 @@ namespace WebCore {
     INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_MESSAGE_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_WEBKIT_TRANSITION_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_BEFORE_LOAD_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
+    INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_OVERFLOW_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
 
 
 } // namespace WebCore
index 73478fe..2dad2e9 100644 (file)
 #include "JSEvent.h"
 #include "JSHashChangeEvent.h"
 #include "JSMessageEvent.h"
+#include "JSOverflowEvent.h"
 #include "JSPageTransitionEvent.h"
 #include "JSPopStateEvent.h"
 #include "JSProgressEvent.h"
 #include "JSWebKitAnimationEvent.h"
 #include "JSWebKitTransitionEvent.h"
 #include "MessageEvent.h"
+#include "OverflowEvent.h"
 #include "PageTransitionEvent.h"
 #include "PopStateEvent.h"
 #include "ProgressEvent.h"
index 1626b67..b05d001 100644 (file)
 #include "EventNames.h"
 
 namespace WebCore {
-        
+
+OverflowEventInit::OverflowEventInit()
+    : orient(0)
+    , horizontalOverflow(false)
+    , verticalOverflow(false)
+{
+}
+
 OverflowEvent::OverflowEvent()
     : Event(eventNames().overflowchangedEvent, false, false)
     , m_orient(VERTICAL)
@@ -53,6 +60,14 @@ OverflowEvent::OverflowEvent(bool horizontalOverflowChanged, bool horizontalOver
         m_orient = VERTICAL;
 }
 
+OverflowEvent::OverflowEvent(const AtomicString& type, const OverflowEventInit& initializer)
+    : Event(type, initializer)
+    , m_orient(initializer.orient)
+    , m_horizontalOverflow(initializer.horizontalOverflow)
+    , m_verticalOverflow(initializer.verticalOverflow)
+{
+}
+
 bool OverflowEvent::isOverflowEvent() const
 {
     return true;
@@ -62,7 +77,7 @@ void OverflowEvent::initOverflowEvent(unsigned short orient, bool horizontalOver
 {
     if (dispatched())
         return;
-    
+
     m_orient = orient;
     m_horizontalOverflow = horizontalOverflow;
     m_verticalOverflow = verticalOverflow;
index f1cd2f3..3e867fd 100644 (file)
 #include "Event.h"
 
 namespace WebCore {
-    
-    class OverflowEvent : public Event {
-    public:
-        enum orientType {
-            HORIZONTAL = 0,
-            VERTICAL   = 1,
-            BOTH       = 2
-        };
 
-        static PassRefPtr<OverflowEvent> create()
-        {
-            return adoptRef(new OverflowEvent);
-        }
-        static PassRefPtr<OverflowEvent> create(bool horizontalOverflowChanged, bool horizontalOverflow, bool verticalOverflowChanged, bool verticalOverflow)
-        {
-            return adoptRef(new OverflowEvent(horizontalOverflowChanged, horizontalOverflow, verticalOverflowChanged, verticalOverflow));
-        }
+struct OverflowEventInit : public EventInit {
+    OverflowEventInit();
 
-        void initOverflowEvent(unsigned short orient, bool horizontalOverflow, bool verticalOverflow);
+    unsigned short orient;
+    bool horizontalOverflow;
+    bool verticalOverflow;
+};
 
-        unsigned short orient() const { return m_orient; }
-        bool horizontalOverflow() const { return m_horizontalOverflow; }
-        bool verticalOverflow() const { return m_verticalOverflow; }
+class OverflowEvent : public Event {
+public:
+    enum orientType {
+        HORIZONTAL = 0,
+        VERTICAL   = 1,
+        BOTH       = 2
+    };
 
-        virtual bool isOverflowEvent() const;
-        
-    private:
-        OverflowEvent();
-        OverflowEvent(bool horizontalOverflowChanged, bool horizontalOverflow, bool verticalOverflowChanged, bool verticalOverflow);
+    static PassRefPtr<OverflowEvent> create()
+    {
+        return adoptRef(new OverflowEvent);
+    }
+    static PassRefPtr<OverflowEvent> create(bool horizontalOverflowChanged, bool horizontalOverflow, bool verticalOverflowChanged, bool verticalOverflow)
+    {
+        return adoptRef(new OverflowEvent(horizontalOverflowChanged, horizontalOverflow, verticalOverflowChanged, verticalOverflow));
+    }
+    static PassRefPtr<OverflowEvent> create(const AtomicString& type, const OverflowEventInit& initializer)
+    {
+        return adoptRef(new OverflowEvent(type, initializer));
+    }
+
+    void initOverflowEvent(unsigned short orient, bool horizontalOverflow, bool verticalOverflow);
+
+    unsigned short orient() const { return m_orient; }
+    bool horizontalOverflow() const { return m_horizontalOverflow; }
+    bool verticalOverflow() const { return m_verticalOverflow; }
+
+    virtual bool isOverflowEvent() const;
+
+private:
+    OverflowEvent();
+    OverflowEvent(bool horizontalOverflowChanged, bool horizontalOverflow, bool verticalOverflowChanged, bool verticalOverflow);
+    OverflowEvent(const AtomicString&, const OverflowEventInit&);
+
+    unsigned short m_orient;
+    bool m_horizontalOverflow;
+    bool m_verticalOverflow;
+};
 
-        unsigned short m_orient;
-        bool m_horizontalOverflow;
-        bool m_verticalOverflow;
-    };
 }
 
 #endif // OverflowEvent_h
-
index 099ba1e..cfa3d61 100644 (file)
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
+
 module events {
-    interface OverflowEvent : Event {
+
+    interface [
+        CanBeConstructed,
+        JSCustomConstructor
+    ] OverflowEvent : Event {
         const unsigned short HORIZONTAL = 0;
         const unsigned short VERTICAL   = 1;
         const unsigned short BOTH       = 2;