diff --git a/browser/metro/base/content/helperui/MenuUI.js b/browser/metro/base/content/helperui/MenuUI.js index d9a2c431794..3c5f59bce33 100644 --- a/browser/metro/base/content/helperui/MenuUI.js +++ b/browser/metro/base/content/helperui/MenuUI.js @@ -382,14 +382,16 @@ MenuPopup.prototype = { let self = this; this._panel.addEventListener("transitionend", function () { self._panel.removeEventListener("transitionend", arguments.callee); + self._panel.removeAttribute("hiding"); self._panel.hidden = true; - self._popupState = null; + let event = document.createEvent("Events"); event.initEvent("popuphidden", true, false); document.dispatchEvent(event); }); - this._panel.removeAttribute("showing"); + this._panel.setAttribute("hiding", "true"); + setTimeout(()=>this._panel.removeAttribute("showing"), 0); }, _position: function _position(aPositionOptions) { @@ -408,7 +410,6 @@ MenuPopup.prototype = { let width = this._popup.boxObject.width; let height = this._popup.boxObject.height; let halfWidth = width / 2; - let halfHeight = height / 2; let screenWidth = ContentAreaObserver.width; let screenHeight = ContentAreaObserver.height; diff --git a/browser/metro/base/tests/mochitest/browser_context_menu_tests.js b/browser/metro/base/tests/mochitest/browser_context_menu_tests.js index e599eee9741..1b43d9a5658 100644 --- a/browser/metro/base/tests/mochitest/browser_context_menu_tests.js +++ b/browser/metro/base/tests/mochitest/browser_context_menu_tests.js @@ -30,7 +30,7 @@ function checkContextMenuPositionRange(aElement, aMinLeft, aMaxLeft, aMinTop, aM ok(aElement.left > aMinLeft && aElement.left < aMaxLeft, "Left position is " + aElement.left + ", expected between " + aMinLeft + " and " + aMaxLeft); - ok(aElement.top > aMinTop && aElement.top < aMaxTop, + ok(aElement.top > aMinTop && aElement.top < aMaxTop, "Top position is " + aElement.top + ", expected between " + aMinTop + " and " + aMaxTop); } @@ -347,7 +347,9 @@ gTests.push({ checkContextMenuPositionRange(ContextMenuUI._panel, 65, 80, notificationHeight + 155, notificationHeight + 180); - ContextMenuUI._menuPopup.hide(); + promise = waitForEvent(document, "popuphidden"); + ContextMenuUI.hide(); + yield promise; Browser.closeTab(Browser.selectedTab); } @@ -497,6 +499,7 @@ gTests.push({ ok(imagetab != null, "tab created"); Browser.closeTab(imagetab); + yield waitForEvent(imagetab.chromeTab.parentNode, "TabRemove"); } }); @@ -511,7 +514,7 @@ gTests.push({ // Sometimes the context ui is visible, sometimes it isn't. try { yield waitForCondition(function () { - return ContextUI.isVisible; + return ContextUI.isVisible; }, 500, 50); } catch (ex) {} diff --git a/browser/metro/base/tests/mochitest/head.js b/browser/metro/base/tests/mochitest/head.js index 6fdab8a303e..b66c4481034 100644 --- a/browser/metro/base/tests/mochitest/head.js +++ b/browser/metro/base/tests/mochitest/head.js @@ -474,19 +474,21 @@ function runTests() { waitForExplicitFinish(); Task.spawn(function() { while((gCurrentTest = gTests.shift())){ - info(gCurrentTest.desc); + info("START " + gCurrentTest.desc); try { if ('function' == typeof gCurrentTest.setUp) { + info("SETUP " + gCurrentTest.desc); yield Task.spawn(gCurrentTest.setUp.bind(gCurrentTest)); } yield Task.spawn(gCurrentTest.run.bind(gCurrentTest)); if ('function' == typeof gCurrentTest.tearDown) { + info("TEARDOWN " + gCurrentTest.desc); yield Task.spawn(gCurrentTest.tearDown.bind(gCurrentTest)); } } catch (ex) { ok(false, "runTests: Task failed - " + ex); } finally { - info("END "+gCurrentTest.desc); + info("END " + gCurrentTest.desc); } } finish(); diff --git a/browser/metro/theme/platform.css b/browser/metro/theme/platform.css index e2a9a45957d..8600fd00451 100644 --- a/browser/metro/theme/platform.css +++ b/browser/metro/theme/platform.css @@ -160,7 +160,6 @@ menulist { .menu-container { position: absolute; opacity: 0; - transition: opacity ease-out 0.2s; } .menu-container[showingfrom="below"] { @@ -171,10 +170,15 @@ menulist { transform: translateY(-@metro_spacing_normal@); } +.menu-container[hiding], +.menu-container[showing] { + transition: opacity ease-out 0.2s, + transform ease-out 0.2s; +} + .menu-container[showing] { opacity: 1; transform: none; - transition: all ease-out 0.2s; } .menu-popup > richlistbox {