Closed
Bug 39776
Opened 25 years ago
Closed 25 years ago
No checkmark in charset menu for current document
Categories
(Core :: XUL, defect, P3)
Core
XUL
Tracking
()
M17
People
(Reporter: cata, Assigned: cata)
References
Details
The charset menu is supposed to have a checkmark next to the character set of the HTML document currently being viewed by the user. The JS code I am using to get to that document is: var charset = document.commandDispatcher.focusedWindow.document.characterSet; dump("Update current charset: " + charset + "\n"); But this code returns the charset of the document contained in the focused window! In other words instead of getting the window containing the HTML document I may get the "Location" bar window. And if I move the focus manually on the HTML window by selecting some text, then the code will return that window... So there are two possibilities here: a) my code is wrong. In this case, please indicate the right one! b) there is bug, please fix it.
Comment 1•25 years ago
|
||
your code is wrong. when the urlbar is focused, the xul window will be focused. just add a guard that uses window.content in the case where window == the focusedwindow you got from the command dispatcher
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → INVALID
The code David suggested is: var wnd = document.commandDispatcher.focusedWindow; if (window == wnd) wnd = window.content; var charset = wnd.document.characterSet; dump("Update current charset: " + charset + "\n"); And it works like a charm. Thanks David for the quick fix. You rock!
Reopened and changed summary. No user feedback creates bad usability bug.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Summary: Unexpected result in getter code for the current HTML window → No checkmark in charset menu for current document
*** This bug has been marked as a duplicate of 31708 ***
Status: NEW → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•