mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-05-13 17:07:01 +00:00
Bug 1356674, only adjust arrow position in panel once, r=dao
This commit is contained in:
parent
f5010781c8
commit
4251bca019
@ -17,18 +17,6 @@ const EXPECTED_APPMENU_OPEN_REFLOWS = [
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
stack: [
|
||||
"get_alignmentPosition@chrome://global/content/bindings/popup.xml",
|
||||
"adjustArrowPosition@chrome://global/content/bindings/popup.xml",
|
||||
"onxblpopupshowing@chrome://global/content/bindings/popup.xml",
|
||||
"openPopup@chrome://global/content/bindings/popup.xml",
|
||||
"show/</<@chrome://browser/content/customizableui/panelUI.js",
|
||||
],
|
||||
|
||||
times: 2, // This number should only ever go down - never up.
|
||||
},
|
||||
|
||||
{
|
||||
stack: [
|
||||
"get_alignmentPosition@chrome://global/content/bindings/popup.xml",
|
||||
@ -51,7 +39,7 @@ const EXPECTED_APPMENU_OPEN_REFLOWS = [
|
||||
"openPopup@chrome://global/content/bindings/popup.xml",
|
||||
],
|
||||
|
||||
times: 6, // This number should only ever go down - never up.
|
||||
times: 7, // This number should only ever go down - never up.
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -92,7 +92,7 @@ function waitForPopupPositioned(actionFn, callback)
|
||||
{
|
||||
panel.addEventListener("popuppositioned", function listener() {
|
||||
panel.removeEventListener("popuppositioned", listener, false);
|
||||
callback();
|
||||
SimpleTest.executeSoon(callback);
|
||||
}, false);
|
||||
actionFn();
|
||||
}
|
||||
@ -173,26 +173,38 @@ var tests = [
|
||||
['simpleMoveToAnchorHorizontal', 'middle', function(next) {
|
||||
openPopup("after_end", function() {
|
||||
isArrowPositionedOn("right");
|
||||
panel.moveToAnchor(anchor, "after_end", 20, 0);
|
||||
// the anchor and the panel should have moved 20px right without flipping.
|
||||
isArrowPositionedOn("right", 20);
|
||||
panel.moveToAnchor(anchor, "after_end", -20, 0);
|
||||
// the anchor and the panel should have moved 20px left without flipping.
|
||||
isArrowPositionedOn("right", -20);
|
||||
next();
|
||||
waitForPopupPositioned(
|
||||
() => { panel.moveToAnchor(anchor, "after_end", 20, 0); },
|
||||
() => {
|
||||
// the anchor and the panel should have moved 20px right without flipping.
|
||||
isArrowPositionedOn("right", 20);
|
||||
waitForPopupPositioned(
|
||||
() => { panel.moveToAnchor(anchor, "after_end", -20, 0); },
|
||||
() => {
|
||||
// the anchor and the panel should have moved 20px left without flipping.
|
||||
isArrowPositionedOn("right", -20);
|
||||
next();
|
||||
});
|
||||
});
|
||||
});
|
||||
}],
|
||||
|
||||
['simpleMoveToAnchorVertical', 'middle', function(next) {
|
||||
openPopup("start_after", function() {
|
||||
isArrowPositionedOn("bottom");
|
||||
panel.moveToAnchor(anchor, "start_after", 0, 20);
|
||||
// the anchor and the panel should have moved 20px down without flipping.
|
||||
isArrowPositionedOn("bottom", 20);
|
||||
panel.moveToAnchor(anchor, "start_after", 0, -20);
|
||||
// the anchor and the panel should have moved 20px up without flipping.
|
||||
isArrowPositionedOn("bottom", -20);
|
||||
next();
|
||||
waitForPopupPositioned(
|
||||
() => { panel.moveToAnchor(anchor, "start_after", 0, 20); },
|
||||
() => {
|
||||
// the anchor and the panel should have moved 20px down without flipping.
|
||||
isArrowPositionedOn("bottom", 20);
|
||||
waitForPopupPositioned(
|
||||
() => { panel.moveToAnchor(anchor, "start_after", 0, -20) },
|
||||
() => {
|
||||
// the anchor and the panel should have moved 20px up without flipping.
|
||||
isArrowPositionedOn("bottom", -20);
|
||||
next();
|
||||
});
|
||||
});
|
||||
});
|
||||
}],
|
||||
|
||||
|
@ -100,7 +100,7 @@ addEventListener("load", function() {
|
||||
arrow.style.transition = "none";
|
||||
|
||||
// and off we go...
|
||||
countReflows(testSimplePanel, 1).then(SimpleTest.finish);
|
||||
countReflows(testSimplePanel, 0).then(SimpleTest.finish);
|
||||
});
|
||||
]]>
|
||||
</script>
|
||||
|
@ -492,8 +492,6 @@
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "arrowbox")
|
||||
.style.removeProperty("transform");
|
||||
|
||||
this.adjustArrowPosition();
|
||||
|
||||
if (this.getAttribute("animate") != "false") {
|
||||
this.setAttribute("animate", "open");
|
||||
// the animating attribute prevents user interaction during transition
|
||||
|
Loading…
x
Reference in New Issue
Block a user