Back out ca56f76237df (bug 922934) because of metro-chrome test failures

This commit is contained in:
Matt Brubeck 2013-10-02 16:00:37 -07:00
Родитель dccd64568e
Коммит 233565104b
3 изменённых файлов: 12 добавлений и 15 удалений

Просмотреть файл

@ -432,10 +432,9 @@ MenuPopup.prototype = {
let deferred = Promise.defer(); let deferred = Promise.defer();
window.addEventListener("keypress", this, true); window.addEventListener("keypress", this, true);
window.addEventListener("mousedown", this, true); window.addEventListener("click", this, true);
window.addEventListener("touchstart", this, true);
window.addEventListener("scroll", this, true);
Elements.stack.addEventListener("PopupChanged", this, false); Elements.stack.addEventListener("PopupChanged", this, false);
Elements.browsers.addEventListener("PanBegin", this, false);
this._panel.hidden = false; this._panel.hidden = false;
let popupFrom = !aPositionOptions.bottomAligned ? "above" : "below"; let popupFrom = !aPositionOptions.bottomAligned ? "above" : "below";
@ -462,10 +461,9 @@ MenuPopup.prototype = {
let deferred = Promise.defer(); let deferred = Promise.defer();
window.removeEventListener("keypress", this, true); window.removeEventListener("keypress", this, true);
window.removeEventListener("mousedown", this, true); window.removeEventListener("click", this, true);
window.removeEventListener("touchstart", this, true);
window.removeEventListener("scroll", this, true);
Elements.stack.removeEventListener("PopupChanged", this, false); Elements.stack.removeEventListener("PopupChanged", this, false);
Elements.browsers.removeEventListener("PanBegin", this, false);
let self = this; let self = this;
this._panel.addEventListener("transitionend", function popuphidden() { this._panel.addEventListener("transitionend", function popuphidden() {
@ -501,9 +499,7 @@ MenuPopup.prototype = {
this.hide(); this.hide();
} }
break; break;
case "mousedown": case "click":
case "touchstart":
case "scroll":
if (!this._popup.contains(aEvent.target)) { if (!this._popup.contains(aEvent.target)) {
aEvent.stopPropagation(); aEvent.stopPropagation();
this.hide(); this.hide();
@ -521,6 +517,9 @@ MenuPopup.prototype = {
this.hide(); this.hide();
} }
break; break;
case "PanBegin":
this.hide();
break;
} }
} }
}; };

Просмотреть файл

@ -98,11 +98,9 @@ gTests.push({
"context-copy-link"]); "context-copy-link"]);
promise = waitForEvent(document, "popuphidden"); promise = waitForEvent(document, "popuphidden");
win.scrollBy(0, 1); ContextMenuUI.hide();
let hidden = yield promise; yield promise;
ok(hidden && !(hidden instanceof Error), "scrolling hides the context menu");
win.getSelection().removeAllRanges(); win.getSelection().removeAllRanges();
win.scrollBy(0, -1);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Context menu in content on a link // Context menu in content on a link

Просмотреть файл

@ -23,7 +23,7 @@
<br /> <br />
<br /> <br />
<br /> <br />
<div style="margin: 0; padding: 5px; margin-bottom: 9999px;"> <div style="margin: 0; padding: 5px;">
<span id="text4">hello, I'm sorry but I must be going.</span> <span id="text4">hello, I'm sorry but I must be going.</span>
</div> </div>
</body> </body>