Changeset 94771 in webkit
- Timestamp:
- Sep 8, 2011 11:28:42 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r94770 r94771 1 2011-09-08 Kentaro Hara <haraken@google.com> 2 3 Implement a ProgressEvent constructor for JSC 4 https://bugs.webkit.org/show_bug.cgi?id=67537 5 6 Reviewed by Sam Weinig. 7 8 * fast/events/constructors/progress-event-constructor-expected.txt: Added. 9 * fast/events/constructors/progress-event-constructor.html: Added. Checks the behavior of the ProgressEvent constructor. 10 * platform/chromium/test_expectations.txt: Skipped progress-event-constructor.html, since V8 does not yet have the ProgressEvent constructor. 11 1 12 2011-09-08 Nate Chapin <japhet@chromium.org> 2 13 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r94763 r94771 504 504 // There's a missing glyph box in "full-time". 505 505 BUGCR20547 WIN : fast/text/capitalize-boundaries.html = FAIL 506 507 // This will soon be fixed after implementing a ProgressEvent constructor for V8. 508 BUGWK67537 : fast/events/constructors/progress-event-constructor.html = FAIL 506 509 507 510 // Different button line-heights, our behavior looks wrong. -
trunk/Source/WebCore/ChangeLog
r94766 r94771 1 2011-09-08 Kentaro Hara <haraken@google.com> 2 3 Implement a ProgressEvent constructor for JSC 4 https://bugs.webkit.org/show_bug.cgi?id=67537 5 6 Reviewed by Sam Weinig. 7 8 The spec for the ProgressEvent constructor is here: 9 http://www.w3.org/TR/progress-events/#interface-progressevent 10 11 Test: fast/events/constructors/progress-event-constructor.html 12 13 * bindings/generic/EventConstructors.h: Added a definition for the ProgressEvent constructor. 14 * bindings/js/JSDictionary.cpp: 15 (WebCore::JSDictionary::convertValue): Converts an ECMA-262 Number into an IDL unsigned long long value. Spec: http://www.w3.org/TR/WebIDL/#es-unsigned-long-long 16 * bindings/js/JSEventConstructors.cpp: Added #includes for ProgressEvent. 17 * dom/ProgressEvent.cpp: 18 (WebCore::ProgressEventInit::ProgressEventInit): 19 (WebCore::ProgressEvent::ProgressEvent): 20 * dom/ProgressEvent.h: Added a definition for ProgressEventInit. 21 (WebCore::ProgressEvent::create): 22 * dom/ProgressEvent.idl: Makes ProgressEvent constructible. 23 1 24 2011-09-08 Ryosuke Niwa <rniwa@webkit.org> 2 25 -
trunk/Source/WebCore/bindings/generic/EventConstructors.h
r94147 r94771 43 43 DICTIONARY_END(CustomEvent) 44 44 45 #define INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_PROGRESS_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \ 46 \ 47 DICTIONARY_START(ProgressEvent) \ 48 FILL_PARENT_PROPERTIES(Event) \ 49 FILL_PROPERTY(lengthComputable) \ 50 FILL_PROPERTY(loaded) \ 51 FILL_PROPERTY(total) \ 52 DICTIONARY_END(ProgressEvent) 53 45 54 46 55 #define INSTANTIATE_ALL_EVENT_INITIALIZING_CONSTRUCTORS(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \ 47 56 INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \ 48 57 INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_CUSTOM_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \ 58 INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_PROGRESS_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \ 49 59 50 60 } // namespace WebCore -
trunk/Source/WebCore/bindings/js/JSDictionary.cpp
r94123 r94771 37 37 38 38 namespace WebCore { 39 40 static const double UnsignedLongLongMax = 18446744073709551616.0; // 2^64 39 41 40 42 JSDictionary::GetPropertyResult JSDictionary::tryGetProperty(const char* propertyName, JSValue& finalResult) … … 78 80 void JSDictionary::convertValue(ExecState* exec, JSValue value, unsigned long long& result) 79 81 { 80 result = static_cast<unsigned long long>(value.toInteger(exec)); 82 double d = value.toNumber(exec); 83 if (isnan(d) || isinf(d)) 84 result = 0; 85 else 86 result = static_cast<unsigned long long>(fmod(trunc(d), UnsignedLongLongMax)); 81 87 } 82 88 -
trunk/Source/WebCore/bindings/js/JSEventConstructors.cpp
r94147 r94771 32 32 #include "JSDictionary.h" 33 33 #include "JSEvent.h" 34 #include "JSProgressEvent.h" 35 #include "ProgressEvent.h" 34 36 #include <runtime/Error.h> 35 37 -
trunk/Source/WebCore/dom/ProgressEvent.cpp
r72985 r94771 28 28 29 29 namespace WebCore { 30 30 31 ProgressEventInit::ProgressEventInit() 32 : lengthComputable(false) 33 , loaded(0) 34 , total(0) 35 { 36 } 37 31 38 ProgressEvent::ProgressEvent() 32 39 : m_lengthComputable(false) 33 40 , m_loaded(0) 34 41 , m_total(0) 42 { 43 } 44 45 ProgressEvent::ProgressEvent(const AtomicString& type, const ProgressEventInit& initializer) 46 : Event(type, initializer) 47 , m_lengthComputable(initializer.lengthComputable) 48 , m_loaded(initializer.loaded) 49 , m_total(initializer.total) 35 50 { 36 51 } -
trunk/Source/WebCore/dom/ProgressEvent.h
r72985 r94771 30 30 31 31 namespace WebCore { 32 32 33 struct ProgressEventInit : public EventInit { 34 ProgressEventInit(); 35 36 bool lengthComputable; 37 unsigned long long loaded; 38 unsigned long long total; 39 }; 40 33 41 class ProgressEvent : public Event { 34 42 public: … … 40 48 { 41 49 return adoptRef(new ProgressEvent(type, lengthComputable, loaded, total)); 50 } 51 static PassRefPtr<ProgressEvent> create(const AtomicString& type, const ProgressEventInit& initializer) 52 { 53 return adoptRef(new ProgressEvent(type, initializer)); 42 54 } 43 55 … … 52 64 ProgressEvent(); 53 65 ProgressEvent(const AtomicString& type, bool lengthComputable, unsigned long long loaded, unsigned long long total); 66 ProgressEvent(const AtomicString&, const ProgressEventInit&); 54 67 55 68 private: -
trunk/Source/WebCore/dom/ProgressEvent.idl
r91617 r94771 26 26 module events { 27 27 28 interface ProgressEvent : Event { 28 interface [ 29 CanBeConstructed, 30 CustomConstructFunction 31 ] ProgressEvent : Event { 29 32 readonly attribute boolean lengthComputable; 30 33 readonly attribute unsigned long long loaded;
Note: See TracChangeset
for help on using the changeset viewer.