Bug 1416372 - Remove remaining references to the view source statusbar;r=jryans

MozReview-Commit-ID: HQcRAo5eTKk

--HG--
extra : rebase_source : 2d8a50937aa653e65c0e6e769875ddd840b5b9af
This commit is contained in:
Brian Grinstead 2017-11-21 08:40:55 -08:00
parent 93c7560697
commit a38f3c265d
3 changed files with 0 additions and 121 deletions

View File

@ -30,12 +30,6 @@ var global = this;
* view source window, and initialized as soon as it has loaded.
*/
var ViewSourceContent = {
/**
* We'll act as an nsISelectionListener as well so that we can send
* updates to the view source window's status bar.
*/
QueryInterface: XPCOMUtils.generateQI([Ci.nsISelectionListener]),
/**
* These are the messages that ViewSourceContent is prepared to listen
* for. If you need ViewSourceContent to handle more messages, add them
@ -58,16 +52,6 @@ var ViewSourceContent = {
*/
needsDrawSelection: false,
/**
* ViewSourceContent is attached as an nsISelectionListener on pageshow,
* and removed on pagehide. When the initial about:blank is transitioned
* away from, a pagehide is fired without us having attached ourselves
* first. We use this boolean to keep track of whether or not we're
* attached, so we don't attempt to remove our listener when it's not
* yet there (which throws).
*/
selectionListenerAttached: false,
get isViewSource() {
let uri = content.document.documentURI;
return uri.startsWith("view-source:") ||
@ -109,11 +93,6 @@ var ViewSourceContent = {
removeEventListener("unload", this);
Services.els.removeSystemEventListener(global, "contextmenu", this, false);
// Cancel any pending toolbar updates.
if (this.updateStatusTask) {
this.updateStatusTask.disarm();
}
},
/**
@ -394,12 +373,6 @@ var ViewSourceContent = {
* The pageshow event being handled.
*/
onPageShow(event) {
let selection = content.getSelection();
if (selection) {
selection.QueryInterface(Ci.nsISelectionPrivate)
.addSelectionListener(this);
this.selectionListenerAttached = true;
}
content.focus();
// If we need to draw the selection, wait until an actual view source page
@ -424,15 +397,6 @@ var ViewSourceContent = {
* The pagehide event being handled.
*/
onPageHide(event) {
// The initial about:blank will fire pagehide before we
// ever set a selectionListener, so we have a boolean around
// to keep track of when the listener is attached.
if (this.selectionListenerAttached) {
content.getSelection()
.QueryInterface(Ci.nsISelectionPrivate)
.removeSelectionListener(this);
this.selectionListenerAttached = false;
}
sendAsyncMessage("ViewSource:SourceUnloaded");
},
@ -701,43 +665,6 @@ var ViewSourceContent = {
}
},
/**
* A reference to a DeferredTask that is armed every time the
* selection changes.
*/
updateStatusTask: null,
/**
* Called once the DeferredTask fires. Sends a message up to the
* parent to update the status bar text.
*/
updateStatus() {
let selection = content.getSelection();
if (!selection.focusNode) {
sendAsyncMessage("ViewSource:UpdateStatus", { label: "" });
return;
}
if (selection.focusNode.nodeType != Ci.nsIDOMNode.TEXT_NODE) {
return;
}
let selCon = this.selectionController;
selCon.setDisplaySelection(Ci.nsISelectionController.SELECTION_ON);
selCon.setCaretVisibilityDuringSelection(true);
let interlinePosition = selection.QueryInterface(Ci.nsISelectionPrivate)
.interlinePosition;
let result = {};
this.findLocation(null, -1,
selection.focusNode, selection.focusOffset, interlinePosition, result);
let label = this.bundle.formatStringFromName("statusBarLineCol",
[result.line, result.col], 2);
sendAsyncMessage("ViewSource:UpdateStatus", { label });
},
/**
* Loads a view source selection showing the given view-source url and
* highlight the selection.
@ -759,25 +686,6 @@ var ViewSourceContent = {
Services.io.newURI(baseURI));
},
/**
* nsISelectionListener
*/
/**
* Gets called every time the selection is changed. Coalesces frequent
* changes, and calls updateStatus after 100ms of no selection change
* activity.
*/
notifySelectionChanged(doc, sel, reason) {
if (!this.updateStatusTask) {
this.updateStatusTask = new DeferredTask(() => {
this.updateStatus();
}, 100);
}
this.updateStatusTask.arm();
},
/**
* Using special markers left in the serialized source, this helper makes the
* underlying markup of the selected fragment to automatically appear as

View File

@ -80,7 +80,6 @@ ViewSourceChrome.prototype = {
"ViewSource:SourceUnloaded",
"ViewSource:Close",
"ViewSource:OpenURL",
"ViewSource:UpdateStatus",
"ViewSource:ContextMenuOpening",
]),
@ -160,9 +159,6 @@ ViewSourceChrome.prototype = {
case "ViewSource:OpenURL":
this.openURL(data.URL);
break;
case "ViewSource:UpdateStatus":
this.updateStatus(data.label);
break;
case "ViewSource:ContextMenuOpening":
this.onContextMenuOpening(data.isLink, data.isEmail, data.href);
if (this.browser.isRemoteBrowser) {
@ -605,30 +601,6 @@ ViewSourceChrome.prototype = {
}
},
/**
* Updates the status displayed in the status bar of the view source window.
*
* @param label
* The string to be displayed in the statusbar-lin-col element.
*/
updateStatus(label) {
let statusBarField = document.getElementById("statusbar-line-col");
if (statusBarField) {
statusBarField.label = label;
}
},
/**
* Called when the frame script reports that a line was successfully gotten
* to.
*
* @param lineNumber
* The line number that we successfully got to.
*/
onGoToLineSuccess(lineNumber) {
ViewSourceBrowser.prototype.onGoToLineSuccess.call(this, lineNumber);
},
/**
* Reloads the browser, bypassing the network cache.
*/

View File

@ -8,7 +8,6 @@ invalidInputTitle = Invalid input
invalidInputText = The line number entered is invalid.
outOfRangeTitle = Line not found
outOfRangeText = The specified line was not found.
statusBarLineCol = Line %1$S, Col %2$S
viewSelectionSourceTitle = DOM Source of Selection
viewMathMLSourceTitle = DOM Source of MathML