Closed
Bug 1118741
Opened 9 years ago
Closed 8 years ago
Implement Document.inputEncoding per spec.
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
DUPLICATE
of bug 647621
People
(Reporter: Ms2ger, Unassigned, Mentored)
Details
(Keywords: dev-doc-needed, Whiteboard: [lang=c++])
Attachments
(1 file)
4.10 KB,
patch
|
Ms2ger
:
feedback+
|
Details | Diff | Splinter Review |
GetInputEncoding should just call GetCharacterSet directly. mHaveInputEncoding should be removed from nsIDocument and the InputEncoding warning should be removed from nsDeprecatedOperationList.h and dom/locales/en-US/chrome/dom/dom.properties. This should fix failures in at least the following web-platform-tests: * dom/interfaces.html * dom/nodes/Document-constructor.html * dom/nodes/DOMImplementation-createDocument.html * dom/nodes/DOMImplementation-createHTMLDocument.html * dom/nodes/Node-properties.html * html/dom/interfaces.html (To adjust the expectations for those tests, remove the entries for the passing tests from the corresponding .ini file at under testing/web-platform/meta/.)
Reporter | ||
Updated•9 years ago
|
Keywords: dev-doc-needed
Comment 1•9 years ago
|
||
I'am interested on working on this bug, can you provide me with some pointers ?
Reporter | ||
Comment 2•9 years ago
|
||
Sure. The implementation of Document.inputEncoding is in the nsIDocument::GetInputEncoding function here: <https://mxr.mozilla.org/mozilla-central/source/dom/base/nsDocument.cpp#7468>. Right now, it calls GetCharacterSet if mHaveInputEncoding is true, while it should just call that function unconditionally. Also, we log a warning to the developer console whenever you first access the inputEncoding attribute; this is what the WarnOnceAbout call is for. Since this attribute has been added to the specification, there's no longer a need to warn about its usage, so we can remove that call and the definition of the warning. Good luck!
Comment 3•9 years ago
|
||
> GetInputEncoding should just call GetCharacterSet directly.
Is there consensus on this spec? What do other implementations do?
I'd rather not change behavior here if we have to change it back later.
Flags: needinfo?(Ms2ger)
Comment 4•9 years ago
|
||
Per the discussion in https://www.w3.org/Bugs/Public/show_bug.cgi?id=27435 it seems WebKit/Blink alias. IE reportedly has casing differences.
Flags: needinfo?(Ms2ger)
Comment 5•9 years ago
|
||
OK. Do we have any indication from the IE team what their plans are here?
Comment 6•9 years ago
|
||
No, I asked on Twitter: https://twitter.com/annevk/status/554662116331110400
Comment 7•9 years ago
|
||
Per Travis they might be interested in aligning with the specification if the casing differences won't cause compatibility problems. We don't have the casing differences to begin with...
Comment 8•9 years ago
|
||
Can i work on this bug??
Comment 9•9 years ago
|
||
There are 2 definitions for WarnOnceAbout() method. Which one do we have to remove here?
Reporter | ||
Comment 10•9 years ago
|
||
Just the call in GetInputEncoding should be removed.
Comment 11•9 years ago
|
||
should i make getInputEncoding a const function?
Reporter | ||
Comment 12•9 years ago
|
||
That's probably a good idea, yes.
Comment 13•9 years ago
|
||
Ok I'll get on it right awa . Thanks .
Comment 14•9 years ago
|
||
should the SetDOMStringToNull(aInputEncoding); in <https://mxr.mozilla.org/mozilla-central/source/dom/base/nsDocument.cpp#7487> be moved above the return line? Otherwise it will be ignored.
Comment 15•9 years ago
|
||
Attachment #8554249 -
Flags: review?(Ms2ger)
Reporter | ||
Comment 16•9 years ago
|
||
Comment on attachment 8554249 [details] [diff] [review] bug-1118741-fix.patch Review of attachment 8554249 [details] [diff] [review]: ----------------------------------------------------------------- Looks good; please make sure it builds and passes the tests I mentioned in comment #0. ::: dom/base/nsDocument.cpp @@ +7454,5 @@ > return NS_OK; > } > > void > +nsIDocument::GetInputEncoding(nsAString& aInputEncoding) const Did this build without a change to the declaration? @@ -7458,5 @@ > -nsIDocument::GetInputEncoding(nsAString& aInputEncoding) > -{ > - // Not const function, because WarnOnceAbout is not a const method > - WarnOnceAbout(eInputEncoding); > - if (mHaveInputEncoding) { You should also remove the other references to mHaveInputEncoding
Attachment #8554249 -
Flags: review?(Ms2ger) → feedback+
Updated•9 years ago
|
Assignee: nobody → anirudh.gp
Comment 17•9 years ago
|
||
Is this bug still open then I would like to work on this ?
Reporter | ||
Comment 18•9 years ago
|
||
Hi Jinank, It looks like Anirudh hasn't had time to address my comments in comment #16. It would be great if you could take the patch (attachment 8554249 [details] [diff] [review]) and address those comments. Let me know if there's anything I can help with.
Assignee: anirudh.gp → nobody
Comment 19•8 years ago
|
||
It seems this is a dupe, as inputEncoding was already fixed in bug 647621.
Reporter | ||
Comment 20•8 years ago
|
||
Thanks!
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Assignee | ||
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•