Merge mozilla-central to tracemonkey.

This commit is contained in:
Robert Sayre 2009-09-28 11:53:36 -07:00
commit 707168902d
395 changed files with 15923 additions and 14047 deletions

View File

@ -29,4 +29,4 @@ _OPT\.OBJ/
^js/src/autom4te.cache$
# Java HTML5 parser classes
^parser/html/java/.*\.class$
^parser/html/java/(html|java)parser/

View File

@ -383,8 +383,7 @@ NS_IMETHODIMP nsDocAccessible::TakeFocus()
nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
if (fm) {
nsCOMPtr<nsIDOMDocument> domDocument;
mDOMNode->GetOwnerDocument(getter_AddRefs(domDocument));
nsCOMPtr<nsIDOMDocument> domDocument(do_QueryInterface(mDOMNode));
nsCOMPtr<nsIDocument> document(do_QueryInterface(domDocument));
if (document) {
// focus the document

View File

@ -1196,21 +1196,22 @@ var PlacesStarButton = {
this._batching = false;
},
onItemAdded: function PSB_onItemAdded(aItemId, aFolder, aIndex) {
onItemAdded: function PSB_onItemAdded(aItemId, aFolder, aIndex, aItemType) {
if (!this._batching && !this._starred)
this.updateState();
},
onBeforeItemRemoved: function PSB_onBeforeItemRemoved(aItemId) {
},
onBeforeItemRemoved: function() {},
onItemRemoved: function PSB_onItemRemoved(aItemId, aFolder, aIndex) {
onItemRemoved: function PSB_onItemRemoved(aItemId, aFolder, aIndex,
aItemType) {
if (!this._batching)
this.updateState();
},
onItemChanged: function PSB_onItemChanged(aItemId, aProperty,
aIsAnnotationProperty, aValue) {
aIsAnnotationProperty, aNewValue,
aLastModified, aItemType) {
if (!this._batching && aProperty == "uri")
this.updateState();
},

View File

@ -296,6 +296,7 @@
<toolbar type="menubar" id="toolbar-menubar" class="chromeclass-menubar" customizable="true"
defaultset="menubar-items"
mode="icons" iconsize="small" defaulticonsize="small"
lockiconsize="true"
#ifdef XP_WIN
toolbarname="&menubarCmd.label;"
accesskey="&menubarCmd.accesskey;"
@ -549,6 +550,7 @@
<toolbar id="PersonalToolbar"
mode="icons" iconsize="small" defaulticonsize="small"
lockiconsize="true"
class="chromeclass-directories"
context="toolbar-context-menu"
defaultset="personal-bookmarks"

View File

@ -89,21 +89,18 @@ function test()
};
let db = Cc["@mozilla.org/download-manager;1"].
getService(Ci.nsIDownloadManager).DBConnection;
let rawStmt = db.createStatement(
let stmt = db.createStatement(
"INSERT INTO moz_downloads (name, source, target, startTime, endTime, " +
"state, currBytes, maxBytes, preferredAction, autoResume) " +
"VALUES (:name, :source, :target, :startTime, :endTime, :state, " +
":currBytes, :maxBytes, :preferredAction, :autoResume)");
let stmt = Cc["@mozilla.org/storage/statement-wrapper;1"].
createInstance(Ci.mozIStorageStatementWrapper);
stmt.initialize(rawStmt);
try {
for (let prop in data)
stmt.params[prop] = data[prop];
stmt.execute();
}
finally {
stmt.statement.finalize();
stmt.finalize();
}
// Toggle history to get everything to update

View File

@ -591,7 +591,7 @@ function downloadExists(aID)
"WHERE id = :id"
);
stmt.params.id = aID;
var rows = stmt.step();
var rows = stmt.executeStep();
stmt.finalize();
return rows;
}

View File

@ -742,7 +742,7 @@ function downloadExists(aID)
"WHERE id = :id"
);
stmt.params.id = aID;
let rows = stmt.step();
let rows = stmt.executeStep();
stmt.finalize();
return !!rows;
}

View File

@ -542,7 +542,7 @@ function downloadExists(aID)
"WHERE id = :id"
);
stmt.params.id = aID;
let rows = stmt.step();
let rows = stmt.executeStep();
stmt.finalize();
return !!rows;
}

View File

@ -81,7 +81,7 @@ static RedirEntry kRedirMap[] = {
{ "privatebrowsing", "chrome://browser/content/aboutPrivateBrowsing.xhtml",
nsIAboutModule::ALLOW_SCRIPT },
{ "rights",
#ifdef OFFICIAL_BUILD
#ifdef MOZ_OFFICIAL_BRANDING
"chrome://global/content/aboutRights.xhtml",
#else
"chrome://global/content/aboutRights-unbranded.xhtml",

View File

@ -58,8 +58,4 @@ CPPSRCS = AboutRedirector.cpp
LOCAL_INCLUDES = -I$(srcdir)/../build
ifdef MOZILLA_OFFICIAL
DEFINES += -DOFFICIAL_BUILD=1
endif
include $(topsrcdir)/config/rules.mk

View File

@ -151,12 +151,9 @@ PlacesController.prototype = {
return this._canInsert(true) && this._isClipboardDataPasteable();
case "cmd_selectAll":
if (this._view.selType != "single") {
var result = this._view.getResult();
if (result) {
var container = asContainer(result.root);
if (container.containerOpen && container.childCount > 0)
var rootNode = this._view.getResultNode();
if (rootNode.containerOpen && rootNode.childCount > 0)
return true;
}
}
return false;
case "placesCmd_open":
@ -171,7 +168,7 @@ PlacesController.prototype = {
return this._canInsert();
case "placesCmd_new:separator":
return this._canInsert() &&
!asQuery(this._view.getResult().root).queryOptions.excludeItems &&
!asQuery(this._view.getResultNode()).queryOptions.excludeItems &&
this._view.getResult().sortingMode ==
Ci.nsINavHistoryQueryOptions.SORT_BY_NONE;
case "placesCmd_show:info":
@ -449,7 +446,7 @@ PlacesController.prototype = {
*/
_buildSelectionMetadata: function PC__buildSelectionMetadata() {
var metadata = [];
var root = this._view.getResult().root;
var root = this._view.getResultNode();
var nodes = this._view.getSelectionNodes();
if (nodes.length == 0)
nodes.push(root); // See the second note above
@ -1011,7 +1008,6 @@ PlacesController.prototype = {
var nodes = this._view.getSelectionNodes();
var URIs = [];
var bhist = PlacesUtils.history.QueryInterface(Ci.nsIBrowserHistory);
var resultView = this._view.getResultView();
var root = this._view.getResultNode();
for (var i = 0; i < nodes.length; ++i) {
@ -1087,7 +1083,7 @@ PlacesController.prototype = {
NS_ASSERT(aTxnName !== undefined, "Must supply Transaction Name");
var root = this._view.getResult().root;
var root = this._view.getResultNode();
if (PlacesUtils.nodeIsFolder(root))
this._removeRowsFromBookmarks(aTxnName);

View File

@ -1065,7 +1065,8 @@ var gEditItemOverlay = {
// nsINavBookmarkObserver
onItemChanged: function EIO_onItemChanged(aItemId, aProperty,
aIsAnnotationProperty, aValue) {
aIsAnnotationProperty, aValue,
aLastModified, aItemType) {
if (this._itemId != aItemId) {
if (aProperty == "title") {
// If the title of a folder which is listed within the folders
@ -1145,7 +1146,7 @@ var gEditItemOverlay = {
},
onItemMoved: function EIO_onItemMoved(aItemId, aOldParent, aOldIndex,
aNewParent, aNewIndex) {
aNewParent, aNewIndex, aItemType) {
if (aItemId != this._itemId ||
aNewParent == this._getFolderIdFromMenuList())
return;
@ -1157,7 +1158,7 @@ var gEditItemOverlay = {
this._folderMenuList.selectedItem = folderItem;
},
onItemAdded: function EIO_onItemAdded(aItemId, aFolder, aIndex) {
onItemAdded: function EIO_onItemAdded(aItemId, aFolder, aIndex, aItemType) {
this._lastNewItem = aItemId;
},

View File

@ -78,8 +78,6 @@
<!-- This is the view that manage the popup -->
<field name="_rootView">PlacesUIUtils.getViewForNode(this);</field>
<field name="_built">false</field>
<method name="onDragOver">
<parameter name="aEvent"/>
<parameter name="aFlavour"/>
@ -536,9 +534,9 @@
extends="chrome://browser/content/places/menu.xml#places-popup-base">
<implementation>
<destructor><![CDATA[
this._resultNode = null;
if (this._result) {
this._result.root.containerOpen = false;
this._resultNode.containerOpen = false;
this._resultNode = null;
this._result.viewer = null;
this._result = null;
}
@ -574,12 +572,13 @@
var resultNode = popup._resultNode;
if (!resultNode.containerOpen)
resultNode.containerOpen = true;
if (!popup._built)
if (!popup.parentNode._built)
this._rebuild(popup);
]]></body>
</method>
<field name="_result">null</field>
<field name="_resultNode">null</field>
<!-- nsIPlacesView -->
<method name="getResult">
@ -599,20 +598,12 @@
<method name="removeItem">
<parameter name="child"/>
<body><![CDATA[
if (PlacesUtils.nodeIsContainer(child.node)) {
for (var i=0; i < this._containerNodesMap.length; i++) {
if (this._containerNodesMap[i].resultNode == child.node) {
this._containerNodesMap.splice(i, 1);
break;
}
}
}
// if document.popupNode pointed to this child, null it out,
// otherwise controller's command-updating may rely on the removed
// item still being "selected".
if (document.popupNode == child)
document.popupNode = null;
child.parentNode.removeChild(child);
if (this._endMarker != -1)
@ -625,8 +616,7 @@
<parameter name="aParentPopup"/>
<parameter name="aBefore"/>
<body><![CDATA[
var element =
PlacesUIUtils.createMenuItemForNode(aChild, this._containerNodesMap);
var element = PlacesUIUtils.createMenuItemForNode(aChild);
if (aBefore)
aParentPopup.insertBefore(element, aBefore);
@ -689,7 +679,7 @@
if (aPopup._startMarker == -1 && aPopup._endMarker == -1)
this._showEmptyMenuItem(aPopup);
}
aPopup._built = true;
aPopup.parentNode._built = true;
]]></body>
</method>
@ -697,18 +687,6 @@
<field name="_viewer"><![CDATA[({
_self: this,
_getPopupForContainer:
function PMV__getPopupForContainer(aNode) {
if (this._self._resultNode == aNode)
return this._self;
for (var i=0; i < this._self._containerNodesMap.length; i++) {
if (this._self._containerNodesMap[i].resultNode == aNode)
return this._self._containerNodesMap[i].domNode;
}
throw("Container view not found");
},
get result() {
return this._self._result;
},
@ -721,130 +699,168 @@
// we should do nothing.
if (this._self._result != val) {
if (this._self._result)
this._self._result.root.containerOpen = false;
this._built = false;
this._self._containerNodesMap = [];
this._self._resultNode = val.root;
this._self._resultNode.containerOpen = false;
this._self.parentNode._built = false;
this._self._result = val;
if (val) {
this._self._resultNode = val.root;
this._self._resultNode._DOMElement = this._self.parentNode;
}
else
this._self._resultNode = null;
}
return val;
},
itemInserted: function PMV_itemInserted(aParentNode, aNode, aIndex) {
var popup = this._getPopupForContainer(aParentNode);
if (!popup._built)
nodeInserted: function PMV_nodeInserted(aParentNode, aNode, aIndex) {
let parentElt = aParentNode._DOMElement;
NS_ASSERT(parentElt, "parent node must have _DOMElement set");
if (!parentElt._built)
return;
var index = popup._startMarker + 1 + aIndex;
var before = popup.childNodes[index] || null;
// parentElt is the <menu> element for the container,
// we need the <menupopup>
let popup = parentElt.firstChild;
let index = popup._startMarker + 1 + aIndex;
let before = popup.childNodes[index] || null;
this._self.insertNewItem(aNode, popup, before);
if (popup._emptyMenuItem)
popup._emptyMenuItem.hidden = true;
},
itemRemoved: function PMV_itemRemoved(aParentNode, aNode, aIndex) {
var popup = this._getPopupForContainer(aParentNode);
if (!popup._built)
nodeRemoved: function PMV_nodeRemoved(aParentNode, aNode, aIndex) {
let parentElt = aParentNode._DOMElement;
NS_ASSERT(parentElt, "parent node must have _DOMElement set");
if (!parentElt._built)
return;
var children = popup.childNodes;
for (var i = popup._startMarker + 1; i < children.length; i++) {
if (children[i].node == aNode) {
this._self.removeItem(children[i]);
if (!popup.hasChildNodes() ||
(popup.childNodes.length == 1 &&
popup.firstChild == popup._emptyMenuItem)) {
this._self._showEmptyMenuItem(popup);
}
return;
}
}
// parentElt is the <menu> element for the container,
// we need the <menupopup>
let popup = parentElt.firstChild;
let nodeElt = aNode._DOMElement;
NS_ASSERT(nodeElt, "node must have _DOMElement set");
popup.removeChild(nodeElt);
// Figure out if we need to show the "<Empty>" menu-item.
// TODO Bug 517701: This doesn't seem to handle the case of an empty
// root (parentElt == this._self.parentNode).
if (!popup.hasChildNodes() ||
(popup.childNodes.length == 1 &&
popup.firstChild == popup._emptyMenuItem))
this._self._showEmptyMenuItem(popup);
if (popup._endMarker != -1)
popup._endMarker--;
},
itemMoved:
function PMV_itemMoved(aItem, aOldParent, aOldIndex, aNewParent,
aNewIndex) {
// This cannot actually happen yet (see IDL)
if (aNewParent != aOldParent)
nodeMoved:
function PMV_nodeMoved(aNode,
aOldParent, aOldIndex,
aNewParent, aNewIndex) {
// Note: the current implementation of moveItem does not actually
// use this notification when the item in question is moved from one
// folder to another. Instead, it calls nodeRemoved and nodeInserted
// for the two folders. Thus, we can assume aOldParent == aNewParent.
let nodeElt = aNode._DOMElement;
NS_ASSERT(nodeElt, "node must have _DOMElement set");
// If our root node is a folder, it might be moved. There's nothing
// we need to do in that case.
if (nodeElt == this._self.parentNode)
return;
var popup = this._getPopupForContainer(aNewParent);
var index = popup._startMarker + 1 + aNewIndex;
var children = popup.childNodes;
for (var i = popup._startMarker + 1; i < children.length; i++) {
var menuItem = children[i];
if (menuItem.node == aItem) {
popup.removeChild(menuItem);
popup.insertBefore(menuItem, children[index]);
return;
}
}
// Move the node.
let popup = nodeElt.parentNode;
popup.removeChild(nodeElt);
popup.insertBefore(nodeElt, popup.childNodes[aNewIndex]);
},
itemChanged: function PMV_itemChanged(aNode) {
// this check can be removed once we fix bug #382397
var parentNode = aNode.parent;
if (!parentNode)
nodeTitleChanged: function PMV__nodeTitleChanged(aNode, aNewTitle) {
let nodeElt = aNode._DOMElement;
NS_ASSERT(nodeElt, "node must have _DOMElement set");
// There's no UI representation for the root node, thus there's
// nothing to be done when the title changes.
if (nodeElt == this._self.parentNode)
return;
if (PlacesUtils.nodeIsSeparator(aNode)) {
// nothing to do when a separator changes
return;
}
nodeElt.label = aNewTitle || PlacesUIUtils.getBestTitle(aNode);
},
var popup = this._getPopupForContainer(parentNode);
if (!popup._built)
nodeURIChanged: function PMV_nodeURIChanged(aNode, aURIString) {
let nodeElt = aNode._DOMElement;
NS_ASSERT(nodeElt, "node must have _DOMElement set");
nodeElt.setAttribute("scheme",
PlacesUIUtils.guessUrlSchemeForUI(aURIString));
},
nodeIconChanged: function PMV_nodeIconChanged(aNode) {
let nodeElt = aNode._DOMElement;
NS_ASSERT(nodeElt, "node must have _DOMElement set");
// There's no UI representation for the root node, thus there's
// nothing to be done when the icon changes.
if (nodeElt == this._self.parentNode)
return;
var children = popup.childNodes;
var menuitem;
for (var i = popup._startMarker + 1; i < children.length; i++) {
if (children[i].node == aNode) {
menuitem = children[i];
break;
}
}
var iconURI = aNode.icon;
if (iconURI) {
var spec = iconURI.spec;
if (menuitem.getAttribute("image") != spec)
menuitem.setAttribute("image", spec);
var icon = aNode.icon;
if (icon) {
if (nodeElt.getAttribute("image") != icon)
nodeElt.setAttribute("image", icon);
}
else
menuitem.removeAttribute("image");
nodeElt.removeAttribute("image");
},
var title = PlacesUIUtils.getBestTitle(aNode);
if (menuitem.getAttribute("label") != title)
menuitem.setAttribute("label", title);
nodeAnnotationChanged:
function PMV_nodeAnnotationChanged(aNode, aAnno) {
// Ensure the changed annotation is a livemark one.
if (/^livemark\//.test(aAnno) &&
PlacesUtils.nodeIsLivemarkContainer(aNode)) {
let nodeElt = aNode._DOMElement;
NS_ASSERT(nodeElt, "node must have _DOMElement set");
if (PlacesUtils.nodeIsLivemarkContainer(aNode)) {
if (!menuitem.hasAttribute("livemark"))
menuitem.setAttribute("livemark", "true");
// If this is a livemark container check if the status menuitem has
// to be added or removed.
PlacesUIUtils.ensureLivemarkStatusMenuItem(menuitem.firstChild);
}
else if (PlacesUtils.nodeIsURI(aNode)) {
menuitem.setAttribute("scheme", PlacesUIUtils.guessUrlSchemeForUI(aNode.uri));
if (!nodeElt.hasAttribute("livemark"))
nodeElt.setAttribute("livemark", "true");
// Add or remove the livemark status menuitem.
PlacesUIUtils.ensureLivemarkStatusMenuItem(nodeElt.firstChild);
}
},
itemReplaced:
function PMV_itemReplaced(aParentNode, aOldNode, aNewNode, aIndex) {
var popup = this._getPopupForContainer(aParentNode);
if (!popup._built)
nodeHistoryDetailsChanged: function() { },
nodeTagsChanged: function() { },
nodeDateAddedChanged: function() { },
nodeLastModifiedChanged: function() { },
nodeKeywordChanged: function() { },
nodeReplaced:
function PMV_nodeReplaced(aParentNode, aOldNode, aNewNode, aIndex) {
let parentElt = aParentNode._DOMElement;
NS_ASSERT(parentElt, "parent node must have _DOMElement set");
if (!parentElt._built)
return;
var children = popup.childNodes;
for (var i = popup._startMarker + 1; i < children.length; i++) {
if (children[i].node == aOldNode) {
var next = children[i].nextSibling;
this._self.removeItem(children[i]);
this._self.insertNewItem(aNewNode, popup, next);
return;
}
}
// parentElt is the <menu> element for the container,
// we need the <menupopup>.
let popup = parentElt.firstChild;
let nodeElt = aOldNode._DOMElement;
NS_ASSERT(nodeElt, "node must have _DOMElement set");
// No worries: If nodeElt is the last item (i.e. no nextSibling),
// insertNewItem will insert the new element as the last item.
let next = nodeElt.nextSibling;
this._self.removeItem(nodeElt);
this._self.insertNewItem(aNewNode, popup, next);
},
containerOpened: function PMV_containerOpened(aNode) {
@ -854,45 +870,19 @@
containerClosed: function PMV_containerClosed(aNode) {
this.invalidateContainer(aNode);
},
invalidateContainer: function PMV_invalidateContainer(aContainer) {
if (!this._self._built)
// Do nothing if the entire view is already marked un-built.
if (!this._self.parentNode._built)
return;
function isChildOf(node, container) {
var parent = node.parent;
while (parent) {
if (parent == container)
return true;
parent = parent.parent;
}
return false;
}
let containerNodeElt = aContainer._DOMElement;
NS_ASSERT(containerNodeElt, "node must have _DOMElement set");
containerNodeElt._built = false;
var popupToRebuild = null;
for (var i=0; i < this._self._containerNodesMap.length; i++) {
var node = this._self._containerNodesMap[i].resultNode;
if (node == aContainer)
popupToRebuild = this._self._containerNodesMap[i].domNode;
if (isChildOf(node, aContainer)) {
this._self._containerNodesMap.splice(i,1);
i--;
}
}
if (!popupToRebuild)
popupToRebuild = this._self;
popupToRebuild._built = false;
// if the menupopup is open we should live-update it
if (popupToRebuild.parentNode.open)
this._self._rebuild(popupToRebuild);
},
invalidateAll: function PMV_invalidateAll() {
this._self._containerNodesMap.splice(0);
this._self._built = false;
// If the menupopup is open we should live-update it.
if (containerNodeElt.open)
this._self._rebuild(containerNodeElt.firstChild);
},
sortingChanged: function PMV_sortingChanged(aSortingMode) {
@ -914,6 +904,7 @@
PlacesUtils.history.executeQueries(queries.value,
queries.value.length,
options.value);
result.viewer = this._viewer;
return val;
]]></setter>

View File

@ -24,6 +24,7 @@
# Ben Goodger <beng@google.com>
# Myk Melez <myk@mozilla.org>
# Marco Bonardo <mak77@bonardo.net>
# Asaf Romano <mano@mozilla.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
@ -37,7 +38,7 @@
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
# ***** END LICENSE BLOCK *****
<!DOCTYPE bindings [
@ -99,6 +100,8 @@
window.removeEventListener("resize", this, false);
if (this._result) {
this._resultNode.containerOpen = false;
this._resultNode = null;
this._result.viewer = null;
this._result = null;
}
@ -110,17 +113,48 @@
<method name="_init">
<body><![CDATA[
this._controller = new PlacesController(this);
this.controllers.appendController(this._controller);
// XBL bug is in the middle...
// When toolbar customization is opened, this binding is attached
// again, as a result of adding the item under the wrapper. However,
// the binding isn't detached from the "original" hbox element due
// to bug 83635.
//
// Then, when the customization dialog is closed, the binding is
// attached the third time, as a result of adding our element back to
// the toolbar.
//
// So, We'll just continue using the original binding, which was
// never removed, and avoid using the new bindings. This means that
// this workaround will work just until bug 83635 is fixed.
//
// However, when the binding is "reconstructed", we do need to add
// back the event listeners and the places controller.
//
// Note: we could avoid part of this mess by moving the "Bookmark
// Toolbar Items" placeholder out of this binding.
this._scrollbox.addEventListener("overflow", this, false);
this._scrollbox.addEventListener("underflow", this, false);
window.addEventListener("resize", this, false);
// We also need to avoid initializing _result and _resultNode and
// _controller as XBL fields. Otherwise, they'll be unset when the
// "extra" bindings are applied.
if (this.hasAttribute("place")) {
// Do the initial build.
this.place = this.place;
}
this._scrollbox.addEventListener("overflow", this, false);
this._scrollbox.addEventListener("underflow", this, false);
window.addEventListener("resize", this, false);
if (this._result === undefined) {
this._result = null;
this._resultNode = null;
if (this.hasAttribute("place")) {
// Do the initial build.
this.place = this.place;
}
}
// Attach the places controller.
if (!this._controller)
this._controller = new PlacesController(this);
this.controllers.appendController(this._controller);
]]></body>
</method>
@ -142,9 +176,6 @@
<field name="_openedMenuButton">null</field>
<field name="_allowPopupShowing">true</field>
<field name="_result">null</field>
<field name="_resultNode">null</field>
<field name="_isRTL">
document.defaultView.getComputedStyle(this.parentNode, "")
.direction == "rtl"
@ -160,7 +191,7 @@
<!-- nsIPlacesView -->
<method name="getResultNode">
<body><![CDATA[
return this._result.root;
return this._resultNode;
]]></body>
</method>
@ -175,10 +206,9 @@
while (this.hasChildNodes())
this.removeChild(this.firstChild);
var rootNode = this._result.root;
var cc = rootNode.childCount;
let cc = this._resultNode.childCount;
for (let i = 0; i < cc; ++i)
this.insertNewItem(rootNode.getChild(i), null);
this.insertNewItem(this._resultNode.getChild(i), null);
if (this._chevronPopup.hasAttribute("type")) {
// Chevron has already been initialized, but since we are forcing
@ -186,9 +216,6 @@
// Otherwise, it will be initialized when the toolbar overflows.
this._chevronPopup.place = this.place;
}
while (chevronPopup.hasChildNodes())
this._chevronPopup.removeChild(this._chevronPopup.lastChild);
]]></body>
</method>
@ -204,12 +231,9 @@
button = document.createElement("toolbarbutton");
button.className = "bookmark-item";
button.setAttribute("label", aChild.title);
var iconURI = aChild.icon;
var iconURISpec = "";
if (iconURI) {
iconURISpec = iconURI.spec;
button.setAttribute("image", iconURISpec);
}
var icon = aChild.icon;
if (icon)
button.setAttribute("image", icon);
if (PlacesUtils.containerTypes.indexOf(type) != -1) {
button.setAttribute("type", "menu");
@ -226,21 +250,17 @@
var popup = document.createElement("menupopup");
popup.setAttribute("placespopup", "true");
button.appendChild(popup);
popup._result = this._result;
popup._resultNode = asContainer(aChild);
#ifndef XP_MACOSX
popup.setAttribute("context", "placesContext");
#endif
this._containerNodesMap.push({ resultNode: aChild,
domNode: popup });
}
else if (PlacesUtils.nodeIsURI(aChild)) {
else if (PlacesUtils.nodeIsURI(aChild))
button.setAttribute("scheme", PlacesUIUtils.guessUrlSchemeForUI(aChild.uri));
}
}
button.node = aChild;
button.node.viewIndex = 0;
aChild._DOMElement = button;
if (aBefore)
this.insertBefore(button, aBefore);
else
@ -251,20 +271,12 @@
<method name="removeItem">
<parameter name="child"/>
<body><![CDATA[
if (PlacesUtils.nodeIsContainer(child.node)) {
for (let i = 0; i < this._containerNodesMap.length; i++) {
if (this._containerNodesMap[i].resultNode == child.node) {
this._containerNodesMap.splice(i, 1);
break;
}
}
}
// if document.popupNode pointed to this child, null it out,
// otherwise controller's command-updating may rely on the removed
// item still being "selected".
if (document.popupNode == child)
document.popupNode = null;
child.parentNode.removeChild(child);
]]></body>
</method>
@ -378,13 +390,13 @@
<getter><![CDATA[
return this.getAttribute("place");
]]></getter>
<setter><![CDATA[
<setter><![CDATA[
this.setAttribute("place", val);
var history = PlacesUtils.history;
var queries = { }, options = { };
history.queryStringToQueries(val, queries, { }, options);
if (!queries.value.length)
if (!queries.value.length)
queries.value = [history.getNewQuery()];
try {
var result =
@ -394,7 +406,7 @@
}
catch(ex) {
// Invalid query, or had no results.
// This is valid, eg: user deletes their bookmarks toolbar folder.
// This is valid, eg: user deletes his bookmarks toolbar folder.
}
return val;
]]></setter>
@ -402,7 +414,7 @@
<!-- nsIPlacesView -->
<property name="hasSelection">
<getter><![CDATA[
<getter><![CDATA[
return this.selectedNode != null;
]]></getter>
</property>
@ -453,9 +465,9 @@
<!-- nsIPlacesView -->
<property name="insertionPoint">
<getter><![CDATA[
// By default, the insertion point is at the top level, at the end.
// By default, the insertion point is at the top level, at the end.
var index = PlacesUtils.bookmarks.DEFAULT_INDEX;
var container = this._result.root;
var container = this._resultNode;
var orientation = Ci.nsITreeView.DROP_BEFORE;
var isTag = false;
@ -486,7 +498,7 @@
<!-- nsIPlacesView -->
<method name="selectAll">
<body><![CDATA[
<body><![CDATA[
// Nothing
]]></body>
</method>
@ -501,18 +513,6 @@
<field name="_viewer"><![CDATA[({
_self: this,
_getPopupForContainer:
function PMV__getPopupForContainer(aNode) {
if (this._self._resultNode == aNode)
return this._self;
for (let i = 0; i < this._self._containerNodesMap.length; i++) {
if (this._self._containerNodesMap[i].resultNode == aNode)
return this._self._containerNodesMap[i].domNode;
}
throw("Container view not found");
},
get result() {
return this._self._result;
},
@ -525,242 +525,235 @@
// we should do nothing.
if (this._self._result != val) {
if (this._self._result)
this._self._result.root.containerOpen = false;
this._self._containerNodesMap = [];
this._self._resultNode.containerOpen = false;
this._self._result = val;
if (val) // this calls _rebuild through invalidateContainer
val.root.containerOpen = true;
if (val) {
this._self._resultNode = val.root;
this._self._resultNode._DOMElement = this._self;
// This calls _rebuild through invalidateContainer.
this._self._resultNode.containerOpen = true;
}
else
this._self._resultNode = null;
}
return val;
},
itemInserted: function TV_V_itemInserted(aParentNode, aNode, aIndex) {
// don't insert new items into the toolbar
// if the parent is not the root
if (aParentNode == this._self.getResultNode()) {
var children = this._self.childNodes;
nodeInserted: function TV_V_nodeInserted(aParentNode, aNode, aIndex) {
let parentElt = aParentNode._DOMElement;
NS_ASSERT(parentElt, "parent node must have _DOMElement set");
if (parentElt == this._self) {
// Node is on the toolbar.
let children = this._self.childNodes;
this._self.insertNewItem(aNode,
aIndex < children.length ? children[aIndex] : null);
this._self.updateChevron();
}
else {
var popup = this._getPopupForContainer(aParentNode);
if (!popup._built)
return;
var before = popup.childNodes[aIndex] || null;
else if (parentElt._built) {
// Node is within a built menu.
let popup = parentElt.firstChild;
let before = popup.childNodes[aIndex] || null;
this._self.insertNewItemToPopup(aNode, popup, before);
if (popup._emptyMenuItem)
popup._emptyMenuItem.hidden = true;
}
},
itemRemoved: function TV_V_itemRemoved(aParentNode, aNode, aIndex) {
if (aParentNode == this._self.getResultNode()) {
var children = this._self.childNodes;
for (let i = 0; i < children.length; i++) {
if (children[i].node == aNode) {
this._self.removeItem(children[i]);
this._self.updateChevron();
return;
}
}
}
else {
var popup = this._getPopupForContainer(aParentNode);
if (!popup._built)
return;
nodeRemoved: function TV_V_nodeRemoved(aParentNode, aNode, aIndex) {
let parentElt = aParentNode._DOMElement;
let nodeElt = aNode._DOMElement;
var children = popup.childNodes;
for (let i = popup._startMarker + 1; i < children.length; i++) {
if (children[i].node == aNode) {
this._self.removeItem(children[i]);
if (!popup.hasChildNodes() ||
(popup.childNodes.length == 1 &&
popup.firstChild == popup._emptyMenuItem)) {
this._self._showEmptyMenuItem(popup);
}
if (popup._endMarker != -1)
popup._endMarker--;
return;
}
}
NS_ASSERT(parentElt, "parent node must have _DOMElement set");
NS_ASSERT(nodeElt, "node must have _DOMElement set");
if (parentElt == this._self) {
// Node is on the toolbar.
this._self.removeChild(nodeElt);
this._self.updateChevron();
}
else if (parentElt._built) {
// Node is within a built menu.
var popup = parentElt.firstChild;
popup.removeChild(nodeElt);
if (!popup.hasChildNodes() ||
(popup.childNodes.length == 1 &&
popup.firstChild == popup._emptyMenuItem))
this._self._showEmptyMenuItem(popup);
if (popup._endMarker != -1)
popup._endMarker--;
}
},
itemMoved:
function TV_V_itemMoved(aItem, aOldParent, aOldIndex, aNewParent,
aNewIndex) {
// This cannot actually happen yet (see IDL)
if (aNewParent != aOldParent)
nodeMoved:
function TV_V_nodeMoved(aNode,
aOldParent, aOldIndex,
aNewParent, aNewIndex) {
// Note: the current implementation of moveItem does not actually
// use this notification when the item in question is moved from one
// folder to another. Instead, it calls nodeRemoved and nodeInserted
// for the two folders. Thus, we can assume aOldParent == aNewParent.
let nodeElt = aNode._DOMElement;
NS_ASSERT(nodeElt, "node must have _DOMElement set");
// If our root node is a folder, it might be moved. There's nothing
// we need to do in that case.
if (nodeElt == this._self)
return;
if (aNewParent == this._self.getResultNode()) {
var children = this._self.childNodes;
for (let i = 0; i < children.length; i++) {
var button = children[i];
if (button.node == aItem) {
this._self.removeChild(button);
this._self.insertBefore(button, children[aNewIndex]);
// If the chevron popup is open, keep it in sync.
if (this._self._chevron.open) {
var chevronPopup = this._self._chevronPopup;
var menuitem = chevronPopup.childNodes[i];
chevronPopup.removeChild(menuitem);
chevronPopup.insertBefore(menuitem,
chevronPopup.childNodes[aNewIndex]);
}
this._self.updateChevron();
return;
}
let parentElt = aNewParent._DOMElement;
NS_ASSERT(parentElt, "parent node must have _DOMElement set");
if (parentElt == this._self) {
// Container is on the toolbar.
// Move the node.
this._self.removeChild(nodeElt);
this._self.insertBefore(nodeElt, this._self.childNodes[aNewIndex]);
// If the chevron popup is open, keep it in sync.
if (this._self._chevron.open) {
let chevronPopup = this._self._chevronPopup;
let menuitem = chevronPopup.childNodes[aOldIndex];
chevronPopup.removeChild(menuitem);
chevronPopup.insertBefore(menuitem,
chevronPopup.childNodes[aNewIndex]);
}
this._self.updateChevron();
}
else {
var popup = this._getPopupForContainer(aNewParent);
var children = popup.childNodes;
for (let i = popup._startMarker + 1; i < children.length; i++) {
var menuItem = children[i];
if (menuItem.node == aItem) {
popup.removeChild(menuItem);
popup.insertBefore(menuItem, children[aNewIndex]);
return;
}
}
else if (parentElt._built) {
// Container is within a built menu.
// parentElt is the <menu> element for the container,
// we need the <menupopup>.
var popup = parentElt.firstChild;
// Move the node.
popup.removeChild(nodeElt);
popup.insertBefore(nodeElt, popup.childNodes[aNewIndex]);
}
},
itemChanged: function TV_V_itemChanged(aNode) {
// this check can be removed once we fix bug #382397
var parentNode = aNode.parent;
if (!parentNode)
nodeTitleChanged: function TV_V_nodeTitleChanged(aNode, aNewTitle) {
let nodeElt = aNode._DOMElement;
NS_ASSERT(nodeElt, "node must have _DOMElement set");
// There's no UI representation for the root node, thus there's
// nothing to be done when the title changes.
if (nodeElt == this._self)
return;
if (PlacesUtils.nodeIsSeparator(aNode)) {
// nothing to do when a separator changes
return;
}
var element;
var onToolbar = false;
if (parentNode == this._self.getResultNode()) {
onToolbar = true;
var children = this._self.childNodes;
for (let i = 0; i < children.length; i++) {
if (children[i].node == aNode) {
element = children[i];
break;
}
}
// Don't replace title on toolbarbuttons
var title = aNode.title;
if (nodeElt.parentNode == this._self) {
// Node is on the toolbar
nodeElt.label = aNewTitle;
this._self.updateChevron();
}
else {
var popup = this._getPopupForContainer(parentNode);
if (!popup._built)
return;
var children = popup.childNodes;
for (let i = popup._startMarker + 1; i < children.length; i++) {
if (children[i].node == aNode) {
element = children[i];
break;
}
}
var title = PlacesUIUtils.getBestTitle(aNode);
// Node is within a built menu.
nodeElt.label = aNewTitle || PlacesUIUtils.getBestTitle(aNode);
}
},
var iconURI = aNode.icon;
if (iconURI) {
var spec = iconURI.spec;
if (element.getAttribute("image") != spec)
element.setAttribute("image", spec);
nodeURIChanged: function TV_V_nodeURIChanged(aNode, aURIString) {
let nodeElt = aNode._DOMElement;
NS_ASSERT(nodeElt, "node must have _DOMElement set");
nodeElt.setAttribute("scheme",
PlacesUIUtils.guessUrlSchemeForUI(aURIString));
},
nodeIconChanged: function TV_V_nodeIconChanged(aNode) {
let nodeElt = aNode._DOMElement;
NS_ASSERT(nodeElt, "node must have _DOMElement set");
// There's no UI representation for the root node, thus there's
// nothing to be done when the icon changes.
if (nodeElt == this._self)
return;
let icon = aNode.icon;
if (icon) {
if (nodeElt.getAttribute("image") != icon)
nodeElt.setAttribute("image", icon);
}
else
element.removeAttribute("image");
nodeElt.removeAttribute("image");
},
if (element.getAttribute("label") != title) {
element.setAttribute("label", title);
if (onToolbar)
this._self.updateChevron();
}
nodeAnnotationChanged:
function TV_V_nodeAnnotationChanged(aNode, aAnno) {
// Ensure the changed annotation is a livemark one.
if (/^livemark\//.test(aAnno) &&
PlacesUtils.nodeIsLivemarkContainer(aNode)) {
let nodeElt = aNode._DOMElement;
NS_ASSERT(nodeElt, "node must have _DOMElement set");
if (PlacesUtils.nodeIsLivemarkContainer(aNode)) {
if (!element.hasAttribute("livemark"))
element.setAttribute("livemark", "true");
// If this is a livemark container check if the status menuitem has
// to be added or removed.
PlacesUIUtils.ensureLivemarkStatusMenuItem(element.firstChild);
}
else if (PlacesUtils.nodeIsURI(aNode)) {
element.setAttribute("scheme", PlacesUIUtils.guessUrlSchemeForUI(aNode.uri));
if (!nodeElt.hasAttribute("livemark"))
nodeElt.setAttribute("livemark", "true");
// Add or remove the livemark status menuitem.
PlacesUIUtils.ensureLivemarkStatusMenuItem(nodeElt.firstChild);
}
},
itemReplaced:
function TV_V_itemReplaced(aParentNode, aOldNode, aNewNode, aIndex) {
if (aParentNode == this._self.getResultNode()) {
var children = this._self.childNodes;
for (let i = 0; i < children.length; i++) {
if (children[i].node == aOldNode) {
var next = children[i].nextSibling;
this._self.removeItem(children[i]);
this._self.insertNewItem(aNewNode, next);
this._self.updateChevron();
return;
}
}
nodeHistoryDetailsChanged: function() { },
nodeTagsChanged: function() { },
nodeDateAddedChanged: function() { },
nodeLastModifiedChanged: function() { },
nodeKeywordChanged: function() { },
nodeReplaced:
function TV_V_nodeReplaced(aParentNode, aOldNode, aNewNode, aIndex) {
let nodeElt = aOldNode._DOMElement;
NS_ASSERT(nodeElt, "node must have _DOMElement set");
// No worries: If nodeElt is the last item (i.e. no nextSibling),
// insertNewItem/insertNewItemToPopup will insert the new element as
// the last item.
let next = nodeElt.nextSibling;
let parentElt = aParentNode._DOMElement;
NS_ASSERT(parentElt, "parent node must have _DOMElement set");
if (parentElt == this._self) {
// Node is on the toolbar.
this._self.removeItem(nodeElt);
this._self.insertNewItem(aNewNode, next);
this._self.updateChevron();
}
else if (parentElt._built) {
// Node is within a built menu.
let popup = parentElt.firstChild;
popup.removeItem(nodeElt);
this._self.insertNewItemToPopup(aNewNode, popup, next);
}
},
containerOpened: function TV_V_containerOpened(aNode) {
this.invalidateContainer(aNode);
containerOpened: function TV_V_containerOpened(aContainer) {
this.invalidateContainer(aContainer);
},
containerClosed: function TV_V_containerClosed(aNode) {
this.invalidateContainer(aNode);
containerClosed: function TV_V_containerClosed(aContainer) {
this.invalidateContainer(aContainer);
},
invalidateContainer: function TV_V_invalidateContainer(aContainer) {
if (aContainer == this._self.getResultNode()) {
this._self._containerNodesMap.splice(0);
let containerNodeElt = aContainer._DOMElement;
NS_ASSERT(containerNodeElt, "node must have _DOMElement set");
if (containerNodeElt == this._self) {
// Container is the toolbar itself.
this._self._rebuild();
return;
}
function isChildOf(node, container) {
var parent = node.parent;
while (parent) {
if (parent == container)
return true;
parent = parent.parent;
}
return false;
else if (containerNodeElt._built) {
// Container is a built menu.
containerNodeElt._built = false;
// If the menupopup is open we should live-update it.
if (containerNodeElt.open)
this._self._rebuildPopup(containerNodeElt.firstChild);
}
var popupToRebuild = null;
for (let i = 0; i < this._self._containerNodesMap.length; i++) {
var node = this._self._containerNodesMap[i].resultNode;
if (node == aContainer)
popupToRebuild = this._self._containerNodesMap[i].domNode;
if (isChildOf(node, aContainer)) {
this._self._containerNodesMap.splice(i,1);
i--;
}
}
if (popupToRebuild) {
popupToRebuild._built = false;
// if the menupopup is open we should live-update it
if (popupToRebuild.parentNode.open)
this._self._rebuildPopup(popupToRebuild);
}
},
invalidateAll: function TV_V_invalidateAll() {
this._self._containerNodesMap.splice(0);
this._self._rebuild();
},
sortingChanged: function TV_V_sortingChanged(aSortingMode) {
@ -808,8 +801,7 @@
<parameter name="aParentPopup"/>
<parameter name="aBefore"/>
<body><![CDATA[
var element =
PlacesUIUtils.createMenuItemForNode(aChild, this._containerNodesMap);
var element = PlacesUIUtils.createMenuItemForNode(aChild);
if (aBefore)
aParentPopup.insertBefore(element, aBefore);
@ -833,7 +825,7 @@
<method name="_containerPopupShowing">
<parameter name="aPopup"/>
<body><![CDATA[
if (!aPopup._built)
if (!aPopup.parentNode._built)
this._rebuildPopup(aPopup);
]]></body>
</method>
@ -868,7 +860,7 @@
if (aPopup._startMarker == -1 && aPopup._endMarker == -1)
this._showEmptyMenuItem(aPopup);
}
aPopup._built = true;
aPopup.parentNode._built = true;
]]></body>
</method>
@ -914,7 +906,7 @@
// - beforeIndex: child index to drop before, for the drop indicator.
// - folderNode: the folder to drop into, if applicable.
var result = this.getResult();
if (!PlacesUtils.nodeIsFolder(result.root))
if (!PlacesUtils.nodeIsFolder(this._resultNode))
return null;
var dropPoint = { ip: null, beforeIndex: null, folderNode: null };
@ -932,7 +924,7 @@
: (aEvent.clientX < nodeRect.left + threshold)) {
// Drop before this folder.
dropPoint.ip =
new InsertionPoint(PlacesUtils.getConcreteItemId(result.root),
new InsertionPoint(PlacesUtils.getConcreteItemId(this._resultNode),
nodeIndex, Ci.nsITreeView.DROP_BEFORE);
dropPoint.beforeIndex = nodeIndex;
}
@ -951,7 +943,7 @@
let beforeIndex =
(nodeIndex == this.childNodes.length - 1) ? -1 : nodeIndex + 1;
dropPoint.ip =
new InsertionPoint(PlacesUtils.getConcreteItemId(result.root),
new InsertionPoint(PlacesUtils.getConcreteItemId(this._resultNode),
beforeIndex, Ci.nsITreeView.DROP_BEFORE);
dropPoint.beforeIndex = beforeIndex;
}
@ -964,7 +956,7 @@
: (aEvent.clientX < nodeRect.left + threshold)) {
// Drop before this bookmark.
dropPoint.ip =
new InsertionPoint(PlacesUtils.getConcreteItemId(result.root),
new InsertionPoint(PlacesUtils.getConcreteItemId(this._resultNode),
nodeIndex, Ci.nsITreeView.DROP_BEFORE);
dropPoint.beforeIndex = nodeIndex;
}
@ -973,7 +965,7 @@
let beforeIndex =
nodeIndex == this.childNodes.length - 1 ? -1 : nodeIndex + 1;
dropPoint.ip =
new InsertionPoint(PlacesUtils.getConcreteItemId(result.root),
new InsertionPoint(PlacesUtils.getConcreteItemId(this._resultNode),
beforeIndex, Ci.nsITreeView.DROP_BEFORE);
dropPoint.beforeIndex = beforeIndex;
}
@ -983,7 +975,7 @@
// We are most likely dragging on the empty area of the
// toolbar, we should drop after the last node.
dropPoint.ip =
new InsertionPoint(PlacesUtils.getConcreteItemId(result.root),
new InsertionPoint(PlacesUtils.getConcreteItemId(this._resultNode),
-1, Ci.nsITreeView.DROP_BEFORE);
dropPoint.beforeIndex = -1;
}
@ -1216,7 +1208,7 @@
this._draggedNode = null;
]]></handler>
<handler event="popupshowing" phase="capturing"><![CDATA[
<handler event="popupshowing" phase="capturing"><![CDATA[
if (!this._allowPopupShowing) {
this._allowPopupShowing = true;
event.preventDefault();

View File

@ -136,7 +136,7 @@
callback = new Function("aContainer", onOpenFlatContainer);
}
var treeView = new PlacesTreeView(this.showRoot, this.flatList, callback);
var treeView = new PlacesTreeView(this.flatList, callback);
result.viewer = treeView;
this.view = treeView;
if (!this._controller) {
@ -147,21 +147,6 @@
]]></body>
</method>
<property name="showRoot">
<getter><![CDATA[
return this.getAttribute("showRoot") == "true";
]]></getter>
<setter><![CDATA[
if (this.showRoot != val) {
this.setAttribute("showRoot", val);
// reload with the last place set
if (this.place)
this.place = this.place;
}
return val;
]]></setter>
</property>
<property name="flatList">
<getter><![CDATA[
return this.getAttribute("flatList") == "true";
@ -259,7 +244,7 @@
<method name="selectNode">
<parameter name="node"/>
<body><![CDATA[
var view = this.getResultView();
var view = this.view;
var parent = node.parent;
if (parent && !parent.containerOpen) {
@ -308,17 +293,6 @@
]]></body>
</method>
<method name="getResultView">
<body><![CDATA[
try {
return this.view.QueryInterface(Ci.nsINavHistoryResultTreeViewer);
}
catch (e) {
}
return null;
]]></body>
</method>
<!-- nsIPlacesView -->
<property name="place">
<getter><![CDATA[
@ -355,7 +329,7 @@
var selection = this.view.selection;
var rc = selection.getRangeCount();
var nodes = [];
var resultview = this.getResultView();
var resultview = this.view;
for (var i = 0; i < rc; ++i) {
var min = { }, max = { };
selection.getRangeAt(i, min, max);
@ -396,7 +370,7 @@
var selection = this.view.selection;
var rc = selection.getRangeCount();
var nodes = [];
var resultview = this.getResultView();
var resultview = this.view;
// This list is kept independently of the range selected (i.e. OUTSIDE
// the for loop) since the row index of a container is unique for the
// entire view, and we could have some really wacky selection and we
@ -437,7 +411,7 @@
var min = { }, max = { };
selection.getRangeAt(0, min, max);
return this.getResultView().nodeForTreeIndex(min.value);
return this.view.nodeForTreeIndex(min.value);
]]></getter>
</property>
@ -478,7 +452,7 @@
// then use getIndexOfNode to find your absolute index in
// the parent container instead.
//
var resultView = this.getResultView();
var resultView = this.view;
var selection = resultView.selection;
var rc = selection.getRangeCount();
var min = { }, max = { };
@ -509,7 +483,7 @@
<parameter name="orientation"/>
<body><![CDATA[
var result = this.getResult();
var resultview = this.getResultView();
var resultview = this.view;
var container = result.root;
var dropNearItemId = -1;
NS_ASSERT(container, "null container");
@ -673,7 +647,7 @@
// For all the nodes we've found, highlight the corresponding
// index in the tree.
var resultview = this.getResultView();
var resultview = this.view;
var selection = this.view.selection;
selection.selectEventsSuppressed = true;
selection.clearSelection();
@ -729,7 +703,7 @@
this.treeBoxObject.getCellAt(aEvent.clientX, aEvent.clientY,
row, col, child);
var node = row.value != -1 ?
this.getResultView().nodeForTreeIndex(row.value) :
this.view.nodeForTreeIndex(row.value) :
this.getResultNode();
// cache the dropTarget for the view
PlacesControllerDragHelper.currentDropTarget = node;

File diff suppressed because it is too large Load Diff

View File

@ -1002,17 +1002,12 @@ var PlacesUIUtils = {
* Helper for the toolbar and menu views
*/
createMenuItemForNode:
function PUU_createMenuItemForNode(aNode, aContainersMap) {
function PUU_createMenuItemForNode(aNode) {
var element;
var type = aNode.type;
if (type == Ci.nsINavHistoryResultNode.RESULT_TYPE_SEPARATOR)
element = document.createElement("menuseparator");
else {
var iconURI = aNode.icon;
var iconURISpec = "";
if (iconURI)
iconURISpec = iconURI.spec;
if (PlacesUtils.uriTypes.indexOf(type) != -1) {
element = document.createElement("menuitem");
element.className = "menuitem-iconic bookmark-item";
@ -1051,8 +1046,6 @@ var PlacesUIUtils = {
popup.setAttribute("context", "placesContext");
#endif
element.appendChild(popup);
if (aContainersMap)
aContainersMap.push({ resultNode: aNode, domNode: popup });
element.className = "menu-iconic bookmark-item";
}
else
@ -1060,11 +1053,12 @@ var PlacesUIUtils = {
element.setAttribute("label", this.getBestTitle(aNode));
if (iconURISpec)
element.setAttribute("image", iconURISpec);
var icon = aNode.icon;
if (icon)
element.setAttribute("image", icon);
}
element.node = aNode;
element.node.viewIndex = 0;
element.node._DOMElement = element;
return element;
},

View File

@ -575,7 +575,7 @@ placesCreateLivemarkTransactions.prototype = {
if (PlacesUtils.annotations.itemHasAnnotation(this._id, GUID_ANNO))
this._GUID = PlacesUtils.bookmarks.getItemGUID(this._id);
PlacesUtils.bookmarks.removeFolder(this._id);
PlacesUtils.bookmarks.removeItem(this._id);
}
};

View File

@ -188,7 +188,8 @@ var bookmarksObserver = {
},
// nsINavBookmarkObserver
onItemAdded: function PSB_onItemAdded(aItemId, aFolderId, aIndex) {
onItemAdded: function PSB_onItemAdded(aItemId, aFolderId, aIndex,
aItemType) {
var views = getViewsForFolder(aFolderId);
ok(views.length > 0, "Found affected views: " + views);
@ -202,7 +203,8 @@ var bookmarksObserver = {
}
},
onItemRemoved: function PSB_onItemRemoved(aItemId, aFolder, aIndex) {
onItemRemoved: function PSB_onItemRemoved(aItemId, aFolder, aIndex,
aItemType) {
var views = getViewsForFolder(aFolderId);
ok(views.length > 0, "Found affected views: " + views);
// Check that item has been removed.
@ -216,7 +218,8 @@ var bookmarksObserver = {
onItemMoved: function(aItemId,
aOldFolderId, aOldIndex,
aNewFolderId, aNewIndex) {
aNewFolderId, aNewIndex,
aItemType) {
var views = getViewsForFolder(aNewFolderId);
ok(views.length > 0, "Found affected views: " + views);
@ -234,8 +237,7 @@ var bookmarksObserver = {
onEndUpdateBatch: function PSB_onEndUpdateBatch() {},
onBeforeItemRemoved: function PSB_onBeforeItemRemoved(aItemId) {},
onItemVisited: function() {},
onItemChanged: function PSB_onItemChanged(aItemId, aProperty,
aIsAnnotationProperty, aValue) {}
onItemChanged: function PSB_onItemChanged() {}
};
/**
@ -291,7 +293,7 @@ function getNodeForToolbarItem(aItemId) {
if (PlacesUtils.nodeIsFolder(child.node)) {
var popup = child.lastChild;
popup.showPopup(popup);
foundNode = findNode(popup);
var foundNode = findNode(popup);
popup.hidePopup();
if (foundNode[0] != null)
return foundNode;
@ -334,7 +336,7 @@ function getNodeForMenuItem(aItemId) {
// XXX Why is this needed on Linux and Mac?
popup.showPopup(popup);
child.open = true;
foundNode = findNode(popup);
var foundNode = findNode(popup);
popup.hidePopup();
child.open = false;
if (foundNode[0] != null)

View File

@ -91,30 +91,33 @@ var observer = {
onEndUpdateBatch: function() {
this._endUpdateBatch = true;
},
onItemAdded: function(id, folder, index) {
onItemAdded: function(id, folder, index, itemType) {
this._itemAddedId = id;
this._itemAddedParent = folder;
this._itemAddedIndex = index;
this._itemAddedType = itemType;
},
onBeforeItemRemoved: function(id) {
},
onItemRemoved: function(id, folder, index) {
onItemRemoved: function(id, folder, index, itemType) {
this._itemRemovedId = id;
this._itemRemovedFolder = folder;
this._itemRemovedIndex = index;
},
onItemChanged: function(id, property, isAnnotationProperty, value) {
onItemChanged: function(id, property, isAnnotationProperty, newValue,
lastModified, itemType) {
this._itemChangedId = id;
this._itemChangedProperty = property;
this._itemChanged_isAnnotationProperty = isAnnotationProperty;
this._itemChangedValue = value;
this._itemChangedValue = newValue;
},
onItemVisited: function(id, visitID, time) {
this._itemVisitedId = id;
this._itemVisitedVistId = visitID;
this._itemVisitedTime = time;
},
onItemMoved: function(id, oldParent, oldIndex, newParent, newIndex) {
onItemMoved: function(id, oldParent, oldIndex, newParent, newIndex,
itemType) {
this._itemMovedId = id
this._itemMovedOldParent = oldParent;
this._itemMovedOldIndex = oldIndex;
@ -150,18 +153,20 @@ function run_test() {
var txn1 = ptSvc.createFolder("Testing folder", root, bmStartIndex, annos);
ptSvc.doTransaction(txn1);
// the check check that calling undoTransaction on an "empty batch" doesn't undo
// the previous transaction
// This checks that calling undoTransaction on an "empty batch" doesn't
// undo the previous transaction (getItemTitle will fail)
ptSvc.beginBatch();
ptSvc.endBatch();
ptSvc.undoTransaction();
var folderId = bmsvc.getChildFolder(root, "Testing folder");
do_check_eq(TEST_DESCRIPTION,
annosvc.getItemAnnotation(folderId, DESCRIPTION_ANNO));
var folderId = observer._itemAddedId;
do_check_eq(bmsvc.getItemTitle(folderId), "Testing folder");
do_check_eq(observer._itemAddedIndex, bmStartIndex);
do_check_eq(observer._itemAddedParent, root);
do_check_eq(observer._itemAddedId, folderId);
do_check_eq(TEST_DESCRIPTION,
annosvc.getItemAnnotation(folderId, DESCRIPTION_ANNO));
txn1.undoTransaction();
do_check_eq(observer._itemRemovedId, folderId);
do_check_eq(observer._itemRemovedFolder, root);
@ -201,7 +206,9 @@ function run_test() {
// Create item to a folder
var txn2a = ptSvc.createFolder("Folder", root, bmStartIndex);
ptSvc.doTransaction(txn2a);
var fldrId = bmsvc.getChildFolder(root, "Folder");
var fldrId = observer._itemAddedId;
do_check_eq(bmsvc.getItemTitle(fldrId), "Folder");
var txn2b = ptSvc.createItem(uri("http://www.example2.com"), fldrId, bmStartIndex, "Testing1b");
ptSvc.doTransaction(txn2b);
var b2 = (bmsvc.getBookmarkIdsForURI(uri("http://www.example2.com"), {}))[0];
@ -287,7 +294,9 @@ function run_test() {
// Test Removing a Folder
ptSvc.doTransaction(ptSvc.createFolder("Folder2", root, -1));
var fldrId2 = bmsvc.getChildFolder(root, "Folder2");
var fldrId2 = observer._itemAddedId;
do_check_eq(bmsvc.getItemTitle(fldrId2), "Folder2");
var txn4 = ptSvc.removeItem(fldrId2);
txn4.doTransaction();
do_check_eq(observer._itemRemovedId, fldrId2);
@ -549,7 +558,8 @@ function run_test() {
// sortFolderByName
ptSvc.doTransaction(ptSvc.createFolder("Sorting folder", root, bmStartIndex, [], null));
var srtFldId = bmsvc.getChildFolder(root, "Sorting folder");
var srtFldId = observer._itemAddedId;
do_check_eq(bmsvc.getItemTitle(srtFldId), "Sorting folder");
ptSvc.doTransaction(ptSvc.createItem(uri("http://www.sortingtest.com"), srtFldId, -1, "c"));
ptSvc.doTransaction(ptSvc.createItem(uri("http://www.sortingtest.com"), srtFldId, -1, "b"));
ptSvc.doTransaction(ptSvc.createItem(uri("http://www.sortingtest.com"), srtFldId, -1, "a"));

View File

@ -197,7 +197,7 @@ function check_downloaded(aURIString, aIsDownloaded)
let checker = aIsDownloaded ? do_check_true : do_check_false;
try {
checker(stmt.step());
checker(stmt.executeStep());
}
finally {
stmt.finalize();

View File

@ -547,7 +547,7 @@ BookmarkFolder.prototype = {
},
remove : function bmf_remove() {
Utilities.bookmarks.removeFolder(this._id);
Utilities.bookmarks.removeItem(this._id);
},
// observer

View File

@ -68,24 +68,12 @@ browser.jar:
skin/classic/browser/places/bookmarksMenu.png (places/bookmarksMenu.png)
skin/classic/browser/places/bookmarksToolbar.png (places/bookmarksToolbar.png)
skin/classic/browser/places/history.png (places/history.png)
skin/classic/browser/places/menubutton-end-pressed.png (places/menubutton-end-pressed.png)
skin/classic/browser/places/menubutton-end-pressed-rtl.png (places/menubutton-end-pressed-rtl.png)
skin/classic/browser/places/menubutton-mid-pressed.png (places/menubutton-mid-pressed.png)
skin/classic/browser/places/menubutton-start-pressed.png (places/menubutton-start-pressed.png)
skin/classic/browser/places/menubutton-start-pressed-rtl.png (places/menubutton-start-pressed-rtl.png)
skin/classic/browser/places/star-icons.png (places/star-icons.png)
skin/classic/browser/places/toolbar-button-backup.png (places/toolbar-button-backup.png)
skin/classic/browser/places/toolbar-button-organize.png (places/toolbar-button-organize.png)
skin/classic/browser/places/toolbar-button-view.png (places/toolbar-button-view.png)
skin/classic/browser/places/toolbar.png (places/toolbar.png)
skin/classic/browser/places/toolbarDropMarker.png (places/toolbarDropMarker.png)
skin/classic/browser/places/folderDropArrow.png (places/folderDropArrow.png)
skin/classic/browser/places/livemarkFolder.png (places/livemarkFolder.png)
skin/classic/browser/places/back-forward.png (places/back-forward.png)
skin/classic/browser/places/editBookmarkOverlay.css (places/editBookmarkOverlay.css)
skin/classic/browser/places/menubutton-start.png (places/menubutton-start.png)
skin/classic/browser/places/menubutton-start-rtl.png (places/menubutton-start-rtl.png)
skin/classic/browser/places/menubutton-end.png (places/menubutton-end.png)
skin/classic/browser/places/menubutton-end-rtl.png (places/menubutton-end-rtl.png)
skin/classic/browser/places/minus.png (places/minus.png)
skin/classic/browser/places/minus-active.png (places/minus-active.png)
skin/classic/browser/places/plus.png (places/plus.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 679 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 729 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 576 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 653 B

View File

@ -1,17 +1,5 @@
%include ../shared.inc
/* Inactive Window */
#places:not([active="true"]) > #placesToolbox > #placesToolbar > toolbarbutton,
#places:not([active="true"]) > #placesToolbox > #placesToolbar > #searchFilter {
opacity: 0.7;
}
#places:not([active="true"]) > #placesView > #placesList {
background-color: #e8e8e8;
}
/* Places Organizer Sidebars */
#placesList {
@ -95,145 +83,101 @@ window:not([active="true"]) #placesList > treechildren::-moz-tree-row(selected)
background-image: none !important;
}
.toolbarbutton-1 {
list-style-image: url("chrome://browser/skin/places/back-forward.png");
#placesToolbar > toolbarbutton {
list-style-image: url("chrome://browser/skin/places/toolbar.png");
margin: 4px 6px 5px;
padding: 1px 5px;
-moz-border-radius: 100%;
border: 1px solid @toolbarbuttonBorderColor@;
-moz-box-shadow: @loweredShadow@;
background: @toolbarbuttonBackground@;
-moz-background-origin: border;
}
/* back button */
#back-button {
-moz-image-region: rect(0px, 34px, 23px, 0px);
-moz-margin-end: 0;
-moz-padding-end: 0;
border-left: none;
border-right: none;
#placesToolbar > toolbarbutton:not([disabled="true"]):active:hover,
#placesToolbar > toolbarbutton[open="true"] {
background: rgba(0, 0, 0, 0.6);
border-color: transparent;
-moz-box-shadow: @toolbarbuttonPressedInnerShadow@,
@loweredShadow@,
inset 0 0 0 20px @toolbarbuttonPressedBackgroundColor@;
}
#back-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px, 67px, 23px, 34px);
:root:not([active]) #placesToolbar > toolbarbutton {
border-color: @toolbarbuttonInactiveBorderColor@;
background-image: @toolbarbuttonInactiveBackgroundImage@;
}
#back-button[disabled="true"] {
-moz-image-region: rect(23px, 34px, 46px, 0px) !important;
#placesToolbar > toolbarbutton[disabled="true"] > .toolbarbutton-icon,
:root:not([active]) #placesToolbar > toolbarbutton > .toolbarbutton-icon,
:root:not([active]) #placesToolbar > toolbarbutton > .toolbarbutton-menu-dropmarker {
opacity: 0.5; /* remove the second and third selector when we support click-through (bug 392188) */
}
#back-button[disabled="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(23px, 67px, 46px, 34px) !important;
#placesToolbar > toolbarbutton > .toolbarbutton-icon {
margin: 0 4px;
}
#back-button:hover:active,
#back-button[buttondown="true"],
#back-button[open="true"] {
-moz-image-region: rect(46px, 34px, 69px, 0px);
}
#back-button:hover:active:-moz-locale-dir(rtl),
#back-button[buttondown="true"]:-moz-locale-dir(rtl),
#back-button[open="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(46px, 67px, 69px, 34px);
}
#back-button > .toolbarbutton-text,
#forward-button > .toolbarbutton-text {
#placesToolbar > toolbarbutton > .toolbarbutton-text {
display: none;
}
/* forward button */
#forward-button {
-moz-image-region: rect(0px, 67px, 23px, 34px);
-moz-margin-start: 0;
-moz-margin-end: 8px;
-moz-padding-start: 0;
border-left: none;
border-right: none;
}
#forward-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px, 34px, 23px, 0px);
}
#forward-button[disabled="true"] {
-moz-image-region: rect(23px, 67px, 46px, 34px) !important;
}
#forward-button[disabled="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(23px, 34px, 46px, 0px) !important;
}
#forward-button:hover:active,
#forward-button[buttondown="true"],
#forward-button[open="true"] {
-moz-image-region: rect(46px, 67px, 69px, 34px);
}
#forward-button:hover:active:-moz-locale-dir(rtl),
#forward-button[buttondown="true"]:-moz-locale-dir(rtl),
#forward-button[open="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(46px, 34px, 69px, 0px);
}
#placesToolbar > toolbarbutton[type="menu"] {
-moz-margin-start: 5px;
-moz-padding-end: 10px;
background: url("chrome://browser/skin/places/menubutton-end.png") right center no-repeat;
}
#placesToolbar > toolbarbutton[type="menu"][open="true"] {
background: url("chrome://browser/skin/places/menubutton-end-pressed.png") right center no-repeat;
}
#placesToolbar:-moz-locale-dir(rtl) > toolbarbutton[type="menu"] {
background: url("chrome://browser/skin/places/menubutton-end-rtl.png") left center no-repeat;
}
#placesToolbar:-moz-locale-dir(rtl) > toolbarbutton[type="menu"][open="true"] {
background: url("chrome://browser/skin/places/menubutton-end-pressed-rtl.png") left center no-repeat;
}
#placesToolbar > toolbarbutton[type="menu"] > menupopup {
-moz-margin-start: 2px;
margin-top: -4px;
}
#placesToolbar > toolbarbutton[type="menu"] > .toolbarbutton-icon {
background: url("chrome://browser/skin/places/menubutton-start.png") left center no-repeat;
padding: 3px 0px 4px 0px;
-moz-padding-start: 10px;
-moz-padding-end: 4px;
height: 23px;
}
#placesToolbar > toolbarbutton[type="menu"][open="true"] > .toolbarbutton-icon {
background: url("chrome://browser/skin/places/menubutton-start-pressed.png") left center no-repeat;
}
#placesToolbar:-moz-locale-dir(rtl) > toolbarbutton[type="menu"] > .toolbarbutton-icon {
background: url("chrome://browser/skin/places/menubutton-start-rtl.png") right center no-repeat;
}
#placesToolbar:-moz-locale-dir(rtl) > toolbarbutton[type="menu"][open="true"] > .toolbarbutton-icon {
background: url("chrome://browser/skin/places/menubutton-start-pressed-rtl.png") right center no-repeat;
}
#placesToolbar > toolbarbutton[type="menu"] > .toolbarbutton-text {
display: none;
}
#placesToolbar > toolbarbutton[type="menu"] > .toolbarbutton-menu-dropmarker {
list-style-image: url("chrome://browser/skin/places/folderDropArrow.png");
padding: 0;
margin-top: 1px;
-moz-margin-end: 3px;
}
/* back and forward button */
#placesToolbar > #back-button {
-moz-margin-start: 3px;
}
#back-button:-moz-locale-dir(ltr),
#forward-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px, 16px, 16px, 0px);
-moz-border-radius-topright: 0;
-moz-border-radius-bottomright: 0;
margin-right: 0;
border-right: 0;
}
#forward-button:-moz-locale-dir(ltr),
#back-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px, 32px, 16px, 16px);
-moz-border-radius-topleft: 0;
-moz-border-radius-bottomleft: 0;
margin-left: 0;
}
#back-button > .toolbarbutton-icon {
-moz-margin-end: 2px !important;
}
#forward-button > .toolbarbutton-icon {
-moz-margin-start: 2px !important;
}
/* organize button */
#organizeButton {
list-style-image: url("chrome://browser/skin/places/toolbar-button-organize.png");
-moz-image-region: rect(0px, 48px, 16px, 32px);
}
/* view button */
#viewMenu {
list-style-image: url("chrome://browser/skin/places/toolbar-button-view.png");
-moz-image-region: rect(0px, 64px, 16px, 48px);
}
/* maintenance button */
#maintenanceButton {
list-style-image: url("chrome://browser/skin/places/toolbar-button-backup.png");
-moz-image-region: rect(0px, 80px, 16px, 64px);
}
/* Search field */
:root:not([active="true"]) #searchFilter {
opacity: 0.7; /* remove this when we support click-through (bug 392188) */
}
/* Root View */
@ -255,6 +199,10 @@ window:not([active="true"]) #placesList > treechildren::-moz-tree-row(selected)
border: 0px;
}
#places:not([active="true"]) > #placesView > #placesList {
background-color: #e8e8e8;
}
#infoPaneBox {
border-top: 1px solid #919191;
background-color: #f0f0f0;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 644 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -2162,15 +2162,6 @@ echo-module:
echo-requires:
@echo $(REQUIRES)
echo-requires-recursive::
ifdef _REPORT_ALL_DIRS
@echo $(subst $(topsrcdir)/,,$(srcdir)): $(MODULE): $(REQUIRES)
else
@$(if $(REQUIRES),echo $(subst $(topsrcdir)/,,$(srcdir)): $(MODULE): $(REQUIRES))
endif
$(LOOP_OVER_PARALLEL_DIRS)
$(LOOP_OVER_DIRS)
echo-depth-path:
@$(topsrcdir)/build/unix/print-depth-path.sh

View File

@ -3147,16 +3147,12 @@ case "$target" in
ac_cv_have_core_text="no")
AC_MSG_RESULT([$ac_cv_have_core_text])
case "${target_cpu}" in
x86_64)
MOZ_CORETEXT=1
;;
esac
MOZ_CORETEXT=1
MOZ_ARG_ENABLE_BOOL(coretext,
[ --enable-coretext Use CoreText instead of ATSUI for text rendering],
MOZ_CORETEXT=1,
MOZ_CORETEXT=)
MOZ_ARG_DISABLE_BOOL(coretext,
[ --disable-coretext Use ATSUI instead of Core Text for text rendering],
MOZ_CORETEXT=,
MOZ_CORETEXT=1)
if test -n "$MOZ_CORETEXT"; then
if test "$ac_cv_have_core_text" = "no"; then
@ -4756,8 +4752,6 @@ cairo-cocoa)
AC_DEFINE(MOZ_WIDGET_COCOA)
MOZ_USER_DIR="Mozilla"
AC_DEFINE(XP_MACOSX)
AC_DEFINE(TARGET_CARBON)
AC_DEFINE(TARGET_API_MAC_CARBON)
TK_LIBS='-framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook'
TK_CFLAGS="-DNO_X11"
LDFLAGS="$LDFLAGS -framework Cocoa"
@ -7363,7 +7357,7 @@ if test "$MOZ_TREE_CAIRO"; then
CAIRO_FT_CFLAGS="$FT2_CFLAGS"
fi
if test "$MOZ_WIDGET_TOOLKIT" = "qt"; then
QPAINTER_SURFACE_FEATURE="#define CAIRO_HAS_QPAINTER_SURFACE 1"
QT_SURFACE_FEATURE="#define CAIRO_HAS_QT_SURFACE 1"
fi
if test "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
@ -7452,7 +7446,7 @@ if test "$MOZ_TREE_CAIRO"; then
AC_SUBST(WIN32_FONT_FEATURE)
AC_SUBST(QUARTZ_FONT_FEATURE)
AC_SUBST(PNG_FUNCTIONS_FEATURE)
AC_SUBST(QPAINTER_SURFACE_FEATURE)
AC_SUBST(QT_SURFACE_FEATURE)
if test "$_WIN32_MSVC"; then
MOZ_CAIRO_LIBS='$(DEPTH)/gfx/cairo/cairo/src/mozcairo.lib $(DEPTH)/gfx/cairo/libpixman/src/mozlibpixman.lib'
@ -7636,10 +7630,14 @@ dnl
dnl Build jsctypes on the platforms we can.
dnl
AC_SUBST(BUILD_CTYPES)
if test "$OS_TEST" != "arm"; then
case "$OS_TEST" in
arm*)
;;
*)
BUILD_CTYPES=1
AC_DEFINE(BUILD_CTYPES)
fi
;;
esac
dnl NECKO_ configuration options are not global
_NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_"

View File

@ -44,7 +44,7 @@ interface nsISelection;
interface nsIDOMNode;
interface nsIOutputStream;
[scriptable, uuid(3c556e41-0f73-4e1d-b724-1474884fe2e3)]
[scriptable, uuid(c0da5b87-0ba7-4d7c-8cb3-fcb02af4253d)]
interface nsIDocumentEncoderNodeFixup : nsISupports
{
/**
@ -207,6 +207,13 @@ interface nsIDocumentEncoder : nsISupports
* Plaintext output only.
*/
const unsigned long OutputPersistNBSP = (1 << 17);
/**
* Normally when serializing the whole document using the HTML or
* XHTML serializer, the encoding declaration is rewritten to match.
* This flag suppresses that behavior.
*/
const unsigned long OutputDontRewriteEncodingDeclaration = (1 << 18);
/**
* Initialize with a pointer to the document and the mime type.

View File

@ -79,7 +79,7 @@ SetUpEncoder(nsIDOMNode *aRoot, const nsACString& aCharset,
nsresult rv;
nsCOMPtr<nsIDocumentEncoder> encoder =
do_CreateInstance(NS_DOC_ENCODER_CONTRACTID_BASE "text/xml", &rv);
do_CreateInstance(NS_DOC_ENCODER_CONTRACTID_BASE "application/xhtml+xml", &rv);
if (NS_FAILED(rv))
return rv;
@ -93,8 +93,10 @@ SetUpEncoder(nsIDOMNode *aRoot, const nsACString& aCharset,
}
// This method will fail if no document
rv = encoder->Init(domDoc, NS_LITERAL_STRING("text/xml"),
nsIDocumentEncoder::OutputEncodeBasicEntities);
rv = encoder->Init(domDoc, NS_LITERAL_STRING("application/xhtml+xml"),
nsIDocumentEncoder::OutputRaw |
nsIDocumentEncoder::OutputDontRewriteEncodingDeclaration);
if (NS_FAILED(rv))
return rv;

View File

@ -917,8 +917,8 @@ nsDocumentEncoder::EncodeToString(nsAString& aOutputString)
}
}
PRBool isWholeDocument = !(mSelection || mRange || mNode);
mSerializer->Init(mFlags, mWrapColumn, mCharset.get(), mIsCopying, isWholeDocument);
PRBool rewriteEncodingDeclaration = !(mSelection || mRange || mNode) && !(mFlags & OutputDontRewriteEncodingDeclaration);
mSerializer->Init(mFlags, mWrapColumn, mCharset.get(), mIsCopying, rewriteEncodingDeclaration);
if (mSelection) {
nsCOMPtr<nsIDOMRange> range;

View File

@ -195,7 +195,7 @@ nsHTMLContentSerializer::SerializeHTMLAttributes(nsIContent* aContent,
valueStr = tempURI;
}
if (mIsWholeDocument && aTagName == nsGkAtoms::meta &&
if (mRewriteEncodingDeclaration && aTagName == nsGkAtoms::meta &&
attrName == nsGkAtoms::content) {
// If we're serializing a <meta http-equiv="content-type">,
// use the proper value, rather than what's in the document.

View File

@ -99,7 +99,7 @@ nsXHTMLContentSerializer::~nsXHTMLContentSerializer()
NS_IMETHODIMP
nsXHTMLContentSerializer::Init(PRUint32 aFlags, PRUint32 aWrapColumn,
const char* aCharSet, PRBool aIsCopying,
PRBool aIsWholeDocument)
PRBool aRewriteEncodingDeclaration)
{
// The previous version of the HTML serializer did implicit wrapping
// when there is no flags, so we keep wrapping in order to keep
@ -113,10 +113,10 @@ nsXHTMLContentSerializer::Init(PRUint32 aFlags, PRUint32 aWrapColumn,
}
nsresult rv;
rv = nsXMLContentSerializer::Init(aFlags, aWrapColumn, aCharSet, aIsCopying, aIsWholeDocument);
rv = nsXMLContentSerializer::Init(aFlags, aWrapColumn, aCharSet, aIsCopying, aRewriteEncodingDeclaration);
NS_ENSURE_SUCCESS(rv, rv);
mIsWholeDocument = aIsWholeDocument;
mRewriteEncodingDeclaration = aRewriteEncodingDeclaration;
mIsCopying = aIsCopying;
mIsFirstChildOfOL = PR_FALSE;
mInBody = 0;
@ -420,7 +420,7 @@ nsXHTMLContentSerializer::SerializeAttributes(nsIContent* aContent,
valueStr = tempURI;
}
if (mIsWholeDocument && aTagName == nsGkAtoms::meta &&
if (mRewriteEncodingDeclaration && aTagName == nsGkAtoms::meta &&
attrName == nsGkAtoms::content) {
// If we're serializing a <meta http-equiv="content-type">,
// use the proper value, rather than what's in the document.
@ -493,7 +493,7 @@ nsXHTMLContentSerializer::AfterElementStart(nsIContent * aContent,
{
nsIAtom *name = aContent->Tag();
if (aContent->GetNameSpaceID() == kNameSpaceID_XHTML &&
mIsWholeDocument &&
mRewriteEncodingDeclaration &&
name == nsGkAtoms::head) {
// Check if there already are any content-type meta children.

View File

@ -60,7 +60,7 @@ class nsXHTMLContentSerializer : public nsXMLContentSerializer {
NS_IMETHOD Init(PRUint32 flags, PRUint32 aWrapColumn,
const char* aCharSet, PRBool aIsCopying,
PRBool aIsWholeDocument);
PRBool aRewriteEncodingDeclaration);
NS_IMETHOD AppendText(nsIDOMText* aText,
PRInt32 aStartOffset,
@ -170,7 +170,7 @@ class nsXHTMLContentSerializer : public nsXMLContentSerializer {
// This is to ensure that we only do meta tag fixups when dealing with
// whole documents.
PRPackedBool mIsWholeDocument;
PRPackedBool mRewriteEncodingDeclaration;
// To keep track of First LI child of OL in selected range
PRPackedBool mIsFirstChildOfOL;

View File

@ -107,7 +107,7 @@ NS_IMPL_ISUPPORTS1(nsXMLContentSerializer, nsIContentSerializer)
NS_IMETHODIMP
nsXMLContentSerializer::Init(PRUint32 aFlags, PRUint32 aWrapColumn,
const char* aCharSet, PRBool aIsCopying,
PRBool aIsWholeDocument)
PRBool aRewriteEncodingDeclaration)
{
mCharset = aCharSet;
mFlags = aFlags;

View File

@ -68,7 +68,7 @@ class nsXMLContentSerializer : public nsIContentSerializer {
NS_IMETHOD Init(PRUint32 flags, PRUint32 aWrapColumn,
const char* aCharSet, PRBool aIsCopying,
PRBool aIsWholeDocument);
PRBool aRewriteEncodingDeclaration);
NS_IMETHOD AppendText(nsIDOMText* aText, PRInt32 aStartOffset,
PRInt32 aEndOffset, nsAString& aStr);

View File

@ -277,6 +277,7 @@ _TEST_FILES = test_bug5141.html \
file_xhtmlserializer_2_enthtml.xhtml \
file_xhtmlserializer_2_entw3c.xhtml \
file_xhtmlserializer_2_latin1.xhtml \
test_bug500937.html \
test_htmlcopyencoder.html \
test_htmlcopyencoder.xhtml \
test_bug270145.xhtml \

View File

@ -0,0 +1,55 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=500937
-->
<head>
<title>Test for Bug 500937</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=500937">Mozilla Bug 500937</a>
<p id="display"></p>
<div id="content" style="display: none">
<iframe id=iframe src="about:blank"></iframe>
</div>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 500937 **/
var d = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", null);
var h = d.documentElement;
h.appendChild(d.createElementNS("http://www.w3.org/1999/xhtml", "head"));
var b = d.createElementNS("http://www.w3.org/1999/xhtml", "body");
h.appendChild(b);
b.appendChild(d.createElementNS("http://www.w3.org/1999/xhtml", "div"));
b.appendChild(d.createElementNS("http://www.w3.org/1999/xhtml", "script"));
b.appendChild(d.createElementNS("http://www.w3.org/1999/xhtml", "br"));
b.appendChild(d.createElementNS("http://www.w3.org/1999/xhtml", "source"));
b.appendChild(d.createElementNS("http://www.w3.org/1999/xhtml", "param"));
b.appendChild(d.createTextNode("\u00A0"));
is(new XMLSerializer().serializeToString(d),
'<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><div></div><script><\/script><br /><source /><param />\u00A0</body></html>',
"XML DOM input to XMLSerializer");
d = document.getElementById('iframe').contentWindow.document;
while(d.documentElement.previousSibling) {
d.removeChild(d.documentElement.previousSibling);
}
d.replaceChild(h, d.documentElement);
is(new XMLSerializer().serializeToString(d),
'<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><div></div><script><\/script><br /><source /><param />\u00A0</body></html>',
"HTML DOM input to XMLSerializer");
</script>
</pre>
</body>
</html>

View File

@ -1796,7 +1796,7 @@ nsHTMLDocument::OpenCommon(const nsACString& aContentType, PRBool aReplace)
if (!IsHTML()) {
// No calling document.open() on XHTML
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
return NS_ERROR_DOM_INVALID_ACCESS_ERR;
}
PRBool loadAsHtml5 = nsHtml5Module::sEnabled;
@ -2056,7 +2056,7 @@ nsHTMLDocument::Close()
if (!IsHTML()) {
// No calling document.close() on XHTML!
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
return NS_ERROR_DOM_INVALID_ACCESS_ERR;
}
nsresult rv = NS_OK;
@ -2121,7 +2121,7 @@ nsHTMLDocument::WriteCommon(const nsAString& aText,
if (!IsHTML()) {
// No calling document.write*() on XHTML!
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
return NS_ERROR_DOM_INVALID_ACCESS_ERR;
}
nsresult rv = NS_OK;

View File

@ -192,11 +192,22 @@ NS_IMPL_ISUPPORTS_INHERITED1(nsPluginDocument, nsMediaDocument,
void
nsPluginDocument::SetScriptGlobalObject(nsIScriptGlobalObject* aScriptGlobalObject)
{
if (!aScriptGlobalObject) {
// Set the script global object on the superclass before doing
// anything that might require it....
nsMediaDocument::SetScriptGlobalObject(aScriptGlobalObject);
if (aScriptGlobalObject) {
if (!mPluginContent) {
// Create synthetic document
#ifdef DEBUG
nsresult rv =
#endif
CreateSyntheticPluginDocument();
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to create synthetic document");
}
} else {
mStreamListener = nsnull;
}
nsMediaDocument::SetScriptGlobalObject(aScriptGlobalObject);
}
@ -218,6 +229,17 @@ nsPluginDocument::StartDocumentLoad(const char* aCommand,
PRBool aReset,
nsIContentSink* aSink)
{
// do not allow message panes to host full-page plugins
// returning an error causes helper apps to take over
nsCOMPtr<nsIDocShellTreeItem> dsti (do_QueryInterface(aContainer));
if (dsti) {
PRBool isMsgPane = PR_FALSE;
dsti->NameEquals(NS_LITERAL_STRING("messagepane").get(), &isMsgPane);
if (isMsgPane) {
return NS_ERROR_FAILURE;
}
}
nsresult rv =
nsMediaDocument::StartDocumentLoad(aCommand, aChannel, aLoadGroup,
aContainer, aDocListener, aReset,
@ -231,12 +253,6 @@ nsPluginDocument::StartDocumentLoad(const char* aCommand,
return rv;
}
// Create synthetic document
rv = CreateSyntheticPluginDocument();
if (NS_FAILED(rv)) {
return rv;
}
mStreamListener = new nsPluginStreamListener(this);
if (!mStreamListener) {
return NS_ERROR_OUT_OF_MEMORY;
@ -250,16 +266,8 @@ nsPluginDocument::StartDocumentLoad(const char* aCommand,
nsresult
nsPluginDocument::CreateSyntheticPluginDocument()
{
// do not allow message panes to host full-page plugins
// returning an error causes helper apps to take over
nsCOMPtr<nsIDocShellTreeItem> dsti (do_QueryReferent(mDocumentContainer));
if (dsti) {
PRBool isMsgPane = PR_FALSE;
dsti->NameEquals(NS_LITERAL_STRING("messagepane").get(), &isMsgPane);
if (isMsgPane) {
return NS_ERROR_FAILURE;
}
}
NS_ASSERTION(!GetPrimaryShell() || !GetPrimaryShell()->DidInitialReflow(),
"Creating synthetic plugin document content too late");
// make our generic document
nsresult rv = nsMediaDocument::CreateSyntheticDocument();

View File

@ -28,7 +28,7 @@ function test() {
document.open();
is(0, 1, "document.open succeeded");
} catch (e) {
is (e.code, DOMException.NOT_SUPPORTED_ERR,
is (e.code, DOMException.INVALID_ACCESS_ERR,
"Wrong exception from document.open");
}
@ -36,7 +36,7 @@ function test() {
document.write("aaa");
is(0, 1, "document.write succeeded");
} catch (e) {
is (e.code, DOMException.NOT_SUPPORTED_ERR,
is (e.code, DOMException.INVALID_ACCESS_ERR,
"Wrong exception from document.write");
}
@ -44,7 +44,7 @@ function test() {
document.close();
is(0, 1, "document.close succeeded");
} catch (e) {
is (e.code, DOMException.NOT_SUPPORTED_ERR,
is (e.code, DOMException.INVALID_ACCESS_ERR,
"Wrong exception from document.close");
}
}

View File

@ -200,7 +200,7 @@ public:
* the distance of the interpolated value in the
* interval.
* @param aResult The interpolated value.
* @result NS_OK on success, NS_ERROR_FAILURE if this data type cannot be
* @return NS_OK on success, NS_ERROR_FAILURE if this data type cannot be
* interpolated or NS_ERROR_OUT_OF_MEMORY if insufficient memory was
* available for storing the result.
*

View File

@ -261,7 +261,7 @@ function test7() {
doc = ParseXML('<root xmlns="http://www.w3.org/1999/xhtml">' +
'<child1 xmlns="">' +
'<child2 xmlns="http://www.w3.org/1999/xhtml"/>' +
'<child2 xmlns="http://www.w3.org/1999/xhtml"></child2>' +
'</child1></root>')
root = doc.documentElement;
// No interface flattening in xpcshell
@ -273,7 +273,7 @@ function test7() {
do_check_serialize(doc);
do_check_eq(SerializeXML(doc),
'<root xmlns="http://www.w3.org/1999/xhtml"><child1 xmlns="">' +
'<a0:child2 xmlns:a0="http://www.w3.org/1999/xhtml" xmlns=""/></child1></root>');
'<a0:child2 xmlns:a0="http://www.w3.org/1999/xhtml" xmlns=""></a0:child2></child1></root>');
}
function test8() {

View File

@ -957,7 +957,7 @@ nsFocusManager::EnsureCurrentWidgetFocused()
nsCOMPtr<nsIWidget> widget;
vm->GetRootWidget(getter_AddRefs(widget));
if (widget)
widget->SetFocus(PR_TRUE);
widget->SetFocus(PR_FALSE);
}
}
}
@ -1371,7 +1371,7 @@ nsFocusManager::Blur(nsPIDOMWindow* aWindowToClear,
nsCOMPtr<nsIWidget> widget;
vm->GetRootWidget(getter_AddRefs(widget));
if (widget)
widget->SetFocus(PR_TRUE);
widget->SetFocus(PR_FALSE);
}
}
}
@ -1454,7 +1454,7 @@ nsFocusManager::Focus(nsPIDOMWindow* aWindow,
if (!aWindow)
return;
if (aContent && aContent == mFirstFocusEvent)
if (aContent && (aContent == mFirstFocusEvent || aContent == mFirstBlurEvent))
return;
// Keep a reference to the presShell since dispatching the DOM event may
@ -1518,7 +1518,7 @@ nsFocusManager::Focus(nsPIDOMWindow* aWindow,
nsCOMPtr<nsIWidget> widget;
vm->GetRootWidget(getter_AddRefs(widget));
if (widget)
widget->SetFocus(PR_TRUE);
widget->SetFocus(PR_FALSE);
}
// if switching to a new document, first fire the focus event on the
@ -1560,7 +1560,7 @@ nsFocusManager::Focus(nsPIDOMWindow* aWindow,
if (objectFrame) {
nsIWidget* widget = objectFrame->GetWidget();
if (widget)
widget->SetFocus(PR_TRUE);
widget->SetFocus(PR_FALSE);
}
nsIMEStateManager::OnChangeFocus(presContext, aContent);

View File

@ -40,7 +40,7 @@
#include "nsIDOMCSS2Properties.idl"
[scriptable, uuid(8C31E4A6-8F3A-4BB9-B180-8385AC2A4080)]
[scriptable, uuid(cc0a6325-770b-476d-8cb8-c2a02a43c348)]
interface nsIDOMNSCSS2Properties : nsIDOMCSS2Properties
{
/* Non-DOM 2 extensions */
@ -278,4 +278,7 @@ interface nsIDOMNSCSS2Properties : nsIDOMCSS2Properties
attribute DOMString pointerEvents;
// raises(DOMException) on setting
attribute DOMString MozTabSize;
// raises(DOMException) on setting
};

View File

@ -739,6 +739,15 @@ function startTest()
expectFocusShift(function () synthesizeKey("VK_TAB", { shiftKey: true }),
null, textbox1.inputField, true, "shift+tab on textbox with tabindex set");
// ---- test to check that refocusing an element during a blur event doesn't succeed
var t1 = getById("t1");
t1.addEventListener("blur", function() t1.focus(), true);
t1.focus();
var t2 = getById("t2");
synthesizeMouse(t2, 2, 2, { });
is(fm.focusedElement, t2, "focus during blur");
setFocusTo("t9", window);
gLastFocusMethod = -1;
window.openDialog("focus_window2.xul", "_blank", "chrome", otherWindowFocused);

View File

@ -58,7 +58,6 @@ static const char kPromptURL[] = "chrome://global/content/commonDialog.xul";
static const char kSelectPromptURL[] = "chrome://global/content/selectDialog.xul";
static const char kQuestionIconClass[] = "question-icon";
static const char kAlertIconClass[] = "alert-icon";
static const char kWarningIconClass[] = "message-icon";
// We include question-icon for backwards compatibility
static const char kAuthenticationIconClass[] = "authentication-icon question-icon";

View File

@ -1,4 +1,4 @@
browser.jar:
toolkit.jar:
% content reporter %content/reporter/ xpcnativewrappers=yes
% overlay chrome://browser/content/browser.xul chrome://reporter/content/reporterOverlay.xul
% overlay chrome://navigator/content/navigator.xul chrome://reporter/content/reporterOverlay.xul

View File

@ -30,8 +30,6 @@ cairo-version-fixes.patch: fix up cairo-version.c/cairo-version.h for in-place b
win32-ddb-dib.patch: fix for bug 455513; not upstream yet pending feebdack
qpainter-type.patch: add SURFACE_TYPE_QPAINTER to cairo.h
wince-fixes.patch: stubs out win32 functions we use but are not supported on win32. Also implements ExtSelectClipRgn in terms of other functions available on wince.
win32-vertically-offset-glyph.patch: bug 454098; vertical positioning errors when drawing glyph runs including delta-y offsets on screen via GDI

View File

@ -79,7 +79,7 @@
@DIRECTFB_SURFACE_FEATURE@
@QPAINTER_SURFACE_FEATURE@
@QT_SURFACE_FEATURE@
@DDRAW_SURFACE_FEATURE@

View File

@ -842,7 +842,7 @@ struct PatternToBrushConverter {
cairo_surface_pattern_t *spattern = (cairo_surface_pattern_t*) pattern;
cairo_surface_t *surface = spattern->surface;
if (surface->type == CAIRO_SURFACE_TYPE_QPAINTER) {
if (surface->type == CAIRO_SURFACE_TYPE_QT) {
cairo_qpainter_surface_t *qs = (cairo_qpainter_surface_t*) surface;
if (qs->image) {
@ -1148,7 +1148,7 @@ _cairo_qpainter_fast_fill (cairo_qpainter_surface_t *qs,
if (source->type == CAIRO_PATTERN_TYPE_SURFACE) {
cairo_surface_pattern_t *spattern = (cairo_surface_pattern_t*) source;
if (spattern->surface->type == CAIRO_SURFACE_TYPE_QPAINTER) {
if (spattern->surface->type == CAIRO_SURFACE_TYPE_QT) {
cairo_qpainter_surface_t *p = (cairo_qpainter_surface_t*) spattern->surface;
qsSrc_image = p->image;
@ -1504,7 +1504,7 @@ _cairo_qpainter_surface_composite (cairo_operator_t op,
qimg_d.reset(qimg);
}
if (surface->type == CAIRO_SURFACE_TYPE_QPAINTER) {
if (surface->type == CAIRO_SURFACE_TYPE_QT) {
cairo_qpainter_surface_t *qsrc = (cairo_qpainter_surface_t*) surface;
if (qsrc->image)
@ -1557,7 +1557,7 @@ _cairo_qpainter_surface_flush (void *abstract_surface)
**/
static const cairo_surface_backend_t cairo_qpainter_surface_backend = {
CAIRO_SURFACE_TYPE_QPAINTER,
CAIRO_SURFACE_TYPE_QT,
_cairo_qpainter_surface_create_similar,
_cairo_qpainter_surface_finish,
_cairo_qpainter_surface_acquire_source_image,
@ -1776,7 +1776,7 @@ cairo_qpainter_surface_get_qpainter (cairo_surface_t *surface)
{
cairo_qpainter_surface_t *qs = (cairo_qpainter_surface_t*) surface;
if (surface->type != CAIRO_SURFACE_TYPE_QPAINTER)
if (surface->type != CAIRO_SURFACE_TYPE_QT)
return NULL;
return qs->p;
@ -1787,7 +1787,7 @@ cairo_qpainter_surface_get_qimage (cairo_surface_t *surface)
{
cairo_qpainter_surface_t *qs = (cairo_qpainter_surface_t*) surface;
if (surface->type != CAIRO_SURFACE_TYPE_QPAINTER)
if (surface->type != CAIRO_SURFACE_TYPE_QT)
return NULL;
return qs->image;
@ -1798,7 +1798,7 @@ cairo_qpainter_surface_get_image (cairo_surface_t *surface)
{
cairo_qpainter_surface_t *qs = (cairo_qpainter_surface_t*) surface;
if (surface->type != CAIRO_SURFACE_TYPE_QPAINTER)
if (surface->type != CAIRO_SURFACE_TYPE_QT)
return NULL;
return (cairo_surface_t*) qs->image_equiv;

View File

@ -39,7 +39,7 @@
#include <cairo.h>
#if CAIRO_HAS_QPAINTER_SURFACE
#if CAIRO_HAS_QT_SURFACE
class QPainter;
class QImage;
@ -70,10 +70,10 @@ cairo_qpainter_surface_get_qimage (cairo_surface_t *surface);
CAIRO_END_DECLS
#else /* CAIRO_HAS_QPAINTER_SURFACE */
#else /* CAIRO_HAS_QT_SURFACE */
# error Cairo was not compiled with support for the QPainter backend
#endif /* CAIRO_HAS_QPAINTER_SURFACE */
#endif /* CAIRO_HAS_QT_SURFACE */
#endif /* CAIRO_QPAINTER_H_ */

View File

@ -2534,7 +2534,7 @@ _cairo_pattern_is_opaque (const cairo_pattern_t *abstract_pattern);
enum {
CAIRO_PATTERN_ACQUIRE_NONE = 0x0,
CAIRO_PATTERN_ACQUIRE_NO_REFLECT = 0x1,
CAIRO_PATTERN_ACQUIRE_NO_REFLECT = 0x1
};
cairo_private cairo_int_status_t
_cairo_pattern_acquire_surface (const cairo_pattern_t *pattern,

View File

@ -1,21 +0,0 @@
diff --git a/gfx/cairo/cairo/src/cairo.h b/gfx/cairo/cairo/src/cairo.h
--- a/gfx/cairo/cairo/src/cairo.h
+++ b/gfx/cairo/cairo/src/cairo.h
@@ -1875,6 +1875,7 @@
* @CAIRO_SURFACE_TYPE_OS2: The surface is of type os2
* @CAIRO_SURFACE_TYPE_WIN32_PRINTING: The surface is a win32 printing surface
* @CAIRO_SURFACE_TYPE_QUARTZ_IMAGE: The surface is of type quartz_image
+ * @CAIRO_SURFACE_TYPE_QPAINTER: The surface is of type qpainter
*
* #cairo_surface_type_t is used to describe the type of a given
* surface. The surface types are also known as "backends" or "surface
@@ -1913,7 +1914,8 @@
CAIRO_SURFACE_TYPE_SVG,
CAIRO_SURFACE_TYPE_OS2,
CAIRO_SURFACE_TYPE_WIN32_PRINTING,
- CAIRO_SURFACE_TYPE_QUARTZ_IMAGE
+ CAIRO_SURFACE_TYPE_QUARTZ_IMAGE,
+ CAIRO_SURFACE_TYPE_QPAINTER
} cairo_surface_type_t;
cairo_public cairo_surface_type_t

View File

@ -221,7 +221,7 @@ nsSystemFontsGTK2::GetSystemFontInfo(GtkWidget *aWidget, nsString *aFontName,
if (!MOZ_pango_font_description_get_size_is_absolute(desc)) {
// |size| is in pango-points, so convert to pixels.
size *= float(gfxPlatform::GetDPI()) / POINTS_PER_INCH_FLOAT;
size *= float(gfxPlatformGtk::GetPlatformDPI()) / POINTS_PER_INCH_FLOAT;
}
// |size| is now pixels

View File

@ -79,7 +79,7 @@ nsSystemFontsQt::GetSystemFontInfo(const char *aClassName, nsString *aFontName,
aFontStyle->weight = qFont.weight();
// FIXME: Set aFontStyle->stretch correctly!
aFontStyle->stretch = NS_FONT_STRETCH_NORMAL;
aFontStyle->size = qFont.pointSizeF() * float(gfxPlatform::GetDPI()) / 72.0f;
aFontStyle->size = qFont.pointSizeF() * float(gfxQtPlatform::GetPlatformDPI()) / 72.0f;
return NS_OK;
}

View File

@ -129,9 +129,18 @@ public:
GdkDrawable *drawable);
GdkDrawable *GetGdkDrawable(gfxASurface *target);
static PRInt32 GetPlatformDPI() {
if (sPlatformDPI < 0) {
gfxPlatformGtk::GetPlatform()->InitDisplayCaps();
}
NS_ASSERTION(sPlatformDPI > 0, "Something is wrong");
return sPlatformDPI;
}
protected:
void InitDisplayCaps();
static PRInt32 sPlatformDPI;
static gfxFontconfigUtils *sFontconfigUtils;
private:

View File

@ -85,9 +85,11 @@ public:
FT_Library GetFTLibrary();
protected:
void InitDisplayCaps();
static PRInt32 GetPlatformDPI() {
return 96;
}
protected:
static gfxFontconfigUtils *sFontconfigUtils;
private:

View File

@ -59,7 +59,7 @@
#include "gfxDirectFBSurface.h"
#endif
#ifdef CAIRO_HAS_QPAINTER_SURFACE
#ifdef CAIRO_HAS_QT_SURFACE
#include "gfxQPainterSurface.h"
#endif
@ -180,8 +180,8 @@ gfxASurface::Wrap (cairo_surface_t *csurf)
result = new gfxDirectFBSurface(csurf);
}
#endif
#ifdef CAIRO_HAS_QPAINTER_SURFACE
else if (stype == CAIRO_SURFACE_TYPE_QPAINTER) {
#ifdef CAIRO_HAS_QT_SURFACE
else if (stype == CAIRO_SURFACE_TYPE_QT) {
result = new gfxQPainterSurface(csurf);
}
#endif

View File

@ -787,7 +787,7 @@ gfx_pango_fc_font_describe(PangoFont *font)
gfxFcFont *gfxFont = gfxPangoFcFont::GfxFont(self);
if (gfxFont) {
double pixelsize = gfxFont->GetStyle()->size;
double dpi = gfxPlatform::GetDPI();
double dpi = gfxPlatformGtk::GetPlatformDPI();
gint size = moz_pango_units_from_double(pixelsize * dpi / 72.0);
pango_font_description_set_size(result, size);
}
@ -1784,8 +1784,8 @@ gfx_pango_font_map_get_resolution(PangoFcFontMap *fcfontmap,
PangoContext *context)
{
// This merely enables the FC_SIZE field of the pattern to be accurate.
// We use gfxPlatform::GetDPI() much of the time...
return gfxPlatform::GetDPI();
// We use gfxPlatformGtk::GetPlatformDPI() much of the time...
return gfxPlatformGtk::GetPlatformDPI();
}
#ifdef MOZ_WIDGET_GTK2

View File

@ -98,6 +98,7 @@
#include "nsNetUtil.h"
#endif
PRInt32 gfxPlatformGtk::sPlatformDPI = -1;
gfxFontconfigUtils *gfxPlatformGtk::sFontconfigUtils = nsnull;
#ifndef MOZ_PANGO
@ -530,6 +531,15 @@ gfxPlatformGtk::CreateFontGroup(const nsAString &aFamilies,
void
gfxPlatformGtk::InitDisplayCaps()
{
GdkScreen *screen = gdk_screen_get_default();
gtk_settings_get_for_screen(screen); // Make sure init is run so we have a resolution
gfxPlatformGtk::sPlatformDPI = PRInt32(round(gdk_screen_get_resolution(screen)));
if (gfxPlatformGtk::sPlatformDPI <= 0) {
// Fall back to something sane
gfxPlatformGtk::sPlatformDPI = 96;
}
#if defined(MOZ_PLATFORM_HILDON)
// Check the cached value
if (gfxPlatform::sDPI == -1) {
@ -539,13 +549,13 @@ gfxPlatformGtk::InitDisplayCaps()
PR_TRUE, getter_AddRefs(file));
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIInputStream> fileStream;
NS_NewLocalFileInputStream(getter_AddRefs(fileStream), file);
NS_NewLocalFileInputStream(getter_AddRefs(fileStream), file);
nsCOMPtr<nsILineInputStream> lineStream = do_QueryInterface(fileStream);
// Extract the product code from the component_version file
nsCAutoString buffer;
PRBool isMore = PR_TRUE;
if (NS_SUCCEEDED(lineStream->ReadLine(buffer, &isMore))) {
if (lineStream && NS_SUCCEEDED(lineStream->ReadLine(buffer, &isMore))) {
if (StringEndsWith(buffer, NS_LITERAL_CSTRING("RX-51"))) {
gfxPlatform::sDPI = 265; // It's an N900
}
@ -558,14 +568,12 @@ gfxPlatformGtk::InitDisplayCaps()
}
}
#else
GdkScreen *screen = gdk_screen_get_default();
gtk_settings_get_for_screen(screen); // Make sure init is run so we have a resolution
gfxPlatform::sDPI = PRInt32(round(gdk_screen_get_resolution(screen)));
gfxPlatform::sDPI = gfxPlatformGtk::sPlatformDPI;
#endif
if (gfxPlatform::sDPI <= 0.0) {
if (gfxPlatform::sDPI <= 0) {
// Fall back to something sane
gfxPlatform::sDPI = 96.0;
gfxPlatform::sDPI = 96;
} else {
// Minimum DPI is 96
gfxPlatform::sDPI = PR_MAX(sDPI, 96);

View File

@ -143,7 +143,7 @@ GetABI(PRUint16 aCallType, ffi_abi& aResult)
case nsIForeignLibrary::DEFAULT:
aResult = FFI_DEFAULT_ABI;
return true;
#if defined(XP_WIN32)
#if defined(_WIN32)
case nsIForeignLibrary::STDCALL:
aResult = FFI_STDCALL;
return true;

View File

@ -202,7 +202,7 @@ function run_int64_tests(library) {
var test_i64_i64 = library.declare("test_i64_i64", Types.DEFAULT, Types.INT64, Types.INT64);
do_check_eq(test_i64_i64(5), 5);
do_check_eq(test_i64_i64(0), 0);
do_check_eq(test_i64_i64(0x7ffffffffffffc00), 0x7ffffffffffffc00);
do_check_eq(test_i64_i64(0x7ffffffffffff000), 0x7ffffffffffff000);
do_check_eq(test_i64_i64(-0x8000000000000000), -0x8000000000000000);
do_check_eq(1/test_i64_i64(-0), 1/0); // that is, test_i64_i64(-0) is +0
do_check_eq(test_i64_i64(true), 1);
@ -222,7 +222,9 @@ function run_int64_tests(library) {
// test the range of unsigned. (we can reuse the signed C function
// here, since it's binary-compatible.)
var test_ui64_ui64 = library.declare("test_i64_i64", Types.DEFAULT, Types.UINT64, Types.UINT64);
do_check_eq(test_ui64_ui64(0xfffffffffffff800), 0xfffffffffffff800);
#ifndef XP_WIN
do_check_eq(test_ui64_ui64(0xffffffffffff000), 0xfffffffffffff000);
#endif
do_check_throws(function () { test_ui64_ui64(0x10000000000000000); }, TypeError);
do_check_throws(function () { test_ui64_ui64(-1); }, TypeError);
}

View File

@ -329,6 +329,7 @@ MOZ_MEMORY_LDFLAGS = @MOZ_MEMORY_LDFLAGS@
MOZ_MAPINFO = @MOZ_MAPINFO@
WINCE = @WINCE@
WINCE_WINDOWS_MOBILE = @WINCE_WINDOWS_MOBILE@
MACOS_SDK_DIR = @MACOS_SDK_DIR@
NEXT_ROOT = @NEXT_ROOT@

View File

@ -2162,15 +2162,6 @@ echo-module:
echo-requires:
@echo $(REQUIRES)
echo-requires-recursive::
ifdef _REPORT_ALL_DIRS
@echo $(subst $(topsrcdir)/,,$(srcdir)): $(MODULE): $(REQUIRES)
else
@$(if $(REQUIRES),echo $(subst $(topsrcdir)/,,$(srcdir)): $(MODULE): $(REQUIRES))
endif
$(LOOP_OVER_PARALLEL_DIRS)
$(LOOP_OVER_DIRS)
echo-depth-path:
@$(topsrcdir)/build/unix/print-depth-path.sh

View File

@ -1853,6 +1853,19 @@ case "$target" in
BIN_SUFFIX='.exe'
MOZ_ENABLE_POSTSCRIPT=
MOZ_USER_DIR="Mozilla"
dnl Default to Windows Mobile components enabled
WINCE_WINDOWS_MOBILE=1
MOZ_ARG_DISABLE_BOOL(windows-mobile-components,
[ --disable-windows-mobile-components
Disable Windows Mobile specific components from CE build],
WINCE_WINDOWS_MOBILE=,
WINCE_WINDOWS_MOBILE=1)
if test "$WINCE_WINDOWS_MOBILE"; then
AC_DEFINE(WINCE_WINDOWS_MOBILE)
fi
;;
*-symbian*)
@ -4865,6 +4878,7 @@ AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
AC_SUBST(MOZ_TIMELINE)
AC_SUBST(WINCE)
AC_SUBST(WINCE_WINDOWS_MOBILE)
AC_SUBST(MOZ_APP_NAME)
AC_SUBST(MOZ_APP_DISPLAYNAME)

View File

@ -6926,6 +6926,9 @@ js_arm_check_arch() {
static bool
js_arm_check_vfp() {
#ifdef WINCE_WINDOWS_MOBILE
return false;
#else
bool ret = false;
__try {
js_arm_try_vfp_op();
@ -6934,6 +6937,7 @@ js_arm_check_vfp() {
ret = false;
}
return ret;
#endif
}
#define HAVE_ENABLE_DISABLE_DEBUGGER_EXCEPTIONS 1

View File

@ -650,6 +650,104 @@ Clear(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
return JS_TRUE;
}
/*
* JSContext option name to flag map. The option names are in alphabetical
* order for better reporting.
*/
static const struct {
const char *name;
uint32 flag;
} js_options[] = {
{"anonfunfix", JSOPTION_ANONFUNFIX},
{"atline", JSOPTION_ATLINE},
{"jit", JSOPTION_JIT},
{"relimit", JSOPTION_RELIMIT},
{"strict", JSOPTION_STRICT},
{"werror", JSOPTION_WERROR},
{"xml", JSOPTION_XML},
};
static uint32
MapContextOptionNameToFlag(JSContext* cx, const char* name)
{
for (size_t i = 0; i != JS_ARRAY_LENGTH(js_options); ++i) {
if (strcmp(name, js_options[i].name) == 0)
return js_options[i].flag;
}
char* msg = JS_sprintf_append(NULL,
"unknown option name '%s'."
" The valid names are ", name);
for (size_t i = 0; i != JS_ARRAY_LENGTH(js_options); ++i) {
if (!msg)
break;
msg = JS_sprintf_append(msg, "%s%s", js_options[i].name,
(i + 2 < JS_ARRAY_LENGTH(js_options)
? ", "
: i + 2 == JS_ARRAY_LENGTH(js_options)
? " and "
: "."));
}
if (!msg) {
JS_ReportOutOfMemory(cx);
} else {
JS_ReportError(cx, msg);
free(msg);
}
return 0;
}
static JSBool
Options(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
uint32 optset, flag;
JSString *str;
const char *opt;
char *names;
JSBool found;
optset = 0;
for (uintN i = 0; i < argc; i++) {
str = JS_ValueToString(cx, argv[i]);
if (!str)
return JS_FALSE;
argv[i] = STRING_TO_JSVAL(str);
opt = JS_GetStringBytes(str);
if (!opt)
return JS_FALSE;
flag = MapContextOptionNameToFlag(cx, opt);
if (!flag)
return JS_FALSE;
optset |= flag;
}
optset = JS_ToggleOptions(cx, optset);
names = NULL;
found = JS_FALSE;
for (size_t i = 0; i != JS_ARRAY_LENGTH(js_options); i++) {
if (js_options[i].flag & optset) {
found = JS_TRUE;
names = JS_sprintf_append(names, "%s%s",
names ? "," : "", js_options[i].name);
if (!names)
break;
}
}
if (!found)
names = strdup("");
if (!names) {
JS_ReportOutOfMemory(cx);
return JS_FALSE;
}
str = JS_NewString(cx, names, strlen(names));
if (!str) {
free(names);
return JS_FALSE;
}
*rval = STRING_TO_JSVAL(str);
return JS_TRUE;
}
static JSFunctionSpec glob_functions[] = {
{"print", Print, 0,0,0},
{"readline", ReadLine, 1,0,0},
@ -661,6 +759,7 @@ static JSFunctionSpec glob_functions[] = {
{"dump", Dump, 1,0,0},
{"gc", GC, 0,0,0},
{"clear", Clear, 1,0,0},
{"options", Options, 0,0,0},
#ifdef DEBUG
{"dumpHeap", DumpHeap, 5,0,0},
#endif
@ -956,7 +1055,7 @@ static int
usage(void)
{
fprintf(gErrFile, "%s\n", JS_GetImplementationVersion());
fprintf(gErrFile, "usage: xpcshell [-g gredir] [-PswWxCij] [-v version] [-f scriptfile] [-e script] [scriptfile] [scriptarg...]\n");
fprintf(gErrFile, "usage: xpcshell [-g gredir] [-PsSwWxCij] [-v version] [-f scriptfile] [-e script] [scriptfile] [scriptarg...]\n");
return 2;
}
@ -1043,6 +1142,8 @@ ProcessArgs(JSContext *cx, JSObject *obj, char **argv, int argc)
case 'w':
reportWarnings = JS_TRUE;
break;
case 'S':
JS_ToggleOptions(cx, JSOPTION_WERROR);
case 's':
JS_ToggleOptions(cx, JSOPTION_STRICT);
break;

View File

@ -4438,9 +4438,9 @@ PresShell::DispatchSynthMouseMove(nsGUIEvent *aEvent,
{
PRUint32 hoverGenerationBefore = mFrameConstructor->GetHoverGeneration();
nsEventStatus status;
nsIView* rootView;
mViewManager->GetRootView(rootView);
mViewManager->DispatchEvent(aEvent, rootView, &status);
nsIView* targetView;
targetView = nsIView::GetViewFor(aEvent->widget);
mViewManager->DispatchEvent(aEvent, targetView, &status);
if (aFlushOnHoverChange &&
hoverGenerationBefore != mFrameConstructor->GetHoverGeneration()) {
// Flush so that the resulting reflow happens now so that our caller
@ -6000,6 +6000,9 @@ PresShell::HandleEvent(nsIView *aView,
}
#endif
nsIContent* capturingContent =
NS_IS_MOUSE_EVENT(aEvent) ? GetCapturingContent() : nsnull;
nsCOMPtr<nsIDocument> retargetEventDoc;
// key and IME events must be targeted at the presshell for the focused frame
if (!sDontRetargetEvents) {
@ -6020,10 +6023,10 @@ PresShell::HandleEvent(nsIView *aView,
retargetEventDoc = do_QueryInterface(piWindow->GetExtantDocument());
if (!retargetEventDoc)
return NS_OK;
} else if (NS_IS_MOUSE_EVENT(aEvent) && GetCapturingContent()) {
} else if (capturingContent) {
// if the mouse is being captured then retarget the mouse event at the
// document that is being captured.
retargetEventDoc = gCaptureInfo.mContent->GetCurrentDoc();
retargetEventDoc = capturingContent->GetCurrentDoc();
}
if (retargetEventDoc) {
@ -6093,43 +6096,7 @@ PresShell::HandleEvent(nsIView *aView,
return NS_OK;
}
PRBool getDescendantPoint = PR_TRUE;
nsIFrame* frame = static_cast<nsIFrame*>(aView->GetClientData());
if (NS_IS_MOUSE_EVENT(aEvent) && GetCapturingContent()) {
// if a node is capturing the mouse, get the frame for the capturing
// content and use that instead. However, if the content has no parent,
// such as the root frame, get the parent canvas frame instead. This
// ensures that positioned frames are included when hit-testing. Note
// that a check was already done above to ensure that capturingContent
// is in this presshell.
nsIContent* capturingContent = gCaptureInfo.mContent;
frame = GetPrimaryFrameFor(capturingContent);
if (frame) {
getDescendantPoint = !gCaptureInfo.mRetargetToElement;
if (!capturingContent->GetParent()) {
frame = frame->GetParent();
}
else {
// special case for <select> as it needs to capture on the dropdown list.
if (capturingContent->Tag() == nsGkAtoms::select &&
capturingContent->IsNodeOfType(nsINode::eHTML)) {
nsIFrame* childframe = frame->GetChildList(nsGkAtoms::selectPopupList).FirstChild();
if (childframe) {
frame = childframe;
}
}
// if the frame is a scrolling frame, get the inner scrolled frame instead.
nsIScrollableFrame* scrollFrame = do_QueryFrame(frame);
if (scrollFrame) {
frame = scrollFrame->GetScrolledFrame();
}
}
aView = frame->GetClosestView();
}
}
PRBool dispatchUsingCoordinates = NS_IsEventUsingCoordinates(aEvent);
// if this event has no frame, we need to retarget it at a parent
@ -6182,8 +6149,28 @@ PresShell::HandleEvent(nsIView *aView,
#endif
}
PRBool captureRetarget = PR_FALSE;
if (capturingContent) {
captureRetarget = gCaptureInfo.mRetargetToElement;
// special case for <select> as it needs to capture on the dropdown list,
// so get the frame for the dropdown list instead.
if (!captureRetarget && capturingContent->Tag() == nsGkAtoms::select &&
capturingContent->IsNodeOfType(nsINode::eHTML)) {
nsIFrame* selectFrame = GetPrimaryFrameFor(capturingContent);
if (selectFrame) {
nsIFrame* childframe = selectFrame->GetChildList(nsGkAtoms::selectPopupList).FirstChild();
if (childframe) {
frame = childframe;
}
}
}
}
// Get the frame at the event point. However, don't do this if we're
// capturing and retargeting the event because the captured frame will
// be used instead below.
nsIFrame* targetFrame = nsnull;
if (getDescendantPoint) {
if (!captureRetarget) {
nsPoint eventPoint
= nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, frame);
{
@ -6197,6 +6184,24 @@ PresShell::HandleEvent(nsIView *aView,
}
}
// if a node is capturing the mouse, check if the event needs to be
// retargeted at the capturing content instead. This will be the case when
// capture retargeting is being used, no frame was found or the frame's
// content is not a descendant of the capturing content.
if (capturingContent &&
(gCaptureInfo.mRetargetToElement ||
!targetFrame || !targetFrame->GetContent() ||
!nsContentUtils::ContentIsCrossDocDescendantOf(targetFrame->GetContent(),
capturingContent))) {
// A check was already done above to ensure that capturingContent is
// in this presshell, so GetPrimaryFrameFor can just be called directly.
nsIFrame* capturingFrame = GetPrimaryFrameFor(capturingContent);
if (capturingFrame) {
targetFrame = capturingFrame;
aView = targetFrame->GetClosestView();
}
}
if (targetFrame) {
PresShell* shell =
static_cast<PresShell*>(targetFrame->PresContext()->PresShell());

View File

@ -657,6 +657,9 @@
#define NS_STYLE_VISIBILITY_VISIBLE 1
#define NS_STYLE_VISIBILITY_COLLAPSE 2
// See nsStyleText
#define NS_STYLE_TABSIZE_INITIAL 8
// See nsStyleText
#define NS_STYLE_WHITESPACE_NORMAL 0
#define NS_STYLE_WHITESPACE_PRE 1

View File

@ -1458,6 +1458,13 @@ void
nsHTMLFramesetFrame::MouseDrag(nsPresContext* aPresContext,
nsGUIEvent* aEvent)
{
// if the capture ended, reset the drag state
if (nsIPresShell::GetCapturingContent() != GetContent()) {
mDragger = nsnull;
gDragInProgress = PR_FALSE;
return;
}
PRInt32 change; // measured positive from left-to-right or top-to-bottom
nsWeakFrame weakFrame(this);
if (mDragger->mVertical) {

View File

@ -3360,7 +3360,7 @@ static void InitializeEventRecord(EventRecord* event, Point* aMousePosition)
::GetGlobalMouse(&event->where);
}
event->when = ::TickCount();
event->modifiers = ::GetCurrentEventKeyModifiers();
event->modifiers = ::GetCurrentKeyModifiers();
}
#endif

View File

@ -2434,6 +2434,10 @@ PropertyProvider::GetSpacingInternal(PRUint32 aStart, PRUint32 aLength,
}
}
// Ignore tab spacing rather than computing it, if the tab size is 0
if (!aIgnoreTabs)
aIgnoreTabs = mFrame->GetStyleText()->mTabSize == 0;
// Now add tab spacing, if there is any
if (!aIgnoreTabs) {
gfxFloat* tabs = GetTabWidths(aStart, aLength);
@ -2485,24 +2489,27 @@ static void TabWidthDestructor(void* aObject, nsIAtom* aProp, void* aValue,
}
static gfxFloat
ComputeTabWidthAppUnits(nsIFrame* aLineContainer, gfxTextRun* aTextRun)
ComputeTabWidthAppUnits(nsIFrame* aFrame, gfxTextRun* aTextRun)
{
// Get the number of spaces from CSS -moz-tab-size
const nsStyleText* textStyle = aFrame->GetStyleText();
// Round the space width when converting to appunits the same way
// textruns do
gfxFloat spaceWidthAppUnits =
NS_roundf(GetFirstFontMetrics(
GetFontGroupForFrame(aLineContainer)).spaceWidth *
GetFontGroupForFrame(aFrame)).spaceWidth *
aTextRun->GetAppUnitsPerDevUnit());
return 8*spaceWidthAppUnits;
return textStyle->mTabSize * spaceWidthAppUnits;
}
// aX and the result are in whole appunits.
static gfxFloat
AdvanceToNextTab(gfxFloat aX, nsIFrame* aLineContainer,
AdvanceToNextTab(gfxFloat aX, nsIFrame* aFrame,
gfxTextRun* aTextRun, gfxFloat* aCachedTabWidth)
{
if (*aCachedTabWidth < 0) {
*aCachedTabWidth = ComputeTabWidthAppUnits(aLineContainer, aTextRun);
*aCachedTabWidth = ComputeTabWidthAppUnits(aFrame, aTextRun);
}
// Advance aX to the next multiple of *aCachedTabWidth. We must advance
@ -2570,7 +2577,7 @@ PropertyProvider::GetTabWidths(PRUint32 aStart, PRUint32 aLength)
}
} else {
double nextTab = AdvanceToNextTab(mOffsetFromBlockOriginForTabs,
mLineContainer, mTextRun, &tabWidth);
mFrame, mTextRun, &tabWidth);
(*mTabWidths)[i - startOffset] = nextTab - mOffsetFromBlockOriginForTabs;
mOffsetFromBlockOriginForTabs = nextTab;
}
@ -5690,7 +5697,7 @@ nsTextFrame::AddInlineMinWidthForFlow(nsIRenderingContext *aRenderingContext,
provider.GetSpacing(i, 1, &spacing);
aData->currentLine += nscoord(spacing.mBefore);
gfxFloat afterTab =
AdvanceToNextTab(aData->currentLine, FindLineContainer(this),
AdvanceToNextTab(aData->currentLine, this,
mTextRun, &tabWidth);
aData->currentLine = nscoord(afterTab + spacing.mAfter);
wordStart = i + 1;
@ -5820,7 +5827,7 @@ nsTextFrame::AddInlinePrefWidthForFlow(nsIRenderingContext *aRenderingContext,
provider.GetSpacing(i, 1, &spacing);
aData->currentLine += nscoord(spacing.mBefore);
gfxFloat afterTab =
AdvanceToNextTab(aData->currentLine, FindLineContainer(this),
AdvanceToNextTab(aData->currentLine, this,
mTextRun, &tabWidth);
aData->currentLine = nscoord(afterTab + spacing.mAfter);
lineStart = i + 1;

View File

@ -5,7 +5,7 @@
<title>Bug 413928</title>
<style type="text/css">
.li {
line-height: 24px;
line-height: 2em;
}
.list-number-he {
direction: rtl;

View File

@ -12,7 +12,7 @@
}
li {
line-height: 24px;
line-height: 2em;
}
</style>
</head>

View File

@ -5,7 +5,7 @@
<title>Bug 413928</title>
<style type="text/css">
.li {
line-height: 24px;
line-height: 2em;
}
.list-number-he {
direction: rtl;

View File

@ -12,7 +12,7 @@
}
li {
line-height: 24px;
line-height: 2em;
}
</style>
</head>

View File

@ -1 +1,12 @@
<div style="background-color: grey; width: 300px; height: 300px; -moz-border-radius: 5px; position: absolute; top: 20px; left: 20px;">inset</div><div style="-moz-border-radius: 5px; width: 300px; height: 300px; background-color: white; position: absolute; top: 40px; left: 40px;">&nbsp;</div>
<body style="font-size: 16px;">
<div style="background-color: grey;
width: 15em; height: 15em;
-moz-border-radius: 0.5em;
position: absolute;
top: 1em; left: 1em;">inset</div>
<div style="-moz-border-radius: 0.5em;
width: 15em; height: 15em;
background-color: white;
position: absolute;
top: 3em; left: 3em;">&nbsp;</div>
</body>

View File

@ -1 +1,7 @@
<div style="-moz-box-shadow: 20px 20px grey inset; width: 300px; height: 300px; -moz-border-radius: 5px; position: absolute; top: 20px; left: 20px;">inset</div>
<body style="font-size: 16px;">
<div style="-moz-box-shadow: 2em 2em grey inset;
width: 15em; height: 15em;
-moz-border-radius: .5em;
position: absolute;
top: 1em; left: 1em;">inset</div>
</body>

View File

@ -6,6 +6,8 @@
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
body { font-size: 10px; }
</style>
</head>
<body>

View File

@ -6,6 +6,8 @@
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
body { font-size: 10px; }
table { margin: 0; border-spacing: 0; }
td, th { padding: 0; vertical-align: top; }

View File

@ -6,6 +6,8 @@
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
body { font-size: 16px; }
table { margin: 0; border-spacing: 0; }
caption, td, th { padding: 0; vertical-align: top; text-align: left; }

View File

@ -6,6 +6,8 @@
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
body { font-size: 16px; }
table { margin: 0; border-spacing: 0; }
caption, td, th { padding: 0; vertical-align: top; text-align: left; }

View File

@ -6,6 +6,8 @@
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
body { font-size: 16px; }
table { margin: 0; border-spacing: 0; }
caption, td, th { padding: 0; vertical-align: top; text-align: left; }

View File

@ -6,6 +6,8 @@
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
body { font-size: 16px; }
table { margin: 0; border-spacing: 0; }
caption, td, th { padding: 0; vertical-align: top; text-align: left; }

View File

@ -6,6 +6,8 @@
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
body { font-size: 16px; }
table { margin: 0; border-spacing: 0; }
caption, td, th { padding: 0; vertical-align: top; text-align: left; }

View File

@ -6,6 +6,8 @@
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
body { font-size: 16px; }
table { margin: 0; border-spacing: 0; }
caption, td, th { padding: 0; vertical-align: top; text-align: left; }

View File

@ -3,7 +3,7 @@
<head>
<title>Bug 262151 Reference</title>
</head>
<body style="text-align: right">
<body style="text-align: right; font-size: 16px;">
<span>This text should all </span><span>be on one line.</span>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More