Bug 1360282 - Use the existing title setter for SidebarUI instead of changing the value directly;r=Gijs draft
authorBrian Grinstead <bgrinstead@mozilla.com>
Tue, 13 Jun 2017 08:14:58 -0700
changeset 593456 bc2b45ea29848aee3767757a8a0497eaf065cd0d
parent 593455 ed67bebb88ca18ba009d3b943d52086e648161f4
child 593457 ac822ab6f4f64a32c51b5cd55ba7f87bee4f90f8
push id63696
push userbgrinstead@mozilla.com
push dateTue, 13 Jun 2017 15:15:10 +0000
reviewersGijs
bugs1360282
milestone56.0a1
Bug 1360282 - Use the existing title setter for SidebarUI instead of changing the value directly;r=Gijs MozReview-Commit-ID: FCke6FxUrJj
browser/base/content/browser-sidebar.js
--- a/browser/base/content/browser-sidebar.js
+++ b/browser/base/content/browser-sidebar.js
@@ -324,17 +324,17 @@ var SidebarUI = {
 
       let title = sidebarBroadcaster.getAttribute("sidebartitle") ||
                   sidebarBroadcaster.getAttribute("label");
 
       // When loading a web page in the sidebar there is no title set on the
       // broadcaster, as it is instead set by openWebPanel. Don't clear out
       // the title in this case.
       if (title) {
-        this._title.value = title;
+        this.title = title;
       }
 
       let url = sidebarBroadcaster.getAttribute("sidebarurl");
       this.browser.setAttribute("src", url); // kick off async load
 
       if (this.browser.contentDocument.location.href != url) {
         this.browser.addEventListener("load", event => {
 
@@ -383,17 +383,17 @@ var SidebarUI = {
     // create a new content viewer because the old one doesn't get destroyed
     // until about:blank has loaded (which does not happen as long as the
     // element is hidden).
     this.browser.setAttribute("src", "about:blank");
     this.browser.docShell.createAboutBlankContentViewer(null);
 
     sidebarBroadcaster.removeAttribute("checked");
     this._box.setAttribute("sidebarcommand", "");
-    this._title.value = "";
+    this.title = "";
     this._box.hidden = this._splitter.hidden = true;
 
     let selBrowser = gBrowser.selectedBrowser;
     selBrowser.focus();
     selBrowser.messageManager.sendAsyncMessage("Sidebar:VisibilityChange",
       {commandID, isOpen: false}
     );
     BrowserUITelemetry.countSidebarEvent(commandID, "hide");