Diff
Modified: trunk/LayoutTests/ChangeLog (140304 => 140305)
--- trunk/LayoutTests/ChangeLog 2013-01-21 07:38:14 UTC (rev 140304)
+++ trunk/LayoutTests/ChangeLog 2013-01-21 07:45:23 UTC (rev 140305)
@@ -1,3 +1,24 @@
+2013-01-20 Kentaro Hara <[email protected]>
+
+ Implement MediaStreamEvent constructor
+ https://bugs.webkit.org/show_bug.cgi?id=107411
+
+ Reviewed by Adam Barth.
+
+ Spec: http://www.w3.org/TR/webrtc/#mediastreamevent
+
+ Test: fast/events/constructors/media-stream-event-constructor.html
+
+ * fast/events/constructors/media-stream-event-constructor-expected.txt: Added.
+ * fast/events/constructors/media-stream-event-constructor.html: Added.
+ * platform/chromium-android/TestExpectations:
+ * platform/efl/TestExpectations:
+ * platform/gtk/TestExpectations:
+ * platform/mac/TestExpectations:
+ * platform/qt/TestExpectations:
+ * platform/win/TestExpectations:
+ * platform/wincairo/TestExpectations:
+
2013-01-20 Mike Lawther <[email protected]>
CSS3 calc: unprefix implementation
Added: trunk/LayoutTests/fast/events/constructors/media-stream-event-constructor-expected.txt (0 => 140305)
--- trunk/LayoutTests/fast/events/constructors/media-stream-event-constructor-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/events/constructors/media-stream-event-constructor-expected.txt 2013-01-21 07:45:23 UTC (rev 140305)
@@ -0,0 +1,38 @@
+This tests the constructor for the MediaStreamEvent DOM class.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS new MediaStreamEvent('eventType').bubbles is false
+PASS new MediaStreamEvent('eventType').cancelable is false
+FAIL new MediaStreamEvent('eventType').data should be null (of type object). Was undefined (of type undefined).
+FAIL new MediaStreamEvent('eventType').origin should be (of type string). Was undefined (of type undefined).
+FAIL new MediaStreamEvent('eventType').lastEventId should be (of type string). Was undefined (of type undefined).
+PASS new MediaStreamEvent('eventType').stream is null
+FAIL new MediaStreamEvent('eventType').ports should be (of type object). Was undefined (of type undefined).
+PASS new MediaStreamEvent('eventType', { bubbles: false }).bubbles is false
+PASS new MediaStreamEvent('eventType', { bubbles: true }).bubbles is true
+PASS new MediaStreamEvent('eventType', { cancelable: false }).cancelable is false
+PASS new MediaStreamEvent('eventType', { cancelable: true }).cancelable is true
+PASS new MediaStreamEvent('eventType', { stream: mediaStream }).stream is mediaStream
+PASS new MediaStreamEvent('eventType', { stream: testObject }).stream is null
+PASS new MediaStreamEvent('eventType', { stream: document }).stream is null
+PASS new MediaStreamEvent('eventType', { stream: undefined }).stream is null
+PASS new MediaStreamEvent('eventType', { stream: null }).stream is null
+PASS new MediaStreamEvent('eventType', { stream: false }).stream is null
+PASS new MediaStreamEvent('eventType', { stream: true }).stream is null
+PASS new MediaStreamEvent('eventType', { stream: '' }).stream is null
+PASS new MediaStreamEvent('eventType', { stream: 'chocolate' }).stream is null
+PASS new MediaStreamEvent('eventType', { stream: 12345 }).stream is null
+PASS new MediaStreamEvent('eventType', { stream: 18446744073709551615 }).stream is null
+PASS new MediaStreamEvent('eventType', { stream: NaN }).stream is null
+PASS new MediaStreamEvent('eventType', { stream: {valueOf: function () { return window; } } }).stream == window is false
+PASS new MediaStreamEvent('eventType', { get stream() { return 123; } }).stream is null
+PASS new MediaStreamEvent('eventType', { get stream() { throw 'MediaStreamEvent Error'; } }) threw exception MediaStreamEvent Error.
+PASS new MediaStreamEvent('eventType', { bubbles: true, cancelable: true, stream: mediaStream }).bubbles is true
+PASS new MediaStreamEvent('eventType', { bubbles: true, cancelable: true, stream: mediaStream }).cancelable is true
+PASS new MediaStreamEvent('eventType', { bubbles: true, cancelable: true, stream: mediaStream }).stream is mediaStream
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/events/constructors/media-stream-event-constructor.html (0 => 140305)
--- trunk/LayoutTests/fast/events/constructors/media-stream-event-constructor.html (rev 0)
+++ trunk/LayoutTests/fast/events/constructors/media-stream-event-constructor.html 2013-01-21 07:45:23 UTC (rev 140305)
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script>
+
+description("This tests the constructor for the MediaStreamEvent DOM class.");
+
+var testObject = {nyannyan: 123};
+var mediaStream = new webkitMediaStream();
+
+// No initializer is passed.
+shouldBe("new MediaStreamEvent('eventType').bubbles", "false");
+shouldBe("new MediaStreamEvent('eventType').cancelable", "false");
+shouldBe("new MediaStreamEvent('eventType').data", "null");
+shouldBeEqualToString("new MediaStreamEvent('eventType').origin", "");
+shouldBeEqualToString("new MediaStreamEvent('eventType').lastEventId", "");
+shouldBe("new MediaStreamEvent('eventType').stream", "null");
+shouldBe("new MediaStreamEvent('eventType').ports", "[]");
+
+// bubbles is passed.
+shouldBe("new MediaStreamEvent('eventType', { bubbles: false }).bubbles", "false");
+shouldBe("new MediaStreamEvent('eventType', { bubbles: true }).bubbles", "true");
+
+// cancelable is passed.
+shouldBe("new MediaStreamEvent('eventType', { cancelable: false }).cancelable", "false");
+shouldBe("new MediaStreamEvent('eventType', { cancelable: true }).cancelable", "true");
+
+// stream is passed.
+// Valid object.
+shouldBe("new MediaStreamEvent('eventType', { stream: mediaStream }).stream", "mediaStream");
+
+// Invalid objects.
+shouldBe("new MediaStreamEvent('eventType', { stream: testObject }).stream", "null");
+shouldBe("new MediaStreamEvent('eventType', { stream: document }).stream", "null");
+shouldBe("new MediaStreamEvent('eventType', { stream: undefined }).stream", "null");
+shouldBe("new MediaStreamEvent('eventType', { stream: null }).stream", "null");
+shouldBe("new MediaStreamEvent('eventType', { stream: false }).stream", "null");
+shouldBe("new MediaStreamEvent('eventType', { stream: true }).stream", "null");
+shouldBe("new MediaStreamEvent('eventType', { stream: '' }).stream", "null");
+shouldBe("new MediaStreamEvent('eventType', { stream: 'chocolate' }).stream", "null");
+shouldBe("new MediaStreamEvent('eventType', { stream: 12345 }).stream", "null");
+shouldBe("new MediaStreamEvent('eventType', { stream: 18446744073709551615 }).stream", "null");
+shouldBe("new MediaStreamEvent('eventType', { stream: NaN }).stream", "null");
+// Note that valueOf() is not called, when the left hand side is evaluated.
+shouldBeFalse("new MediaStreamEvent('eventType', { stream: {valueOf: function () { return window; } } }).stream == window");
+shouldBe("new MediaStreamEvent('eventType', { get stream() { return 123; } }).stream", "null");
+shouldThrow("new MediaStreamEvent('eventType', { get stream() { throw 'MediaStreamEvent Error'; } })");
+
+// All initializers are passed.
+shouldBe("new MediaStreamEvent('eventType', { bubbles: true, cancelable: true, stream: mediaStream }).bubbles", "true");
+shouldBe("new MediaStreamEvent('eventType', { bubbles: true, cancelable: true, stream: mediaStream }).cancelable", "true");
+shouldBe("new MediaStreamEvent('eventType', { bubbles: true, cancelable: true, stream: mediaStream }).stream", "mediaStream");
+</script>
+<script src=""
+</body>
+</html>
Modified: trunk/LayoutTests/platform/chromium-android/TestExpectations (140304 => 140305)
--- trunk/LayoutTests/platform/chromium-android/TestExpectations 2013-01-21 07:38:14 UTC (rev 140304)
+++ trunk/LayoutTests/platform/chromium-android/TestExpectations 2013-01-21 07:45:23 UTC (rev 140305)
@@ -44,6 +44,7 @@
crbug.com/145338 fast/forms/datalist
crbug.com/145338 fast/forms/date
crbug.com/145338 fast/mediastream
+crbug.com/145338 fast/events/constructors/media-stream-event-constructor.html
crbug.com/145338 fast/notifications
crbug.com/145338 fast/speech
crbug.com/145338 http/tests/notifications
Modified: trunk/LayoutTests/platform/efl/TestExpectations (140304 => 140305)
--- trunk/LayoutTests/platform/efl/TestExpectations 2013-01-21 07:38:14 UTC (rev 140304)
+++ trunk/LayoutTests/platform/efl/TestExpectations 2013-01-21 07:45:23 UTC (rev 140305)
@@ -1231,6 +1231,7 @@
# Requires MEDIA_STREAM support.
webkit.org/b/87662 fast/mediastream [ Skip ]
+webkit.org/b/87662 fast/events/constructors/media-stream-event-constructor.html [ Skip ]
# The EFL port has no support for x-webkit-speech
webkit.org/b/95302 fast/speech [ Skip ]
Modified: trunk/LayoutTests/platform/gtk/TestExpectations (140304 => 140305)
--- trunk/LayoutTests/platform/gtk/TestExpectations 2013-01-21 07:38:14 UTC (rev 140304)
+++ trunk/LayoutTests/platform/gtk/TestExpectations 2013-01-21 07:45:23 UTC (rev 140305)
@@ -360,6 +360,7 @@
# Mediastream implementation is not complete yet.
webkit.org/b/79203 fast/mediastream [ Skip ]
+webkit.org/b/79203 fast/events/constructors/media-stream-event-constructor.html [ Skip ]
# CSS Variables are not yet enabled.
webkit.org/b/99057 fast/css/variables [ Skip ]
Modified: trunk/LayoutTests/platform/mac/TestExpectations (140304 => 140305)
--- trunk/LayoutTests/platform/mac/TestExpectations 2013-01-21 07:38:14 UTC (rev 140304)
+++ trunk/LayoutTests/platform/mac/TestExpectations 2013-01-21 07:45:23 UTC (rev 140305)
@@ -196,6 +196,7 @@
# Media Stream API is not yet enabled.
fast/mediastream
+fast/events/constructors/media-stream-event-constructor.html
# Needs to be fixed at image decoder layer for Safari.
fast/images/large-size-image-crash.html
Modified: trunk/LayoutTests/platform/qt/TestExpectations (140304 => 140305)
--- trunk/LayoutTests/platform/qt/TestExpectations 2013-01-21 07:38:14 UTC (rev 140304)
+++ trunk/LayoutTests/platform/qt/TestExpectations 2013-01-21 07:45:23 UTC (rev 140305)
@@ -99,6 +99,7 @@
# ENABLE(MEDIA_STREAM) is disabled.
fast/mediastream
+fast/events/constructors/media-stream-event-constructor.html
# ENABLE(DIRECTORY_UPLOAD) is disabled.
fast/forms/file/input-file-directory-upload.html
Modified: trunk/LayoutTests/platform/win/TestExpectations (140304 => 140305)
--- trunk/LayoutTests/platform/win/TestExpectations 2013-01-21 07:38:14 UTC (rev 140304)
+++ trunk/LayoutTests/platform/win/TestExpectations 2013-01-21 07:45:23 UTC (rev 140305)
@@ -1205,6 +1205,7 @@
# Media Stream API is not yet enabled.
fast/mediastream
+fast/events/constructors/media-stream-event-constructor.html
# Needs to be fixed at image decoder layer for Safari.
fast/images/large-size-image-crash.html
Modified: trunk/LayoutTests/platform/wincairo/TestExpectations (140304 => 140305)
--- trunk/LayoutTests/platform/wincairo/TestExpectations 2013-01-21 07:38:14 UTC (rev 140304)
+++ trunk/LayoutTests/platform/wincairo/TestExpectations 2013-01-21 07:45:23 UTC (rev 140305)
@@ -1732,6 +1732,7 @@
# Media Stream API is not yet enabled.
fast/mediastream
+fast/events/constructors/media-stream-event-constructor.html
# Needs to be fixed at image decoder layer for Safari.
fast/images/large-size-image-crash.html
Modified: trunk/Source/WebCore/ChangeLog (140304 => 140305)
--- trunk/Source/WebCore/ChangeLog 2013-01-21 07:38:14 UTC (rev 140304)
+++ trunk/Source/WebCore/ChangeLog 2013-01-21 07:45:23 UTC (rev 140305)
@@ -1,3 +1,35 @@
+2013-01-20 Kentaro Hara <[email protected]>
+
+ Implement MediaStreamEvent constructor
+ https://bugs.webkit.org/show_bug.cgi?id=107411
+
+ Reviewed by Adam Barth.
+
+ Spec: http://www.w3.org/TR/webrtc/#mediastreamevent
+
+ Test: fast/events/constructors/media-stream-event-constructor.html
+
+ * Modules/mediastream/MediaStreamEvent.cpp:
+ (WebCore::MediaStreamEventInit::MediaStreamEventInit):
+ (WebCore):
+ (WebCore::MediaStreamEvent::create):
+ (WebCore::MediaStreamEvent::MediaStreamEvent):
+ * Modules/mediastream/MediaStreamEvent.h:
+ (MediaStreamEventInit):
+ (WebCore):
+ (MediaStreamEvent):
+ * Modules/mediastream/MediaStreamEvent.idl:
+ * bindings/js/JSDictionary.cpp:
+ (WebCore):
+ (WebCore::JSDictionary::convertValue):
+ * bindings/js/JSDictionary.h:
+ (WebCore):
+ * bindings/v8/Dictionary.cpp:
+ (WebCore):
+ (WebCore::Dictionary::get):
+ * bindings/v8/Dictionary.h:
+ (Dictionary):
+
2013-01-20 Vladislav Kaznacheev <[email protected]>
Web Inspector: Allow SplitView to change orientation after the construction.
Modified: trunk/Source/WebCore/Modules/mediastream/MediaStreamEvent.cpp (140304 => 140305)
--- trunk/Source/WebCore/Modules/mediastream/MediaStreamEvent.cpp 2013-01-21 07:38:14 UTC (rev 140304)
+++ trunk/Source/WebCore/Modules/mediastream/MediaStreamEvent.cpp 2013-01-21 07:45:23 UTC (rev 140305)
@@ -32,6 +32,11 @@
namespace WebCore {
+MediaStreamEventInit::MediaStreamEventInit()
+ : stream(0)
+{
+}
+
PassRefPtr<MediaStreamEvent> MediaStreamEvent::create()
{
return adoptRef(new MediaStreamEvent);
@@ -42,6 +47,10 @@
return adoptRef(new MediaStreamEvent(type, canBubble, cancelable, stream));
}
+PassRefPtr<MediaStreamEvent> MediaStreamEvent::create(const AtomicString& type, const MediaStreamEventInit& initializer)
+{
+ return adoptRef(new MediaStreamEvent(type, initializer));
+}
MediaStreamEvent::MediaStreamEvent()
{
@@ -53,6 +62,12 @@
{
}
+MediaStreamEvent::MediaStreamEvent(const AtomicString& type, const MediaStreamEventInit& initializer)
+ : Event(type, initializer)
+ , m_stream(initializer.stream)
+{
+}
+
MediaStreamEvent::~MediaStreamEvent()
{
}
Modified: trunk/Source/WebCore/Modules/mediastream/MediaStreamEvent.h (140304 => 140305)
--- trunk/Source/WebCore/Modules/mediastream/MediaStreamEvent.h 2013-01-21 07:38:14 UTC (rev 140304)
+++ trunk/Source/WebCore/Modules/mediastream/MediaStreamEvent.h 2013-01-21 07:45:23 UTC (rev 140305)
@@ -33,12 +33,19 @@
namespace WebCore {
+struct MediaStreamEventInit : public EventInit {
+ MediaStreamEventInit();
+
+ RefPtr<MediaStream> stream;
+};
+
class MediaStreamEvent : public Event {
public:
virtual ~MediaStreamEvent();
static PassRefPtr<MediaStreamEvent> create();
static PassRefPtr<MediaStreamEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStream>);
+ static PassRefPtr<MediaStreamEvent> create(const AtomicString& type, const MediaStreamEventInit& initializer);
MediaStream* stream() const;
@@ -47,6 +54,7 @@
private:
MediaStreamEvent();
MediaStreamEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStream>);
+ MediaStreamEvent(const AtomicString& type, const MediaStreamEventInit&);
RefPtr<MediaStream> m_stream;
};
Modified: trunk/Source/WebCore/Modules/mediastream/MediaStreamEvent.idl (140304 => 140305)
--- trunk/Source/WebCore/Modules/mediastream/MediaStreamEvent.idl 2013-01-21 07:38:14 UTC (rev 140304)
+++ trunk/Source/WebCore/Modules/mediastream/MediaStreamEvent.idl 2013-01-21 07:45:23 UTC (rev 140305)
@@ -22,11 +22,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// According to the WHATWG specification:
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/video-conferencing-and-peer-to-peer-communication.html#mediastreamevent
[
Conditional=MEDIA_STREAM,
+ ConstructorTemplate=Event
] interface MediaStreamEvent : Event {
- readonly attribute MediaStream stream;
+ [InitializedByEventConstructor] readonly attribute MediaStream stream;
};
Modified: trunk/Source/WebCore/bindings/js/JSDictionary.cpp (140304 => 140305)
--- trunk/Source/WebCore/bindings/js/JSDictionary.cpp 2013-01-21 07:38:14 UTC (rev 140304)
+++ trunk/Source/WebCore/bindings/js/JSDictionary.cpp 2013-01-21 07:45:23 UTC (rev 140305)
@@ -45,6 +45,10 @@
#include "JSMediaKeyError.h"
#endif
+#if ENABLE(MEDIA_STREAM)
+#include "JSMediaStream.h"
+#endif
+
using namespace JSC;
namespace WebCore {
@@ -215,6 +219,13 @@
}
#endif
+#if ENABLE(MEDIA_STREAM)
+void JSDictionary::convertValue(JSC::ExecState*, JSC::JSValue value, RefPtr<MediaStream>& result)
+{
+ result = toMediaStream(value);
+}
+#endif
+
bool JSDictionary::getWithUndefinedOrNullCheck(const String& propertyName, String& result) const
{
ASSERT(isValid());
Modified: trunk/Source/WebCore/bindings/js/JSDictionary.h (140304 => 140305)
--- trunk/Source/WebCore/bindings/js/JSDictionary.h 2013-01-21 07:38:14 UTC (rev 140304)
+++ trunk/Source/WebCore/bindings/js/JSDictionary.h 2013-01-21 07:45:23 UTC (rev 140305)
@@ -40,6 +40,7 @@
class DOMWindow;
class EventTarget;
class MediaKeyError;
+class MediaStream;
class Node;
class ScriptValue;
class SerializedScriptValue;
@@ -115,6 +116,9 @@
#if ENABLE(ENCRYPTED_MEDIA)
static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr<MediaKeyError>& result);
#endif
+#if ENABLE(MEDIA_STREAM)
+ static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr<MediaStream>& result);
+#endif
JSC::ExecState* m_exec;
JSC::Strong<JSC::JSObject> m_initializerObject;
Modified: trunk/Source/WebCore/bindings/v8/Dictionary.cpp (140304 => 140305)
--- trunk/Source/WebCore/bindings/v8/Dictionary.cpp 2013-01-21 07:38:14 UTC (rev 140304)
+++ trunk/Source/WebCore/bindings/v8/Dictionary.cpp 2013-01-21 07:45:23 UTC (rev 140305)
@@ -58,6 +58,11 @@
#include "V8SpeechRecognitionResultList.h"
#endif
+#if ENABLE(MEDIA_STREAM)
+#include "MediaStream.h"
+#include "V8MediaStream.h"
+#endif
+
namespace WebCore {
Dictionary::Dictionary()
@@ -434,6 +439,25 @@
#endif
+#if ENABLE(MEDIA_STREAM)
+bool Dictionary::get(const String& key, RefPtr<MediaStream>& value) const
+{
+ v8::Local<v8::Value> v8Value;
+ if (!getKey(key, v8Value))
+ return false;
+
+ MediaStream* stream = 0;
+ if (v8Value->IsObject()) {
+ v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value);
+ v8::Handle<v8::Object> error = wrapper->FindInstanceInPrototypeChain(V8MediaStream::GetTemplate());
+ if (!error.IsEmpty())
+ stream = V8MediaStream::toNative(error);
+ }
+ value = stream;
+ return true;
+}
+#endif
+
bool Dictionary::get(const String& key, Dictionary& value) const
{
v8::Local<v8::Value> v8Value;
Modified: trunk/Source/WebCore/bindings/v8/Dictionary.h (140304 => 140305)
--- trunk/Source/WebCore/bindings/v8/Dictionary.h 2013-01-21 07:38:14 UTC (rev 140304)
+++ trunk/Source/WebCore/bindings/v8/Dictionary.h 2013-01-21 07:45:23 UTC (rev 140305)
@@ -85,6 +85,9 @@
bool get(const String&, RefPtr<SpeechRecognitionResult>&) const;
bool get(const String&, RefPtr<SpeechRecognitionResultList>&) const;
#endif
+#if ENABLE(MEDIA_STREAM)
+ bool get(const String&, RefPtr<MediaStream>&) const;
+#endif
bool get(const String&, HashSet<AtomicString>&) const;
bool get(const String&, Dictionary&) const;
bool get(const String&, Vector<String>&) const;