From cc95309be8998366616d00745c2fad1b9eb5757c Mon Sep 17 00:00:00 2001 From: Felipe Gomes Date: Wed, 15 Jun 2011 15:46:12 -0700 Subject: [PATCH] Bug 575248. Double-click on tab bar should behave according to theme and tab positioning. r=dao,jmathies --- browser/base/content/browser.js | 15 ++++++++------- browser/base/content/tabbrowser.xml | 23 ++++++++++++++--------- widget/src/windows/nsWindow.cpp | 11 +++++++++++ 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index f44c6aa9052..c2ca5bda610 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -5093,6 +5093,10 @@ var TabsInTitlebar = { #endif }, + get enabled() { + return document.documentElement.getAttribute("tabsintitlebar") == "true"; + }, + #ifdef CAN_DRAW_IN_TITLEBAR observe: function (subject, topic, data) { if (topic == "nsPref:changed") @@ -5118,8 +5122,7 @@ var TabsInTitlebar = { break; } - let docElement = document.documentElement; - if (allowed == (docElement.getAttribute("tabsintitlebar") == "true")) + if (allowed == this.enabled) return; function $(id) document.getElementById(id); @@ -5140,20 +5143,18 @@ var TabsInTitlebar = { titlebar.style.marginBottom = - Math.min(tabsToolbarRect.top - titlebarTop, tabsToolbarRect.height) + "px"; - docElement.setAttribute("tabsintitlebar", "true"); + document.documentElement.setAttribute("tabsintitlebar", "true"); if (!this._draghandle) { let tmp = {}; Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp); this._draghandle = new tmp.WindowDraggingElement(tabsToolbar, window); this._draghandle.mouseDownCheck = function () { - return !this._dragBindingAlive && - this.ownerDocument.documentElement - .getAttribute("tabsintitlebar") == "true"; + return !this._dragBindingAlive && TabsInTitlebar.enabled; }; } } else { - docElement.removeAttribute("tabsintitlebar"); + document.documentElement.removeAttribute("tabsintitlebar"); titlebar.style.marginBottom = ""; } diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index d192b764c6a..abeefc7476f 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -3203,19 +3203,24 @@ ]]>