Title: [96208] trunk
Revision
96208
Author
[email protected]
Date
2011-09-28 02:27:55 -0700 (Wed, 28 Sep 2011)

Log Message

Implement an ErrorEvent constructor for V8
https://bugs.webkit.org/show_bug.cgi?id=68336

Patch by Kentaro Hara <[email protected]> on 2011-09-28
Reviewed by Adam Barth.

Source/WebCore:

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

* bindings/v8/OptionsObject.cpp:
(WebCore::OptionsObject::getKeyValue): Returns an unsigned value corresponding to a given key.
* bindings/v8/OptionsObject.h:
* bindings/v8/custom/V8EventConstructors.cpp: Added the ErrorEvent constructor.
* dom/ErrorEvent.idl: Added a 'V8CustomConstructor' attribute.

LayoutTests:

Enabled fast/events/constructors/error-event-constructor.html,
since V8 now has the constructor for ErrorEvent.

* platform/chromium/test_expectations.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (96207 => 96208)


--- trunk/LayoutTests/ChangeLog	2011-09-28 09:27:35 UTC (rev 96207)
+++ trunk/LayoutTests/ChangeLog	2011-09-28 09:27:55 UTC (rev 96208)
@@ -1,3 +1,15 @@
+2011-09-28  Kentaro Hara  <[email protected]>
+
+        Implement an ErrorEvent constructor for V8
+        https://bugs.webkit.org/show_bug.cgi?id=68336
+
+        Reviewed by Adam Barth.
+
+        Enabled fast/events/constructors/error-event-constructor.html,
+        since V8 now has the constructor for ErrorEvent.
+
+        * platform/chromium/test_expectations.txt:
+
 2011-09-28  Gabor Rapcsanyi  <[email protected]>
 
         [Qt][GTK] Skip http/tests/multipart/stop-crash.html because it fails after r96174.

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (96207 => 96208)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-09-28 09:27:35 UTC (rev 96207)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-09-28 09:27:55 UTC (rev 96208)
@@ -62,9 +62,6 @@
 // Implement java testing harness.
 BUGCR36681 SKIP : java = TEXT
 
-// This will soon be fixed after implementing an ErrorEvent constructor for V8.
-BUGWK68148 : fast/events/constructors/error-event-constructor.html = FAIL
-
 // Quota API is not supported in DRT yet.
 BUGCR84572 SKIP : storage/storageinfo-query-usage.html = FAIL
 BUGCR84572 SKIP : storage/storageinfo-request-quota.html = FAIL

Modified: trunk/Source/WebCore/ChangeLog (96207 => 96208)


--- trunk/Source/WebCore/ChangeLog	2011-09-28 09:27:35 UTC (rev 96207)
+++ trunk/Source/WebCore/ChangeLog	2011-09-28 09:27:55 UTC (rev 96208)
@@ -1,3 +1,18 @@
+2011-09-28  Kentaro Hara  <[email protected]>
+
+        Implement an ErrorEvent constructor for V8
+        https://bugs.webkit.org/show_bug.cgi?id=68336
+
+        Reviewed by Adam Barth.
+
+        Test: fast/events/constructors/error-event-constructor.html
+
+        * bindings/v8/OptionsObject.cpp:
+        (WebCore::OptionsObject::getKeyValue): Returns an unsigned value corresponding to a given key.
+        * bindings/v8/OptionsObject.h:
+        * bindings/v8/custom/V8EventConstructors.cpp: Added the ErrorEvent constructor.
+        * dom/ErrorEvent.idl: Added a 'V8CustomConstructor' attribute.
+
 2011-09-27  Andy Estes  <[email protected]>
 
         WebKitLinkedOnOrAfter() check is ineffective for Solar Walk app-specific hack.

Modified: trunk/Source/WebCore/bindings/v8/OptionsObject.cpp (96207 => 96208)


--- trunk/Source/WebCore/bindings/v8/OptionsObject.cpp	2011-09-28 09:27:35 UTC (rev 96207)
+++ trunk/Source/WebCore/bindings/v8/OptionsObject.cpp	2011-09-28 09:27:55 UTC (rev 96208)
@@ -193,6 +193,19 @@
     return true;
 }
 
+bool OptionsObject::getKeyValue(const String& key, unsigned& value) const
+{
+    v8::Local<v8::Value> v8Value;
+    if (!getKey(key, v8Value))
+        return false;
+
+    v8::Local<v8::Int32> v8Int32 = v8Value->ToInt32();
+    if (v8Int32.IsEmpty())
+        return false;
+    value = static_cast<unsigned>(v8Int32->Value());
+    return true;
+}
+
 bool OptionsObject::getKeyValue(const String& key, unsigned long long& value) const
 {
     v8::Local<v8::Value> v8Value;

Modified: trunk/Source/WebCore/bindings/v8/OptionsObject.h (96207 => 96208)


--- trunk/Source/WebCore/bindings/v8/OptionsObject.h	2011-09-28 09:27:35 UTC (rev 96207)
+++ trunk/Source/WebCore/bindings/v8/OptionsObject.h	2011-09-28 09:27:55 UTC (rev 96208)
@@ -77,8 +77,9 @@
         value = ScriptValue(v8Value);
         return true;
     }
-    bool getKeyValue(const String& key, unsigned short& value) const;
-    bool getKeyValue(const String& key, unsigned long long& value) const;
+    bool getKeyValue(const String&, unsigned short&) const;
+    bool getKeyValue(const String&, unsigned&) const;
+    bool getKeyValue(const String&, unsigned long long&) const;
 
 private:
     bool getKey(const String& key, v8::Local<v8::Value>&) const;

Modified: trunk/Source/WebCore/bindings/v8/custom/V8EventConstructors.cpp (96207 => 96208)


--- trunk/Source/WebCore/bindings/v8/custom/V8EventConstructors.cpp	2011-09-28 09:27:35 UTC (rev 96207)
+++ trunk/Source/WebCore/bindings/v8/custom/V8EventConstructors.cpp	2011-09-28 09:27:55 UTC (rev 96208)
@@ -35,6 +35,7 @@
 #include "CustomEvent.h"
 #include "Document.h"
 #include "DocumentFragment.h"
+#include "ErrorEvent.h"
 #include "HashChangeEvent.h"
 #include "Node.h"
 #include "PageTransitionEvent.h"
@@ -47,6 +48,7 @@
 #include "V8CloseEvent.h"
 #include "V8CustomEvent.h"
 #include "V8Document.h"
+#include "V8ErrorEvent.h"
 #include "V8Event.h"
 #include "V8HashChangeEvent.h"
 #include "V8Node.h"
@@ -114,6 +116,7 @@
 INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_HASH_CHANGE_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY)
 INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_CLOSE_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)
+INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_ERROR_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY)
 
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/dom/ErrorEvent.idl (96207 => 96208)


--- trunk/Source/WebCore/dom/ErrorEvent.idl	2011-09-28 09:27:35 UTC (rev 96207)
+++ trunk/Source/WebCore/dom/ErrorEvent.idl	2011-09-28 09:27:55 UTC (rev 96208)
@@ -33,7 +33,8 @@
     interface [
         NoStaticTables,
         CanBeConstructed,
-        CustomConstructFunction
+        CustomConstructFunction,
+        V8CustomConstructor
     ] ErrorEvent : Event {
 
         readonly attribute DOMString message;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to