Intent to Ship: FileReader - Set Result Only on Load

64 views
Skip to first unread message

Shubham Aggarwal

unread,
Aug 19, 2020, 3:40:43 PM8/19/20
to blink-dev

Contact emails
shu...@microsoft.com

Explainer

w3c/FileAPI#79

Specification
https://w3c.github.io/FileAPI/#APIASynch

Design docs

w3c/FileAPI#79
https://crbug.com/768972
https://chromium-review.googlesource.com/c/chromium/src/+/2352610

TAG review
This is essentially a bug fix so no review needed.

Summary
The feature changes the behavior of FileReader API so that the result attribute is only set right before the Load event is fired. Motivation: This brings the chromium FileReader implementation in line with the FileAPI spec. The existing implementation was identified to possibly cause memory leaks but that scenario was very rarely seen, as evidenced by this experiment: https://www.chromestatus.com/metrics/feature/timeline/popularity/2158.

Link to “Intent to Prototype” blink-dev discussion
w3c/FileAPI#79

Risks

Interoperability and Compatibility
Very minimal risk as the scenario it removes is super rarely used as can be seen from https://www.chromestatus.com/metrics/feature/timeline/popularity/2158 .

Gecko: Shipped/Shipping Already fixed

WebKit: No signal

Web developers: No signals

Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes

Is this feature fully tested by web-platform-tests?
Yes https://github.com/web-platform-tests/wpt/blob/master/FileAPI/reading-data-section/filereader_result.html

Tracking bug
https://crbug.com/768972

Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5336723045220352

Chris Harrelson

unread,
Aug 19, 2020, 10:20:49 PM8/19/20
to Shubham Aggarwal, blink-dev
LGTM1

Does Webkit have the same behavior as Chromium in this regard? Could you file a bug requesting it be fixed on that implementation as well?

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/ed9bd689-29e3-4d04-af9c-0ab041eab02en%40chromium.org.

Yoav Weiss

unread,
Aug 20, 2020, 3:08:49 AM8/20/20
to Chris Harrelson, Shubham Aggarwal, blink-dev

Alex Russell

unread,
Aug 20, 2020, 3:37:27 PM8/20/20
to blink-dev, yo...@yoav.ws, shu...@microsoft.com, blink-dev, Chris Harrelson
LGTM3
Reply all
Reply to author
Forward
0 new messages