Diff
Modified: trunk/Source/WTF/ChangeLog (282344 => 282345)
--- trunk/Source/WTF/ChangeLog 2021-09-13 18:38:11 UTC (rev 282344)
+++ trunk/Source/WTF/ChangeLog 2021-09-13 18:40:59 UTC (rev 282345)
@@ -1,3 +1,12 @@
+2021-09-13 Youenn Fablet <[email protected]>
+
+ Remove WritableStream runtime flag
+ https://bugs.webkit.org/show_bug.cgi?id=230148
+
+ Reviewed by Sihui Liu.
+
+ * Scripts/Preferences/WebPreferencesExperimental.yaml:
+
2021-09-11 Philippe Normand <[email protected]>
[GLIB] MediaSession is not enabled
Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml (282344 => 282345)
--- trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml 2021-09-13 18:38:11 UTC (rev 282344)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml 2021-09-13 18:40:59 UTC (rev 282345)
@@ -1517,15 +1517,3 @@
default: true
WebCore:
default: true
-
-WritableStreamAPIEnabled:
- type: bool
- humanReadableName: "WritableStream API"
- humanReadableDescription: "Enable Writable Stream API"
- webcoreBinding: RuntimeEnabledFeatures
- defaultValue:
- WebKitLegacy:
- default: true
- WebKit:
- default: true
-
Modified: trunk/Source/WebCore/ChangeLog (282344 => 282345)
--- trunk/Source/WebCore/ChangeLog 2021-09-13 18:38:11 UTC (rev 282344)
+++ trunk/Source/WebCore/ChangeLog 2021-09-13 18:40:59 UTC (rev 282345)
@@ -1,3 +1,31 @@
+2021-09-13 Youenn Fablet <[email protected]>
+
+ Remove WritableStream runtime flag
+ https://bugs.webkit.org/show_bug.cgi?id=230148
+
+ Reviewed by Sihui Liu.
+
+ WritableStream is enabled in all platforms and is mirroring ReadableStream which no longer has a runtime flag.
+
+ No change of behavior.
+
+ * Modules/streams/ReadableStream.js:
+ (pipeThrough):
+ (pipeTo):
+ (pipeTo.doPipe): Deleted.
+ (pipeTo.closeDestination): Deleted.
+ (pipeTo.abortDestination): Deleted.
+ * Modules/streams/WritableStream.idl:
+ * Modules/streams/WritableStreamDefaultController.idl:
+ * Modules/streams/WritableStreamDefaultWriter.idl:
+ * bindings/js/JSDOMGlobalObject.cpp:
+ (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
+ * bindings/js/WebCoreBuiltinNames.h:
+ * page/RuntimeEnabledFeatures.h:
+ (WebCore::RuntimeEnabledFeatures::readableByteStreamAPIEnabled const):
+ (WebCore::RuntimeEnabledFeatures::setWritableStreamAPIEnabled): Deleted.
+ (WebCore::RuntimeEnabledFeatures::writableStreamAPIEnabled const): Deleted.
+
2021-09-13 Ziran Sun <[email protected]>
[css-grid] calling correct offset function for RTL for out of flow child
Modified: trunk/Source/WebCore/Modules/streams/ReadableStream.js (282344 => 282345)
--- trunk/Source/WebCore/Modules/streams/ReadableStream.js 2021-09-13 18:38:11 UTC (rev 282344)
+++ trunk/Source/WebCore/Modules/streams/ReadableStream.js 2021-09-13 18:40:59 UTC (rev 282345)
@@ -115,54 +115,45 @@
{
"use strict";
- if (@writableStreamAPIEnabled()) {
- const transforms = streams;
+ const transforms = streams;
- const readable = transforms["readable"];
- if (!@isReadableStream(readable))
- throw @makeTypeError("readable should be ReadableStream");
+ const readable = transforms["readable"];
+ if (!@isReadableStream(readable))
+ throw @makeTypeError("readable should be ReadableStream");
- const writable = transforms["writable"];
- const internalWritable = @getInternalWritableStream(writable);
- if (!@isWritableStream(internalWritable))
- throw @makeTypeError("writable should be WritableStream");
+ const writable = transforms["writable"];
+ const internalWritable = @getInternalWritableStream(writable);
+ if (!@isWritableStream(internalWritable))
+ throw @makeTypeError("writable should be WritableStream");
- let preventClose = false;
- let preventAbort = false;
- let preventCancel = false;
- let signal;
- if (!@isUndefinedOrNull(options)) {
- if (!@isObject(options))
- throw @makeTypeError("options must be an object");
+ let preventClose = false;
+ let preventAbort = false;
+ let preventCancel = false;
+ let signal;
+ if (!@isUndefinedOrNull(options)) {
+ if (!@isObject(options))
+ throw @makeTypeError("options must be an object");
- preventAbort = !!options["preventAbort"];
- preventCancel = !!options["preventCancel"];
- preventClose = !!options["preventClose"];
+ preventAbort = !!options["preventAbort"];
+ preventCancel = !!options["preventCancel"];
+ preventClose = !!options["preventClose"];
- signal = options["signal"];
- if (signal !== @undefined && !@isAbortSignal(signal))
- throw @makeTypeError("options.signal must be AbortSignal");
- }
+ signal = options["signal"];
+ if (signal !== @undefined && !@isAbortSignal(signal))
+ throw @makeTypeError("options.signal must be AbortSignal");
+ }
- if (!@isReadableStream(this))
- throw @makeThisTypeError("ReadableStream", "pipeThrough");
+ if (!@isReadableStream(this))
+ throw @makeThisTypeError("ReadableStream", "pipeThrough");
- if (@isReadableStreamLocked(this))
- throw @makeTypeError("ReadableStream is locked");
+ if (@isReadableStreamLocked(this))
+ throw @makeTypeError("ReadableStream is locked");
- if (@isWritableStreamLocked(internalWritable))
- throw @makeTypeError("WritableStream is locked");
+ if (@isWritableStreamLocked(internalWritable))
+ throw @makeTypeError("WritableStream is locked");
- @readableStreamPipeToWritableStream(this, internalWritable, preventClose, preventAbort, preventCancel, signal);
+ @readableStreamPipeToWritableStream(this, internalWritable, preventClose, preventAbort, preventCancel, signal);
- return readable;
- }
-
- const writable = streams.writable;
- const readable = streams.readable;
- const promise = this.pipeTo(writable, options);
- if (@isPromise(promise))
- @markPromiseAsHandled(promise);
return readable;
}
@@ -174,126 +165,42 @@
// Built-in generator should be able to parse function signature to compute the function length correctly.
let options = arguments[1];
- if (@writableStreamAPIEnabled()) {
- let preventClose = false;
- let preventAbort = false;
- let preventCancel = false;
- let signal;
- if (!@isUndefinedOrNull(options)) {
- if (!@isObject(options))
- return @Promise.@reject(@makeTypeError("options must be an object"));
+ let preventClose = false;
+ let preventAbort = false;
+ let preventCancel = false;
+ let signal;
+ if (!@isUndefinedOrNull(options)) {
+ if (!@isObject(options))
+ return @Promise.@reject(@makeTypeError("options must be an object"));
- try {
- preventAbort = !!options["preventAbort"];
- preventCancel = !!options["preventCancel"];
- preventClose = !!options["preventClose"];
+ try {
+ preventAbort = !!options["preventAbort"];
+ preventCancel = !!options["preventCancel"];
+ preventClose = !!options["preventClose"];
- signal = options["signal"];
- } catch(e) {
- return @Promise.@reject(e);
- }
-
- if (signal !== @undefined && !@isAbortSignal(signal))
- return @Promise.@reject(@makeTypeError("options.signal must be AbortSignal"));
+ signal = options["signal"];
+ } catch(e) {
+ return @Promise.@reject(e);
}
- const internalDestination = @getInternalWritableStream(destination);
- if (!@isWritableStream(internalDestination))
- return @Promise.@reject(@makeTypeError("ReadableStream pipeTo requires a WritableStream"));
-
- if (!@isReadableStream(this))
- return @Promise.@reject(@makeThisTypeError("ReadableStream", "pipeTo"));
-
- if (@isReadableStreamLocked(this))
- return @Promise.@reject(@makeTypeError("ReadableStream is locked"));
-
- if (@isWritableStreamLocked(internalDestination))
- return @Promise.@reject(@makeTypeError("WritableStream is locked"));
-
- return @readableStreamPipeToWritableStream(this, internalDestination, preventClose, preventAbort, preventCancel, signal);
+ if (signal !== @undefined && !@isAbortSignal(signal))
+ return @Promise.@reject(@makeTypeError("options.signal must be AbortSignal"));
}
- // FIXME: rewrite pipeTo so as to require to have 'this' as a ReadableStream and destination be a WritableStream.
- // See https://github.com/whatwg/streams/issues/407.
- // We should shield the pipeTo implementation at the same time.
+ const internalDestination = @getInternalWritableStream(destination);
+ if (!@isWritableStream(internalDestination))
+ return @Promise.@reject(@makeTypeError("ReadableStream pipeTo requires a WritableStream"));
- const preventClose = @isObject(options) && !!options.preventClose;
- const preventAbort = @isObject(options) && !!options.preventAbort;
- const preventCancel = @isObject(options) && !!options.preventCancel;
+ if (!@isReadableStream(this))
+ return @Promise.@reject(@makeThisTypeError("ReadableStream", "pipeTo"));
- const source = this;
+ if (@isReadableStreamLocked(this))
+ return @Promise.@reject(@makeTypeError("ReadableStream is locked"));
- let reader;
- let lastRead;
- let lastWrite;
- let closedPurposefully = false;
- let promiseCapability;
+ if (@isWritableStreamLocked(internalDestination))
+ return @Promise.@reject(@makeTypeError("WritableStream is locked"));
- function doPipe() {
- lastRead = reader.read();
- @Promise.prototype.@then.@call(@Promise.all([lastRead, destination.ready]), function([{ value, done }]) {
- if (done)
- closeDestination();
- else if (destination.state === "writable") {
- lastWrite = destination.write(value);
- doPipe();
- }
- }, function(e) {
- throw e;
- });
- }
-
- function cancelSource(reason) {
- if (!preventCancel) {
- reader.cancel(reason);
- reader.releaseLock();
- promiseCapability.@reject.@call(@undefined, reason);
- } else {
- @Promise.prototype.@then.@call(lastRead, function() {
- reader.releaseLock();
- promiseCapability.@reject.@call(@undefined, reason);
- });
- }
- }
-
- function closeDestination() {
- reader.releaseLock();
-
- const destinationState = destination.state;
- if (!preventClose && (destinationState === "waiting" || destinationState === "writable")) {
- closedPurposefully = true;
- @Promise.prototype.@then.@call(destination.close(), promiseCapability.@resolve, promiseCapability.@reject);
- } else if (lastWrite !== @undefined)
- @Promise.prototype.@then.@call(lastWrite, promiseCapability.@resolve, promiseCapability.@reject);
- else
- promiseCapability.@resolve.@call();
-
- }
-
- function abortDestination(reason) {
- reader.releaseLock();
-
- if (!preventAbort)
- destination.abort(reason);
- promiseCapability.@reject.@call(@undefined, reason);
- }
-
- promiseCapability = @newPromiseCapability(@Promise);
-
- reader = source.getReader();
-
- @Promise.prototype.@then.@call(reader.closed, @undefined, abortDestination);
- @Promise.prototype.@then.@call(destination.closed,
- function() {
- if (!closedPurposefully)
- cancelSource(@makeTypeError('destination is closing or closed and cannot be piped to anymore'));
- },
- cancelSource
- );
-
- doPipe();
-
- return promiseCapability.@promise;
+ return @readableStreamPipeToWritableStream(this, internalDestination, preventClose, preventAbort, preventCancel, signal);
}
function tee()
Modified: trunk/Source/WebCore/Modules/streams/WritableStream.idl (282344 => 282345)
--- trunk/Source/WebCore/Modules/streams/WritableStream.idl 2021-09-13 18:38:11 UTC (rev 282344)
+++ trunk/Source/WebCore/Modules/streams/WritableStream.idl 2021-09-13 18:40:59 UTC (rev 282345)
@@ -29,7 +29,6 @@
*/
[
- EnabledAtRuntime=WritableStreamAPI,
Exposed=(Window,Worker),
PrivateIdentifier,
PublicIdentifier,
Modified: trunk/Source/WebCore/Modules/streams/WritableStreamDefaultController.idl (282344 => 282345)
--- trunk/Source/WebCore/Modules/streams/WritableStreamDefaultController.idl 2021-09-13 18:38:11 UTC (rev 282344)
+++ trunk/Source/WebCore/Modules/streams/WritableStreamDefaultController.idl 2021-09-13 18:40:59 UTC (rev 282345)
@@ -24,7 +24,6 @@
*/
[
- EnabledAtRuntime=WritableStreamAPI,
Exposed=(Window,Worker),
JSBuiltin,
PrivateIdentifier,
Modified: trunk/Source/WebCore/Modules/streams/WritableStreamDefaultWriter.idl (282344 => 282345)
--- trunk/Source/WebCore/Modules/streams/WritableStreamDefaultWriter.idl 2021-09-13 18:38:11 UTC (rev 282344)
+++ trunk/Source/WebCore/Modules/streams/WritableStreamDefaultWriter.idl 2021-09-13 18:40:59 UTC (rev 282345)
@@ -24,7 +24,6 @@
*/
[
- EnabledAtRuntime=WritableStreamAPI,
Exposed=(Window,Worker),
JSBuiltin,
PrivateIdentifier,
Modified: trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp (282344 => 282345)
--- trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp 2021-09-13 18:38:11 UTC (rev 282344)
+++ trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp 2021-09-13 18:40:59 UTC (rev 282345)
@@ -73,7 +73,6 @@
JSC_DECLARE_HOST_FUNCTION(makeDOMExceptionForBuiltins);
JSC_DECLARE_HOST_FUNCTION(isReadableByteStreamAPIEnabled);
JSC_DECLARE_HOST_FUNCTION(getInternalWritableStream);
-JSC_DECLARE_HOST_FUNCTION(isWritableStreamAPIEnabled);
JSC_DECLARE_HOST_FUNCTION(whenSignalAborted);
JSC_DECLARE_HOST_FUNCTION(isAbortSignal);
@@ -160,11 +159,6 @@
return JSValue::encode(jsBoolean(RuntimeEnabledFeatures::sharedFeatures().readableByteStreamAPIEnabled()));
}
-JSC_DEFINE_HOST_FUNCTION(isWritableStreamAPIEnabled, (JSGlobalObject*, CallFrame*))
-{
- return JSValue::encode(jsBoolean(RuntimeEnabledFeatures::sharedFeatures().writableStreamAPIEnabled()));
-}
-
JSC_DEFINE_HOST_FUNCTION(getInternalWritableStream, (JSGlobalObject* globalObject, CallFrame* callFrame))
{
ASSERT(callFrame);
@@ -226,7 +220,6 @@
JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamWaitingPrivateName(), jsNumber(5), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamWritablePrivateName(), jsNumber(6), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().readableByteStreamAPIEnabledPrivateName(), JSFunction::create(vm, this, 0, String(), isReadableByteStreamAPIEnabled), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
- JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().writableStreamAPIEnabledPrivateName(), JSFunction::create(vm, this, 0, String(), isWritableStreamAPIEnabled), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().isAbortSignalPrivateName(), JSFunction::create(vm, this, 1, String(), isAbortSignal), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().getInternalWritableStreamPrivateName(), JSFunction::create(vm, this, 1, String(), getInternalWritableStream), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
};
Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (282344 => 282345)
--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h 2021-09-13 18:38:11 UTC (rev 282344)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h 2021-09-13 18:40:59 UTC (rev 282345)
@@ -473,7 +473,6 @@
macro(whenSignalAborted) \
macro(window) \
macro(writable) \
- macro(writableStreamAPIEnabled) \
macro(writeAlgorithm) \
macro(writing) \
macro(writer) \
Modified: trunk/Source/WebCore/page/RuntimeEnabledFeatures.h (282344 => 282345)
--- trunk/Source/WebCore/page/RuntimeEnabledFeatures.h 2021-09-13 18:38:11 UTC (rev 282344)
+++ trunk/Source/WebCore/page/RuntimeEnabledFeatures.h 2021-09-13 18:40:59 UTC (rev 282345)
@@ -176,8 +176,6 @@
void setReadableByteStreamAPIEnabled(bool isEnabled) { m_isReadableByteStreamAPIEnabled = isEnabled; }
bool readableByteStreamAPIEnabled() const { return m_isReadableByteStreamAPIEnabled; }
- void setWritableStreamAPIEnabled(bool isEnabled) { m_isWritableStreamAPIEnabled = isEnabled; }
- bool writableStreamAPIEnabled() const { return m_isWritableStreamAPIEnabled; }
void setTransformStreamAPIEnabled(bool isEnabled) { m_isTransformStreamAPIEnabled = isEnabled; }
bool transformStreamAPIEnabled() const { return m_isTransformStreamAPIEnabled; }
@@ -330,7 +328,6 @@
#endif
bool m_isReadableByteStreamAPIEnabled { false };
- bool m_isWritableStreamAPIEnabled { false };
bool m_isTransformStreamAPIEnabled { false };
#if ENABLE(SERVICE_WORKER)
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (282344 => 282345)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2021-09-13 18:38:11 UTC (rev 282344)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2021-09-13 18:40:59 UTC (rev 282345)
@@ -1,3 +1,16 @@
+2021-09-13 Youenn Fablet <[email protected]>
+
+ Remove WritableStream runtime flag
+ https://bugs.webkit.org/show_bug.cgi?id=230148
+
+ Reviewed by Sihui Liu.
+
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.mm:
+ (-[WebPreferences writableStreamAPIEnabled]): Deleted.
+ (-[WebPreferences setWritableStreamAPIEnabled:]): Deleted.
+ * WebView/WebPreferencesPrivate.h:
+
2021-09-11 David Kilzer <[email protected]>
CFNotificationCenterAddObserver() should use weak observers
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h (282344 => 282345)
--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h 2021-09-13 18:38:11 UTC (rev 282344)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h 2021-09-13 18:40:59 UTC (rev 282345)
@@ -275,7 +275,6 @@
#define WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey @"WebKitLinkPreloadResponsiveImagesEnabled"
#define WebKitRemotePlaybackEnabledPreferenceKey @"WebKitRemotePlaybackEnabled"
#define WebKitDialogElementEnabledPreferenceKey @"WebKitDialogElementEnabledPreferenceKey"
-#define WebKitWritableStreamAPIEnabledPreferenceKey @"WebKitWritableStreamAPIEnabled"
#define WebKitReadableByteStreamAPIEnabledPreferenceKey @"WebKitReadableByteStreamAPIEnabled"
#define WebKitTransformStreamAPIEnabledPreferenceKey @"WebKitTransformStreamAPIEnabled"
#define WebKitMediaRecorderEnabledPreferenceKey @"WebKitMediaRecorderEnabled"
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm (282344 => 282345)
--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm 2021-09-13 18:38:11 UTC (rev 282344)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm 2021-09-13 18:40:59 UTC (rev 282345)
@@ -3320,16 +3320,6 @@
[self _setBoolValue:flag forKey:WebKitReadableByteStreamAPIEnabledPreferenceKey];
}
-- (BOOL)writableStreamAPIEnabled
-{
- return [self _boolValueForKey:WebKitWritableStreamAPIEnabledPreferenceKey];
-}
-
-- (void)setWritableStreamAPIEnabled:(BOOL)flag
-{
- [self _setBoolValue:flag forKey:WebKitWritableStreamAPIEnabledPreferenceKey];
-}
-
- (BOOL)transformStreamAPIEnabled
{
return [self _boolValueForKey:WebKitTransformStreamAPIEnabledPreferenceKey];
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h (282344 => 282345)
--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h 2021-09-13 18:38:11 UTC (rev 282344)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h 2021-09-13 18:40:59 UTC (rev 282345)
@@ -350,7 +350,6 @@
@property (nonatomic) BOOL remotePlaybackEnabled;
@property (nonatomic) BOOL dialogElementEnabled;
@property (nonatomic) BOOL readableByteStreamAPIEnabled;
-@property (nonatomic) BOOL writableStreamAPIEnabled;
@property (nonatomic) BOOL transformStreamAPIEnabled;
@property (nonatomic) BOOL mediaRecorderEnabled;
@property (nonatomic, setter=_setMediaRecorderEnabled:) BOOL _mediaRecorderEnabled;