Skip to content

Commit

Permalink
Bug 597931 - New CSS' Item bounds incorrectly include highlighting [r…
Browse files Browse the repository at this point in the history
…=ian, a=beltzner]
  • Loading branch information
mitcho committed Jan 28, 2011
1 parent a7d02bd commit 39b0742
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 48 deletions.
60 changes: 15 additions & 45 deletions browser/base/content/test/tabview/browser_tabview_bug587503.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,14 @@
function test() {
waitForExplicitFinish();

window.addEventListener("tabviewshown", onTabViewWindowLoaded, false);
if (TabView.isVisible())
onTabViewWindowLoaded();
else
TabView.show();
newWindowWithTabView(onTabViewWindowLoaded);
}

function onTabViewWindowLoaded() {
window.removeEventListener("tabviewshown", onTabViewWindowLoaded, false);
function onTabViewWindowLoaded(win) {
ok(win.TabView.isVisible(), "Tab View is visible");

ok(TabView.isVisible(), "Tab View is visible");

let contentWindow = document.getElementById("tab-view").contentWindow;
let [originalTab] = gBrowser.visibleTabs;
let contentWindow = win.document.getElementById("tab-view").contentWindow;
let [originalTab] = win.gBrowser.visibleTabs;

let currentGroup = contentWindow.GroupItems.getActiveGroupItem();

Expand All @@ -63,37 +57,16 @@ function onTabViewWindowLoaded() {

// Create a bunch of tabs in the group
let tabs = [];
tabs.push(gBrowser.loadOneTab("about:blank#0", {inBackground: true}));
tabs.push(gBrowser.loadOneTab("about:blank#1", {inBackground: true}));
tabs.push(gBrowser.loadOneTab("about:blank#2", {inBackground: true}));
tabs.push(gBrowser.loadOneTab("about:blank#3", {inBackground: true}));
tabs.push(gBrowser.loadOneTab("about:blank#4", {inBackground: true}));
tabs.push(gBrowser.loadOneTab("about:blank#5", {inBackground: true}));
tabs.push(gBrowser.loadOneTab("about:blank#6", {inBackground: true}));
tabs.push(win.gBrowser.loadOneTab("about:blank#0", {inBackground: true}));
tabs.push(win.gBrowser.loadOneTab("about:blank#1", {inBackground: true}));
tabs.push(win.gBrowser.loadOneTab("about:blank#2", {inBackground: true}));
tabs.push(win.gBrowser.loadOneTab("about:blank#3", {inBackground: true}));
tabs.push(win.gBrowser.loadOneTab("about:blank#4", {inBackground: true}));
tabs.push(win.gBrowser.loadOneTab("about:blank#5", {inBackground: true}));
tabs.push(win.gBrowser.loadOneTab("about:blank#6", {inBackground: true}));

ok(!group.shouldStack(group._children.length), "Group should not stack.");
is(group._columns, 3, "There should be three columns.");

// 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(gBrowser.tabs.length, 1, "There is only one tab left");
is(gBrowser.visibleTabs.length, 1, "There is also only one visible tab");

let onTabViewHidden = function() {
window.removeEventListener("tabviewhidden", onTabViewHidden, false);
finish();
};
window.addEventListener("tabviewhidden", onTabViewHidden, false);
gBrowser.selectedTab = originalTab;

TabView.hide();
});

// STAGE 1: move the last tab to the third position
let currentTarget = tabs[6]._tabViewTabItem;
Expand Down Expand Up @@ -163,10 +136,9 @@ function onTabViewWindowLoaded() {
is(dropSpaceActiveValues[0], false, "The group began by not showing a dropSpace");
is(dropSpaceActiveValues[dropSpaceActiveValues.length - 1], true, "In the end, the group was showing a dropSpace");

// Get rid of the group and its children
// The group close will trigger a finish().
group.closeAll();
group.closeHidden();
// Close the window and we're done!
win.close();
finish();
}, 6000, false);
},1000);

Expand All @@ -181,9 +153,7 @@ function simulateSlowDragDrop(srcElement, offsetX, offsetY, contentWindow, time)
// enter drag mode
let dataTransfer;

// contentWindow.Utils.log('offset', offsetX, offsetY);
let bounds = srcElement.getBoundingClientRect();
// contentWindow.Utils.log('original center', bounds.left + bounds.width / 2, bounds.top + bounds.height / 2);

EventUtils.synthesizeMouse(
srcElement, 2, 2, { type: "mousedown" }, contentWindow);
Expand Down
2 changes: 1 addition & 1 deletion browser/themes/gnomestripe/browser/tabview/tabview.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ body {
-1px 0 1px rgba(255, 255, 255, 0.4) inset,
0 1px 1.5px rgba(0, 0, 0, 0.4);
cursor: pointer;
margin: 4px;
}

html[dir=rtl] .tab {
Expand Down Expand Up @@ -198,6 +197,7 @@ html[dir=rtl] .stack-trayed .tab-title {
.tabInGroupItem {
border: none;
box-shadow: none !important;
margin: 4px;
}

.groupItem {
Expand Down
2 changes: 1 addition & 1 deletion browser/themes/pinstripe/browser/tabview/tabview.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ body {
box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.4);
border: 1px solid rgba(255, 255, 255, 0.5);
cursor: pointer;
margin: 8px;
}

.tab canvas,
Expand Down Expand Up @@ -197,6 +196,7 @@ html[dir=rtl] .stack-trayed .tab-title {
box-shadow: none;
border-color: transparent;
background-color: transparent;
margin: 8px;
}

.tabInGroupItem .favicon {
Expand Down
2 changes: 1 addition & 1 deletion browser/themes/winstripe/browser/tabview/tabview.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ body {
-1px 0 1px rgba(255, 255, 255, 0.8) inset,
0 1px 1.5px rgba(4, 38, 60, 0.4);
cursor: pointer;
margin: 4px;
}

html[dir=rtl] .tab {
Expand Down Expand Up @@ -211,6 +210,7 @@ html[dir=rtl] .tab.focus {
.tabInGroupItem {
box-shadow: none;
background-color: #E0EAF5;
margin: 4px;
}

.tabInGroupItem .favicon {
Expand Down

0 comments on commit 39b0742

Please sign in to comment.