Closed
Bug 393742
Opened 17 years ago
Closed 17 years ago
Silly var use in exitPrintPreview()
Categories
(Toolkit :: Printing, defect)
Toolkit
Printing
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha8
People
(Reporter: philor, Assigned: philor)
References
()
Details
Attachments
(1 file)
(deleted),
patch
|
Gavin
:
review+
|
Details | Diff | Splinter Review |
Had I been paying attention, I would have seen bug 321954 comment 9, and spared myself filing a bug to remove a single single-use var.
Attachment #278269 -
Flags: review?(gavin.sharp)
If you think single-use variables are silly (I agree), why don't you remove the others in that function, webBrowserPrint and contentWindow, too?
Assignee | ||
Comment 2•17 years ago
|
||
Because they aren't silly a priori, they're silly when they don't provide any added clarity. printPreviewTB is single-use too, but |getNavToolbox().parentNode.removeChild(document.getElementById("print-preview-toolbar"));| or |aWindow ? aWindow.focus() : window.content.focus();| make it harder to read; |getNavToolbox().parentNode.removeChild(printPreviewTB);| doesn't.
Ehm, I said webBrowserPrint, not navToolBox
var webBrowserPrint = this.getWebBrowserPrint(aWindow);
webBrowserPrint.exitPrintPreview();
isn't easier to read than
this.getWebBrowserPrint(aWindow).exitPrintPreview();
and
contentWindow = aWindow || window.content;
contentWindow.focus();
isn't easier to read than
(aWindow || window.content).focus();
All IMHO, of course. Although, that navToolBox use looks strange, too. Why not
just
printPreviewTB.parentNode.removeChild(printPreviewTB);
Updated•17 years ago
|
Attachment #278269 -
Flags: review?(gavin.sharp) → review+
Assignee | ||
Comment 4•17 years ago
|
||
toolkit/components/printing/content/printUtils.js 1.30
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•