Bug 1795901 - Stop persisting attributes for the bookmark properties dialog, r=dao,emilio

From quite some time the vast moajority of instances of this dialog are non
resizable, and persisting attributes is now creating problems with the new flex
layout.
Thus, this patch is removing attributes persistence and the dialog duplication
whose only intent was to persist different attributes depending on the dialog
contents.
As a compromise due to not being able to resize the dialog, we increase the
dialog min-width.

Differential Revision: https://phabricator.services.mozilla.com/D160486
This commit is contained in:
Marco Bonardo 2022-11-03 08:31:47 +00:00
parent 62dd4b218f
commit 2da3fbed82
5 changed files with 4 additions and 21 deletions

View File

@ -523,17 +523,8 @@ export var PlacesUIUtils = {
async showBookmarkDialog(aInfo, aParentWindow = null) {
this.lastBookmarkDialogDeferred = lazy.PromiseUtils.defer();
// Preserve size attributes differently based on the fact the dialog has
// a folder picker or not, since it needs more horizontal space than the
// other controls.
let hasFolderPicker =
!("hiddenRows" in aInfo) || !aInfo.hiddenRows.includes("folderPicker");
// Use a different chrome url to persist different sizes.
let dialogURL = hasFolderPicker
? "chrome://browser/content/places/bookmarkProperties2.xhtml"
: "chrome://browser/content/places/bookmarkProperties.xhtml";
let features = "centerscreen,chrome,modal,resizable=yes";
let dialogURL = "chrome://browser/content/places/bookmarkProperties.xhtml";
let features = "centerscreen,chrome,modal";
let bookmarkGuid;
if (

View File

@ -19,8 +19,7 @@
headerparent="bookmarkpropertiesdialog"
neediconheader="true"
onunload="BookmarkPropertiesPanel.onDialogUnload();"
style="min-width: 30em;"
persist="screenX screenY width">
style="min-width: 40em;">
<dialog id="bookmarkpropertiesdialog"
buttons="accept, cancel">

View File

@ -5,7 +5,6 @@
browser.jar:
# Provide another URI for the bookmarkProperties dialog so we can persist the
# attributes separately
* content/browser/places/bookmarkProperties2.xhtml (content/bookmarkProperties.xhtml)
* content/browser/places/places.xhtml (content/places.xhtml)
content/browser/places/places.js (content/places.js)
content/browser/places/places.css (content/places.css)

View File

@ -32,8 +32,6 @@ const TYPE_BOOKMARK = 1;
const TEST_URL = "http://www.example.com/";
const DIALOG_URL = "chrome://browser/content/places/bookmarkProperties.xhtml";
const DIALOG_URL_MINIMAL_UI =
"chrome://browser/content/places/bookmarkProperties2.xhtml";
function add_bookmark(url) {
return PlacesUtils.bookmarks.insert({
@ -309,7 +307,7 @@ gTests.push({
desc:
" Bug 491269 - Test that editing folder name in bookmarks properties dialog does not accept the dialog",
sidebar: SIDEBAR_HISTORY_ID,
dialogUrl: DIALOG_URL_MINIMAL_UI,
dialogUrl: DIALOG_URL,
action: ACTION_ADD,
historyView: SIDEBAR_HISTORY_BYLASTVISITED_VIEW,
window: null,

View File

@ -12,10 +12,6 @@ updater.app/Contents/MacOS/org.mozilla.updater
plugin-container.app/Contents/PkgInfo
updater.app/Contents/PkgInfo
# Duplicated for XUL persistence, see PlacesUIUtils.jsm
browser/chrome/browser/content/browser/places/bookmarkProperties.xhtml
browser/chrome/browser/content/browser/places/bookmarkProperties2.xhtml
# Duplicated on Linux by browser/branding/branding-common.mozbuild
#ifdef XP_LINUX
browser/chrome/browser/content/branding/icon16.png