Closed
Bug 966385
Opened 10 years ago
Closed 10 years ago
xhr gives Warning: Use of inputEncoding is deprecated
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: rkent, Assigned: bzbarsky)
References
Details
Attachments
(1 file)
1.29 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
See also bug 860312 and bug 801545 My ExQuilla addon for Thunderbird, that uses XHR extensively, generates these junk warnings constantly: "Warning: Use of inputEncoding is deprecated" This warning originates in nsDocument.cpp GetInputEncoding, which in turn is called from nsXMLHttpRequest.cpp GetRequestBody As far as I can tell, this error occurs whenever XHR is used to send a request, with no way to suppress it. My users complain about seeing this warning in the Error Console. It seems to me that core code should not be generating an error message on the console that other core code routinely causes. Can't we remove that warning message until the core code is fixed, or at least have it only appear in debug mode?
Assignee | ||
Comment 1•10 years ago
|
||
Ms2ger, you added the warning here. What's the right replacement for inputEncoding here?
> with no way to suppress it
At least not as long as you're passing a document object as an argument to send(), yeah...
Blocks: 688190
Flags: needinfo?(Ms2ger)
Reporter | ||
Comment 2•10 years ago
|
||
(In reply to Boris Zbarsky [:bz] from comment #1) > > > with no way to suppress it > > At least not as long as you're passing a document object as an argument to > send(), yeah... Thanks for the hint. If I serialize the DOM object before passing to XHR.send I can get rid of the junk warning. I'll do that. It must not be that common to pass a DOM document to send, because when I google for the error message, my addon appears in the top page (Assuming that I correctly convinced google to give me generic and not personalized results).
Assignee | ||
Comment 4•10 years ago
|
||
Though per spec, I think we should always be using UTF-8 here... I don't see an existing bug on that, though.
Attachment #8529529 -
Flags: review?(peterv)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Comment 5•10 years ago
|
||
Comment on attachment 8529529 [details] [diff] [review] Stop using the deprecated GetInputEncoding in XHR code Review of attachment 8529529 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/base/nsXMLHttpRequest.cpp @@ +2402,5 @@ > { > aContentType.AssignLiteral("application/xml"); > + nsAutoString charset; > + aDoc->GetCharacterSet(charset); > + CopyUTF16toUTF8(charset, aCharset); Or |aCharset = aDoc->GetDocumentCharacterSet();|?
Attachment #8529529 -
Flags: review?(peterv) → review+
Assignee | ||
Comment 6•10 years ago
|
||
Did that and https://hg.mozilla.org/integration/mozilla-inbound/rev/fcc020cf3afe
Target Milestone: --- → mozilla37
Assignee | ||
Comment 7•10 years ago
|
||
Except of course aDoc is an nsIDOMDocument. Added a QI: https://hg.mozilla.org/integration/mozilla-inbound/rev/458fbb343a6d
Comment 8•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/fcc020cf3afe https://hg.mozilla.org/mozilla-central/rev/458fbb343a6d
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•