mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-25 14:17:22 +00:00
Bug 881287 - Remove obsolete ContextUI code related to navbar visibility and touch up contextui tests. r=mbrubeck
This commit is contained in:
parent
88193b5d52
commit
c4c332e050
@ -1137,7 +1137,10 @@ var ContextUI = {
|
||||
* Context UI state getters & setters
|
||||
*/
|
||||
|
||||
get isVisible() { return Elements.tray.hasAttribute("visible"); },
|
||||
get isVisible() {
|
||||
return (Elements.navbar.hasAttribute("visible") ||
|
||||
Elements.navbar.hasAttribute("startpage"));
|
||||
},
|
||||
get isExpanded() { return Elements.tray.hasAttribute("expanded"); },
|
||||
get isExpandable() { return this._expandable; },
|
||||
|
||||
@ -1173,11 +1176,6 @@ var ContextUI = {
|
||||
this._setIsExpanded(true);
|
||||
shown = true;
|
||||
}
|
||||
if (!this.isVisible) {
|
||||
// show the navbar
|
||||
this._setIsVisible(true);
|
||||
shown = true;
|
||||
}
|
||||
if (!Elements.navbar.isShowing) {
|
||||
// show the navbar
|
||||
Elements.navbar.show();
|
||||
@ -1194,13 +1192,12 @@ var ContextUI = {
|
||||
// Display the nav bar
|
||||
displayNavbar: function displayNavbar() {
|
||||
this._clearDelayedTimeout();
|
||||
this._setIsVisible(true, true);
|
||||
Elements.navbar.show();
|
||||
},
|
||||
|
||||
// Display the toolbar and tabs
|
||||
displayTabs: function displayTabs() {
|
||||
this._clearDelayedTimeout();
|
||||
this._setIsVisible(true, true);
|
||||
this._setIsExpanded(true, true);
|
||||
},
|
||||
|
||||
@ -1227,10 +1224,6 @@ var ContextUI = {
|
||||
this._setIsExpanded(false);
|
||||
dismissed = true;
|
||||
}
|
||||
if (this.isVisible && !StartUI.isStartURI()) {
|
||||
this._setIsVisible(false);
|
||||
dismissed = true;
|
||||
}
|
||||
if (Elements.navbar.isShowing) {
|
||||
this.dismissAppbar();
|
||||
dismissed = true;
|
||||
@ -1269,24 +1262,6 @@ var ContextUI = {
|
||||
* Internal tray state setters
|
||||
*/
|
||||
|
||||
// url bar state
|
||||
_setIsVisible: function _setIsVisible(aFlag, setSilently) {
|
||||
if (this.isVisible == aFlag)
|
||||
return;
|
||||
|
||||
if (aFlag)
|
||||
Elements.tray.setAttribute("visible", "true");
|
||||
else
|
||||
Elements.tray.removeAttribute("visible");
|
||||
|
||||
if (!aFlag) {
|
||||
content.focus();
|
||||
}
|
||||
|
||||
if (!setSilently)
|
||||
this._fire(aFlag ? "MozContextUIShow" : "MozContextUIDismiss");
|
||||
},
|
||||
|
||||
// tab tray state
|
||||
_setIsExpanded: function _setIsExpanded(aFlag, setSilently) {
|
||||
// if the tray can't be expanded, don't expand it.
|
||||
|
@ -180,7 +180,7 @@
|
||||
<stack id="stack" flex="1">
|
||||
<!-- Page Area -->
|
||||
<vbox id="page">
|
||||
<vbox id="tray" class="tray-toolbar" visible="true" observes="bcast_windowState" >
|
||||
<vbox id="tray" class="tray-toolbar" observes="bcast_windowState" >
|
||||
<!-- Tabs -->
|
||||
<hbox id="tabs-container" observes="bcast_windowState">
|
||||
<box id="tabs" flex="1"
|
||||
|
@ -13,27 +13,32 @@ gTests.push({
|
||||
desc: "Context UI on about:start",
|
||||
run: function testAboutStart() {
|
||||
yield addTab("about:start");
|
||||
|
||||
yield waitForCondition(function () {
|
||||
return StartUI.isStartPageVisible;
|
||||
});
|
||||
|
||||
is(StartUI.isVisible, true, "Start UI is displayed on about:start");
|
||||
is(ContextUI.isVisible, true, "Toolbar is displayed on about:start");
|
||||
is(ContextUI.isExpanded, false, "Tab bar is not displayed initially");
|
||||
is(ContextUI.isVisible, true, "Navbar is displayed on about:start");
|
||||
is(ContextUI.isExpanded, false, "Tabbar is not displayed initially");
|
||||
is(Elements.navbar.isShowing, false, "Appbar is not displayed initially");
|
||||
|
||||
// toggle on
|
||||
doEdgeUIGesture();
|
||||
is(ContextUI.isVisible, true, "Toolbar is still visible after one swipe");
|
||||
is(ContextUI.isExpanded, true, "Tab bar is visible after one swipe");
|
||||
is(ContextUI.isVisible, true, "Navbar is still visible after one swipe");
|
||||
is(ContextUI.isExpanded, true, "Tabbar is visible after one swipe");
|
||||
is(Elements.navbar.isShowing, true, "Appbar is visible after one swipe");
|
||||
|
||||
// toggle off
|
||||
doEdgeUIGesture();
|
||||
is(ContextUI.isVisible, true, "Toolbar is still visible after second swipe");
|
||||
is(ContextUI.isExpanded, false, "Tab bar is hidden after second swipe");
|
||||
is(ContextUI.isVisible, true, "Navbar is still visible after second swipe");
|
||||
is(ContextUI.isExpanded, false, "Tabbar is hidden after second swipe");
|
||||
is(Elements.navbar.isShowing, false, "Appbar is hidden after second swipe");
|
||||
|
||||
// sanity check - toggle on again
|
||||
doEdgeUIGesture();
|
||||
is(ContextUI.isVisible, true, "Toolbar is still visible after third swipe");
|
||||
is(ContextUI.isExpanded, true, "Tab bar is visible after third swipe");
|
||||
is(ContextUI.isVisible, true, "Navbar is still visible after third swipe");
|
||||
is(ContextUI.isExpanded, true, "Tabbar is visible after third swipe");
|
||||
is(Elements.navbar.isShowing, true, "Appbar is visible after third swipe");
|
||||
|
||||
is(StartUI.isVisible, true, "Start UI is still visible");
|
||||
@ -46,18 +51,18 @@ gTests.push({
|
||||
yield addTab("about:");
|
||||
ContextUI.dismiss();
|
||||
is(StartUI.isVisible, false, "Start UI is not visible on about:");
|
||||
is(ContextUI.isVisible, false, "Toolbar is not initially visible on about:");
|
||||
is(ContextUI.isExpanded, false, "Tab bar is not initially visible on about:");
|
||||
is(ContextUI.isVisible, false, "Navbar is not initially visible on about:");
|
||||
is(ContextUI.isExpanded, false, "Tabbar is not initially visible on about:");
|
||||
is(Elements.navbar.isShowing, false, "Appbar is not initially visible on about on about::");
|
||||
|
||||
doEdgeUIGesture();
|
||||
is(ContextUI.isVisible, true, "Toolbar is visible after one swipe");
|
||||
is(ContextUI.isExpanded, true, "Tab bar is visble after one swipe");
|
||||
is(ContextUI.isVisible, true, "Navbar is visible after one swipe");
|
||||
is(ContextUI.isExpanded, true, "Tabbar is visble after one swipe");
|
||||
is(Elements.navbar.isShowing, true, "Appbar is visible after one swipe");
|
||||
|
||||
doEdgeUIGesture();
|
||||
is(ContextUI.isVisible, false, "Toolbar is not visible after second swipe");
|
||||
is(ContextUI.isExpanded, false, "Tab bar is not visible after second swipe");
|
||||
is(ContextUI.isVisible, false, "Navbar is not visible after second swipe");
|
||||
is(ContextUI.isExpanded, false, "Tabbar is not visible after second swipe");
|
||||
is(Elements.navbar.isShowing, false, "Appbar is hidden after second swipe");
|
||||
|
||||
is(StartUI.isVisible, false, "Start UI is still not visible");
|
||||
|
@ -52,7 +52,7 @@
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
#tray[visible][expanded]:not([viewstate="snapped"]) {
|
||||
#tray[expanded]:not([viewstate="snapped"]) {
|
||||
transform: none;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user