WebKit Bugzilla
Attachment 340301 Details for
Bug 185602
: readableStreamDefaultControllerError should return early if stream is not readable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185602-20180514101409.patch (text/plain), 17.15 KB, created by
youenn fablet
on 2018-05-14 01:14:11 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2018-05-14 01:14:11 PDT
Size:
17.15 KB
patch
obsolete
>Subversion Revision: 231744 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index cf540aec2a73503bea3bb0d3d9ba349723b88337..b5f815b62318ebf91f8b6085deb8a9cebb91f3d7 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2018-05-14 Youenn Fablet <youenn@apple.com> >+ >+ readableStreamDefaultControllerError should return early if stream is not readable >+ https://bugs.webkit.org/show_bug.cgi?id=185602 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Return early if stream is not readable in @readableStreamDefaultControllerError. >+ Update call sites to no longer check for ReadableStream state. >+ Covered by unflaked and rebased tests. >+ >+ * Modules/streams/ReadableStreamDefaultController.js: >+ (error): >+ * Modules/streams/ReadableStreamInternals.js: >+ (readableStreamDefaultControllerError): >+ (readableStreamDefaultControllerCallPullIfNeeded): >+ > 2018-05-13 Dirk Schulze <krit@webkit.org> > > Implement SVGGeometryElement's isPointInFill and isPointInStroke >diff --git a/Source/WebCore/Modules/streams/ReadableStreamDefaultController.js b/Source/WebCore/Modules/streams/ReadableStreamDefaultController.js >index cf3defff3eff7cdb769c73d7daa6f8cfa4e57356..a373fadb74b063205dc7fcf005f499a2c56a72da 100644 >--- a/Source/WebCore/Modules/streams/ReadableStreamDefaultController.js >+++ b/Source/WebCore/Modules/streams/ReadableStreamDefaultController.js >@@ -45,9 +45,6 @@ function error(error) > if (!@isReadableStreamDefaultController(this)) > throw @makeThisTypeError("ReadableStreamDefaultController", "error"); > >- if (@getByIdDirectPrivate(@getByIdDirectPrivate(this, "controlledReadableStream"), "state") !== @streamReadable) >- @throwTypeError("ReadableStream is not readable"); >- > @readableStreamDefaultControllerError(this, error); > } > >diff --git a/Source/WebCore/Modules/streams/ReadableStreamInternals.js b/Source/WebCore/Modules/streams/ReadableStreamInternals.js >index 3429a6104c971290ced6a213e080b23c12628fda..95aa75b504da5c4d1d2542a4cff87a58679d7a7e 100644 >--- a/Source/WebCore/Modules/streams/ReadableStreamInternals.js >+++ b/Source/WebCore/Modules/streams/ReadableStreamInternals.js >@@ -85,8 +85,7 @@ function privateInitializeReadableStreamDefaultController(stream, underlyingSour > @assert(!@getByIdDirectPrivate(controller, "pullAgain")); > @readableStreamDefaultControllerCallPullIfNeeded(controller); > }, (error) => { >- if (@getByIdDirectPrivate(stream, "state") === @streamReadable) >- @readableStreamDefaultControllerError(controller, error); >+ @readableStreamDefaultControllerError(controller, error); > }); > > @putByIdDirectPrivate(this, "cancel", @readableStreamDefaultControllerCancel); >@@ -101,7 +100,8 @@ function readableStreamDefaultControllerError(controller, error) > "use strict"; > > const stream = @getByIdDirectPrivate(controller, "controlledReadableStream"); >- @assert(@getByIdDirectPrivate(stream, "state") === @streamReadable); >+ if (@getByIdDirectPrivate(stream, "state") !== @streamReadable) >+ return; > @putByIdDirectPrivate(controller, "queue", @newQueue()); > @readableStreamError(stream, error); > } >@@ -341,8 +341,7 @@ function readableStreamDefaultControllerCallPullIfNeeded(controller) > @readableStreamDefaultControllerCallPullIfNeeded(controller); > } > }, function(error) { >- if (@getByIdDirectPrivate(stream, "state") === @streamReadable) >- @readableStreamDefaultControllerError(controller, error); >+ @readableStreamDefaultControllerError(controller, error); > }); > } > >@@ -477,8 +476,7 @@ function readableStreamDefaultControllerEnqueue(controller, chunk) > @enqueueValueWithSize(@getByIdDirectPrivate(controller, "queue"), chunk, chunkSize); > } > catch(error) { >- if (@getByIdDirectPrivate(stream, "state") === @streamReadable) >- @readableStreamDefaultControllerError(controller, error); >+ @readableStreamDefaultControllerError(controller, error); > throw error; > } > @readableStreamDefaultControllerCallPullIfNeeded(controller); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 2ce1d0a52ca71d966faed23858b0e5627ecb2fe6..e351694c69521ea03ec435a73666bf5b3af06f84 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,12 @@ >+2018-05-14 Youenn Fablet <youenn@apple.com> >+ >+ readableStreamDefaultControllerError should return early if stream is not readable >+ https://bugs.webkit.org/show_bug.cgi?id=185602 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestExpectations: >+ > 2018-05-13 Andy VanWagoner <andy@vanwagoner.family> > > [INTL] Improve spec & test262 compliance for Intl APIs >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index e125abf020f4b243fd9a97fd8491308dfa2f7ec8..9e28d6190e6d594e05c1343b9b6081f55e3192d9 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,18 @@ >+2018-05-14 Youenn Fablet <youenn@apple.com> >+ >+ readableStreamDefaultControllerError should return early if stream is not readable >+ https://bugs.webkit.org/show_bug.cgi?id=185602 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * web-platform-tests/streams/readable-streams/bad-underlying-sources-expected.txt: >+ * web-platform-tests/streams/readable-streams/bad-underlying-sources.dedicatedworker-expected.txt: >+ * web-platform-tests/streams/readable-streams/bad-underlying-sources.serviceworker.https-expected.txt: >+ * web-platform-tests/streams/readable-streams/garbage-collection-expected.txt: >+ * web-platform-tests/streams/readable-streams/garbage-collection.dedicatedworker-expected.txt: >+ * web-platform-tests/streams/readable-streams/garbage-collection.serviceworker.https-expected.txt: >+ * web-platform-tests/streams/readable-streams/tee-expected.txt: >+ > 2018-05-11 Ryosuke Niwa <rniwa@webkit.org> > > Tapping after CSS-based table casues an infinite loop in wordRangeFromPosition >diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations >index ec018affd716addde45481504ea2b1a896c4f780..752fefb41c8297f238aa5b53ba05ad1dcb5afb09 100644 >--- a/LayoutTests/TestExpectations >+++ b/LayoutTests/TestExpectations >@@ -618,10 +618,8 @@ http/tests/loading/text-content-type-with-binary-extension.html [ Pass Failure ] > webkit.org/b/171094 streams/brand-checks.html [ Pass Failure ] > webkit.org/b/171094 streams/reference-implementation/abstract-ops.html [ Pass Failure ] > >-# tee.html is flaky with release and crashes with debug builds >-webkit.org/b/171094 imported/w3c/web-platform-tests/streams/readable-streams/tee.html [ Pass Failure Crash ] >-[ Debug ] imported/w3c/web-platform-tests/streams/readable-streams/tee.serviceworker.https.html [ Failure ] >-[ Debug ] imported/w3c/web-platform-tests/streams/readable-streams/tee.dedicatedworker.html [ Crash ] >+# tee.html is flaky with unhandled promise rejections >+imported/w3c/web-platform-tests/streams/readable-streams/tee.html [ DumpJSConsoleLogInStdErr ] > > # WPT tests that fail after doing full test repository reimport and need further investigation > imported/w3c/web-platform-tests/dom/nodes/Document-createElement-namespace.html [ Pass Failure ] >diff --git a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-underlying-sources-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-underlying-sources-expected.txt >index dc2e1836bb025f4b11e3a676d47295cad2a48e91..51e6be5daccdcc3c60e9bced5cde53df873237e9 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-underlying-sources-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-underlying-sources-expected.txt >@@ -24,8 +24,8 @@ PASS Underlying source: calling close twice on a non-empty stream should throw t > PASS Underlying source: calling close on an empty canceled stream should throw > PASS Underlying source: calling close on a non-empty canceled stream should throw > PASS Underlying source: calling close after error should throw >-FAIL Underlying source: calling error twice should not throw ReadableStream is not readable >-FAIL Underlying source: calling error after close should not throw ReadableStream is not readable >+PASS Underlying source: calling error twice should not throw >+PASS Underlying source: calling error after close should not throw > PASS Underlying source: calling error and returning a rejected promise from start should cause the stream to error with the first error > PASS Underlying source: calling error and returning a rejected promise from pull should cause the stream to error with the first error > PASS read should not error if it dequeues and pull() throws >diff --git a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-underlying-sources.dedicatedworker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-underlying-sources.dedicatedworker-expected.txt >index dc2e1836bb025f4b11e3a676d47295cad2a48e91..51e6be5daccdcc3c60e9bced5cde53df873237e9 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-underlying-sources.dedicatedworker-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-underlying-sources.dedicatedworker-expected.txt >@@ -24,8 +24,8 @@ PASS Underlying source: calling close twice on a non-empty stream should throw t > PASS Underlying source: calling close on an empty canceled stream should throw > PASS Underlying source: calling close on a non-empty canceled stream should throw > PASS Underlying source: calling close after error should throw >-FAIL Underlying source: calling error twice should not throw ReadableStream is not readable >-FAIL Underlying source: calling error after close should not throw ReadableStream is not readable >+PASS Underlying source: calling error twice should not throw >+PASS Underlying source: calling error after close should not throw > PASS Underlying source: calling error and returning a rejected promise from start should cause the stream to error with the first error > PASS Underlying source: calling error and returning a rejected promise from pull should cause the stream to error with the first error > PASS read should not error if it dequeues and pull() throws >diff --git a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-underlying-sources.serviceworker.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-underlying-sources.serviceworker.https-expected.txt >index b3dae7d063ba3ef9056f1dffed8635a3caea467b..dff3da3bb5d915442c374038aea3a76926901171 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-underlying-sources.serviceworker.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/bad-underlying-sources.serviceworker.https-expected.txt >@@ -25,8 +25,8 @@ PASS Underlying source: calling close twice on a non-empty stream should throw t > PASS Underlying source: calling close on an empty canceled stream should throw > PASS Underlying source: calling close on a non-empty canceled stream should throw > PASS Underlying source: calling close after error should throw >-FAIL Underlying source: calling error twice should not throw ReadableStream is not readable >-FAIL Underlying source: calling error after close should not throw ReadableStream is not readable >+PASS Underlying source: calling error twice should not throw >+PASS Underlying source: calling error after close should not throw > PASS Underlying source: calling error and returning a rejected promise from start should cause the stream to error with the first error > PASS Underlying source: calling error and returning a rejected promise from pull should cause the stream to error with the first error > PASS read should not error if it dequeues and pull() throws >diff --git a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/garbage-collection-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/garbage-collection-expected.txt >index c72ce18de4ad82cbc5a038a4c6c325a13f253c57..010f50a0c1385db6107d346d9551f0f710e6d52b 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/garbage-collection-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/garbage-collection-expected.txt >@@ -1,5 +1,5 @@ > >-FAIL ReadableStreamController methods should continue working properly when scripts lose their reference to the readable stream promise_test: Unhandled rejection with value: object "TypeError: ReadableStream is not readable" >+PASS ReadableStreamController methods should continue working properly when scripts lose their reference to the readable stream > PASS ReadableStream closed promise should fulfill even if the stream and reader JS references are lost > PASS ReadableStream closed promise should reject even if stream and reader JS references are lost > PASS Garbage-collecting a ReadableStreamDefaultReader should not unlock its stream >diff --git a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/garbage-collection.dedicatedworker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/garbage-collection.dedicatedworker-expected.txt >index c72ce18de4ad82cbc5a038a4c6c325a13f253c57..010f50a0c1385db6107d346d9551f0f710e6d52b 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/garbage-collection.dedicatedworker-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/garbage-collection.dedicatedworker-expected.txt >@@ -1,5 +1,5 @@ > >-FAIL ReadableStreamController methods should continue working properly when scripts lose their reference to the readable stream promise_test: Unhandled rejection with value: object "TypeError: ReadableStream is not readable" >+PASS ReadableStreamController methods should continue working properly when scripts lose their reference to the readable stream > PASS ReadableStream closed promise should fulfill even if the stream and reader JS references are lost > PASS ReadableStream closed promise should reject even if stream and reader JS references are lost > PASS Garbage-collecting a ReadableStreamDefaultReader should not unlock its stream >diff --git a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/garbage-collection.serviceworker.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/garbage-collection.serviceworker.https-expected.txt >index c171d126d65a608b54763dbebc06157876a9717f..effb9b528b032aa6fa0451b084e6109883de046e 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/garbage-collection.serviceworker.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/garbage-collection.serviceworker.https-expected.txt >@@ -1,6 +1,6 @@ > > PASS Service worker test setup >-FAIL ReadableStreamController methods should continue working properly when scripts lose their reference to the readable stream promise_test: Unhandled rejection with value: object "TypeError: ReadableStream is not readable" >+PASS ReadableStreamController methods should continue working properly when scripts lose their reference to the readable stream > PASS ReadableStream closed promise should fulfill even if the stream and reader JS references are lost > PASS ReadableStream closed promise should reject even if stream and reader JS references are lost > PASS Garbage-collecting a ReadableStreamDefaultReader should not unlock its stream >diff --git a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/tee-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/tee-expected.txt >index 6de2142fdce3682870f9df4b36f71ab18f28eb84..e03a5c2183c845526d1b0b2f9a7ea433981d3d5d 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/tee-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/streams/readable-streams/tee-expected.txt >@@ -1,7 +1,3 @@ >-CONSOLE MESSAGE: Unhandled Promise Rejection: [object Object] >-CONSOLE MESSAGE: Unhandled Promise Rejection: [object Object] >-CONSOLE MESSAGE: Unhandled Promise Rejection: [object Object] >-CONSOLE MESSAGE: Unhandled Promise Rejection: [object Object] > > PASS ReadableStream teeing: rs.tee() returns an array of two ReadableStreams > PASS ReadableStream teeing: should be able to read one branch to the end without affecting the other >@@ -11,6 +7,8 @@ PASS ReadableStream teeing: canceling branch1 should not impact branch2 > PASS ReadableStream teeing: canceling branch2 should not impact branch2 > PASS ReadableStream teeing: canceling both branches should aggregate the cancel reasons into an array > PASS ReadableStream teeing: failing to cancel the original stream should cause cancel() to reject on branches >+PASS ReadableStream teeing: erroring a teed stream should properly handle canceled branches > PASS ReadableStream teeing: closing the original should immediately close the branches > PASS ReadableStream teeing: erroring the original should immediately error the branches >+PASS ReadableStreamTee should not use a modified ReadableStream constructor from the global object >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185602
:
340296
| 340301 |
340307