From f7cdb8cbb21d8c199fd5cd9fef499895b7fdfa8f Mon Sep 17 00:00:00 2001 From: Nidhi Jaju Date: Wed, 21 Oct 2020 00:53:39 +0000 Subject: [PATCH] Remove NotEnumerable from Readable Streams WebIDL According to https://github.com/whatwg/streams/pull/1035, all methods and accessors are now enumerable, per Web IDL defaults, instead of non-enumerable, per ECMAScript defaults. Hence, 'NotEnumerable' can be removed from the Streams WebIDL files. This CL specifically removes them from readable streams. Bug: 1093862 Change-Id: I2cab1814a7d34beeca16b15fd6c64339d296952f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2485986 Reviewed-by: Adam Rice Commit-Queue: Nidhi Jaju Cr-Commit-Position: refs/heads/master@{#819180} --- .../renderer/core/streams/readable_stream.idl | 13 +++++------ .../readable_stream_default_controller.idl | 8 +++---- .../readable_stream_default_reader.idl | 8 +++---- .../wpt/streams/idlharness.any-expected.txt | 22 +++++++++---------- .../idlharness.any.serviceworker-expected.txt | 22 +++++++++---------- .../idlharness.any.sharedworker-expected.txt | 22 +++++++++---------- .../idlharness.any.worker-expected.txt | 22 +++++++++---------- 7 files changed, 58 insertions(+), 59 deletions(-) diff --git a/third_party/blink/renderer/core/streams/readable_stream.idl b/third_party/blink/renderer/core/streams/readable_stream.idl index e2d7d380864b71..f27029ca558e50 100644 --- a/third_party/blink/renderer/core/streams/readable_stream.idl +++ b/third_party/blink/renderer/core/streams/readable_stream.idl @@ -7,15 +7,14 @@ Exposed=(Window,Worker,Worklet) ] interface ReadableStream { [CallWith=ScriptState, RaisesException] constructor(optional any underlyingSource, optional any strategy); - [NotEnumerable] readonly attribute boolean locked; + readonly attribute boolean locked; // TODO(yhirano): function length is different from what's specced. Fix it. - [RaisesException, CallWith=ScriptState, NotEnumerable] Promise cancel( - optional any reason); - [RaisesException, CallWith=ScriptState, NotEnumerable, MeasureAs=ReadableStreamGetReader] ReadableStreamDefaultReader getReader(optional any mode); - [RaisesException, CallWith=ScriptState, NotEnumerable, MeasureAs=ReadableStreamPipeThrough] any pipeThrough( + [RaisesException, CallWith=ScriptState] Promise cancel(optional any reason); + [RaisesException, CallWith=ScriptState, MeasureAs=ReadableStreamGetReader] ReadableStreamDefaultReader getReader(optional any mode); + [RaisesException, CallWith=ScriptState, MeasureAs=ReadableStreamPipeThrough] any pipeThrough( any transformStream, optional any options); - [RaisesException, CallWith=ScriptState, NotEnumerable, MeasureAs=ReadableStreamPipeTo] Promise pipeTo( + [RaisesException, CallWith=ScriptState, MeasureAs=ReadableStreamPipeTo] Promise pipeTo( any destination, optional any option); - [RaisesException, CallWith=ScriptState, NotEnumerable] any tee(); + [RaisesException, CallWith=ScriptState] any tee(); }; diff --git a/third_party/blink/renderer/core/streams/readable_stream_default_controller.idl b/third_party/blink/renderer/core/streams/readable_stream_default_controller.idl index e605a1a7d114ce..33c806618e70d0 100644 --- a/third_party/blink/renderer/core/streams/readable_stream_default_controller.idl +++ b/third_party/blink/renderer/core/streams/readable_stream_default_controller.idl @@ -4,9 +4,9 @@ // https://streams.spec.whatwg.org/#rs-default-controller-class-definition interface ReadableStreamDefaultController { - [NotEnumerable] readonly attribute double? desiredSize; - [CallWith=ScriptState, NotEnumerable, RaisesException] void close(); - [CallWith=ScriptState, NotEnumerable, RaisesException] void enqueue( + readonly attribute double? desiredSize; + [CallWith=ScriptState, RaisesException] void close(); + [CallWith=ScriptState, RaisesException] void enqueue( optional any chunk); - [CallWith=ScriptState, NotEnumerable] void error(optional any e); + [CallWith=ScriptState] void error(optional any e); }; diff --git a/third_party/blink/renderer/core/streams/readable_stream_default_reader.idl b/third_party/blink/renderer/core/streams/readable_stream_default_reader.idl index 5fb3288dae2fb5..2e338483dd7eba 100644 --- a/third_party/blink/renderer/core/streams/readable_stream_default_reader.idl +++ b/third_party/blink/renderer/core/streams/readable_stream_default_reader.idl @@ -8,11 +8,11 @@ ImplementedAs=ReadableStreamReader ] interface ReadableStreamDefaultReader { [CallWith=ScriptState, RaisesException] constructor(ReadableStream stream); - [CallWith=ScriptState, NotEnumerable] readonly attribute Promise + [CallWith=ScriptState] readonly attribute Promise closed; - [CallWith=ScriptState, RaisesException, NotEnumerable] Promise cancel( + [CallWith=ScriptState, RaisesException] Promise cancel( optional any reason); - [CallWith=ScriptState, RaisesException, NotEnumerable] Promise read(); - [CallWith=ScriptState, NotEnumerable, RaisesException] void releaseLock(); + [CallWith=ScriptState, RaisesException] Promise read(); + [CallWith=ScriptState, RaisesException] void releaseLock(); }; diff --git a/third_party/blink/web_tests/external/wpt/streams/idlharness.any-expected.txt b/third_party/blink/web_tests/external/wpt/streams/idlharness.any-expected.txt index f9cb7f3b13c11b..542c62cc839e5d 100644 --- a/third_party/blink/web_tests/external/wpt/streams/idlharness.any-expected.txt +++ b/third_party/blink/web_tests/external/wpt/streams/idlharness.any-expected.txt @@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 224 tests; 116 PASS, 108 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 224 tests; 126 PASS, 98 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS idl_test setup PASS idl_test validation PASS ReadableStreamDefaultReader includes ReadableStreamGenericReader: member names are unique @@ -10,12 +10,12 @@ PASS ReadableStream interface object name PASS ReadableStream interface: existence and properties of interface prototype object PASS ReadableStream interface: existence and properties of interface prototype object's "constructor" property PASS ReadableStream interface: existence and properties of interface prototype object's @@unscopables property -FAIL ReadableStream interface: attribute locked assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation cancel(optional any) assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation getReader(optional ReadableStreamGetReaderOptions) assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation pipeThrough(ReadableWritablePair, optional StreamPipeOptions) assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation pipeTo(WritableStream, optional StreamPipeOptions) assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation tee() assert_true: property should be enumerable expected true got false +PASS ReadableStream interface: attribute locked +PASS ReadableStream interface: operation cancel(optional any) +PASS ReadableStream interface: operation getReader(optional ReadableStreamGetReaderOptions) +PASS ReadableStream interface: operation pipeThrough(ReadableWritablePair, optional StreamPipeOptions) +PASS ReadableStream interface: operation pipeTo(WritableStream, optional StreamPipeOptions) +PASS ReadableStream interface: operation tee() FAIL ReadableStream interface: async iterable Cannot read property 'writable' of undefined PASS ReadableStream must be primary interface of new ReadableStream() PASS Stringification of new ReadableStream() @@ -35,10 +35,10 @@ PASS ReadableStreamDefaultReader interface object name PASS ReadableStreamDefaultReader interface: existence and properties of interface prototype object PASS ReadableStreamDefaultReader interface: existence and properties of interface prototype object's "constructor" property PASS ReadableStreamDefaultReader interface: existence and properties of interface prototype object's @@unscopables property -FAIL ReadableStreamDefaultReader interface: operation read() assert_true: property should be enumerable expected true got false -FAIL ReadableStreamDefaultReader interface: operation releaseLock() assert_true: property should be enumerable expected true got false -FAIL ReadableStreamDefaultReader interface: attribute closed assert_true: property should be enumerable expected true got false -FAIL ReadableStreamDefaultReader interface: operation cancel(optional any) assert_true: property should be enumerable expected true got false +PASS ReadableStreamDefaultReader interface: operation read() +PASS ReadableStreamDefaultReader interface: operation releaseLock() +PASS ReadableStreamDefaultReader interface: attribute closed +PASS ReadableStreamDefaultReader interface: operation cancel(optional any) PASS ReadableStreamDefaultReader must be primary interface of (new ReadableStream()).getReader() PASS Stringification of (new ReadableStream()).getReader() PASS ReadableStreamDefaultReader interface: (new ReadableStream()).getReader() must inherit property "read()" with the proper type diff --git a/third_party/blink/web_tests/external/wpt/streams/idlharness.any.serviceworker-expected.txt b/third_party/blink/web_tests/external/wpt/streams/idlharness.any.serviceworker-expected.txt index f9cb7f3b13c11b..542c62cc839e5d 100644 --- a/third_party/blink/web_tests/external/wpt/streams/idlharness.any.serviceworker-expected.txt +++ b/third_party/blink/web_tests/external/wpt/streams/idlharness.any.serviceworker-expected.txt @@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 224 tests; 116 PASS, 108 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 224 tests; 126 PASS, 98 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS idl_test setup PASS idl_test validation PASS ReadableStreamDefaultReader includes ReadableStreamGenericReader: member names are unique @@ -10,12 +10,12 @@ PASS ReadableStream interface object name PASS ReadableStream interface: existence and properties of interface prototype object PASS ReadableStream interface: existence and properties of interface prototype object's "constructor" property PASS ReadableStream interface: existence and properties of interface prototype object's @@unscopables property -FAIL ReadableStream interface: attribute locked assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation cancel(optional any) assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation getReader(optional ReadableStreamGetReaderOptions) assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation pipeThrough(ReadableWritablePair, optional StreamPipeOptions) assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation pipeTo(WritableStream, optional StreamPipeOptions) assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation tee() assert_true: property should be enumerable expected true got false +PASS ReadableStream interface: attribute locked +PASS ReadableStream interface: operation cancel(optional any) +PASS ReadableStream interface: operation getReader(optional ReadableStreamGetReaderOptions) +PASS ReadableStream interface: operation pipeThrough(ReadableWritablePair, optional StreamPipeOptions) +PASS ReadableStream interface: operation pipeTo(WritableStream, optional StreamPipeOptions) +PASS ReadableStream interface: operation tee() FAIL ReadableStream interface: async iterable Cannot read property 'writable' of undefined PASS ReadableStream must be primary interface of new ReadableStream() PASS Stringification of new ReadableStream() @@ -35,10 +35,10 @@ PASS ReadableStreamDefaultReader interface object name PASS ReadableStreamDefaultReader interface: existence and properties of interface prototype object PASS ReadableStreamDefaultReader interface: existence and properties of interface prototype object's "constructor" property PASS ReadableStreamDefaultReader interface: existence and properties of interface prototype object's @@unscopables property -FAIL ReadableStreamDefaultReader interface: operation read() assert_true: property should be enumerable expected true got false -FAIL ReadableStreamDefaultReader interface: operation releaseLock() assert_true: property should be enumerable expected true got false -FAIL ReadableStreamDefaultReader interface: attribute closed assert_true: property should be enumerable expected true got false -FAIL ReadableStreamDefaultReader interface: operation cancel(optional any) assert_true: property should be enumerable expected true got false +PASS ReadableStreamDefaultReader interface: operation read() +PASS ReadableStreamDefaultReader interface: operation releaseLock() +PASS ReadableStreamDefaultReader interface: attribute closed +PASS ReadableStreamDefaultReader interface: operation cancel(optional any) PASS ReadableStreamDefaultReader must be primary interface of (new ReadableStream()).getReader() PASS Stringification of (new ReadableStream()).getReader() PASS ReadableStreamDefaultReader interface: (new ReadableStream()).getReader() must inherit property "read()" with the proper type diff --git a/third_party/blink/web_tests/external/wpt/streams/idlharness.any.sharedworker-expected.txt b/third_party/blink/web_tests/external/wpt/streams/idlharness.any.sharedworker-expected.txt index f9cb7f3b13c11b..542c62cc839e5d 100644 --- a/third_party/blink/web_tests/external/wpt/streams/idlharness.any.sharedworker-expected.txt +++ b/third_party/blink/web_tests/external/wpt/streams/idlharness.any.sharedworker-expected.txt @@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 224 tests; 116 PASS, 108 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 224 tests; 126 PASS, 98 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS idl_test setup PASS idl_test validation PASS ReadableStreamDefaultReader includes ReadableStreamGenericReader: member names are unique @@ -10,12 +10,12 @@ PASS ReadableStream interface object name PASS ReadableStream interface: existence and properties of interface prototype object PASS ReadableStream interface: existence and properties of interface prototype object's "constructor" property PASS ReadableStream interface: existence and properties of interface prototype object's @@unscopables property -FAIL ReadableStream interface: attribute locked assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation cancel(optional any) assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation getReader(optional ReadableStreamGetReaderOptions) assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation pipeThrough(ReadableWritablePair, optional StreamPipeOptions) assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation pipeTo(WritableStream, optional StreamPipeOptions) assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation tee() assert_true: property should be enumerable expected true got false +PASS ReadableStream interface: attribute locked +PASS ReadableStream interface: operation cancel(optional any) +PASS ReadableStream interface: operation getReader(optional ReadableStreamGetReaderOptions) +PASS ReadableStream interface: operation pipeThrough(ReadableWritablePair, optional StreamPipeOptions) +PASS ReadableStream interface: operation pipeTo(WritableStream, optional StreamPipeOptions) +PASS ReadableStream interface: operation tee() FAIL ReadableStream interface: async iterable Cannot read property 'writable' of undefined PASS ReadableStream must be primary interface of new ReadableStream() PASS Stringification of new ReadableStream() @@ -35,10 +35,10 @@ PASS ReadableStreamDefaultReader interface object name PASS ReadableStreamDefaultReader interface: existence and properties of interface prototype object PASS ReadableStreamDefaultReader interface: existence and properties of interface prototype object's "constructor" property PASS ReadableStreamDefaultReader interface: existence and properties of interface prototype object's @@unscopables property -FAIL ReadableStreamDefaultReader interface: operation read() assert_true: property should be enumerable expected true got false -FAIL ReadableStreamDefaultReader interface: operation releaseLock() assert_true: property should be enumerable expected true got false -FAIL ReadableStreamDefaultReader interface: attribute closed assert_true: property should be enumerable expected true got false -FAIL ReadableStreamDefaultReader interface: operation cancel(optional any) assert_true: property should be enumerable expected true got false +PASS ReadableStreamDefaultReader interface: operation read() +PASS ReadableStreamDefaultReader interface: operation releaseLock() +PASS ReadableStreamDefaultReader interface: attribute closed +PASS ReadableStreamDefaultReader interface: operation cancel(optional any) PASS ReadableStreamDefaultReader must be primary interface of (new ReadableStream()).getReader() PASS Stringification of (new ReadableStream()).getReader() PASS ReadableStreamDefaultReader interface: (new ReadableStream()).getReader() must inherit property "read()" with the proper type diff --git a/third_party/blink/web_tests/external/wpt/streams/idlharness.any.worker-expected.txt b/third_party/blink/web_tests/external/wpt/streams/idlharness.any.worker-expected.txt index f9cb7f3b13c11b..542c62cc839e5d 100644 --- a/third_party/blink/web_tests/external/wpt/streams/idlharness.any.worker-expected.txt +++ b/third_party/blink/web_tests/external/wpt/streams/idlharness.any.worker-expected.txt @@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 224 tests; 116 PASS, 108 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 224 tests; 126 PASS, 98 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS idl_test setup PASS idl_test validation PASS ReadableStreamDefaultReader includes ReadableStreamGenericReader: member names are unique @@ -10,12 +10,12 @@ PASS ReadableStream interface object name PASS ReadableStream interface: existence and properties of interface prototype object PASS ReadableStream interface: existence and properties of interface prototype object's "constructor" property PASS ReadableStream interface: existence and properties of interface prototype object's @@unscopables property -FAIL ReadableStream interface: attribute locked assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation cancel(optional any) assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation getReader(optional ReadableStreamGetReaderOptions) assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation pipeThrough(ReadableWritablePair, optional StreamPipeOptions) assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation pipeTo(WritableStream, optional StreamPipeOptions) assert_true: property should be enumerable expected true got false -FAIL ReadableStream interface: operation tee() assert_true: property should be enumerable expected true got false +PASS ReadableStream interface: attribute locked +PASS ReadableStream interface: operation cancel(optional any) +PASS ReadableStream interface: operation getReader(optional ReadableStreamGetReaderOptions) +PASS ReadableStream interface: operation pipeThrough(ReadableWritablePair, optional StreamPipeOptions) +PASS ReadableStream interface: operation pipeTo(WritableStream, optional StreamPipeOptions) +PASS ReadableStream interface: operation tee() FAIL ReadableStream interface: async iterable Cannot read property 'writable' of undefined PASS ReadableStream must be primary interface of new ReadableStream() PASS Stringification of new ReadableStream() @@ -35,10 +35,10 @@ PASS ReadableStreamDefaultReader interface object name PASS ReadableStreamDefaultReader interface: existence and properties of interface prototype object PASS ReadableStreamDefaultReader interface: existence and properties of interface prototype object's "constructor" property PASS ReadableStreamDefaultReader interface: existence and properties of interface prototype object's @@unscopables property -FAIL ReadableStreamDefaultReader interface: operation read() assert_true: property should be enumerable expected true got false -FAIL ReadableStreamDefaultReader interface: operation releaseLock() assert_true: property should be enumerable expected true got false -FAIL ReadableStreamDefaultReader interface: attribute closed assert_true: property should be enumerable expected true got false -FAIL ReadableStreamDefaultReader interface: operation cancel(optional any) assert_true: property should be enumerable expected true got false +PASS ReadableStreamDefaultReader interface: operation read() +PASS ReadableStreamDefaultReader interface: operation releaseLock() +PASS ReadableStreamDefaultReader interface: attribute closed +PASS ReadableStreamDefaultReader interface: operation cancel(optional any) PASS ReadableStreamDefaultReader must be primary interface of (new ReadableStream()).getReader() PASS Stringification of (new ReadableStream()).getReader() PASS ReadableStreamDefaultReader interface: (new ReadableStream()).getReader() must inherit property "read()" with the proper type