Closed Bug 191158 Opened 22 years ago Closed 12 years ago

javascript strict warnings in mailWindowOverlay.js, printing.js, and printPreviewBindings.xml

Categories

(Core :: Print Preview, defect)

x86
Windows XP
defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: bugzilla, Unassigned)

References

Details

(Whiteboard: [See comment 12])

Attachments

(3 obsolete files)

If you right click in an empty message pane and select print preview Warning: assignment to undeclared variable gPrintSettingsAreGlobal Source File: chrome://communicator/content/printing.js Line: 65 Warning: assignment to undeclared variable gSavePrintSettings Source File: chrome://communicator/content/printing.js Line: 66 Error: uriArray has no properties Source File: chrome://messenger/content/msgPrintEngine.js Line: 260 20030128
please don't cc me on random ui bugs
Priority: -- → P3
Target Milestone: --- → Future
I have a patch that fixes the warnings, but I could not reproduce the error. How do I get an empty message pane that I can right-click in?
Attached patch (Av1) fix (obsolete) — Splinter Review
I figured out how to get an empty message pane: first select a message, then select another folder. This patch fixes the original warnings and error, plus an additional warning that appeared after fixing those. With this patch, selecting Print Preview on an empty message pane leads to no warnings or errors, and selecting Print Preview on a non-empty message pane still works. Selecting Print Preview on an empty message pane will now just briefly display a Print Preview dialog and do nothing else. Probably the Print Preview item in the context menu should be disabled in the case of an empty message pane.
Attachment #118889 - Flags: review?(rods)
Attachment #118889 - Flags: review?(rods) → review?(neil)
Yeah, that menuitem should be disabled unless a message is loaded. I thought that there was already a bug for that, but I can't find it. If there is, then this bug is invalid/duplicate/whatever.
It looks like bug 173074 is that bug. But this bug still is not invalid, because three warnings are produced when selecting Print Preview on a non-empty message pane. Changing summary to reflect warnings now produced.
Summary: javascript strict warnings and errors in printing.js and msgPrintEngine.js → javascript strict warnings in mailWindowOverlay.js and printPreviewBindings.xml
Attachment #118889 - Attachment is obsolete: true
Attachment #118889 - Flags: review?(neil.parkwaycc.co.uk)
Strange, I get six warnings :-)
Summary: javascript strict warnings in mailWindowOverlay.js and printPreviewBindings.xml → javascript strict warnings in mailWindowOverlay.js, printing.js, and printPreviewBindings.xml
Attached patch (Av2) Fix for four warnings (obsolete) — Splinter Review
This patch fixes the four warnings I currently get. If anyone can reproduce more warnings, please list the steps and the warnings.
Attached patch (Av2b) Fix for five warnings (obsolete) — Splinter Review
With this patch and the reviewed patch for bug 173074, I cannot generate any warnings or errors with Print Preview in MailNews.
Attachment #129641 - Attachment is obsolete: true
Attachment #130212 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 130212 [details] [diff] [review] (Av2b) Fix for five warnings >@@ -399,7 +396,7 @@ > var webBrowserPrint; > var domWin; > try { >- var ifreq = _content.QueryInterface(Components.interfaces.nsIInterfaceRequestor); >+ ifreq = _content.QueryInterface(Components.interfaces.nsIInterfaceRequestor); > domWin = ifreq.QueryInterface(Components.interfaces.nsIDOMWindow); > } catch (e) { > // Pressing cancel is expressed as an NS_ERROR_ABORT return value, Now unfortunately this code is a waste of time, as domWin == content :-) Had this code been necessary, the correct fix would have been to remove the var ifreq; at line 398. >@@ -39,6 +39,8 @@ > * ***** END LICENSE BLOCK ***** */ > > var gPrintSettings = null; >+var gPrintSettingsAreGlobal = null; >+var gSavePrintSettings = null; These are booleans. Find out whether they should default to true or false. >@@ -40,6 +40,7 @@ > var gPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); > var gPrintSettings = null; > var gWindowReuse = 0; >+var printEngineWindow; This variable is assigned to but never used... definitely no point making it a global.
Attachment #130212 - Flags: review?(neil.parkwaycc.co.uk) → review-
Attachment #118889 - Attachment description: fix → (Av1) fix
Attachment #129641 - Attachment description: Fix for four warnings → (Av2) Fix for four warnings
Comment on attachment 130212 [details] [diff] [review] (Av2b) Fix for five warnings <printPreviewBindings.xml> and <printing.js> were fixed in bug 228529... <mailWindowOverlay.js> Which fix is needed for |printEngineWindow|, variable declaration (and what use ?) or removal ?
Attachment #130212 - Attachment description: Fix for five warnings → (Av2b) Fix for five warnings
Attachment #130212 - Attachment is obsolete: true
Depends on: 228529
I don't see the console messages. Fixed?
(In reply to comment #11) > Fixed? No: [Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.9a1) Gecko/20050904 SeaMonkey/1.1a] (nightly) (W98SE) Try it on a message without body; Note that the (strict) warning displays only the first time in the "session". {{ Warning: assignment to undeclared variable printEngineWindow Source File: chrome://messenger/content/mailWindowOverlay.js Line: 1576 }} Same code at http://lxr.mozilla.org/mozilla/source/mail/base/content/mailWindowOverlay.js#1596 Variable removal seems appropriate. David: Would you r+sr a patch that would do just this ?
Assignee: rods → printing
Severity: normal → minor
Component: Printing → Print Preview
Priority: P3 → --
Summary: javascript strict warnings in mailWindowOverlay.js, printing.js, and printPreviewBindings.xml → javascript strict warnings in mailWindowOverlay.js, and printPreviewBindings.xml
Whiteboard: [See comment 12]
Target Milestone: Future → ---
Summary: javascript strict warnings in mailWindowOverlay.js, and printPreviewBindings.xml → javascript strict warnings in mailWindowOverlay.js, printing.js, and printPreviewBindings.xml
Blocks: 296661
Assignee: printing → nobody
QA Contact: sujay → printing
Bug 462681 fixed the "assignment to undeclared variable printEngineWindow" issue.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: