- Revision
- 207019
- Author
- [email protected]
- Date
- 2016-10-10 13:57:37 -0700 (Mon, 10 Oct 2016)
Log Message
Update ProgressEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163221
Reviewed by Darin Adler.
Update ProgressEvent to stop using legacy [ConstructorTemplate=Event]
and use a regular constructor as in the specification:
- https://xhr.spec.whatwg.org/#firing-events-using-the-progressevent-interface
* dom/ProgressEvent.cpp:
(WebCore::ProgressEvent::ProgressEvent):
* dom/ProgressEvent.h:
(WebCore::ProgressEvent::create):
* dom/ProgressEvent.idl:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (207018 => 207019)
--- trunk/Source/WebCore/ChangeLog 2016-10-10 20:52:54 UTC (rev 207018)
+++ trunk/Source/WebCore/ChangeLog 2016-10-10 20:57:37 UTC (rev 207019)
@@ -1,3 +1,20 @@
+2016-10-10 Chris Dumez <[email protected]>
+
+ Update ProgressEvent to stop using legacy [ConstructorTemplate=Event]
+ https://bugs.webkit.org/show_bug.cgi?id=163221
+
+ Reviewed by Darin Adler.
+
+ Update ProgressEvent to stop using legacy [ConstructorTemplate=Event]
+ and use a regular constructor as in the specification:
+ - https://xhr.spec.whatwg.org/#firing-events-using-the-progressevent-interface
+
+ * dom/ProgressEvent.cpp:
+ (WebCore::ProgressEvent::ProgressEvent):
+ * dom/ProgressEvent.h:
+ (WebCore::ProgressEvent::create):
+ * dom/ProgressEvent.idl:
+
2016-10-10 Wenson Hsieh <[email protected]>
Address some review feedback from r206979 and r207010
Modified: trunk/Source/WebCore/dom/ProgressEvent.cpp (207018 => 207019)
--- trunk/Source/WebCore/dom/ProgressEvent.cpp 2016-10-10 20:52:54 UTC (rev 207018)
+++ trunk/Source/WebCore/dom/ProgressEvent.cpp 2016-10-10 20:57:37 UTC (rev 207019)
@@ -30,8 +30,8 @@
namespace WebCore {
-ProgressEvent::ProgressEvent(const AtomicString& type, const ProgressEventInit& initializer)
- : Event(type, initializer)
+ProgressEvent::ProgressEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
+ : Event(type, initializer, isTrusted)
, m_lengthComputable(initializer.lengthComputable)
, m_loaded(initializer.loaded)
, m_total(initializer.total)
Modified: trunk/Source/WebCore/dom/ProgressEvent.h (207018 => 207019)
--- trunk/Source/WebCore/dom/ProgressEvent.h 2016-10-10 20:52:54 UTC (rev 207018)
+++ trunk/Source/WebCore/dom/ProgressEvent.h 2016-10-10 20:57:37 UTC (rev 207019)
@@ -30,12 +30,6 @@
namespace WebCore {
-struct ProgressEventInit : public EventInit {
- bool lengthComputable { false };
- unsigned long long loaded { 0 };
- unsigned long long total { 0 };
-};
-
class ProgressEvent : public Event {
public:
static Ref<ProgressEvent> create(const AtomicString& type, bool lengthComputable, unsigned long long loaded, unsigned long long total)
@@ -42,9 +36,16 @@
{
return adoptRef(*new ProgressEvent(type, lengthComputable, loaded, total));
}
- static Ref<ProgressEvent> createForBindings(const AtomicString& type, const ProgressEventInit& initializer)
+
+ struct Init : EventInit {
+ bool lengthComputable { false };
+ unsigned long long loaded { 0 };
+ unsigned long long total { 0 };
+ };
+
+ static Ref<ProgressEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
{
- return adoptRef(*new ProgressEvent(type, initializer));
+ return adoptRef(*new ProgressEvent(type, initializer, isTrusted));
}
bool lengthComputable() const { return m_lengthComputable; }
@@ -55,7 +56,7 @@
protected:
ProgressEvent(const AtomicString& type, bool lengthComputable, unsigned long long loaded, unsigned long long total);
- ProgressEvent(const AtomicString&, const ProgressEventInit&);
+ ProgressEvent(const AtomicString&, const Init&, IsTrusted);
private:
bool m_lengthComputable;
Modified: trunk/Source/WebCore/dom/ProgressEvent.idl (207018 => 207019)
--- trunk/Source/WebCore/dom/ProgressEvent.idl 2016-10-10 20:52:54 UTC (rev 207018)
+++ trunk/Source/WebCore/dom/ProgressEvent.idl 2016-10-10 20:57:37 UTC (rev 207019)
@@ -24,7 +24,7 @@
*/
[
- ConstructorTemplate=Event,
+ Constructor(DOMString type, optional ProgressEventInit eventInitDict),
Exposed=(Window,Worker),
] interface ProgressEvent : Event {
[InitializedByEventConstructor] readonly attribute boolean lengthComputable;
@@ -32,3 +32,8 @@
[InitializedByEventConstructor] readonly attribute unsigned long long total;
};
+dictionary ProgressEventInit : EventInit {
+ boolean lengthComputable = false;
+ unsigned long long loaded = 0;
+ unsigned long long total = 0;
+};