Skip to content

Commit

Permalink
Backed out 2 changesets (bug 1664053) for Browser-chrome failures. CL…
Browse files Browse the repository at this point in the history
…OSED TREE

Backed out changeset 7ead316c420d (bug 1664053)
Backed out changeset 7ae93e1c8b86 (bug 1664053)
  • Loading branch information
dgluca committed Oct 26, 2020
1 parent a861f9e commit 4f4f42a
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 270 deletions.
64 changes: 1 addition & 63 deletions browser/base/content/browser-places.js
Original file line number Diff line number Diff line change
Expand Up @@ -2150,10 +2150,6 @@ var BookmarkingUI = {
}
break;
}

if (ev.parentGuid === PlacesUtils.bookmarks.unfiledGuid) {
this.updateUnfiledBookmarksVisibility();
}
}
},

Expand Down Expand Up @@ -2191,21 +2187,7 @@ var BookmarkingUI = {
onEndUpdateBatch() {},
onBeforeItemRemoved() {},
onItemVisited() {},
onItemMoved(
aItemId,
aProperty,
aIsAnnotationProperty,
aNewValue,
aLastModified,
aItemType,
aParentId,
aGuid,
aParentGuid
) {
if (aParentGuid === PlacesUtils.bookmarks.unfiledGuid) {
this.updateUnfiledBookmarksVisibility();
}
},
onItemMoved() {},

onWidgetUnderflow(aNode, aContainer) {
let win = aNode.ownerGlobal;
Expand All @@ -2218,49 +2200,5 @@ var BookmarkingUI = {
this._uninitView();
},

async updateUnfiledBookmarksVisibility() {
// Only show the "Other Bookmarks" folder in the toolbar if pref is enabled.
let featureEnabled = Services.prefs.getBoolPref(
"browser.toolbars.bookmarks.2h2020",
false
);

if (!featureEnabled) {
return;
}

let unfiledGuid = PlacesUtils.bookmarks.unfiledGuid;
let unfiledBookmarksFolderId = await PlacesUtils.promiseItemId(unfiledGuid);

let numberOfBookmarks = await PlacesUtils.withConnectionWrapper(
"PlacesUtils: maybeShowOtherBookmarksFolder",
async db => {
let rows = await db.execute(
`SELECT COUNT(*) as n FROM moz_bookmarks b
WHERE b.parent = :parentId`,
{ parentId: unfiledBookmarksFolderId }
);
return rows[0].getResultByName("n");
}
).catch(e => {
// We want to report errors, but we still want to show the folder then:
Cu.reportError(e);
return 0;
});

let otherBookmarks = document.getElementById("OtherBookmarks");

if (numberOfBookmarks > 0) {
let otherBookmarksPopup = document.getElementById("OtherBookmarksPopup");
let result = PlacesUtils.getFolderContents(unfiledGuid);
let node = result.root;
otherBookmarksPopup._placesNode = PlacesUtils.asContainer(node);

otherBookmarks.setAttribute("collapsed", "false");
} else {
otherBookmarks.setAttribute("collapsed", "true");
}
},

QueryInterface: ChromeUtils.generateQI(["nsINavBookmarkObserver"]),
};
13 changes: 0 additions & 13 deletions browser/base/content/browser.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -2086,19 +2086,6 @@
tooltip="bhTooltip" popupsinherittooltip="true"
context="placesContext"/>
</toolbarbutton>
<toolbarbutton type="menu"
id="OtherBookmarks"
class="bookmark-item"
collapsed="true"
label="&bookmarksMenuButton.other.label;"
container="true"
onpopupshowing="document.getElementById('PlacesToolbar')
._placesView._onOtherBookmarksPopupShowing(event);">
<menupopup id="OtherBookmarksPopup"
is="places-popup"
placespopup="true"
context="placesContext" />
</toolbarbutton>
</hbox>
</hbox>
</toolbaritem>
Expand Down
13 changes: 0 additions & 13 deletions browser/components/places/content/browserPlacesViews.js
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,6 @@ function PlacesToolbar(aPlace) {
["_dropIndicator", "PlacesToolbarDropIndicator"],
["_chevron", "PlacesChevron"],
["_chevronPopup", "PlacesChevronPopup"],
["_otherBookmarks", "OtherBookmarks"],
["_otherBookmarksPopup", "OtherBookmarksPopup"],
].forEach(function(elementGlobal) {
let [name, id] = elementGlobal;
thisView.__defineGetter__(name, function() {
Expand Down Expand Up @@ -1032,8 +1030,6 @@ PlacesToolbar.prototype = {
// Otherwise, it will be initialized when the toolbar overflows.
this._chevronPopup.place = this.place;
}

BookmarkingUI.updateUnfiledBookmarksVisibility();
},

_insertNewItem: function PT__insertNewItem(
Expand Down Expand Up @@ -1123,15 +1119,6 @@ PlacesToolbar.prototype = {
this._updateChevronPopupNodesVisibility();
},

_onOtherBookmarksPopupShowing: function PT__onOtherBookmarksPopupShowing(
aEvent
) {
if (aEvent.target != this._otherBookmarksPopup) {
return;
}
this._rebuildPopup(this._otherBookmarksPopup);
},

handleEvent: function PT_handleEvent(aEvent) {
switch (aEvent.type) {
case "unload":
Expand Down
1 change: 0 additions & 1 deletion browser/components/places/tests/browser/browser.ini
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ skip-if = (os == "mac" && debug) # Bug 1467049
[browser_toolbar_drop_text.js]
[browser_toolbar_library_downloads.js]
[browser_toolbar_library_open_recent.js]
[browser_toolbar_other_bookmarks.js]
[browser_toolbar_overflow.js]
skip-if = os == "linux" && bits == 32 && debug # bug 1463443
[browser_toolbarbutton_menu_context.js]
Expand Down

This file was deleted.

5 changes: 5 additions & 0 deletions browser/themes/linux/places/editBookmark.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,8 @@
#editBMPanel_bmRootItem {
list-style-image: url("chrome://browser/skin/places/bookmarksMenu.svg") !important;
}

#editBMPanel_folderMenuList[selectedGuid="unfiled_____"],
#editBMPanel_unfiledRootItem {
list-style-image: url("chrome://browser/skin/places/unfiledBookmarks.svg") !important;
}
6 changes: 6 additions & 0 deletions browser/themes/osx/browser.css
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@
list-style-image: url("chrome://browser/skin/places/bookmarksToolbar.svg");
}

#menu_unsortedBookmarks,
#BMB_unsortedBookmarks,
#panelMenu_unsortedBookmarks {
list-style-image: url("chrome://browser/skin/places/unfiledBookmarks.svg");
}

%include ../shared/toolbarbuttons.inc.css
%include ../shared/toolbarbutton-icons.inc.css
%include ../shared/menupanel.inc.css
Expand Down
5 changes: 5 additions & 0 deletions browser/themes/osx/places/editBookmark.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,8 @@
#editBMPanel_bmRootItem {
list-style-image: url("chrome://browser/skin/places/bookmarksMenu.svg") !important;
}

#editBMPanel_folderMenuList[selectedGuid="unfiled_____"],
#editBMPanel_unfiledRootItem {
list-style-image: url("chrome://browser/skin/places/unfiledBookmarks.svg") !important;
}
1 change: 1 addition & 0 deletions browser/themes/shared/jar.inc.mn
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@
skin/classic/browser/places/folder-smart.svg (../shared/places/folder-smart.svg)
skin/classic/browser/places/history.svg (../shared/places/history.svg)
skin/classic/browser/places/tag.svg (../shared/places/tag.svg)
skin/classic/browser/places/unfiledBookmarks.svg (../shared/places/unfiledBookmarks.svg)
skin/classic/browser/places/tree-icons.css (../shared/places/tree-icons.css)
skin/classic/browser/privatebrowsing/aboutPrivateBrowsing.css (../shared/privatebrowsing/aboutPrivateBrowsing.css)
skin/classic/browser/privatebrowsing/favicon.svg (../shared/privatebrowsing/favicon.svg)
Expand Down
4 changes: 4 additions & 0 deletions browser/themes/shared/places/tree-icons.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ treechildren::-moz-tree-image(container, queryFolder_menu________) {
list-style-image: url("chrome://browser/skin/places/bookmarksMenu.svg");
}

treechildren::-moz-tree-image(container, queryFolder_unfiled_____) {
list-style-image: url("chrome://browser/skin/places/unfiledBookmarks.svg");
}

/* query-nodes should be styled even if they're not expandable */
treechildren::-moz-tree-image(query) {
list-style-image: url("chrome://browser/skin/places/folder-smart.svg");
Expand Down
9 changes: 9 additions & 0 deletions browser/themes/shared/places/unfiledBookmarks.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions browser/themes/shared/toolbarbuttons.inc.css
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,7 @@ toolbarbutton.bookmark-item:not(.subviewbutton) {

#managed-bookmarks > .toolbarbutton-icon,
#bookmarks-toolbar-placeholder > .toolbarbutton-icon,
#PlacesToolbarItems > .bookmark-item > .toolbarbutton-icon[label]:not([label=""]),
#OtherBookmarks.bookmark-item[container] > .toolbarbutton-icon {
#PlacesToolbarItems > .bookmark-item > .toolbarbutton-icon[label]:not([label=""]) {
margin-inline-end: 4px;
}

Expand Down
Loading

0 comments on commit 4f4f42a

Please sign in to comment.