Backed out changeset 106d5e139889 (bug 1678523) for causing PresShell crashes (bug 1678873). a=backout DONTBUILD

This commit is contained in:
Brindusan Cristian 2020-11-22 11:26:28 +02:00
Родитель cf2999e1b9
Коммит 6b9a9a229b
5 изменённых файлов: 29 добавлений и 25 удалений

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

@ -717,13 +717,11 @@ var PlacesOrganizer = {
_fillDetailsPane: function PO__fillDetailsPane(aNodeList) {
var infoBox = document.getElementById("infoBox");
var itemsCountBox = document.getElementById("itemsCountBox");
var detailsDeck = document.getElementById("detailsDeck");
// Make sure the infoBox UI is visible if we need to use it, we hide it
// below when we don't.
infoBox.hidden = false;
itemsCountBox.hidden = true;
let selectedNode = aNodeList.length == 1 ? aNodeList[0] : null;
// If an input within a panel is focused, force-blur it so its contents
@ -748,7 +746,11 @@ var PlacesOrganizer = {
(selectedNode.itemId == -1 &&
gEditItemOverlay.uri &&
gEditItemOverlay.uri == selectedNode.uri);
if (nodeIsSame && !infoBox.hidden && !gEditItemOverlay.multiEdit) {
if (
nodeIsSame &&
detailsDeck.selectedIndex == 1 &&
!gEditItemOverlay.multiEdit
) {
return;
}
}
@ -758,6 +760,8 @@ var PlacesOrganizer = {
gEditItemOverlay.uninitPanel(false);
if (selectedNode && !PlacesUtils.nodeIsSeparator(selectedNode)) {
detailsDeck.selectedIndex = 1;
gEditItemOverlay.initPanel({
node: selectedNode,
hiddenRows: ["folderPicker"],
@ -765,11 +769,13 @@ var PlacesOrganizer = {
} else if (!selectedNode && aNodeList[0]) {
if (aNodeList.every(PlacesUtils.nodeIsURI)) {
let uris = aNodeList.map(node => Services.io.newURI(node.uri));
detailsDeck.selectedIndex = 1;
gEditItemOverlay.initPanel({
uris,
hiddenRows: ["folderPicker", "location", "keyword", "name"],
});
} else {
detailsDeck.selectedIndex = 0;
let selectItemDesc = document.getElementById("selectItemDescription");
let itemsCountLabel = document.getElementById("itemsCountText");
selectItemDesc.hidden = false;
@ -781,6 +787,7 @@ var PlacesOrganizer = {
infoBox.hidden = true;
}
} else {
detailsDeck.selectedIndex = 0;
infoBox.hidden = true;
let selectItemDesc = document.getElementById("selectItemDescription");
let itemsCountLabel = document.getElementById("itemsCountText");
@ -803,7 +810,6 @@ var PlacesOrganizer = {
);
}
}
itemsCountBox.hidden = !infoBox.hidden;
},
};
@ -1292,7 +1298,7 @@ var ContentArea = {
_specialViews: new Map(),
init: function CA_init() {
this._box = document.getElementById("placesViewsBox");
this._deck = document.getElementById("placesViewsDeck");
this._toolbar = document.getElementById("placesToolbar");
ContentTree.init();
this._setupView();
@ -1356,16 +1362,12 @@ var ContentArea = {
},
get currentView() {
let selectedPane = [...this._box.children].filter(
child => !child.hidden
)[0];
return PlacesUIUtils.getViewForNode(selectedPane);
return PlacesUIUtils.getViewForNode(this._deck.selectedPanel);
},
set currentView(aNewView) {
let oldView = this.currentView;
if (oldView != aNewView) {
oldView.associatedElement.hidden = true;
aNewView.associatedElement.hidden = false;
this._deck.selectedPanel = aNewView.associatedElement;
// If the content area inactivated view was focused, move focus
// to the new view.
@ -1397,8 +1399,8 @@ var ContentArea = {
let options = this.currentViewOptions;
// showDetailsPane.
let detailsPane = document.getElementById("detailsPane");
detailsPane.hidden = !options.showDetailsPane;
let detailsDeck = document.getElementById("detailsDeck");
detailsDeck.hidden = !options.showDetailsPane;
// toolbarSet.
for (let elt of this._toolbar.childNodes) {
@ -1431,7 +1433,7 @@ var ContentArea = {
},
focus() {
this.currentView.associatedElement.focus();
this._deck.selectedPanel.focus();
},
};

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

@ -356,7 +356,9 @@
</tree>
<splitter collapse="none" persist="state"></splitter>
<vbox id="contentView" flex="4">
<vbox id="placesViewsBox" flex="1">
<deck id="placesViewsDeck"
selectedIndex="0"
flex="1">
<tree id="placeContent"
class="plain placesTree"
context="placesContext"
@ -406,9 +408,9 @@
seltype="multiple"
id="downloadsRichListBox"
context="downloadsContextMenu"/>
</vbox>
<vbox id="detailsPane" style="height: 11em;">
<vbox id="itemsCountBox" align="center" flex="1" hidden="true">
</deck>
<deck id="detailsDeck" style="height: 11em;">
<vbox id="itemsCountBox" align="center">
<spacer flex="3"/>
<label id="itemsCountText"/>
<spacer flex="1"/>
@ -417,10 +419,10 @@
</description>
<spacer flex="3"/>
</vbox>
<vbox id="infoBox" flex="1">
<vbox id="infoBox">
#include editBookmarkPanel.inc.xhtml
</vbox>
</vbox>
</deck>
</vbox>
</hbox>
</window>

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

@ -91,7 +91,7 @@
}
/* Info box */
#detailsPane {
#detailsDeck {
padding: 5px;
}

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

@ -143,7 +143,7 @@
}
/* Info box */
#detailsPane {
#detailsDeck {
border-top: 1px solid #919191;
background-color: #f0f0f0;
padding: 10px;

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

@ -108,7 +108,7 @@
/* Info box */
#detailsPane {
#detailsDeck {
border-top: 1px solid var(--organizer-border-color);
padding: 5px;
}
@ -240,7 +240,7 @@
background-color: var(--organizer-background-primary-color);
}
#detailsPane {
#detailsDeck {
background-color: var(--organizer-background-intermediate-color);
color: var(--organizer-text-primary-color);
}