Bug 42723 - FileReader needs addEventListener
Summary: FileReader needs addEventListener
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Jian Li
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-20 23:01 PDT by Ridley Combs
Modified: 2012-01-05 11:00 PST (History)
10 users (show)

See Also:


Attachments
Proposed Patch (4.78 KB, patch)
2012-01-04 18:00 PST, Jian Li
abarth: review+
jianli: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ridley Combs 2010-07-20 23:01:24 PDT
The FileReader class currently doesn't implement addEventListener, which it... should. Leaving defining object.oneventname as the only way to define events results in some pages not working in WebKit (i.e. those that use addEventListener).
Comment 1 Luis 2011-03-28 02:51:00 PDT
I confirm this in version 534.24 (branches/chromium/696@81543) with a few corrections.
This applies to the WebCore component, not JavaScriptCore.
(According to the JavaScript Console) the FileReader interface is missing the entire EventTarget interface despite the current File API specification's draft stipulating it (http://www.w3.org/TR/FileAPI/#FileReader-interface):
'FileReader implements EventTarget;'.
Oddly, it's present in the source code
http://trac.webkit.org/browser/trunk/Source/WebCore/fileapi/FileReader.idl
and has been for a while.
However, I'm not seeing a reference to 'FileReader' show up in 'EventTarget* toEventTarget(JSC::JSValue value)' where it perhaps should (I honestly don't know):
http://trac.webkit.org/browser/trunk/Source/WebCore/bindings/js/JSEventTarget.cpp
Somewhere down the line, the right source code isn't getting generated.
Comment 3 Jian Li 2012-01-04 18:00:37 PST
Created attachment 121197 [details]
Proposed Patch
Comment 4 Adam Barth 2012-01-04 23:40:01 PST
Comment on attachment 121197 [details]
Proposed Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=121197&action=review

> LayoutTests/fast/files/file-reader-event-listener.html:40
> +    if (layoutTestController.notifyDone)

Do you mean:
if (window.layoutTestController)
    layoutTestController.notifyDone();
?

> LayoutTests/fast/files/file-reader-event-listener.html:84
> +    window.onload = runTests;

Should we alert a message if eventSender isn't present?
Comment 5 David Levin 2012-01-04 23:45:04 PST
Comment on attachment 121197 [details]
Proposed Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=121197&action=review

> LayoutTests/fast/files/file-reader-event-listener.html:82
> +    layoutTestController.dumpAsText();

if (window.layoutTestController) around these lines.
Comment 6 Jian Li 2012-01-05 11:00:07 PST
Committed as http://trac.webkit.org/changeset/104180.