Closed Bug 1448689 Opened 7 years ago Closed 7 years ago

View Message Source (Ctrl+U), then "View > Text Encoding" doesn't work

Categories

(Thunderbird :: General, defect)

defect
Not set
normal

Tracking

(thunderbird60 fixed, thunderbird61 fixed)

RESOLVED FIXED
Thunderbird 61.0
Tracking Status
thunderbird60 --- fixed
thunderbird61 --- fixed

People

(Reporter: jorgk-bmo, Assigned: jorgk-bmo)

References

Details

Attachments

(3 files, 1 obsolete file)

In bug 1439021 I made "View Message Source" work again: https://hg.mozilla.org/comm-central/rev/2caecab6e8c0 Landed 27-Feb-2018. Looks like on 28-Feb-2018 there was no Daily. In Daily of 1-Mar-2018, the "View > Text Encoding" worked. In that binary I could change, for example, from Western to Unicode, and when revisiting the menu later, it was still set to Unicode. Now that doesn't work any more. Bug 1441939 also made changes to viewSource.xul, but that landed before the Daily build on 1-Mar-2018. So somewhere between 1st of March and today, something broke. Actually, since TB 60 beta was branched off on 12-Mar-2018 and it's not working there either, the breakage occurred between the 1st and 12th. Alice, can you please find it for us: STR: Ctrl+U on a message, View > Text Encoding, select an encoding. Close menu. Revisit menu, check that encoding is still selected.
Flags: needinfo?(alice0775)
I cannot reproduce the issue on the following latest Windows 2012 x64 opt tc(B) build Build ID 20180325101631 User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Thunderbird/61.0a1 Built from comm-central revision 89435f04afee556e91d8f17634cd377dff5ac: 89435f04afee556e91d8f17634cd377dff5ac8d2 Built from mozilla-central revision 6862624e24d005fb4f8fb07c6800d2acef: 6862624e24d005fb4f8fb07c6800d2acef1d287e My Steps To Reproduce: 1. Select a message in thread pane 2. Ctrl+U --- I can observe that "Source of bla bla" window pops up 3. View > Text Encoding in "Source of bla bla" window --- I can observe "Western" is selected now 4. Chose ”Unicode" --- the menu rolls up 5. Again, View > Text Encoding in "Source of bla bla" window --- I can observe "Western" is selected now
Flags: needinfo?(alice0775)
Is there a misunderstanding? In 4 you chose "Unicode" and in 5 you revisit and it's back at "Western". That's the bug. It should be "Unicode". Also, when you chose a different encoding, the displayed content should actually change, which is doesn't. What do you get for a Japanese e-mail in UTF-8 or ISO-2022-JP? Also "Western"? - then the display would be garbled. Before you could correct that by choosing the correct encoding. Now choosing an encoding has no effect.
Like I have an e-mail in windows-1252 here, with an á. That displays fine in "Western", but when I switch to "Unicode", it should be garbled. But since it doesn't switch, nothing happens.
Attached file Mail in UTF-8.eml
Try viewing the source of this e-mail in UTF-8. You can't you're stuck at Western.
(In reply to Jorg K (GMT+1) from comment #2) > Is there a misunderstanding? > In 4 you chose "Unicode" and in 5 you revisit and it's back at "Western". > That's the bug. It should be "Unicode". > > Also, when you chose a different encoding, the displayed content should > actually change, which is doesn't. What do you get for a Japanese e-mail in > UTF-8 or ISO-2022-JP? Also "Western"? - then the display would be garbled. > Before you could correct that by choosing the correct encoding. Now choosing > an encoding has no effect. Aha, My bad. I had misunderstood. I will try again.
Suspect: 3cee5c02db0a J. Ryan Stinnett — Bug 1443371 - Remove unused page descriptor in viewSourceUtils.js. r=bdahl b98a010be06f J. Ryan Stinnett — Bug 1443371 - Remove unused View Source message listeners. r=bdahl
That's it: https://hg.mozilla.org/mozilla-central/rev/b98a010be06f#l1.17 We used that to set the charset: onSetCharacterSet(event) { if (event.target.hasAttribute("charset")) { let charset = event.target.getAttribute("charset"); // If we don't have history enabled, we have to do a reload in order to // show the character set change. See bug 136322. this.sendAsyncMessage("ViewSource:SetCharacterSet", { :-( Thanks so much for finding it.
"ViewSource:ToggleWrapping", "ViewSource:ToggleSyntaxHighlighting" and "ViewSource:SetCharacterSet" were all removed, so that stuff will also not work any more. We should remove it from the menu, I've never used it. Being able to set the charset is essential, we need to restore that.
This works for me. It uses snippets from here: https://hg.mozilla.org/mozilla-central/rev/b98a010be06f#l1.131 The reload is always necessary. As far as I can tell, wrapping already didn't work for e-mail source and syntax highlighting makes no sense for e-mail source either. Both were also used in SM, but since the message sending for "ViewSource:ToggleWrapping", "ViewSource:ToggleSyntaxHighlighting" has gone away, I'm just guarding this code with #ifdef and SM may want to restore whatever they deem fit. I can't dedicate more time to this and we need to restore at least the charset feature. Please apply the patch on top of bug 1448652 (which will land soon).
Assignee: nobody → jorgk
Status: NEW → ASSIGNED
Attachment #8962202 - Flags: review?(acelists)
Highlight was also used to show the line when opened from console. I know, opening from console doesn't work now.
Syntax highlight the JS code? Sorry, it was always *disabled*, I tried in TB 52.
Sorry, only saw the "highlighting". Yeah, syntax highlighting wasn't enabled.
"Goto" still works and that highlights the line ;-)
Comment on attachment 8962202 [details] [diff] [review] 1448689-charset.patch (v1) Review of attachment 8962202 [details] [diff] [review]: ----------------------------------------------------------------- Thanks, works for me.
Attachment #8962202 - Flags: review?(acelists) → review+
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/019e34d5f6f5 fix setting charset and remove wrapping and highlight options in 'View Source'. r=aceman
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 61.0
Attachment #8962202 - Flags: approval-comm-beta+
Grrrr, I removed id="menu_wrapLongLines" and id="menu_highlightSyntax" from the XUL file, but it's still referenced in the JS file :-(
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch 1448689-follow-up.patch (obsolete) — Splinter Review
Attachment #8965493 - Flags: approval-comm-beta+
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/5c77a04b630b Follow-up: Don't access removed menu items. r=me
Status: REOPENED → RESOLVED
Closed: 7 years ago7 years ago
Resolution: --- → FIXED
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/3fc4e8ecfe15 Follow-up: Fix linting error. r=me DONTBUILD
OR maybe it would be enough to check whether wrapMenuItem and highlightMenuItem are not null first?
Sorry, better with review this time :-(
Attachment #8965493 - Attachment is obsolete: true
Attachment #8965586 - Flags: review?(acelists)
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/3296b386b6a7 Backed out changeset 3fc4e8ecfe15 and 5c77a04b630b. a=backout https://hg.mozilla.org/comm-central/rev/c43c822333a1 Follow-up: Don't access removed menu items. r=aceman DONTBUILD
Comment on attachment 8965586 [details] [diff] [review] 1448689-follow-up-take2.patch Review of attachment 8965586 [details] [diff] [review]: ----------------------------------------------------------------- Thanks.
Attachment #8965586 - Flags: review?(acelists) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: