[BETA] Need to expose api GetDocumentCharacterSet() to JS

VERIFIED FIXED

Status

()

Core
DOM
P3
normal
VERIFIED FIXED
19 years ago
17 years ago

People

(Reporter: tao, Assigned: tao)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: patch available for checkin, URL)

(Assignee)

Description

19 years ago
Here is a copy of the article pointed by the URL field above.

"These |GetDocumentCharacterSet()| method is exposed
on nsIDocument only. IMO, we should probably add this to either
NSDocument
(http://lxr.mozilla.org/mozilla/source/dom/public/idl/coreDom/Document.idl)
or NSHTMLDocument
(http://lxr.mozilla.org/mozilla/source/dom/public/idl/html/HTMLDocument.idl)."

The "View| charset > " menu feature needs to know the charset of the current
loaded document in the frame from JS.

Updated

19 years ago
Assignee: vidur → tao

Comment 1

19 years ago
Sorry guys, if this an RFE, you're going to have to implement yourself. I'll be
happy to point you in the right direction and review when you're done, but I
don't have the bandwidth to deal with new functionality.
(Assignee)

Comment 2

19 years ago
Hi, Vidur:

Would you please feed us information about how to do it in the right way?


Thanks.

Updated

19 years ago
Blocks: 20761

Updated

19 years ago
Summary: Need to expose api GetDocumentCharacterSet() to JS → [BETA] Need to expose api GetDocumentCharacterSet() to JS

Comment 3

19 years ago
Vidur, Can you point us at similar code that uses the pre-non-IDL mechanism
to expose APIs to JS?  This functionality is needed to enable the new charset
encoding menu for Beta1.
(Assignee)

Updated

19 years ago
Status: NEW → ASSIGNED
Whiteboard: patch available for checkin
(Assignee)

Comment 4

19 years ago
Hi, Bob:

Vidur worked with me yesterday afteroon to come up the patch. Mostly Vidur's
work; the only thing I did is to test it on NT and Linux.

I'll check in the code as soon as tree open.


Thanks
(Assignee)

Updated

19 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED
(Assignee)

Comment 5

19 years ago
To verify it:

Please copy the lines inbetween "+++" marks to the bottom of

      chrome/global/content/default/charsetOverlay.js

and rerun Mozilla. You can click on Sidebar panel, the location bar, or the
browser page to move focus. You shall see the current charset of the loaded
page dump to the console.

Feel free to let me know if you have any problem verifying it.

+++++ BEGIN ++++++++
function charsetFocusListener(event)
{

    dump("\n++ JS charsetFocusListener, event=" + event + "++\n");
    var charsetMenu = document.getElementById( "charsetMenu" );
    if (charsetMenu) {
      dump("\n** charsetMenu=" + charsetMenu + "--\n");
    }

    dump("\n++++ JS charsetFocusListener: the current focused object is: " +
         document.commandDispatcher.focusedWindow + "--\n");
    dump("\n>>>> JS charsetFocusListener: content object charset is: " +
         document.commandDispatcher.focusedWindow.content.document.characterSet
+ "--\n");

}

  window.addEventListener("focus",
             charsetFocusListener,
             false /* true = capture, false = bubble */);


+++++ END ++++++++++

Comment 6

19 years ago
Teruko, this is a code change for i18n. Please set the appropriate QA contact. 
Thanks.
QA Contact: gerardok → teruko

Comment 7

18 years ago
Verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.