Closed
Bug 661876
Opened 13 years ago
Closed 13 years ago
Kill obsolete nsIDOMFile properties/methods
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
VERIFIED
FIXED
mozilla7
Tracking | Status | |
---|---|---|
firefox7 | + | --- |
People
(Reporter: khuey, Assigned: khuey)
References
Details
(Keywords: dev-doc-complete, relnote, Whiteboard: [warning landed on aurora])
Attachments
(4 files, 2 obsolete files)
13.76 KB,
patch
|
sicking
:
review+
|
Details | Diff | Splinter Review |
5.75 KB,
patch
|
sicking
:
review+
jst
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
2.64 KB,
patch
|
Details | Diff | Splinter Review | |
997 bytes,
text/html
|
Details |
No description provided.
Attachment #537181 -
Flags: review?(jonas)
Comment on attachment 537181 [details] [diff] [review]
Patch
Please also add a patch here which adds warnings to all these methods which we could check in to aurora.
I suspect none of these methods are used in inner loops or anything like that, so no need to add complexity by making sure that we only warn once per document or some such. Just add a warning to the console every time they are called.
Attachment #537181 -
Flags: review?(jonas) → review+
Assignee | ||
Comment 2•13 years ago
|
||
Attachment #537246 -
Flags: review?(jonas)
Comment on attachment 537246 [details] [diff] [review]
Warn on aurora
Don't add strings to the dom.properties file as it's too late to take string changes on aurora. Even just adding it to the file, even if we don't expect people to translate it, will set off all sorts of warnings in various systems which we don't want.
Also, the properties are to developers called "fileName", "getAsDataURL" etc, no uppercase first character.
Attachment #537246 -
Flags: review?(jonas) → review-
Assignee | ||
Comment 4•13 years ago
|
||
What do you want me to do then, hardcode it into the binary?
Yes
Assignee | ||
Comment 6•13 years ago
|
||
Comments addressed.
Did I mention that nsPrintfCString is a horrible thing?
Attachment #537246 -
Attachment is obsolete: true
Attachment #537266 -
Flags: review?(jonas)
Comment on attachment 537266 [details] [diff] [review]
Now with hardcoded strings
Review of attachment 537266 [details] [diff] [review]:
-----------------------------------------------------------------
I assume you tested that this works: r=me
::: content/base/src/nsDOMFile.cpp
@@ +706,5 @@
> + // This is hardcoded here in English since we're past string freeze.
> +
> + nsPrintfCString warningText
> + (500,
> + "Use of File.%s is deprecated. To upgrade your code, use standard properties or use the DOM FileReader object. For more help https://developer.mozilla.org/en/DOM/FileReader",
"For more help, see https://..."
Attachment #537266 -
Flags: review?(jonas) → review+
Assignee | ||
Comment 8•13 years ago
|
||
Yes, I tested this for all of the properties from the error console.
Assignee | ||
Comment 9•13 years ago
|
||
Comment on attachment 537266 [details] [diff] [review]
Now with hardcoded strings
We would like to take this patch on Aurora to warn web developers that these deprecated APIs are going away (in Firefox 7).
Attachment #537266 -
Flags: approval-mozilla-aurora?
Assignee | ||
Comment 10•13 years ago
|
||
Assignee | ||
Comment 11•13 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/64dd0ffff3f2
http://hg.mozilla.org/mozilla-central/rev/1dec937dfbb6
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
Comment on attachment 537455 [details] [diff] [review]
Test fixes
Review of attachment 537455 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/canvas/test/test_mozGetAsFile.html
@@ +15,5 @@
> + reader.onload =
> + function(e) {
> + is(e.target.result, canvas.toDataURL(type),
> + "<canvas>.mozGetAsFile().getAsDataURL() should equal <canvas>.toDataURL()");
> + SimpleTest.finish();
This doesn't look correct. Won't you call finish multiple times? Is that allowed?
Comment 13•13 years ago
|
||
This broke some of our tools; see bug 662403.
Assignee | ||
Comment 14•13 years ago
|
||
We might want to emphasize this change to web devs.
Keywords: dev-doc-needed
Updated•13 years ago
|
Attachment #537266 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 15•13 years ago
|
||
To recap: no string changes on central, and hard-coded English deprecation notices to the error console for aurora?
If so, sounds good.
Assignee | ||
Comment 16•13 years ago
|
||
(In reply to comment #15)
> To recap: no string changes on central, and hard-coded English deprecation
> notices to the error console for aurora?
>
> If so, sounds good.
Correct.
Updated•13 years ago
|
Keywords: dev-doc-needed → dev-doc-complete
Assignee | ||
Comment 17•13 years ago
|
||
http://hg.mozilla.org/releases/mozilla-aurora/rev/fed3cae237b1
Not marking fixed on Aurora or anything since these are just warnings.
Whiteboard: [warning added in aurora, "fixed in aurora"] → [warning landed on aurora]
Comment 18•13 years ago
|
||
going to track this for potential fallout similar to what we saw at bug 670086
tracking-firefox7:
--- → +
Comment 19•13 years ago
|
||
Can anyone please help me with a test case, STR or some guidelines that I can use to verify this fix?
Thank you
If you get hold of a File object, using for example <input type=file> and getting .files[0], then the File object should *not* have any of the following properties or functions:
.fileName
.fileSize
.getAsText()
.getAsDataURL()
.getAsBinary()
Comment 21•13 years ago
|
||
test case used to verify the bug/fix
Comment 22•13 years ago
|
||
Verified fixed on:
Mozilla/5.0 (Windows NT 6.1; rv:7.0) Gecko/20100101 Firefox/7.0
Mozilla/5.0 (X11; Linux i686 on x86_64; rv:7.0) Gecko/20100101 Firefox/7.0
Mozilla/5.0 (Windows NT 5.1; rv:7.0) Gecko/20100101 Firefox/7.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0) Gecko/20100101 Firefox/7.0
Steps used to verify the fix:
1. Open the test case from comment #21.
2. Upload a file.
3. Tap on the Display Properties button.
The Name and Size properties are displayed as "undefined". The .getAsText(), .getAsDataURL() and .getAsBinary() functions don't return anything.
(I verified the test case on FF6 and all the properties were displayed).
Status: RESOLVED → VERIFIED
Updated•13 years ago
|
Attachment #556771 -
Attachment is obsolete: true
Comment 23•13 years ago
|
||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•