mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
backout merge a=bustage
This commit is contained in:
commit
083b99c3ba
@ -927,20 +927,12 @@ let TabItems = {
|
|||||||
let tabItem = tab._tabViewTabItem;
|
let tabItem = tab._tabViewTabItem;
|
||||||
|
|
||||||
// ___ icon
|
// ___ icon
|
||||||
if (this.shouldLoadFavIcon(tab.linkedBrowser)) {
|
let iconUrl = tab.image;
|
||||||
let iconUrl = tab.image;
|
if (!iconUrl)
|
||||||
if (!iconUrl)
|
iconUrl = Utils.defaultFaviconURL;
|
||||||
iconUrl = Utils.defaultFaviconURL;
|
|
||||||
|
if (iconUrl != tabItem.favImgEl.src)
|
||||||
if (iconUrl != tabItem.favImgEl.src)
|
tabItem.favImgEl.src = iconUrl;
|
||||||
tabItem.favImgEl.src = iconUrl;
|
|
||||||
|
|
||||||
iQ(tabItem.favEl).show();
|
|
||||||
} else {
|
|
||||||
if (tabItem.favImgEl.hasAttribute("src"))
|
|
||||||
tabItem.favImgEl.removeAttribute("src");
|
|
||||||
iQ(tabItem.favEl).hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ___ URL
|
// ___ URL
|
||||||
let tabUrl = tab.linkedBrowser.currentURI.spec;
|
let tabUrl = tab.linkedBrowser.currentURI.spec;
|
||||||
@ -980,14 +972,6 @@ let TabItems = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// ----------
|
|
||||||
// Function: shouldLoadFavIcon
|
|
||||||
// Takes a xul:browser and checks whether we should display a favicon for it.
|
|
||||||
shouldLoadFavIcon: function TabItems_shouldLoadFavIcon(browser) {
|
|
||||||
return !(browser.contentDocument instanceof window.ImageDocument) &&
|
|
||||||
gBrowser.shouldLoadFavIcon(browser.contentDocument.documentURIObject);
|
|
||||||
},
|
|
||||||
|
|
||||||
// ----------
|
// ----------
|
||||||
// Function: link
|
// Function: link
|
||||||
// Takes in a xul:tab, creates a TabItem for it and adds it to the scene.
|
// Takes in a xul:tab, creates a TabItem for it and adds it to the scene.
|
||||||
|
@ -73,7 +73,6 @@ _BROWSER_FILES = \
|
|||||||
browser_tabview_bug606905.js \
|
browser_tabview_bug606905.js \
|
||||||
browser_tabview_bug608037.js \
|
browser_tabview_bug608037.js \
|
||||||
browser_tabview_bug608158.js \
|
browser_tabview_bug608158.js \
|
||||||
browser_tabview_bug610242.js \
|
|
||||||
browser_tabview_bug618828.js \
|
browser_tabview_bug618828.js \
|
||||||
browser_tabview_bug619937.js \
|
browser_tabview_bug619937.js \
|
||||||
browser_tabview_dragdrop.js \
|
browser_tabview_dragdrop.js \
|
||||||
|
@ -1,122 +0,0 @@
|
|||||||
/* ***** BEGIN LICENSE BLOCK *****
|
|
||||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
||||||
*
|
|
||||||
* The contents of this file are subject to the Mozilla Public License Version
|
|
||||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
||||||
* the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
|
||||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
||||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
||||||
* for the specific language governing rights and limitations under the
|
|
||||||
* License.
|
|
||||||
*
|
|
||||||
* The Original Code is bug 610242 test.
|
|
||||||
*
|
|
||||||
* The Initial Developer of the Original Code is
|
|
||||||
* Mozilla Foundation.
|
|
||||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
|
||||||
* the Initial Developer. All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
* Michael Yoshitaka Erlewine <mitcho@mitcho.com>
|
|
||||||
*
|
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
||||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
||||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
||||||
* of those above. If you wish to allow use of your version of this file only
|
|
||||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
||||||
* use your version of this file under the terms of the MPL, indicate your
|
|
||||||
* decision by deleting the provisions above and replace them with the notice
|
|
||||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
||||||
* the provisions above, a recipient may use your version of this file under
|
|
||||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
||||||
*
|
|
||||||
* ***** END LICENSE BLOCK ***** */
|
|
||||||
|
|
||||||
function test() {
|
|
||||||
waitForExplicitFinish();
|
|
||||||
|
|
||||||
newWindowWithTabView(onTabViewWindowLoaded);
|
|
||||||
}
|
|
||||||
|
|
||||||
function onTabViewWindowLoaded(win) {
|
|
||||||
win.removeEventListener("tabviewshown", onTabViewWindowLoaded, false);
|
|
||||||
|
|
||||||
ok(win.TabView.isVisible(), "Tab View is visible");
|
|
||||||
|
|
||||||
let contentWindow = win.document.getElementById("tab-view").contentWindow;
|
|
||||||
let [originalTab] = win.gBrowser.visibleTabs;
|
|
||||||
|
|
||||||
let currentGroup = contentWindow.GroupItems.getActiveGroupItem();
|
|
||||||
|
|
||||||
// Create a group and make it active
|
|
||||||
let box = new contentWindow.Rect(100, 100, 370, 370);
|
|
||||||
let group = new contentWindow.GroupItem([], { bounds: box });
|
|
||||||
ok(group.isEmpty(), "This group is empty");
|
|
||||||
contentWindow.GroupItems.setActiveGroupItem(group);
|
|
||||||
is(contentWindow.GroupItems.getActiveGroupItem(), group, "new group is active");
|
|
||||||
|
|
||||||
// Create a bunch of tabs in the group
|
|
||||||
let bg = {inBackground: true};
|
|
||||||
let datatext = win.gBrowser.loadOneTab("data:text/plain,bug610242", bg);
|
|
||||||
let datahtml = win.gBrowser.loadOneTab("data:text/html,<blink>don't blink!</blink>", bg);
|
|
||||||
let mozilla = win.gBrowser.loadOneTab("about:mozilla", bg);
|
|
||||||
let html = win.gBrowser.loadOneTab("http://example.com", bg);
|
|
||||||
let png = win.gBrowser.loadOneTab("http://mochi.test:8888/browser/browser/base/content/test/moz.png", bg);
|
|
||||||
let svg = win.gBrowser.loadOneTab("http://mochi.test:8888/browser/browser/base/content/test/title_test.svg", bg);
|
|
||||||
|
|
||||||
ok(!group.shouldStack(group._children.length), "Group should not stack.");
|
|
||||||
|
|
||||||
// PREPARE FINISH:
|
|
||||||
group.addSubscriber(group, "close", function() {
|
|
||||||
group.removeSubscriber(group, "close");
|
|
||||||
|
|
||||||
ok(group.isEmpty(), "The group is empty again");
|
|
||||||
|
|
||||||
contentWindow.GroupItems.setActiveGroupItem(currentGroup);
|
|
||||||
isnot(contentWindow.GroupItems.getActiveGroupItem(), null, "There is an active group");
|
|
||||||
is(win.gBrowser.tabs.length, 1, "There is only one tab left");
|
|
||||||
is(win.gBrowser.visibleTabs.length, 1, "There is also only one visible tab");
|
|
||||||
|
|
||||||
let onTabViewHidden = function() {
|
|
||||||
win.removeEventListener("tabviewhidden", onTabViewHidden, false);
|
|
||||||
win.close();
|
|
||||||
ok(win.closed, "new window is closed");
|
|
||||||
finish();
|
|
||||||
};
|
|
||||||
win.addEventListener("tabviewhidden", onTabViewHidden, false);
|
|
||||||
win.gBrowser.selectedTab = originalTab;
|
|
||||||
|
|
||||||
win.TabView.hide();
|
|
||||||
});
|
|
||||||
|
|
||||||
function check(tab, label, visible) {
|
|
||||||
let display = contentWindow.getComputedStyle(tab.tabItem.favEl, null).getPropertyValue("display");
|
|
||||||
if (visible) {
|
|
||||||
is(display, "block", label + " has favicon");
|
|
||||||
} else {
|
|
||||||
is(display, "none", label + " has no favicon");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
afterAllTabsLoaded(function() {
|
|
||||||
afterAllTabItemsUpdated(function() {
|
|
||||||
check(datatext, "datatext", false);
|
|
||||||
check(datahtml, "datahtml", false);
|
|
||||||
check(mozilla, "about:mozilla", false);
|
|
||||||
check(html, "html", true);
|
|
||||||
check(png, "png", false);
|
|
||||||
check(svg, "svg", true);
|
|
||||||
|
|
||||||
// Get rid of the group and its children
|
|
||||||
// The group close will trigger a finish().
|
|
||||||
group.addSubscriber(group, "groupHidden", function() {
|
|
||||||
group.removeSubscriber(group, "groupHidden");
|
|
||||||
group.closeHidden();
|
|
||||||
});
|
|
||||||
group.closeAll();
|
|
||||||
}, win);
|
|
||||||
}, win);
|
|
||||||
}
|
|
@ -203,3 +203,23 @@ function togglePBAndThen(callback) {
|
|||||||
Services.obs.addObserver(pbObserver, "private-browsing-transition-complete", false);
|
Services.obs.addObserver(pbObserver, "private-browsing-transition-complete", false);
|
||||||
pb.privateBrowsingEnabled = !pb.privateBrowsingEnabled;
|
pb.privateBrowsingEnabled = !pb.privateBrowsingEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------
|
||||||
|
function afterAllTabsLoaded(callback) {
|
||||||
|
let stillToLoad = 0;
|
||||||
|
function onLoad() {
|
||||||
|
this.removeEventListener("load", onLoad, true);
|
||||||
|
|
||||||
|
stillToLoad--;
|
||||||
|
if (!stillToLoad)
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let a = 0; a < gBrowser.tabs.length; a++) {
|
||||||
|
let browser = gBrowser.tabs[a].linkedBrowser;
|
||||||
|
if (browser.webProgress.isLoadingDocument) {
|
||||||
|
stillToLoad++;
|
||||||
|
browser.addEventListener("load", onLoad, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
* Raymond Lee <raymond@appcoast.com>
|
* Raymond Lee <raymond@appcoast.com>
|
||||||
* Michael Yoshitaka Erlewine <mitcho@mitcho.com>
|
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
@ -50,55 +49,3 @@ function createEmptyGroupItem(contentWindow, width, height, padding, noAnimation
|
|||||||
|
|
||||||
return emptyGroupItem;
|
return emptyGroupItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------
|
|
||||||
function afterAllTabsLoaded(callback, win) {
|
|
||||||
win = win || window;
|
|
||||||
|
|
||||||
let stillToLoad = 0;
|
|
||||||
function onLoad() {
|
|
||||||
this.removeEventListener("load", onLoad, true);
|
|
||||||
stillToLoad--;
|
|
||||||
if (!stillToLoad)
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let a = 0; a < win.gBrowser.tabs.length; a++) {
|
|
||||||
let browser = win.gBrowser.tabs[a].linkedBrowser;
|
|
||||||
if (browser.webProgress.isLoadingDocument) {
|
|
||||||
stillToLoad++;
|
|
||||||
browser.addEventListener("load", onLoad, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!stillToLoad)
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------
|
|
||||||
function afterAllTabItemsUpdated(callback, win) {
|
|
||||||
win = win || window;
|
|
||||||
let tabItems = win.document.getElementById("tab-view").contentWindow.TabItems;
|
|
||||||
|
|
||||||
for (let a = 0; a < win.gBrowser.tabs.length; a++) {
|
|
||||||
let tabItem = win.gBrowser.tabs[a].tabItem;
|
|
||||||
if (tabItem)
|
|
||||||
tabItems._update(win.gBrowser.tabs[a]);
|
|
||||||
}
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------
|
|
||||||
function newWindowWithTabView(callback) {
|
|
||||||
let win = window.openDialog(getBrowserURL(), "_blank",
|
|
||||||
"chrome,all,dialog=no,height=800,width=800");
|
|
||||||
let onLoad = function() {
|
|
||||||
win.removeEventListener("load", onLoad, false);
|
|
||||||
let onShown = function() {
|
|
||||||
win.removeEventListener("tabviewshown", onShown, false);
|
|
||||||
callback(win);
|
|
||||||
};
|
|
||||||
win.addEventListener("tabviewshown", onShown, false);
|
|
||||||
win.TabView.toggle();
|
|
||||||
}
|
|
||||||
win.addEventListener("load", onLoad, false);
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user