Backing out patch from bug 330063 to see if it's responsible for the

branch balsa allocation increases, and if so, fix before resubmitting.
This commit is contained in:
joe%retrovirus.com 2006-04-08 17:58:16 +00:00
Родитель b03dcc9001
Коммит d3614485d3
9 изменённых файлов: 39 добавлений и 275 удалений

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

@ -6613,18 +6613,13 @@ var BookmarksEventHandler = {
var button = target.parentNode;
if (button.getAttribute("livemark") == "true") {
// Live bookmarks aren't required to have site URIs
if (button.hasAttribute("siteURI")) {
var openHomePage = document.createElement("menuitem");
openHomePage.setAttribute(
"siteURI", button.getAttribute("siteURI"));
openHomePage.setAttribute(
"label",
openHomePage.setAttribute("siteURI", button.getAttribute("siteURI"));
openHomePage.setAttribute("label",
strings.getFormattedString("menuOpenLivemarkOrigin.label",
[button.getAttribute("label")]));
target.appendChild(openHomePage);
}
}
var openInTabs = document.createElement("menuitem");
openInTabs.setAttribute("openInTabs", "true");

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

@ -89,32 +89,18 @@ var BookmarkPropertiesPanel = {
return this.__ios;
},
/**
* The Live Bookmark service for dealing with syndication feed folders.
*/
__livemarks: null,
get _livemarks() {
if (!this.__livemarks) {
this.__livemarks =
Cc["@mozilla.org/browser/livemark-service;1"].
getService(Ci.nsILivemarkService);
}
return this.__livemarks;
},
_bookmarkURI: null,
_bookmarkTitle: "",
_dialogWindow: null,
_parentWindow: null,
_controller: null,
MAX_INDENT_DEPTH: 6, // maximum indentation level of "tag" display
EDIT_BOOKMARK_VARIANT: 0,
ADD_BOOKMARK_VARIANT: 1,
EDIT_HISTORY_VARIANT: 2,
EDIT_FOLDER_VARIANT: 3,
ADD_MULTIPLE_BOOKMARKS_VARIANT: 4,
ADD_LIVEMARK_VARIANT: 5,
EDIT_LIVEMARK_VARIANT: 6,
/**
* The variant identifier for the current instance of the dialog.
@ -135,8 +121,6 @@ var BookmarkPropertiesPanel = {
switch(this._variant) {
case this.EDIT_FOLDER_VARIANT:
case this.ADD_MULTIPLE_BOOKMARKS_VARIANT:
case this.ADD_LIVEMARK_VARIANT:
case this.EDIT_LIVEMARK_VARIANT:
return false;
default:
return true;
@ -151,7 +135,6 @@ var BookmarkPropertiesPanel = {
_identifierIsFolderID: function BPP__identifierIsFolderID() {
switch(this._variant) {
case this.EDIT_FOLDER_VARIANT:
case this.EDIT_LIVEMARK_VARIANT:
return true;
default:
return false;
@ -178,8 +161,6 @@ var BookmarkPropertiesPanel = {
case this.EDIT_HISTORY_VARIANT:
case this.EDIT_FOLDER_VARIANT:
case this.ADD_MULTIPLE_BOOKMARKS_VARIANT:
case this.EDIT_LIVEMARK_VARIANT:
case this.ADD_LIVEMARK_VARIANT:
return false;
default:
return true;
@ -193,8 +174,6 @@ var BookmarkPropertiesPanel = {
switch(this._variant) {
case this.EDIT_FOLDER_VARIANT:
case this.ADD_MULTIPLE_BOOKMARKS_VARIANT:
case this.EDIT_LIVEMARK_VARIANT:
case this.ADD_LIVEMARK_VARIANT:
return false;
default:
return true;
@ -210,28 +189,12 @@ var BookmarkPropertiesPanel = {
case this.EDIT_HISTORY_VARIANT:
case this.EDIT_FOLDER_VARIANT:
case this.ADD_MULTIPLE_BOOKMARKS_VARIANT:
case this.ADD_LIVEMARK_VARIANT:
case this.EDIT_LIVEMARK_VARIANT:
return false;
default:
return true;
}
},
/**
* Returns true if the livemark feed and site URI fields are visible.
*/
_areLivemarkURIsVisible: function BPP__areLivemarkURIsVisible() {
switch(this._variant) {
case this.ADD_LIVEMARK_VARIANT:
case this.EDIT_LIVEMARK_VARIANT:
return true;
default:
return false;
}
},
/**
* Returns true if bookmark deletion is possible from the current
* variant of the dialog.
@ -269,7 +232,6 @@ var BookmarkPropertiesPanel = {
_getAcceptLabel: function BPP__getAcceptLabel() {
switch(this._variant) {
case this.ADD_BOOKMARK_VARIANT:
case this.ADD_LIVEMARK_VARIANT:
return this._strings.getString("dialogAcceptLabelAdd");
case this.ADD_MULTIPLE_BOOKMARKS_VARIANT:
return this._strings.getString("dialogAcceptLabelAddMulti");
@ -292,8 +254,6 @@ var BookmarkPropertiesPanel = {
return this._strings.getString("dialogTitleFolderEdit");
case this.ADD_MULTIPLE_BOOKMARKS_VARIANT:
return this._strings.getString("dialogTitleAddMulti");
case this.ADD_LIVEMARK_VARIANT:
return this._strings.getString("dialogTitleAddLivemark");
default:
return this._strings.getString("dialogTitleBookmarkEdit");
}
@ -311,7 +271,6 @@ var BookmarkPropertiesPanel = {
switch(this._variant) {
case this.ADD_MULTIPLE_BOOKMARKS_VARIANT:
case this.EDIT_FOLDER_VARIANT:
case this.EDIT_LIVEMARK_VARIANT:
return "single";
default:
return "multiple";
@ -357,14 +316,8 @@ var BookmarkPropertiesPanel = {
return this.ADD_MULTIPLE_BOOKMARKS_VARIANT;
}
else { /* Assume "edit" */
if (typeof(identifier) == "number") {
if (this._livemarks.isLivemark(identifier)) {
return this.EDIT_LIVEMARK_VARIANT;
}
else {
if (typeof(identifier) == "number")
return this.EDIT_FOLDER_VARIANT;
}
}
if (this._bms.isBookmarked(identifier)) {
return this.EDIT_BOOKMARK_VARIANT;
@ -457,29 +410,6 @@ var BookmarkPropertiesPanel = {
this._folderTree._load([query], options);
},
/**
* This is a shorter form of getElementById for the dialog document.
* Given a XUL element ID from the dialog, returns the corresponding
* DOM element.
*
* @param XUL element ID
* @returns corresponding DOM element, or null if none found
*/
_element: function BPP__element(id) {
return this._dialogWindow.document.getElementById(id);
},
/**
* Hides the XUL element with the given ID.
*
* @param string ID of the XUL element to hide
*/
_hide: function BPP__hide(id) {
this._element(id).setAttribute("hidden", "true");
},
/**
* This method fills in the data values for the fields in the dialog.
*/
@ -503,9 +433,9 @@ var BookmarkPropertiesPanel = {
"true";
}
var nurl = this._element("editURLBar");
var nurl = document.getElementById("editURLBar");
var titlebox = this._element("editTitleBox");
var titlebox = document.getElementById("editTitleBox");
titlebox.value = this._bookmarkTitle;
@ -519,36 +449,28 @@ var BookmarkPropertiesPanel = {
nurl.setAttribute("disabled", "true");
}
else {
this._hide("locationRow");
}
if (this._areLivemarkURIsVisible()) {
if (this._identifierIsFolderID()) {
var feedURI = this._livemarks.getFeedURI(this._folderId);
if (feedURI)
this._element("editLivemarkFeedLocationBox").value = feedURI.spec;
var siteURI = this._livemarks.getSiteURI(this._folderId);
if (siteURI)
this._element("editLivemarkSiteLocationBox").value = siteURI.spec;
}
} else {
this._hide("livemarkFeedLocationRow");
this._hide("livemarkSiteLocationRow");
var locationRow = document.getElementById("locationRow");
locationRow.setAttribute("hidden", "true");
}
if (this._isShortcutVisible()) {
var shortcutbox = this._element("editShortcutBox");
var shortcutbox =
this._dialogWindow.document.getElementById("editShortcutBox");
shortcutbox.value = this._bms.getKeywordForURI(this._bookmarkURI);
}
else {
this._hide("shortcutRow");
var shortcutRow =
this._dialogWindow.document.getElementById("shortcutRow");
shortcutRow.setAttribute("hidden", "true");
}
if (this._isFolderEditable()) {
this._folderTree.selectFolders([this._bms.bookmarksRoot]);
}
else {
this._hide("folderRow");
var folderRow =
this._dialogWindow.document.getElementById("folderRow");
folderRow.setAttribute("hidden", "true");
}
},
@ -613,71 +535,14 @@ var BookmarkPropertiesPanel = {
this._controller.tm.doTransaction(aggregate);
},
/**
* This method checks the current state of the input fields in the
* dialog, and if any of them are in an invalid state, it will disable
* the submit button. This method should be called after every
* significant change to the input.
*/
validateChanges: function BPP_validateChanges() {
this._dialogWindow.document.documentElement.getButton("accept").disabled =
!this._inputIsValid();
},
/**
* This method checks to see if the input fields are in a valid state.
*
* @returns true if the input is valid, false otherwise
*/
_inputIsValid: function BPP__inputIsValid() {
// When in multiple select mode, it's possible to deselect all rows,
// but you have to file your bookmark in at least one folder.
if (this._isFolderEditable()) {
if (this._folderTree.getSelectionNodes().length == 0)
return false;
}
if (this._isURIEditable() && !this._containsValidURI("editURLBar"))
return false;
// Feed Location has to be a valid URI;
// Site Location has to be a valid URI or empty
if (this._areLivemarkURIsVisible()) {
if (!this._containsValidURI("editLivemarkFeedLocationBox"))
return false;
if (!this._containsValidURI("editLivemarkSiteLocationBox") &&
(this._element("editLivemarkSiteLocationBox").value.length > 0))
return false;
}
return true;
},
/**
* Determines whether the XUL textbox with the given ID contains a
* string that can be converted into an nsIURI.
*
* @param textboxID the ID of the textbox element whose contents we'll test
*
* @returns true if the textbox contains a valid URI string, false otherwise
*/
_containsValidURI: function BPP__containsValidURI(textboxID) {
try {
var uri = this._uri(this._element(textboxID).value);
} catch (e) {
return false;
}
return true;
},
/**
* Save any changes that might have been made while the properties dialog
* was open.
*/
_saveChanges: function BPP__saveChanges() {
_saveChanges: function PBD_saveChanges() {
var transactions = [];
var urlbox = this._element("editURLBar");
var titlebox = this._element("editTitleBox");
var urlbox = this._dialogWindow.document.getElementById("editURLBar");
var titlebox = this._dialogWindow.document.getElementById("editTitleBox");
var newURI = this._bookmarkURI;
if (this._identifierIsURI() && this._isURIEditable())
newURI = this._uri(urlbox.value);
@ -723,34 +588,13 @@ var BookmarkPropertiesPanel = {
if (this._identifierIsURI())
transactions.push(
new PlacesEditItemTitleTransaction(newURI, titlebox.value));
else if (this._identifierIsFolderID()) {
if (this._areLivemarkURIsVisible()) {
if (this._identifierIsFolderID()) {
var feedURIString =
this._element("editLivemarkFeedLocationBox").value;
var feedURI = this._uri(feedURIString);
transactions.push(
new PlacesEditLivemarkFeedURITransaction(this._folderId, feedURI));
// Site Location is empty, we can set its URI to null
var siteURI = null;
var siteURIString =
this._element("editLivemarkSiteLocationBox").value;
if (siteURIString.length > 0)
siteURI = this._uri(siteURIString);
transactions.push(
new PlacesEditLivemarkSiteURITransaction(this._folderId, siteURI));
}
}
else if (this._identifierIsFolderID())
transactions.push(
new PlacesEditFolderTitleTransaction(this._folderId, titlebox.value));
}
if (this._isShortcutVisible()) {
var shortcutbox =
this._element("editShortcutBox");
this._dialogWindow.document.getElementById("editShortcutBox");
transactions.push(
new PlacesEditBookmarkKeywordTransaction(this._bookmarkURI,
shortcutbox.value));

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

@ -50,26 +50,7 @@
<label value="&bookmark.property.location;" align="middle"/>
</hbox>
</vbox>
<textbox id="editURLBar" size="10"
onchange="BookmarkPropertiesPanel.validateChanges()"/>
</row>
<row id="livemarkFeedLocationRow">
<vbox align="end">
<hbox align="center" flex="1">
<label value="&livemark.property.feed_uri;" align="middle"/>
</hbox>
</vbox>
<textbox id="editLivemarkFeedLocationBox"
onchange="BookmarkPropertiesPanel.validateChanges()"/>
</row>
<row id="livemarkSiteLocationRow">
<vbox align="end">
<hbox align="center" flex="1">
<label value="&livemark.property.site_uri;" align="middle"/>
</hbox>
</vbox>
<textbox id="editLivemarkSiteLocationBox"
onchange="BookmarkPropertiesPanel.validateChanges()"/>
<textbox id="editURLBar" size="10"/>
</row>
<row id="shortcutRow">
<vbox align="end">
@ -92,8 +73,7 @@
type="places"
place="place:&amp;folder=1&amp;group=3&amp;excludeItems=1"
hidecolumnpicker="true"
seltype="multiple"
onselect="BookmarkPropertiesPanel.validateChanges()">
seltype="multiple">
<treecols>
<treecol id="title"
flex="1"

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

@ -2184,8 +2184,6 @@ function PlacesBaseTransaction() {
PlacesBaseTransaction.prototype = {
bookmarks: Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Ci.nsINavBookmarksService),
livemarks: Cc["@mozilla.org/browser/livemark-service;1"].
getService(Ci.nsILivemarkService),
LOG: LOG,
redoTransaction: function PIT_redoTransaction() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED;
@ -2556,49 +2554,3 @@ PlacesEditBookmarkKeywordTransaction.prototype = {
this.bookmarks.setKeywordForURI(this._uri, this._oldKeyword);
}
};
/**
* Edit a live bookmark's site URI.
*/
function PlacesEditLivemarkSiteURITransaction(folderId, uri) {
this._folderId = folderId;
this._newURI = uri;
this._oldURI = null;
this.redoTransaction = this.doTransaction;
}
PlacesEditLivemarkSiteURITransaction.prototype = {
__proto__: PlacesBaseTransaction.prototype,
doTransaction: function PELSUT_doTransaction() {
this._oldURI = this.livemarks.getSiteURI(this._folderId);
this.livemarks.setSiteURI(this._folderId, this._newURI);
},
undoTransaction: function PELSUT_undoTransaction() {
this.livemarks.setSiteURI(this._folderId, this._oldURI);
}
};
/**
* Edit a live bookmark's feed URI.
*/
function PlacesEditLivemarkFeedURITransaction(folderId, uri) {
this._folderId = folderId;
this._newURI = uri;
this._oldURI = null;
this.redoTransaction = this.doTransaction;
}
PlacesEditLivemarkFeedURITransaction.prototype = {
__proto__: PlacesBaseTransaction.prototype,
doTransaction: function PELFUT_doTransaction() {
this._oldURI = this.livemarks.getFeedURI(this._folderId);
this.livemarks.setFeedURI(this._folderId, this._newURI);
this.livemarks.reloadLivemarkFolder(this._folderId);
},
undoTransaction: function PELFUT_undoTransaction() {
this.livemarks.setFeedURI(this._folderId, this._oldURI);
this.livemarks.reloadLivemarkFolder(this._folderId);
}
};

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

@ -193,13 +193,12 @@
var bms =
Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Ci.nsINavBookmarksService);
var lms =
Cc["@mozilla.org/browser/livemark-service;1"].
getService(Ci.nsILivemarkService);
var siteURI = lms.getSiteURI(folder);
if (siteURI) {
element.setAttribute("siteURI", siteURI.spec);
}
var folderURI = bms.getFolderURI(folder);
var anno =
Cc["@mozilla.org/browser/annotation-service;1"].
getService(Ci.nsIAnnotationService);
var siteURI = anno.getAnnotationString(folderURI, "livemark/siteURI");
element.setAttribute("siteURI", siteURI);
}
var popup = document.createElementNS(XULNS, "menupopup");

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

@ -128,13 +128,12 @@
if (PlacesController.nodeIsLivemarkContainer(child)) {
button.setAttribute("livemark", "true");
var folder = asFolder(child).folderId;
var lms =
Cc["@mozilla.org/browser/livemark-service;1"].
getService(Ci.nsILivemarkService);
var siteURI = lms.getSiteURI(folder);
if (siteURI) {
button.setAttribute("siteURI", siteURI.spec);
}
var folderURI = this._bms.getFolderURI(folder);
var anno =
Cc["@mozilla.org/browser/annotation-service;1"].
getService(Ci.nsIAnnotationService);
var siteURI = anno.getAnnotationString(folderURI, "livemark/siteURI");
button.setAttribute("siteURI", siteURI);
}
var popup = document.createElementNS(XULNS, "menupopup");
popup.setAttribute("type", "places");

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

@ -480,7 +480,7 @@ nsLivemarkService::SetFeedURI(PRInt64 aContainer, nsIURI *aFeedURI)
// Now update our internal table
PRInt32 livemarkIndex = GetLivemarkIndex(aContainer);
NS_ENSURE_TRUE(livemarkIndex > -1, NS_ERROR_FAILURE);
NS_ENSURE_TRUE(livemarkIndex == -1, NS_ERROR_FAILURE);
mLivemarks[livemarkIndex]->feedURI = aFeedURI;

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

@ -12,10 +12,6 @@
"Folder List">
<!ENTITY bookmark.property.parents
"Visible In">
<!ENTITY livemark.property.feed_uri
"Feed Location">
<!ENTITY livemark.property.site_uri
"Site Location">
<!ENTITY cmd.delete_bookmark.label
"Delete Bookmark">
<!ENTITY cmd.accept.edit

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

@ -6,4 +6,3 @@ dialogTitleAddMulti=Bookmark All Tabs
dialogTitleBookmarkEdit=Bookmark Properties
dialogTitleHistoryEdit=Viewed Page Properties
dialogTitleFolderEdit=Edit Folder Properties
dialogTitleAddLivemark=Add Live Bookmark