Bug 1451256 - Dump inner and outer element size.
MozReview-Commit-ID: 8PqjgnY28Hn
--- a/browser/components/customizableui/CustomizeMode.jsm
+++ b/browser/components/customizableui/CustomizeMode.jsm
@@ -1669,16 +1669,20 @@ CustomizeMode.prototype = {
dt.effectAllowed = "move";
let itemRect = this._dwu.getBoundsWithoutFlushing(draggedItem);
let itemCenter = {x: itemRect.left + itemRect.width / 2,
y: itemRect.top + itemRect.height / 2};
this._dragOffset = {x: aEvent.clientX - itemCenter.x,
y: aEvent.clientY - itemCenter.y};
+ let outerRect = this._dwu.getBoundsWithoutFlushing(item);
+ dump("Outer: " + outerRect.width + "x" + outerRect.height + "\n");
+ dump("Inner: " + itemRect.width + "x" + itemRect.height + "\n");
+
let toolbarParent = draggedItem.closest("toolbar");
if (toolbarParent) {
let toolbarRect = this._dwu.getBoundsWithoutFlushing(toolbarParent);
toolbarParent.style.minHeight = toolbarRect.height + "px";
}
gDraggingInToolbars = new Set();
--- a/browser/components/customizableui/test/browser_876926_customize_mode_wrapping.js
+++ b/browser/components/customizableui/test/browser_876926_customize_mode_wrapping.js
@@ -108,23 +108,26 @@ function isLastVisibleInToolbar(containe
function isFirst(containerId, defaultPlacements, id) {
assertAreaPlacements(containerId, [id].concat(defaultPlacements));
is(document.getElementById(containerId).customizationTarget.firstChild.firstChild.id, id,
"Widget " + id + " should be in " + containerId + " in customizing window.");
is(otherWin.document.getElementById(containerId).customizationTarget.firstChild.id, id,
"Widget " + id + " should be in " + containerId + " in other window.");
}
+let count = 0;
+
async function checkToolbar(id, method) {
// Place at start of the toolbar:
let toolbarPlacements = getAreaWidgetIds(kToolbar);
await move[method](id, kToolbar);
if (method == "dragToItem") {
isFirst(kToolbar, toolbarPlacements, id);
} else if (method == "drag") {
+ if (++count == 2) { await new Promise(() => {}); }
isLastVisibleInToolbar(kToolbar, toolbarPlacements, id);
} else {
isLast(kToolbar, toolbarPlacements, id);
}
checkWrapper(id);
}
async function checkPanel(id, method) {
--- a/toolkit/content/widgets/toolbar.xml
+++ b/toolkit/content/widgets/toolbar.xml
@@ -120,17 +120,17 @@
this.getAttribute("customizing") != "true";
};
} catch (e) {}
}
]]></constructor>
</implementation>
</binding>
- <binding id="toolbarpaletteitem">
+ <binding id="toolbarpaletteitem" extends="xul:button">
<content>
<xul:hbox class="toolbarpaletteitem-box" flex="1" xbl:inherits="type,place">
<children/>
</xul:hbox>
</content>
</binding>
<binding id="toolbarpaletteitem-palette" extends="chrome://global/content/bindings/toolbar.xml#toolbarpaletteitem">