Changeset 94480 in webkit
- Timestamp:
- Sep 2, 2011 11:04:21 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r94471 r94480 1 2011-09-02 Kentaro Hara <haraken@google.com> 2 3 Implement a CustomEvent constructor for V8 4 https://bugs.webkit.org/show_bug.cgi?id=67527 5 6 Reviewed by Sam Weinig. 7 8 * platform/chromium/fast/events/constructors/custom-event-constructor-expected.txt: Updated the result. 9 1 10 2011-09-02 Chris Marrin <cmarrin@apple.com> 2 11 -
trunk/LayoutTests/platform/chromium/fast/events/constructors/custom-event-constructor-expected.txt
r94151 r94480 7 7 PASS new CustomEvent('eventType').cancelable is false 8 8 FAIL new CustomEvent('eventType').detail should be null (of type object). Was undefined (of type undefined). 9 FAIL new CustomEvent('eventType', { bubbles: true, cancelable: true }).bubbles should be true. Was false. 10 FAIL new CustomEvent('eventType', { bubbles: true, cancelable: true }).cancelable should be true. Was false. 9 PASS new CustomEvent('eventType', { bubbles: true, cancelable: true }).bubbles is true 10 PASS new CustomEvent('eventType', { bubbles: true, cancelable: true }).cancelable is true 11 11 FAIL new CustomEvent('eventType', { bubbles: true, cancelable: true }).detail should be null (of type object). Was undefined (of type undefined). 12 FAIL new CustomEvent('eventType', { detail: 10 }).detail should be 10 (of type number). Was undefined (of type undefined). 13 FAIL new CustomEvent('eventType', { detail: 'string' }).detail should be string (of type string). Was undefined (of type undefined). 14 FAIL new CustomEvent('eventType', { detail: detailObject }).detail should be [object Object] (of type object). Was undefined (of type undefined). 15 FAIL new CustomEvent('eventType', { detail: document }).detail should be [object HTMLDocument] (of type object). Was undefined (of type undefined). 16 FAIL new CustomEvent('eventType', { get detail() { return true; } }).detail should be true (of type boolean). Was undefined (of type undefined). 17 FAIL new CustomEvent('eventType', { get detail() { throw 'Custom Error'; } }) should throw an exception. Was [object CustomEvent].12 PASS new CustomEvent('eventType', { detail: 10 }).detail is 10 13 PASS new CustomEvent('eventType', { detail: 'string' }).detail is 'string' 14 PASS new CustomEvent('eventType', { detail: detailObject }).detail is detailObject 15 PASS new CustomEvent('eventType', { detail: document }).detail is document 16 PASS new CustomEvent('eventType', { get detail() { return true; } }).detail is true 17 PASS new CustomEvent('eventType', { get detail() { throw 'Custom Error'; } }) threw exception Custom Error. 18 18 PASS successfullyParsed is true 19 19 -
trunk/Source/WebCore/ChangeLog
r94474 r94480 1 2011-09-02 Kentaro Hara <haraken@google.com> 2 3 Implement a CustomEvent constructor for V8 4 https://bugs.webkit.org/show_bug.cgi?id=67527 5 6 Reviewed by Sam Weinig. 7 8 Test: fast/events/constructors/custom-event-constructor.html 9 10 * bindings/v8/OptionsObject.h: 11 (WebCore::OptionsObject::getKeyValue): Returns ScriptValue corresponding to a given key. 12 * bindings/v8/custom/V8EventConstructors.cpp: Added the CustomEvent constructor. 13 * dom/CustomEvent.idl: Added a 'V8CustomConstructor' attribute. 14 1 15 2011-09-02 Adrienne Walker <enne@google.com> 2 16 -
trunk/Source/WebCore/bindings/v8/OptionsObject.h
r94424 r94480 28 28 29 29 #include "PlatformString.h" 30 #include "ScriptValue.h" 30 31 #include <v8.h> 31 32 … … 68 69 return getKeyString(key, value); 69 70 } 71 bool getKeyValue(const String& key, ScriptValue& value) const 72 { 73 v8::Local<v8::Value> v8Value; 74 if (!getKey(key, v8Value)) 75 return false; 76 77 value = ScriptValue(v8Value); 78 return true; 79 } 70 80 71 81 private: -
trunk/Source/WebCore/bindings/v8/custom/V8EventConstructors.cpp
r94424 r94480 32 32 #include "EventConstructors.h" 33 33 34 #include "CustomEvent.h" 34 35 #include "Document.h" 35 36 #include "DocumentFragment.h" … … 39 40 #include "V8Binding.h" 40 41 #include "V8BindingMacros.h" 42 #include "V8CustomEvent.h" 41 43 #include "V8Document.h" 42 44 #include "V8Event.h" … … 77 79 78 80 #define DICTIONARY_START(EventType) \ 79 static bool fill##EventType##Init(Event ##Init& eventInit, const OptionsObject& options) \81 static bool fill##EventType##Init(EventType##Init& eventInit, const OptionsObject& options) \ 80 82 { 81 83 … … 86 88 v8::Handle<v8::Value> V8##EventType::constructorCallback(const v8::Arguments& args) \ 87 89 { \ 88 return constructV8Event<EventType, EventType##Init>(args, fill##EventType##Init, &info); \90 return constructV8Event<EventType, EventType##Init>(args, fill##EventType##Init, &info); \ 89 91 } 90 92 91 93 #define FILL_PARENT_PROPERTIES(parentEventType) \ 92 if (!fill##parentEventType##Init(eventInit )) \94 if (!fill##parentEventType##Init(eventInit, options)) \ 93 95 return false; 94 96 … … 97 99 98 100 INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) 101 INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_CUSTOM_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) 99 102 100 103 -
trunk/Source/WebCore/dom/CustomEvent.idl
r94147 r94480 30 30 interface [ 31 31 CanBeConstructed, 32 CustomConstructFunction 32 CustomConstructFunction, 33 V8CustomConstructor 33 34 ] CustomEvent : Event { 34 35
Note: See TracChangeset
for help on using the changeset viewer.