Title: [205024] trunk
Revision
205024
Author
eric.carl...@apple.com
Date
2016-08-26 10:13:35 -0700 (Fri, 26 Aug 2016)

Log Message

[MediaStream] Add support for OverConstrainedErrorEvent
https://bugs.webkit.org/show_bug.cgi?id=161199
<rdar://problem/28011819>

Reviewed by Jer Noble.

Source/WebCore:

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

* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/OverconstrainedErrorEvent.h: Added.
(WebCore::OverconstrainedErrorEvent::~OverconstrainedErrorEvent):
(WebCore::OverconstrainedErrorEvent::create):
(WebCore::OverconstrainedErrorEvent::createForBindings):
(WebCore::OverconstrainedErrorEvent::error):
(WebCore::OverconstrainedErrorEvent::eventInterface):
(WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent):
* Modules/mediastream/OverconstrainedErrorEvent.idl: Added.

* WebCore.xcodeproj/project.pbxproj: Add new files.

* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue): Add OverconstrainedErrorEvent converter.
* bindings/js/JSDictionary.h:

* dom/EventNames.in: Add OverconstrainedErrorEvent.

LayoutTests:

* fast/events/constructors/overconstrained-error-event-constructor-expected.txt: Added.
* fast/events/constructors/overconstrained-error-event-constructor.html: Added.
* js/dom/global-constructors-attributes-expected.txt: Updated.
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (205023 => 205024)


--- trunk/LayoutTests/ChangeLog	2016-08-26 17:05:21 UTC (rev 205023)
+++ trunk/LayoutTests/ChangeLog	2016-08-26 17:13:35 UTC (rev 205024)
@@ -1,3 +1,19 @@
+2016-08-26  Eric Carlson  <eric.carl...@apple.com>
+
+        [MediaStream] Add support for OverConstrainedErrorEvent
+        https://bugs.webkit.org/show_bug.cgi?id=161199
+        <rdar://problem/28011819>
+
+        Reviewed by Jer Noble.
+
+        * fast/events/constructors/overconstrained-error-event-constructor-expected.txt: Added.
+        * fast/events/constructors/overconstrained-error-event-constructor.html: Added.
+        * js/dom/global-constructors-attributes-expected.txt: Updated.
+        * platform/gtk/js/dom/global-constructors-attributes-expected.txt:
+        * platform/mac/js/dom/global-constructors-attributes-expected.txt:
+        * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
+        * platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
+
 2016-08-26  Frederic Wang  <fw...@igalia.com>
 
         The annotation-xml element does not need to be behave as an mrow

Added: trunk/LayoutTests/fast/events/constructors/overconstrained-error-event-constructor-expected.txt (0 => 205024)


--- trunk/LayoutTests/fast/events/constructors/overconstrained-error-event-constructor-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/constructors/overconstrained-error-event-constructor-expected.txt	2016-08-26 17:13:35 UTC (rev 205024)
@@ -0,0 +1,26 @@
+This tests the constructor for the OverconstrainedErrorEvent DOM class.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS new OverconstrainedErrorEvent('eventType').bubbles is false
+PASS new OverconstrainedErrorEvent('eventType').cancelable is false
+PASS new OverconstrainedErrorEvent('eventType').error is null
+PASS new OverconstrainedErrorEvent('eventType', { bubbles: false }).bubbles is false
+PASS new OverconstrainedErrorEvent('eventType', { bubbles: true }).bubbles is true
+PASS new OverconstrainedErrorEvent('eventType', { cancelable: false }).cancelable is false
+PASS new OverconstrainedErrorEvent('eventType', { cancelable: true }).cancelable is true
+PASS new OverconstrainedErrorEvent('eventType', { error: new OverconstrainedError() }).error.constraint is ""
+PASS new OverconstrainedErrorEvent('eventType', { error: new OverconstrainedError() }).error.message is ""
+PASS new OverconstrainedErrorEvent('eventType', { error: new OverconstrainedError('width') }).error.constraint is "width"
+PASS new OverconstrainedErrorEvent('eventType', { error: new OverconstrainedError('fred', 'unsupported constraint') }).error.message is "unsupported constraint"
+PASS new OverconstrainedErrorEvent('eventType', { error: null }).reason is undefined.
+PASS new OverconstrainedErrorEvent('eventType', { error: 'fake error' }).error is null
+PASS new OverconstrainedErrorEvent('eventType', { error: [] }).error is null
+PASS new OverconstrainedErrorEvent('eventType', { bubbles: true, cancelable: true, error: new OverconstrainedError() }).bubbles is true
+PASS new OverconstrainedErrorEvent('eventType', { bubbles: true, cancelable: true, error: new OverconstrainedError() }).cancelable is true
+PASS new OverconstrainedErrorEvent('eventType', { bubbles: true, cancelable: true, error: new OverconstrainedError('bogus') }).error.constraint is "bogus"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/events/constructors/overconstrained-error-event-constructor.html (0 => 205024)


--- trunk/LayoutTests/fast/events/constructors/overconstrained-error-event-constructor.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/constructors/overconstrained-error-event-constructor.html	2016-08-26 17:13:35 UTC (rev 205024)
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <script src=""
+    </head>
+<body>
+    <script>
+
+    (() => {
+        description("This tests the constructor for the OverconstrainedErrorEvent DOM class.");
+
+        if (!window.OverconstrainedErrorEvent) {
+            testFailed('window.OverconstrainedErrorEvent not defined!');
+            finishJSTest();
+            return;
+        } 
+
+        // No initializer is passed.
+        shouldBe("new OverconstrainedErrorEvent('eventType').bubbles", "false");
+        shouldBe("new OverconstrainedErrorEvent('eventType').cancelable", "false");
+        shouldBeNull("new OverconstrainedErrorEvent('eventType').error", null);
+
+        // bubbles is passed.
+        shouldBe("new OverconstrainedErrorEvent('eventType', { bubbles: false }).bubbles", "false");
+        shouldBe("new OverconstrainedErrorEvent('eventType', { bubbles: true }).bubbles", "true");
+
+        // cancelable is passed.
+        shouldBe("new OverconstrainedErrorEvent('eventType', { cancelable: false }).cancelable", "false");
+        shouldBe("new OverconstrainedErrorEvent('eventType', { cancelable: true }).cancelable", "true");
+
+        // error is passed.
+        shouldBeEqualToString("new OverconstrainedErrorEvent('eventType', { error: new OverconstrainedError() }).error.constraint", "");
+        shouldBeEqualToString("new OverconstrainedErrorEvent('eventType', { error: new OverconstrainedError() }).error.message", "");
+        shouldBeEqualToString("new OverconstrainedErrorEvent('eventType', { error: new OverconstrainedError('width') }).error.constraint", "width");
+        shouldBeEqualToString("new OverconstrainedErrorEvent('eventType', { error: new OverconstrainedError('fred', 'unsupported constraint') }).error.message", "unsupported constraint");
+
+        shouldBeUndefined("new OverconstrainedErrorEvent('eventType', { error: null }).reason");
+        shouldBeNull("new OverconstrainedErrorEvent('eventType', { error: 'fake error' }).error", null);
+        shouldBeNull("new OverconstrainedErrorEvent('eventType', { error: [] }).error", null);
+
+        // All initializers are passed.
+        shouldBe("new OverconstrainedErrorEvent('eventType', { bubbles: true, cancelable: true, error: new OverconstrainedError() }).bubbles", "true");
+        shouldBe("new OverconstrainedErrorEvent('eventType', { bubbles: true, cancelable: true, error: new OverconstrainedError() }).cancelable", "true");
+        shouldBeEqualToString("new OverconstrainedErrorEvent('eventType', { bubbles: true, cancelable: true, error: new OverconstrainedError('bogus') }).error.constraint", "bogus");
+    })();
+
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/LayoutTests/js/dom/global-constructors-attributes-expected.txt (205023 => 205024)


--- trunk/LayoutTests/js/dom/global-constructors-attributes-expected.txt	2016-08-26 17:05:21 UTC (rev 205023)
+++ trunk/LayoutTests/js/dom/global-constructors-attributes-expected.txt	2016-08-26 17:13:35 UTC (rev 205024)
@@ -923,11 +923,6 @@
 PASS Object.getOwnPropertyDescriptor(global, 'OscillatorNode').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'OscillatorNode').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'OscillatorNode').configurable is true
-PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedError').value is OverconstrainedError
-PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedError').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedError').hasOwnProperty('set') is false
-PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedError').enumerable is false
-PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedError').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'OverflowEvent').value is OverflowEvent
 PASS Object.getOwnPropertyDescriptor(global, 'OverflowEvent').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'OverflowEvent').hasOwnProperty('set') is false

Modified: trunk/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt (205023 => 205024)


--- trunk/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt	2016-08-26 17:05:21 UTC (rev 205023)
+++ trunk/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt	2016-08-26 17:13:35 UTC (rev 205024)
@@ -1088,6 +1088,16 @@
 PASS Object.getOwnPropertyDescriptor(global, 'OscillatorNode').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'OscillatorNode').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'OscillatorNode').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedError').value is OverconstrainedError
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedError').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedError').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedError').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedError').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').value is OverconstrainedErrorEvent
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'OverflowEvent').value is OverflowEvent
 PASS Object.getOwnPropertyDescriptor(global, 'OverflowEvent').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'OverflowEvent').hasOwnProperty('set') is false

Modified: trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt (205023 => 205024)


--- trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt	2016-08-26 17:05:21 UTC (rev 205023)
+++ trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt	2016-08-26 17:13:35 UTC (rev 205024)
@@ -1113,6 +1113,11 @@
 PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedError').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedError').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedError').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').value is OverconstrainedErrorEvent
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'OverflowEvent').value is OverflowEvent
 PASS Object.getOwnPropertyDescriptor(global, 'OverflowEvent').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'OverflowEvent').hasOwnProperty('set') is false

Modified: trunk/LayoutTests/platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt (205023 => 205024)


--- trunk/LayoutTests/platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt	2016-08-26 17:05:21 UTC (rev 205023)
+++ trunk/LayoutTests/platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt	2016-08-26 17:13:35 UTC (rev 205024)
@@ -1098,6 +1098,11 @@
 PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedError').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedError').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedError').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').value is OverconstrainedErrorEvent
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'OverflowEvent').value is OverflowEvent
 PASS Object.getOwnPropertyDescriptor(global, 'OverflowEvent').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'OverflowEvent').hasOwnProperty('set') is false

Modified: trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt (205023 => 205024)


--- trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt	2016-08-26 17:05:21 UTC (rev 205023)
+++ trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt	2016-08-26 17:13:35 UTC (rev 205024)
@@ -1113,6 +1113,11 @@
 PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedError').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedError').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedError').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').value is OverconstrainedErrorEvent
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'OverconstrainedErrorEvent').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'OverflowEvent').value is OverflowEvent
 PASS Object.getOwnPropertyDescriptor(global, 'OverflowEvent').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'OverflowEvent').hasOwnProperty('set') is false

Modified: trunk/Source/WebCore/CMakeLists.txt (205023 => 205024)


--- trunk/Source/WebCore/CMakeLists.txt	2016-08-26 17:05:21 UTC (rev 205023)
+++ trunk/Source/WebCore/CMakeLists.txt	2016-08-26 17:13:35 UTC (rev 205024)
@@ -229,6 +229,8 @@
     Modules/mediastream/MediaTrackSupportedConstraints.idl
     Modules/mediastream/NavigatorMediaDevices.idl
     Modules/mediastream/NavigatorUserMedia.idl
+    Modules/mediastream/OverconstrainedError.idl
+    Modules/mediastream/OverconstrainedErrorEvent.idl
     Modules/mediastream/RTCConfiguration.idl
     Modules/mediastream/RTCDTMFSender.idl
     Modules/mediastream/RTCDTMFToneChangeEvent.idl

Modified: trunk/Source/WebCore/ChangeLog (205023 => 205024)


--- trunk/Source/WebCore/ChangeLog	2016-08-26 17:05:21 UTC (rev 205023)
+++ trunk/Source/WebCore/ChangeLog	2016-08-26 17:13:35 UTC (rev 205024)
@@ -1,3 +1,32 @@
+2016-08-26  Eric Carlson  <eric.carl...@apple.com>
+
+        [MediaStream] Add support for OverConstrainedErrorEvent
+        https://bugs.webkit.org/show_bug.cgi?id=161199
+        <rdar://problem/28011819>
+
+        Reviewed by Jer Noble.
+
+        Test: fast/events/constructors/overconstrained-error-event-constructor.html
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * Modules/mediastream/OverconstrainedErrorEvent.h: Added.
+        (WebCore::OverconstrainedErrorEvent::~OverconstrainedErrorEvent):
+        (WebCore::OverconstrainedErrorEvent::create):
+        (WebCore::OverconstrainedErrorEvent::createForBindings):
+        (WebCore::OverconstrainedErrorEvent::error):
+        (WebCore::OverconstrainedErrorEvent::eventInterface):
+        (WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent):
+        * Modules/mediastream/OverconstrainedErrorEvent.idl: Added.
+
+        * WebCore.xcodeproj/project.pbxproj: Add new files.
+
+        * bindings/js/JSDictionary.cpp:
+        (WebCore::JSDictionary::convertValue): Add OverconstrainedErrorEvent converter.
+        * bindings/js/JSDictionary.h:
+
+        * dom/EventNames.in: Add OverconstrainedErrorEvent.
+
 2016-08-26  Frederic Wang  <fw...@igalia.com>
 
         The annotation-xml element does not need to be behave as an mrow

Modified: trunk/Source/WebCore/DerivedSources.make (205023 => 205024)


--- trunk/Source/WebCore/DerivedSources.make	2016-08-26 17:05:21 UTC (rev 205023)
+++ trunk/Source/WebCore/DerivedSources.make	2016-08-26 17:13:35 UTC (rev 205024)
@@ -147,6 +147,7 @@
     $(WebCore)/Modules/mediastream/NavigatorMediaDevices.idl \
     $(WebCore)/Modules/mediastream/NavigatorUserMedia.idl \
     $(WebCore)/Modules/mediastream/OverconstrainedError.idl \
+    $(WebCore)/Modules/mediastream/OverconstrainedErrorEvent.idl \
     $(WebCore)/Modules/mediastream/RTCConfiguration.idl \
     $(WebCore)/Modules/mediastream/RTCDTMFSender.idl \
     $(WebCore)/Modules/mediastream/RTCDTMFToneChangeEvent.idl \

Added: trunk/Source/WebCore/Modules/mediastream/OverconstrainedErrorEvent.h (0 => 205024)


--- trunk/Source/WebCore/Modules/mediastream/OverconstrainedErrorEvent.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/OverconstrainedErrorEvent.h	2016-08-26 17:13:35 UTC (rev 205024)
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "Event.h"
+#include "OverconstrainedError.h"
+#include <wtf/text/AtomicString.h>
+
+namespace WebCore {
+
+struct OverconstrainedErrorEventInit : public EventInit {
+    RefPtr<OverconstrainedError> error;
+};
+
+class OverconstrainedErrorEvent : public Event {
+public:
+    virtual ~OverconstrainedErrorEvent() { }
+
+    static Ref<OverconstrainedErrorEvent> create(const AtomicString& type, bool canBubble, bool cancelable, OverconstrainedError* error)
+    {
+        return adoptRef(*new OverconstrainedErrorEvent(type, canBubble, cancelable, error));
+    }
+
+    static Ref<OverconstrainedErrorEvent> createForBindings(const AtomicString& type, const OverconstrainedErrorEventInit& initializer)
+    {
+        return adoptRef(*new OverconstrainedErrorEvent(type, initializer));
+    }
+
+    OverconstrainedError* error() const { return m_error.get(); }
+    virtual EventInterface eventInterface() const { return OverconstrainedErrorEventInterfaceType; }
+
+private:
+    explicit OverconstrainedErrorEvent(const AtomicString& type, bool canBubble, bool cancelable, OverconstrainedError* error)
+        : Event(type, canBubble, cancelable)
+        , m_error(error)
+    {
+    }
+    OverconstrainedErrorEvent(const AtomicString& type, const OverconstrainedErrorEventInit& initializer)
+        : Event(type, initializer)
+        , m_error(initializer.error)
+    {
+    }
+
+    RefPtr<OverconstrainedError> m_error;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)

Added: trunk/Source/WebCore/Modules/mediastream/OverconstrainedErrorEvent.idl (0 => 205024)


--- trunk/Source/WebCore/Modules/mediastream/OverconstrainedErrorEvent.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/OverconstrainedErrorEvent.idl	2016-08-26 17:13:35 UTC (rev 205024)
@@ -0,0 +1,35 @@
+/*
+* Copyright (C) 2016 Apple Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* 1.  Redistributions of source code must retain the above copyright
+*     notice, this list of conditions and the following disclaimer.
+* 2.  Redistributions in binary form must reproduce the above copyright
+*     notice, this list of conditions and the following disclaimer in the
+*     documentation and/or other materials provided with the distribution.
+* 3.  Neither the name of Apple Inc. ("Apple") nor the names of
+*     its contributors may be used to endorse or promote products derived
+*     from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+[
+    Conditional=MEDIA_STREAM,
+    ConstructorTemplate=Event,
+] interface OverconstrainedErrorEvent : Event {
+   [InitializedByEventConstructor] readonly attribute OverconstrainedError? error;
+};
+

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (205023 => 205024)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-08-26 17:05:21 UTC (rev 205023)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-08-26 17:13:35 UTC (rev 205024)
@@ -82,6 +82,8 @@
 		0704A4081D6DE9F10086DCDB /* OverconstrainedError.h in Headers */ = {isa = PBXBuildFile; fileRef = 0704A4051D6DE9F10086DCDB /* OverconstrainedError.h */; };
 		0704A40B1D6DFC690086DCDB /* JSOverconstrainedError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0704A4091D6DFC690086DCDB /* JSOverconstrainedError.cpp */; };
 		0704A40C1D6DFC690086DCDB /* JSOverconstrainedError.h in Headers */ = {isa = PBXBuildFile; fileRef = 0704A40A1D6DFC690086DCDB /* JSOverconstrainedError.h */; };
+		0704A4151D6F39FB0086DCDB /* JSOverconstrainedErrorEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0704A4131D6F39FB0086DCDB /* JSOverconstrainedErrorEvent.cpp */; };
+		0704A4161D6F39FB0086DCDB /* JSOverconstrainedErrorEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 0704A4141D6F39FB0086DCDB /* JSOverconstrainedErrorEvent.h */; };
 		0705852117FDC140005F2BCB /* MediaTrackConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0705851D17FDC140005F2BCB /* MediaTrackConstraint.h */; };
 		0705852317FDC140005F2BCB /* MediaTrackConstraints.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0705851F17FDC140005F2BCB /* MediaTrackConstraints.cpp */; };
 		0705852417FDC140005F2BCB /* MediaTrackConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 0705852017FDC140005F2BCB /* MediaTrackConstraints.h */; };
@@ -136,6 +138,7 @@
 		07277E5517D018CC0015534D /* JSMediaStreamTrackEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 07277E4917D018CC0015534D /* JSMediaStreamTrackEvent.h */; };
 		07297FA71C1881C5003F0735 /* UserMediaPermissionCheck.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07297FA51C1881C5003F0735 /* UserMediaPermissionCheck.cpp */; };
 		07297FA81C1881C5003F0735 /* UserMediaPermissionCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = 07297FA61C1881C5003F0735 /* UserMediaPermissionCheck.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		072A70401D6E8F6200DF0AFC /* OverconstrainedErrorEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 072A703E1D6E8F6200DF0AFC /* OverconstrainedErrorEvent.h */; };
 		072AE1E5183C0741000A5988 /* PluginReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 072AE1DF183C0741000A5988 /* PluginReplacement.h */; };
 		072AE1E6183C0741000A5988 /* QuickTimePluginReplacement.mm in Sources */ = {isa = PBXBuildFile; fileRef = 072AE1E0183C0741000A5988 /* QuickTimePluginReplacement.mm */; };
 		072AE1E8183C0741000A5988 /* QuickTimePluginReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 072AE1E2183C0741000A5988 /* QuickTimePluginReplacement.h */; };
@@ -6789,6 +6792,8 @@
 		0704A4051D6DE9F10086DCDB /* OverconstrainedError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverconstrainedError.h; sourceTree = "<group>"; };
 		0704A4091D6DFC690086DCDB /* JSOverconstrainedError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSOverconstrainedError.cpp; sourceTree = "<group>"; };
 		0704A40A1D6DFC690086DCDB /* JSOverconstrainedError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSOverconstrainedError.h; sourceTree = "<group>"; };
+		0704A4131D6F39FB0086DCDB /* JSOverconstrainedErrorEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSOverconstrainedErrorEvent.cpp; path = JSOverconstrainedErrorEvent.cpp; sourceTree = "<group>"; };
+		0704A4141D6F39FB0086DCDB /* JSOverconstrainedErrorEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSOverconstrainedErrorEvent.h; path = JSOverconstrainedErrorEvent.h; sourceTree = "<group>"; };
 		0705851C17FDB23C005F2BCB /* MediaTrackConstraints.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = MediaTrackConstraints.idl; sourceTree = "<group>"; };
 		0705851D17FDC140005F2BCB /* MediaTrackConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaTrackConstraint.h; sourceTree = "<group>"; };
 		0705851E17FDC140005F2BCB /* MediaTrackConstraint.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaTrackConstraint.idl; sourceTree = "<group>"; };
@@ -6917,6 +6922,8 @@
 		072847E216EBC5B00043CFA4 /* PlatformTextTrack.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformTextTrack.h; sourceTree = "<group>"; };
 		07297FA51C1881C5003F0735 /* UserMediaPermissionCheck.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMediaPermissionCheck.cpp; sourceTree = "<group>"; };
 		07297FA61C1881C5003F0735 /* UserMediaPermissionCheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserMediaPermissionCheck.h; sourceTree = "<group>"; };
+		072A703E1D6E8F6200DF0AFC /* OverconstrainedErrorEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverconstrainedErrorEvent.h; sourceTree = "<group>"; };
+		072A703F1D6E8F6200DF0AFC /* OverconstrainedErrorEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OverconstrainedErrorEvent.idl; sourceTree = "<group>"; };
 		072AE1DF183C0741000A5988 /* PluginReplacement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginReplacement.h; sourceTree = "<group>"; };
 		072AE1E0183C0741000A5988 /* QuickTimePluginReplacement.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = QuickTimePluginReplacement.mm; sourceTree = "<group>"; };
 		072AE1E1183C0741000A5988 /* QuickTimePluginReplacement.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = QuickTimePluginReplacement.css; sourceTree = "<group>"; };
@@ -14415,6 +14422,8 @@
 				419BE75A1BCBD3ED00E1C85B /* NavigatorUserMedia.js */,
 				0704A4031D6DE9F10086DCDB /* OverconstrainedError.idl */,
 				0704A4051D6DE9F10086DCDB /* OverconstrainedError.h */,
+				072A703E1D6E8F6200DF0AFC /* OverconstrainedErrorEvent.h */,
+				072A703F1D6E8F6200DF0AFC /* OverconstrainedErrorEvent.idl */,
 				5E2C434D1BCEE2E50001E2BC /* PeerConnectionBackend.h */,
 				5E2C434E1BCEE2E50001E2BC /* PeerConnectionStates.h */,
 				5E2C434F1BCEE2E50001E2BC /* RTCConfiguration.cpp */,
@@ -14637,6 +14646,8 @@
 				073BE33F17D17E01002BD431 /* JSNavigatorUserMedia.h */,
 				0704A4091D6DFC690086DCDB /* JSOverconstrainedError.cpp */,
 				0704A40A1D6DFC690086DCDB /* JSOverconstrainedError.h */,
+				0704A4131D6F39FB0086DCDB /* JSOverconstrainedErrorEvent.cpp */,
+				0704A4141D6F39FB0086DCDB /* JSOverconstrainedErrorEvent.h */,
 				073794E319EE2FF200E5A045 /* JSRTCConfiguration.cpp */,
 				073794E419EE2FF200E5A045 /* JSRTCConfiguration.h */,
 				07969D9117D14151007FF842 /* JSRTCDataChannel.cpp */,
@@ -24076,7 +24087,6 @@
 				81AC5999131636E60009A7E0 /* DataTransferItem.h in Headers */,
 				81AC599A131636E60009A7E0 /* DataTransferItemList.h in Headers */,
 				E4A007831B820EC8002C5A6E /* DataURLDecoder.h in Headers */,
-				0704A40C1D6DFC690086DCDB /* JSOverconstrainedError.h in Headers */,
 				E4A007831B820EC8002C5A6E /* DataURLDecoder.h in Headers */,
 				A5732B0B136A161D005C8D7C /* DateComponents.h in Headers */,
 				F55B3DB61251F12D003EF269 /* DateInputType.h in Headers */,
@@ -24915,6 +24925,7 @@
 				1AE2AB220A1CE63B00B42B25 /* JSHTMLLabelElement.h in Headers */,
 				1AE2AB240A1CE63B00B42B25 /* JSHTMLLegendElement.h in Headers */,
 				1AE2AB260A1CE63B00B42B25 /* JSHTMLLIElement.h in Headers */,
+				072A70401D6E8F6200DF0AFC /* OverconstrainedErrorEvent.h in Headers */,
 				A80E7B0D0A19D606007FB8C5 /* JSHTMLLinkElement.h in Headers */,
 				1AE2AB280A1CE63B00B42B25 /* JSHTMLMapElement.h in Headers */,
 				BC491B790C023EFD009D6316 /* JSHTMLMarqueeElement.h in Headers */,
@@ -25028,6 +25039,8 @@
 				FDF6BAF9134A4C9800822920 /* JSOfflineAudioCompletionEvent.h in Headers */,
 				FDA9326716703BA9008982DC /* JSOfflineAudioContext.h in Headers */,
 				FDEA6243152102E200479DF0 /* JSOscillatorNode.h in Headers */,
+				0704A40C1D6DFC690086DCDB /* JSOverconstrainedError.h in Headers */,
+				0704A4161D6F39FB0086DCDB /* JSOverconstrainedErrorEvent.h in Headers */,
 				1A0D57410A5C7867007EDD4C /* JSOverflowEvent.h in Headers */,
 				E1284BB110449FFA00EAEB52 /* JSPageTransitionEvent.h in Headers */,
 				FDA15EB212B03EE1003A583A /* JSPannerNode.h in Headers */,
@@ -28701,6 +28714,8 @@
 				FDA9326616703BA9008982DC /* JSOfflineAudioContext.cpp in Sources */,
 				FDEA6242152102E200479DF0 /* JSOscillatorNode.cpp in Sources */,
 				FDBD1DFC167FE27D0051A11E /* JSOscillatorNodeCustom.cpp in Sources */,
+				0704A40B1D6DFC690086DCDB /* JSOverconstrainedError.cpp in Sources */,
+				0704A4151D6F39FB0086DCDB /* JSOverconstrainedErrorEvent.cpp in Sources */,
 				1A0D57400A5C7867007EDD4C /* JSOverflowEvent.cpp in Sources */,
 				E1284BB210449FFA00EAEB52 /* JSPageTransitionEvent.cpp in Sources */,
 				FDA15EB112B03EE1003A583A /* JSPannerNode.cpp in Sources */,
@@ -29658,7 +29673,6 @@
 				0F605AEC15F94848004DF0C0 /* ScrollingConstraints.cpp in Sources */,
 				1AF62EE714DA22A70041556C /* ScrollingCoordinator.cpp in Sources */,
 				0FC4E40E187F82E10045882C /* ScrollingCoordinatorIOS.mm in Sources */,
-				0704A40B1D6DFC690086DCDB /* JSOverconstrainedError.cpp in Sources */,
 				1AF62EE614DA22A70041556C /* ScrollingCoordinatorMac.mm in Sources */,
 				93C38BFE164473C700091EB2 /* ScrollingStateFixedNode.cpp in Sources */,
 				0FEA3E7C191B2FC5000F1B55 /* ScrollingStateFrameScrollingNode.cpp in Sources */,

Modified: trunk/Source/WebCore/bindings/js/JSDictionary.cpp (205023 => 205024)


--- trunk/Source/WebCore/bindings/js/JSDictionary.cpp	2016-08-26 17:05:21 UTC (rev 205023)
+++ trunk/Source/WebCore/bindings/js/JSDictionary.cpp	2016-08-26 17:13:35 UTC (rev 205024)
@@ -55,6 +55,7 @@
 #if ENABLE(MEDIA_STREAM)
 #include "JSMediaStream.h"
 #include "JSMediaStreamTrack.h"
+#include "JSOverconstrainedError.h"
 #endif
 
 #if ENABLE(WEB_RTC)
@@ -272,6 +273,11 @@
 {
     result = JSMediaStreamTrack::toWrapped(value);
 }
+
+void JSDictionary::convertValue(JSC::ExecState*, JSC::JSValue value, RefPtr<OverconstrainedError>& result)
+{
+    result = JSOverconstrainedError::toWrapped(value);
+}
 #endif
 
 #if ENABLE(WEB_RTC)

Modified: trunk/Source/WebCore/bindings/js/JSDictionary.h (205023 => 205024)


--- trunk/Source/WebCore/bindings/js/JSDictionary.h	2016-08-26 17:05:21 UTC (rev 205023)
+++ trunk/Source/WebCore/bindings/js/JSDictionary.h	2016-08-26 17:13:35 UTC (rev 205024)
@@ -52,6 +52,7 @@
 class MediaKeyError;
 class MediaStream;
 class MediaStreamTrack;
+class OverconstrainedError;
 class RTCRtpReceiver;
 class RTCRtpTransceiver;
 class Node;
@@ -151,6 +152,7 @@
 #if ENABLE(MEDIA_STREAM)
     static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr<MediaStream>& result);
     static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr<MediaStreamTrack>& result);
+    static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr<OverconstrainedError>& result);
 #endif
 #if ENABLE(WEB_RTC)
     static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr<RTCRtpReceiver>& result);

Modified: trunk/Source/WebCore/dom/EventNames.in (205023 => 205024)


--- trunk/Source/WebCore/dom/EventNames.in	2016-08-26 17:05:21 UTC (rev 205023)
+++ trunk/Source/WebCore/dom/EventNames.in	2016-08-26 17:13:35 UTC (rev 205024)
@@ -67,4 +67,4 @@
 GestureEvent conditional=IOS_GESTURE_EVENTS|MAC_GESTURE_EVENTS
 WebKitPlaybackTargetAvailabilityEvent conditional=WIRELESS_PLAYBACK_TARGET
 GamepadEvent conditional=GAMEPAD
-
+OverconstrainedErrorEvent conditional=MEDIA_STREAM
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to