mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 225680 - Fix regressions from the landing of the detach-tabs feature. r=mconnor.
This commit is contained in:
parent
129be917b4
commit
3932fab823
@ -271,9 +271,9 @@
|
||||
</tooltip>
|
||||
|
||||
<toolbox id="navigator-toolbox" class="toolbox-top" mode="icons"
|
||||
ondragover="gBrowser._onDragOver(event); event.stopPropagation();"
|
||||
ondrop="gBrowser._onDrop(event); event.stopPropagation();"
|
||||
ondragleave="gBrowser._onDragLeave(event); event.stopPropagation();"
|
||||
ondragover="gBrowser._onDragOver(event);"
|
||||
ondrop="gBrowser._onDrop(event);"
|
||||
ondragleave="gBrowser._onDragLeave(event);"
|
||||
defaultmode="icons">
|
||||
<!-- Menu -->
|
||||
<toolbar type="menubar" id="toolbar-menubar" class="chromeclass-menubar" customizable="true"
|
||||
|
@ -69,18 +69,18 @@
|
||||
<xul:tabbox anonid="tabbox" flex="1" eventnode="document" xbl:inherits="handleCtrlPageUpDown"
|
||||
onselect="if (!('updateCurrentBrowser' in this.parentNode) || event.target.localName != 'tabpanels') return; this.parentNode.updateCurrentBrowser();">
|
||||
<xul:hbox class="tab-drop-indicator-bar" collapsed="true" chromedir="&locale.dir;"
|
||||
ondragover="this.parentNode.parentNode._onDragOver(event); event.stopPropagation();"
|
||||
ondragleave="this.parentNode.parentNode._onDragLeave(event); event.stopPropagation();"
|
||||
ondrop="this.parentNode.parentNode._onDrop(event); event.stopPropagation();">
|
||||
ondragover="this.parentNode.parentNode._onDragOver(event);"
|
||||
ondragleave="this.parentNode.parentNode._onDragLeave(event);"
|
||||
ondrop="this.parentNode.parentNode._onDrop(event);">
|
||||
<xul:hbox class="tab-drop-indicator" mousethrough="always"/>
|
||||
</xul:hbox>
|
||||
<xul:hbox class="tabbrowser-strip" collapsed="true" tooltip="_child" context="_child"
|
||||
anonid="strip"
|
||||
ondragstart="this.parentNode.parentNode._onDragStart(event); event.stopPropagation();"
|
||||
ondragover="this.parentNode.parentNode._onDragOver(event); event.stopPropagation();"
|
||||
ondrop="this.parentNode.parentNode._onDrop(event); event.stopPropagation();"
|
||||
ondragend="this.parentNode.parentNode._onDragEnd(event); event.stopPropagation();"
|
||||
ondragleave="this.parentNode.parentNode._onDragLeave(event); event.stopPropagation();">
|
||||
ondragstart="this.parentNode.parentNode._onDragStart(event);"
|
||||
ondragover="this.parentNode.parentNode._onDragOver(event);"
|
||||
ondrop="this.parentNode.parentNode._onDrop(event);"
|
||||
ondragend="this.parentNode.parentNode._onDragEnd(event);"
|
||||
ondragleave="this.parentNode.parentNode._onDragLeave(event);">
|
||||
<xul:tooltip onpopupshowing="return this.parentNode.parentNode.parentNode.createTooltip(event);"/>
|
||||
<xul:menupopup anonid="tabContextMenu" onpopupshowing="this.parentNode.parentNode.parentNode.updatePopupMenu(this);">
|
||||
<xul:menuitem id="context_newTab" label="&newTab.label;" accesskey="&newTab.accesskey;"
|
||||
@ -1842,6 +1842,10 @@
|
||||
<parameter name="aEvent"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
// don't interfere with toolbar customization
|
||||
if (gNavToolbox.customizing)
|
||||
return;
|
||||
|
||||
var target = aEvent.target;
|
||||
if (target.localName == "tab" &&
|
||||
aEvent.originalTarget.localName != "toolbarbutton") {
|
||||
@ -1852,6 +1856,7 @@
|
||||
|
||||
var canvas = tabPreviews.capture(target, false);
|
||||
dt.setDragImage(canvas, 0, 0);
|
||||
aEvent.stopPropagation();
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
@ -1865,10 +1870,13 @@
|
||||
]]></field>
|
||||
|
||||
<field name="_cachedTargetInToolbox">null</field>
|
||||
<field name="_draggingOnItself">false</field>
|
||||
<method name="_setEffectAllowedForDataTransfer">
|
||||
<parameter name="aEvent"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
this._draggingOnItself = false;
|
||||
|
||||
// Find out if the we're dragged over the toolbox
|
||||
var target = aEvent.target;
|
||||
var isInToolbox = target == this._cachedTargetInToolbox;
|
||||
@ -1881,10 +1889,12 @@
|
||||
target = target.parentNode;
|
||||
}
|
||||
|
||||
// NOTE: within the toolbox, we don't touch effectAllowed for
|
||||
// anything but tabs
|
||||
var dt = aEvent.dataTransfer;
|
||||
// Disallow dropping multiple items
|
||||
if (dt.mozItemCount > 1)
|
||||
return dt.effectAllowed = "none";
|
||||
return isInToolbox ? "" : dt.effectAllowed = "none";
|
||||
|
||||
var types = dt.mozTypesAt(0);
|
||||
var sourceNode = null;
|
||||
@ -1900,6 +1910,7 @@
|
||||
(aEvent.screenX >= sourceNode.boxObject.screenX &&
|
||||
aEvent.screenX <= (sourceNode.boxObject.screenX +
|
||||
sourceNode.boxObject.width))) {
|
||||
this._draggingOnItself = true;
|
||||
return dt.effectAllowed = "none";
|
||||
}
|
||||
|
||||
@ -1915,7 +1926,7 @@
|
||||
|
||||
// only tab-drags are taken care of within the toolbox
|
||||
if (isInToolbox)
|
||||
return dt.effectAllowed = "none";
|
||||
return ""; // see note above the tab-drags block
|
||||
|
||||
for (var i=0; i < this._supportedLinkDropTypes.length; i++) {
|
||||
if (types.contains(this._supportedLinkDropTypes[i])) {
|
||||
@ -1932,14 +1943,19 @@
|
||||
<parameter name="aEvent"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
// don't interfere with toolbar customization
|
||||
if (gNavToolbox.customizing)
|
||||
return;
|
||||
|
||||
var effects = this._setEffectAllowedForDataTransfer(aEvent);
|
||||
|
||||
var ib = this.mTabDropIndicatorBar;
|
||||
if (effects == "none") {
|
||||
if (effects == "" || effects == "none") {
|
||||
ib.collapsed = "true";
|
||||
return;
|
||||
}
|
||||
aEvent.preventDefault();
|
||||
aEvent.stopPropagation();
|
||||
|
||||
var tabStrip = this.mTabContainer.mTabstrip;
|
||||
var ltr = (window.getComputedStyle(this.parentNode, null).direction
|
||||
@ -2033,16 +2049,22 @@
|
||||
<parameter name="aEvent"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
// don't interfere with toolbar customization
|
||||
if (gNavToolbox.customizing)
|
||||
return;
|
||||
|
||||
var dt = aEvent.dataTransfer;
|
||||
var dropEffect = dt.dropEffect;
|
||||
var draggedTab;
|
||||
if (dropEffect != "link") { // copy or move
|
||||
draggedTab = dt.mozGetDataAt("application/x-moz-tabbrowser-tab", 0);
|
||||
NS_ASSERT(draggedTab && draggedTab.localName == "tab",
|
||||
"copy or move action without a tab");
|
||||
// not our drop then
|
||||
if (!draggedTab)
|
||||
return;
|
||||
}
|
||||
|
||||
this.mTabDropIndicatorBar.collapsed = true;
|
||||
aEvent.stopPropagation();
|
||||
|
||||
if (draggedTab && (dropEffect == "copy" ||
|
||||
draggedTab.parentNode == this.mTabContainer)) {
|
||||
@ -2151,10 +2173,11 @@
|
||||
return;
|
||||
|
||||
var dt = aEvent.dataTransfer;
|
||||
if (dt.dropEffect == "none") {
|
||||
if (dt.dropEffect == "none" && !this._draggingOnItself) {
|
||||
var draggedTab = dt.mozGetDataAt("application/x-moz-tabbrowser-tab", 0);
|
||||
this._replaceTabWithWindow(draggedTab);
|
||||
}
|
||||
aEvent.stopPropagation();
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
@ -2189,6 +2212,8 @@
|
||||
return;
|
||||
|
||||
this.mTabDropIndicatorBar.collapsed = true;
|
||||
this._draggingOnItself = false;
|
||||
aEvent.stopPropagation();
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -154,6 +154,7 @@
|
||||
newMarginTop += sbo.y - this._scrollBox.boxObject.y;
|
||||
this._indicatorBar.firstChild.style.marginTop = newMarginTop + "px";
|
||||
this._indicatorBar.hidden = false;
|
||||
aEvent.stopPropagation();
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
@ -212,6 +213,7 @@
|
||||
this._rootView._controller.setDataTransfer(aEvent);
|
||||
|
||||
this.setAttribute("dragstart", "true");
|
||||
aEvent.stopPropagation();
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
@ -228,6 +230,7 @@
|
||||
return;
|
||||
|
||||
PlacesControllerDragHelper.onDrop(dropPoint.ip);
|
||||
aEvent.stopPropagation();
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
@ -521,7 +524,7 @@
|
||||
window.XULBrowserWindow.setOverLink("", null);
|
||||
]]></handler>
|
||||
<handler event="draggesture" action="if (event.target.node) nsDragAndDrop.startDrag(event, this);"/>
|
||||
<handler event="dragdrop" action="nsDragAndDrop.drop(event, this);"/>
|
||||
<handler event="drop" action="nsDragAndDrop.drop(event, this);"/>
|
||||
<handler event="dragover" action="nsDragAndDrop.dragOver(event, this);"/>
|
||||
<handler event="dragexit" action="nsDragAndDrop.dragExit(event, this);"/>
|
||||
</handlers>
|
||||
|
@ -1022,6 +1022,7 @@
|
||||
this.focus();
|
||||
|
||||
this._controller.setDataTransfer(event);
|
||||
event.stopPropagation();
|
||||
]]></handler>
|
||||
|
||||
<handler event="dragover"><![CDATA[
|
||||
@ -1029,6 +1030,7 @@
|
||||
var dt = PlacesControllerDragHelper.currentDataTransfer =
|
||||
event.dataTransfer;
|
||||
|
||||
var ib = this._dropIndicatorBar;
|
||||
var ip = this.insertionPoint;
|
||||
if (!ip || !PlacesControllerDragHelper.canDrop(ip)) {
|
||||
ib.removeAttribute("dragging");
|
||||
@ -1044,7 +1046,6 @@
|
||||
this._ibTimer = null;
|
||||
}
|
||||
|
||||
var ib = this._dropIndicatorBar;
|
||||
if (dropPoint.folderNode ||
|
||||
event.originalTarget == this._chevron) {
|
||||
// Dropping over a menubutton or chevron button
|
||||
@ -1101,21 +1102,31 @@
|
||||
|
||||
dt.effectAllowed = "all";
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
]]></handler>
|
||||
|
||||
<handler event="drop"><![CDATA[
|
||||
// If the data-transfer isn't cached, it's not ours
|
||||
// This happens when dropping tabs
|
||||
if (event.dataTransfer != PlacesControllerDragHelper.currentDataTransfer)
|
||||
PlacesControllerDragHelper.currentDataTransfer = event.dataTransfer;
|
||||
PlacesControllerDragHelper.currentDropTarget = event.target;
|
||||
|
||||
var ip = this.insertionPoint;
|
||||
if (!ip || !PlacesControllerDragHelper.canDrop(ip))
|
||||
return;
|
||||
|
||||
var dropPoint = this._getDropPoint(event);
|
||||
if (!dropPoint)
|
||||
return;
|
||||
|
||||
PlacesControllerDragHelper.onDrop(dropPoint.ip);
|
||||
event.stopPropagation();
|
||||
]]></handler>
|
||||
|
||||
<handler event="dragleave"><![CDATA[
|
||||
// Only handle dragleaves for the toolbar itself (and not for its child
|
||||
// nodes)
|
||||
if (event.target != this)
|
||||
return;
|
||||
|
||||
PlacesControllerDragHelper.currentDropTarget = null;
|
||||
PlacesControllerDragHelper.currentDataTransfer = null;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user