Update UIRequestEvent to stop using legacy [ConstructorTemplate=Event]
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Oct 2016 23:07:35 +0000 (23:07 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Oct 2016 23:07:35 +0000 (23:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=163288

Reviewed by Darin Adler.

Update UIRequestEvent to stop using legacy [ConstructorTemplate=Event]
and use a constructor as in the specification:
- https://dvcs.w3.org/hg/IndieUI/raw-file/default/src/indie-ui-events.html#UIRequestEvent

* Modules/indieui/UIRequestEvent.cpp:
(WebCore::UIRequestEvent::create):
(WebCore::UIRequestEvent::UIRequestEvent):
(WebCore::UIRequestEvent::createForBindings): Deleted.
* Modules/indieui/UIRequestEvent.h:
* Modules/indieui/UIRequestEvent.idl:

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

Source/WebCore/ChangeLog
Source/WebCore/Modules/indieui/UIRequestEvent.cpp
Source/WebCore/Modules/indieui/UIRequestEvent.h
Source/WebCore/Modules/indieui/UIRequestEvent.idl

index c143370..0b6d172 100644 (file)
@@ -1,3 +1,21 @@
+2016-10-11  Chris Dumez  <cdumez@apple.com>
+
+        Update UIRequestEvent to stop using legacy [ConstructorTemplate=Event]
+        https://bugs.webkit.org/show_bug.cgi?id=163288
+
+        Reviewed by Darin Adler.
+
+        Update UIRequestEvent to stop using legacy [ConstructorTemplate=Event]
+        and use a constructor as in the specification:
+        - https://dvcs.w3.org/hg/IndieUI/raw-file/default/src/indie-ui-events.html#UIRequestEvent
+
+        * Modules/indieui/UIRequestEvent.cpp:
+        (WebCore::UIRequestEvent::create):
+        (WebCore::UIRequestEvent::UIRequestEvent):
+        (WebCore::UIRequestEvent::createForBindings): Deleted.
+        * Modules/indieui/UIRequestEvent.h:
+        * Modules/indieui/UIRequestEvent.idl:
+
 2016-10-11  Dean Jackson  <dino@apple.com>
 
         Implement prefers-reduced-motion media query
index e293f70..f06ecfc 100644 (file)
@@ -30,9 +30,9 @@
 
 namespace WebCore {
 
-Ref<UIRequestEvent> UIRequestEvent::createForBindings(const AtomicString& type, const UIRequestEventInit& initializer)
+Ref<UIRequestEvent> UIRequestEvent::create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
 {
-    return adoptRef(*new UIRequestEvent(type, initializer));
+    return adoptRef(*new UIRequestEvent(type, initializer, isTrusted));
 }
 
 Ref<UIRequestEvent> UIRequestEvent::create(const AtomicString& type, bool bubbles, bool cancelable, DOMWindow* view, int detail, RefPtr<EventTarget>&& receiver)
@@ -40,8 +40,8 @@ Ref<UIRequestEvent> UIRequestEvent::create(const AtomicString& type, bool bubble
     return adoptRef(*new UIRequestEvent(type, bubbles, cancelable, view, detail, WTFMove(receiver)));
 }
 
-UIRequestEvent::UIRequestEvent(const AtomicString& type, const UIRequestEventInit& initializer)
-    : UIEvent(type, initializer)
+UIRequestEvent::UIRequestEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
+    : UIEvent(type, initializer, isTrusted)
     , m_receiver(initializer.receiver)
 {
 }
index db182cf..dbc3c4a 100644 (file)
 #if ENABLE(INDIE_UI)
 
 namespace WebCore {
-    
-struct UIRequestEventInit : public UIEventInit {
-    RefPtr<EventTarget> receiver;
-};
 
 class UIRequestEvent : public UIEvent {
 public:
     static Ref<UIRequestEvent> create(const AtomicString& type, bool bubbles, bool cancelable, DOMWindow*, int detail, RefPtr<EventTarget>&& receiver);
-    static Ref<UIRequestEvent> createForBindings(const AtomicString& eventType, const UIRequestEventInit&);
+
+    struct Init : UIEventInit {
+        RefPtr<EventTarget> receiver;
+    };
+    static Ref<UIRequestEvent> create(const AtomicString& eventType, const Init&, IsTrusted = IsTrusted::No);
     
     virtual ~UIRequestEvent();
     
@@ -49,7 +49,7 @@ public:
 protected:
     UIRequestEvent(const AtomicString& type, bool bubbles, bool cancelable, DOMWindow*, int detail, RefPtr<EventTarget>&& receiver);
     
-    UIRequestEvent(const AtomicString& type, const UIRequestEventInit&);
+    UIRequestEvent(const AtomicString& type, const Init&, IsTrusted);
     
     EventInterface eventInterface() const override;
     
index 45efdec..a571dd9 100644 (file)
  
 [
     Conditional=INDIE_UI,
-    ConstructorTemplate=Event
+    Constructor(DOMString typeArg, optional UIRequestEventInit dictUIRequestEventInit),
 ] interface UIRequestEvent : UIEvent { 
     readonly attribute EventTarget receiver;
 };
 
+dictionary UIRequestEventInit : UIEventInit {
+    EventTarget? receiver = null;
+};