Merge mozilla-central

This commit is contained in:
Ben Turner 2009-10-05 16:08:52 -07:00
commit 62534891fc
1685 changed files with 166362 additions and 41511 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

@ -105,6 +105,9 @@ export::
ifdef ENABLE_TESTS
# Additional makefile targets to call automated test suites
include $(topsrcdir)/testing/testsuite-targets.mk
else
# OS X Universal builds will want to call this, so stub it out
package-tests:
endif
include $(topsrcdir)/config/rules.mk

View File

@ -46,15 +46,12 @@ include $(DEPTH)/config/autoconf.mk
MODULE = accessibility
LIBRARY_NAME = accessibility
EXPORT_LIBRARY = 1
ifneq ($(OS_ARCH),WINNT)
SHORT_LIBNAME = access
endif
IS_COMPONENT = 1
MODULE_NAME = nsAccessibilityModule
GRE_MODULE = 1
LIBXUL_LIBRARY = 1
CPPSRCS = nsAccessibilityFactory.cpp
LOCAL_INCLUDES = -I$(srcdir)/../src

View File

@ -1453,7 +1453,7 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
return InitAccessible(newAcc, aAccessible, nsnull);
}
PRBool isHTML = content->IsNodeOfType(nsINode::eHTML);
PRBool isHTML = content->IsHTML();
if (isHTML && content->Tag() == nsAccessibilityAtoms::map) {
// Create hyper text accessible for HTML map if it is used to group links
// (see http://www.w3.org/TR/WCAG10-HTML-TECHS/#group-bypass). If the HTML

View File

@ -298,9 +298,9 @@ nsAccessible::GetName(nsAString& aName)
nsIAtom *tooltipAttr = nsnull;
if (content->IsNodeOfType(nsINode::eHTML))
if (content->IsHTML())
tooltipAttr = nsAccessibilityAtoms::title;
else if (content->IsNodeOfType(nsINode::eXUL))
else if (content->IsXUL())
tooltipAttr = nsAccessibilityAtoms::tooltiptext;
else
return NS_OK;
@ -342,7 +342,7 @@ NS_IMETHODIMP nsAccessible::GetDescription(nsAString& aDescription)
NS_ENSURE_SUCCESS(rv, rv);
if (description.IsEmpty()) {
PRBool isXUL = content->IsNodeOfType(nsINode::eXUL);
PRBool isXUL = content->IsXUL();
if (isXUL) {
// Try XUL <description control="[id]">description text</description>
nsIContent *descriptionContent =
@ -1009,7 +1009,7 @@ nsAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
// if someone sets it on another attribute,
// it seems reasonable to consider it unavailable
PRBool isDisabled;
if (content->IsNodeOfType(nsINode::eHTML)) {
if (content->IsHTML()) {
// In HTML, just the presence of the disabled attribute means it is disabled,
// therefore disabled="false" indicates disabled!
isDisabled = content->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::disabled);
@ -1049,7 +1049,7 @@ nsAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
*aState |= nsIAccessibleStates::STATE_FLOATING;
// Check if a XUL element has the popup attribute (an attached popup menu).
if (content->IsNodeOfType(nsINode::eXUL))
if (content->IsXUL())
if (content->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::popup))
*aState |= nsIAccessibleStates::STATE_HASPOPUP;
@ -2413,7 +2413,7 @@ nsAccessible::GetRelationByType(PRUint32 aRelationType,
case nsIAccessibleRelation::RELATION_LABEL_FOR:
{
if (content->Tag() == nsAccessibilityAtoms::label) {
nsIAtom *IDAttr = content->IsNodeOfType(nsINode::eHTML) ?
nsIAtom *IDAttr = content->IsHTML() ?
nsAccessibilityAtoms::_for : nsAccessibilityAtoms::control;
rv = nsRelUtils::
AddTargetFromIDRefAttr(aRelationType, aRelation, content, IDAttr);
@ -2470,7 +2470,7 @@ nsAccessible::GetRelationByType(PRUint32 aRelationType,
return NS_OK; // XXX bug 381599, avoid performance problems
if (content->Tag() == nsAccessibilityAtoms::description &&
content->IsNodeOfType(nsINode::eXUL)) {
content->IsXUL()) {
// This affectively adds an optional control attribute to xul:description,
// which only affects accessibility, by allowing the description to be
// tied to a control.
@ -2554,7 +2554,7 @@ nsAccessible::GetRelationByType(PRUint32 aRelationType,
case nsIAccessibleRelation::RELATION_DEFAULT_BUTTON:
{
if (content->IsNodeOfType(nsINode::eHTML)) {
if (content->IsHTML()) {
// HTML form controls implements nsIFormControl interface.
nsCOMPtr<nsIFormControl> control(do_QueryInterface(content));
if (control) {
@ -3101,10 +3101,10 @@ nsAccessible::GetNameInternal(nsAString& aName)
if (!content)
return NS_OK;
if (content->IsNodeOfType(nsINode::eHTML))
if (content->IsHTML())
return GetHTMLName(aName);
if (content->IsNodeOfType(nsINode::eXUL))
if (content->IsXUL())
return GetXULName(aName);
return NS_OK;
@ -3231,7 +3231,7 @@ nsAccessible::GetActionRule(PRUint32 aStates)
return eJumpAction;
// Return "click" action on elements that have an attached popup menu.
if (content->IsNodeOfType(nsINode::eXUL))
if (content->IsXUL())
if (content->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::popup))
return eClickAction;

View File

@ -75,7 +75,7 @@ nsAccessibleTreeWalker::~nsAccessibleTreeWalker()
void nsAccessibleTreeWalker::GetKids(nsIDOMNode *aParentNode)
{
nsCOMPtr<nsIContent> parentContent(do_QueryInterface(aParentNode));
if (!parentContent || !parentContent->IsNodeOfType(nsINode::eHTML)) {
if (!parentContent || !parentContent->IsHTML()) {
mState.frame = nsnull; // Don't walk frames in non-HTML content, just walk the DOM.
}

View File

@ -760,7 +760,7 @@ nsCoreUtils::FindDescendantPointingToIDImpl(nsCString& aIdWithSpaces,
nsIContent*
nsCoreUtils::GetLabelContent(nsIContent *aForNode)
{
if (aForNode->IsNodeOfType(nsINode::eXUL))
if (aForNode->IsXUL())
return FindNeighbourPointingToNode(aForNode, nsAccessibilityAtoms::control,
nsAccessibilityAtoms::label);

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

@ -219,7 +219,7 @@ nsTextEquivUtils::AppendTextEquivFromTextContent(nsIContent *aContent,
return NS_OK;
}
if (aContent->IsNodeOfType(nsINode::eHTML) &&
if (aContent->IsHTML() &&
aContent->NodeInfo()->Equals(nsAccessibilityAtoms::br)) {
aString->AppendLiteral("\r\n");
return NS_OK;
@ -393,7 +393,7 @@ nsTextEquivUtils::AppendFromDOMNode(nsIContent *aContent, nsAString *aString)
if (rv != NS_OK_NO_NAME_CLAUSE_HANDLED)
return NS_OK;
if (aContent->IsNodeOfType(nsINode::eXUL)) {
if (aContent->IsXUL()) {
nsAutoString textEquivalent;
nsCOMPtr<nsIDOMXULLabeledControlElement> labeledEl =
do_QueryInterface(aContent);

View File

@ -408,7 +408,7 @@ nsHTMLSelectListAccessible::CacheOptSiblings(nsIAccessibilityService *aAccServic
for (PRUint32 count = 0; count < numChildren; count ++) {
nsIContent *childContent = aParentContent->GetChildAt(count);
if (!childContent->IsNodeOfType(nsINode::eHTML)) {
if (!childContent->IsHTML()) {
continue;
}
nsCOMPtr<nsIAtom> tag = childContent->Tag();
@ -835,7 +835,7 @@ nsresult nsHTMLSelectOptionAccessible::GetFocusedOptionNode(nsIDOMNode *aListNod
void nsHTMLSelectOptionAccessible::SelectionChangedIfOption(nsIContent *aPossibleOption)
{
if (!aPossibleOption || aPossibleOption->Tag() != nsAccessibilityAtoms::option ||
!aPossibleOption->IsNodeOfType(nsINode::eHTML)) {
!aPossibleOption->IsHTML()) {
return;
}

View File

@ -633,7 +633,7 @@ nsresult nsHyperTextAccessible::DOMPointToHypertextOffset(nsIDOMNode* aNode, PRI
nsCOMPtr<nsIAccessible> descendantAccessible;
if (findNode) {
nsCOMPtr<nsIContent> findContent = do_QueryInterface(findNode);
if (findContent->IsNodeOfType(nsINode::eHTML) &&
if (findContent->IsHTML() &&
findContent->NodeInfo()->Equals(nsAccessibilityAtoms::br)) {
nsIContent *parent = findContent->GetParent();
if (parent &&

View File

@ -51,11 +51,17 @@ nsWinUtils::ConvertToIA2Array(nsIArray *aGeckoArray, IUnknown ***aIA2Array,
*aIA2Array = NULL;
*aIA2ArrayLen = 0;
if (!aGeckoArray)
return S_FALSE;
PRUint32 length = 0;
nsresult rv = aGeckoArray->GetLength(&length);
if (NS_FAILED(rv))
return GetHRESULT(rv);
if (length == 0)
return S_FALSE;
*aIA2Array =
static_cast<IUnknown**>(nsMemory::Alloc((length) * sizeof(IUnknown*)));
if (!*aIA2Array)

View File

@ -86,13 +86,12 @@ include $(topsrcdir)/config/rules.mk
else
# Build a binary bootstrapping with XRE_main
ifeq ($(USE_SHORT_LIBNAME), 1)
ifneq (,$(filter OS2 WINCE WINNT,$(OS_ARCH)))
PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
else
PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
endif
CPPSRCS = nsBrowserApp.cpp
LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
@ -344,8 +343,10 @@ else
rm -f $(DIST)/$(APP_NAME).app/Contents/MacOS/$(PROGRAM)
rsync -aL $(PROGRAM) $(DIST)/$(APP_NAME).app/Contents/MacOS
endif
ifndef MOZ_COCOA_PRINTING
mkdir -p $(DIST)/$(APP_NAME).app/Contents/Plug-Ins
rsync -a --copy-unsafe-links $(LIBXUL_DIST)/package/PrintPDE.plugin $(DIST)/$(APP_NAME).app/Contents/Plug-Ins
endif
-cp -L $(DIST)/bin/mangle $(DIST)/bin/shlibsign $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)
cp -RL $(DIST)/branding/firefox.icns $(DIST)/$(APP_NAME).app/Contents/Resources/firefox.icns
cp -RL $(DIST)/branding/document.icns $(DIST)/$(APP_NAME).app/Contents/Resources/document.icns

View File

@ -568,8 +568,12 @@ pref("plugin.default_plugin_disabled", true);
// plugin finder service url
pref("pfs.datasource.url", "https://pfs.mozilla.org/plugins/PluginFinderService.php?mimetype=%PLUGIN_MIMETYPE%&appID=%APP_ID%&appVersion=%APP_VERSION%&clientOS=%CLIENT_OS%&chromeLocale=%CHROME_LOCALE%&appRelease=%APP_RELEASE%");
// by default we show an infobar message when pages require plugins the user has not installed
// by default we show an infobar message when pages require plugins the user has not installed, or are outdated
pref("plugins.hide_infobar_for_missing_plugin", false);
pref("plugins.hide_infobar_for_outdated_plugin", false);
pref("plugins.update.url", "https://www.mozilla.com/%LOCALE%/plugins/");
pref("plugins.update.notifyUser", false);
#ifdef XP_WIN
pref("browser.preferences.instantApply", false);

View File

@ -0,0 +1,452 @@
<?xml version="1.0" encoding="UTF-8"?>
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is aboutSupport.xhtml.
#
# The Initial Developer of the Original Code is
# Mozilla Corporation
# Portions created by the Initial Developer are Copyright (C) 2009
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Curtis Bartley <cbartley@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
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# 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 *****
<!DOCTYPE html [
<!ENTITY % htmlDTD PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> %htmlDTD;
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd"> %globalDTD;
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd"> %brandDTD;
<!ENTITY % aboutSupportDTD SYSTEM "chrome://browser/locale/aboutSupport.dtd"> %aboutSupportDTD;
]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>&aboutSupport.pageTitle;</title>
<style type="text/css"><![CDATA[
html {
background-color: -moz-Field;
color: -moz-FieldText;
font: message-box;
}
body {
text-align: justify;
width: 90%;
margin-left: 5%;
margin-right: 5%;
}
.page-subtitle {
margin-bottom: 3em;
}
.major-section {
margin-top: 2em;
margin-bottom: 1em;
font-size: large;
text-align: start;
font-weight: bold;
}
table {
background-color: -moz-Dialog;
color: -moz-DialogText;
font: message-box;
text-align: start;
width: 100%;
border: 1px solid ThreeDShadow;
border-spacing: 0px;
}
th, td {
border: 1px dotted ThreeDShadow;
padding: 3px;
}
thead th {
text-align: center;
}
th {
text-align: start;
background-color: Highlight;
color: HighlightText;
}
th.column {
white-space: nowrap;
width: 0px;
}
td {
text-align: start;
border-top: 1px dotted ThreeDShadow;
}
.prefs-table {
width: 100%;
table-layout: fixed;
}
.pref-name {
width: 70%;
white-space: nowrap;
overflow: hidden;
}
.pref-value {
width: 30%;
white-space: nowrap;
overflow: hidden;
}
]]></style>
<script type="application/javascript;version=1.7"><![CDATA[
const Cc = Components.classes;
const Ci = Components.interfaces;
window.onload = function () {
// Get the FUEL Application object.
let Application = Cc["@mozilla.org/fuel/application;1"]
.getService(Ci.fuelIApplication);
// Get the support URL.
let urlFormatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Ci.nsIURLFormatter);
let supportUrl = urlFormatter.formatURLPref("app.support.baseURL");
// Get the profile directory.
let propertiesService = Cc["@mozilla.org/file/directory_service;1"]
.getService(Ci.nsIProperties);
let currProfD = propertiesService.get("ProfD", Ci.nsIFile);
let profileDir = currProfD.path;
// Update the application basics section.
document.getElementById("application-box").textContent = Application.name;
document.getElementById("version-box").textContent = Application.version;
document.getElementById("profile-box").textContent = profileDir;
document.getElementById("supportLink").href = supportUrl;
// Update the other sections.
populateExtensionsSection();
populatePreferencesSection();
}
function populateExtensionsSection() {
let extensions = Application.extensions.all;
let trExtensions = [];
for (let i = 0; i < extensions.length; i++) {
let extension = extensions[i];
let tr = createParentElement("tr", [
createElement("td", extension.name),
createElement("td", extension.version),
createElement("td", extension.enabled),
createElement("td", extension.id),
]);
trExtensions.push(tr);
}
appendChildren(document.getElementById("extensions-tbody"), trExtensions);
}
function populatePreferencesSection() {
let modifiedPrefs = getModifiedPrefs();
function comparePrefs(pref1, pref2) {
if (pref1.name < pref2.name)
return -1;
if (pref1.name > pref2.name)
return 1;
return 0;
}
let sortedPrefs = modifiedPrefs.sort(comparePrefs);
let trPrefs = [];
for each (let pref in sortedPrefs) {
let tdName = createElement("td", pref.name, "pref-name");
let tdValue = createElement("td", pref.value, "pref-value");
let tr = createParentElement("tr", [tdName, tdValue]);
trPrefs.push(tr);
}
appendChildren(document.getElementById("prefs-tbody"), trPrefs);
}
function getModifiedPrefs() {
// We use the low-level prefs API to identify prefs that have been
// modified, rather that Application.prefs.all since the latter is
// much, much slower. Application.prefs.all also gets slower each
// time it's called. See bug 517312.
let prefService = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService);
let prefRootBranch = prefService.getBranch("");
let prefNames = prefRootBranch.getChildList("", { value: 0 });
let prefs = [Application.prefs.get(prefName)
for each (prefName in prefNames)
if (prefRootBranch.prefHasUserValue(prefName))];
return prefs;
}
function createParentElement(tagName, childElems) {
let elem = document.createElement(tagName);
appendChildren(elem, childElems);
return elem;
}
function createElement(tagName, textContent, opt_class) {
let elem = document.createElement(tagName);
elem.textContent = textContent;
elem.className = opt_class || "";
return elem;
}
function appendChildren(parentElem, childNodes) {
for (let i = 0; i < childNodes.length; i++)
parentElem.appendChild(childNodes[i]);
}
function copyContentsToClipboard() {
// Get the HTML and text representations for the important part of the page.
let contentsDiv = document.getElementById("contents");
let dataHtml = contentsDiv.innerHTML;
let dataText = createTextForElement(contentsDiv);
// We can't use plain strings, we have to use nsSupportsString.
let supportsStringClass = Cc["@mozilla.org/supports-string;1"];
let ssHtml = supportsStringClass.createInstance(Ci.nsISupportsString);
let ssText = supportsStringClass.createInstance(Ci.nsISupportsString);
let transferable = Cc["@mozilla.org/widget/transferable;1"]
.createInstance(Ci.nsITransferable);
// Add the HTML flavor.
transferable.addDataFlavor("text/html");
ssHtml.data = dataHtml;
transferable.setTransferData("text/html", ssHtml, dataHtml.length * 2);
// Add the plain text flavor.
transferable.addDataFlavor("text/unicode");
ssText.data = dataText;
transferable.setTransferData("text/unicode", ssText, dataText.length * 2);
// Store the data into the clipboard.
let clipboard = Cc["@mozilla.org/widget/clipboard;1"]
.getService(Ci.nsIClipboard);
clipboard.setData(transferable, null, clipboard.kGlobalClipboard);
}
// Return the plain text representation of an element. Do a little bit
// of pretty-printing to make it human-readable.
function createTextForElement(elem) {
// Generate the initial text.
let textFragmentAccumulator = [];
generateTextForElement(elem, "", textFragmentAccumulator);
let text = textFragmentAccumulator.join("");
// Trim extraneous whitespace before newlines, then squash extraneous
// blank lines.
text = text.replace(/[ \t]+\n/g, "\n");
text = text.replace(/\n\n\n*/g, "\n\n");
return text;
}
function generateTextForElement(elem, indent, textFragmentAccumulator) {
// Add a little extra spacing around most elements.
if (elem.tagName != "td")
textFragmentAccumulator.push("\n");
// Generate the text representation for each child node.
let node = elem.firstChild;
while (node) {
if (node.nodeType == Node.TEXT_NODE) {
// Text belonging to this element uses its indentation level.
generateTextForTextNode(node, indent, textFragmentAccumulator);
}
else if (node.nodeType == Node.ELEMENT_NODE) {
// Recurse on the child element with an extra level of indentation.
generateTextForElement(node, indent + " ", textFragmentAccumulator);
}
// Advance!
node = node.nextSibling;
}
}
function generateTextForTextNode(node, indent, textFragmentAccumulator) {
// If the text node is the first of a run of text nodes, then start
// a new line and add the initial indentation.
let prevNode = node.previousSibling;
if (!prevNode || prevNode.nodeType == Node.TEXT_NODE)
textFragmentAccumulator.push("\n" + indent);
// Trim the text node's text content and add proper indentation after
// any internal line breaks.
let text = node.textContent.trim().replace("\n[ \t]*", "\n" + indent);
textFragmentAccumulator.push(text);
}
]]></script>
</head>
<body dir="&locale.dir;">
<h1>
&aboutSupport.pageTitle;
</h1>
<div class="page-subtitle">
&aboutSupport.pageSubtitle;
</div>
<div>
<button onclick="copyContentsToClipboard()">
&aboutSupport.copyToClipboard.label;
</button>
</div>
<div id="contents">
<!-- - - - - - - - - - - - - - - - - - - - - -->
<h2 class="major-section">
&aboutSupport.appBasicsTitle;
</h2>
<table>
<tbody>
<tr>
<th class="column">
&aboutSupport.appBasicsName;
</th>
<td id="application-box">
</td>
</tr>
<tr>
<th class="column">
&aboutSupport.appBasicsVersion;
</th>
<td id="version-box">
</td>
</tr>
<tr>
<th class="column">
&aboutSupport.appBasicsProfileDir;
</th>
<td id="profile-box">
</td>
</tr>
<tr>
<th class="column">
&aboutSupport.appBasicsPlugins;
</th>
<td>
<a href="about:plugins">about:plugins</a>
</td>
</tr>
<tr>
<th class="column">
&aboutSupport.appBasicsBuildConfig;
</th>
<td>
<a href="about:buildconfig">about:buildconfig</a>
</td>
</tr>
</tbody>
</table>
<!-- - - - - - - - - - - - - - - - - - - - - -->
<h2 class="major-section">
&aboutSupport.extensionsTitle;
</h2>
<table>
<thead>
<tr>
<th>
&aboutSupport.extensionName;
</th>
<th>
&aboutSupport.extensionVersion;
</th>
<th>
&aboutSupport.extensionEnabled;
</th>
<th>
&aboutSupport.extensionId;
</th>
</tr>
</thead>
<tbody id="extensions-tbody">
</tbody>
</table>
<!-- - - - - - - - - - - - - - - - - - - - - -->
<h2 class="major-section">
&aboutSupport.modifiedPrefsTitle;
</h2>
<table class="prefs-table">
<thead>
<th class="name">
&aboutSupport.modifiedPrefsName;
</th>
<th class="value">
&aboutSupport.modifiedPrefsValue;
</th>
</thead>
<tbody id="prefs-tbody">
</tbody>
</table>
<!-- - - - - - - - - - - - - - - - - - - - - -->
</div>
</body>
</html>

View File

@ -91,6 +91,11 @@
accesskey="&helpForIEUsers.accesskey;"
oncommand="openHelpLink('ieusers');"/>
#endif
<menuitem id="troubleShooting"
accesskey="&helpTroubleshooting.accesskey;"
label="&helpTroubleshooting.label;"
oncommand="openTroubleshootingPage()"
onclick="checkForMiddleClick(this, event);"/>
<menuitem id="releaseNotes"
accesskey="&helpReleaseNotes.accesskey;"
label="&helpReleaseNotes.label;"
@ -105,8 +110,8 @@
#endif
<menuseparator id="aboutSeparator"/>
<menuitem id="aboutName"
accesskey="&aboutCmd.accesskey;"
label="&aboutCmd.label;"
accesskey="&aboutProduct.accesskey;"
label="&aboutProduct.label;"
oncommand="openAboutDialog();"/>
</menupopup>
</menu>

View File

@ -102,6 +102,10 @@
label="&mediaHideControls.label;"
accesskey="&mediaHideControls.accesskey;"
oncommand="gContextMenu.mediaCommand('hidecontrols');"/>
<menuitem id="context-video-fullscreen"
accesskey="&videoFullScreen.accesskey;"
label="&videoFullScreen.label;"
oncommand="gContextMenu.fullScreenVideo();"/>
<menuseparator id="context-media-sep-commands"/>
<menuitem id="context-reloadimage"
label="&reloadImageCmd.label;"

View File

@ -40,7 +40,7 @@
style="border:0px;padding:0px;margin:0px;-moz-appearance:none">
<menu id="file-menu" label="&fileMenu.label;"
accesskey="&fileMenu.accesskey;">
<menupopup id="menu_FilePopup" onpopupshowing="getContentAreaFrameCount();">
<menupopup id="menu_FilePopup">
<menuitem id="menu_newNavigator"
label="&newNavigatorCmd.label;"
accesskey="&newNavigatorCmd.accesskey;"
@ -78,11 +78,6 @@
accesskey="&savePageCmd.accesskey;"
key="key_savePage"
command="Browser:SavePage"/>
<menuitem id="menu_saveFrame"
label="&saveFrameCmd.label;"
accesskey="&saveFrameCmd.accesskey;"
command="Browser:SaveFrame"
hidden="true"/>
<menuitem id="menu_sendLink"
label="&sendPageCmd.label;"
accesskey="&sendPageCmd.accesskey;"

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

@ -59,7 +59,6 @@
<command id="cmd_newNavigatorTab" oncommand="BrowserOpenTab();"/>
<command id="Browser:OpenFile" oncommand="BrowserOpenFileWindow();"/>
<command id="Browser:SavePage" oncommand="saveDocument(window.content.document);"/>
<command id="Browser:SaveFrame" oncommand="saveFrameDocument();"/>
<command id="Browser:SendLink"
oncommand="MailIntegration.sendLinkForWindow(window.content);"/>

View File

@ -17,7 +17,7 @@ toolbarpaletteitem[place="palette"] > toolbaritem > hbox[type="places"] {
display: none;
}
#main-window[lwtheme="true"] {
#main-window:-moz-lwtheme {
background-repeat: no-repeat;
background-position: top right;
}
@ -71,6 +71,8 @@ toolbarpaletteitem[place="palette"] > toolbaritem > hbox[type="places"] {
}
/* ::::: Unified Back-/Forward Button ::::: */
#back-button > dropmarker,
#forward-button > dropmarker,
#back-forward-dropmarker > image ,
#back-forward-dropmarker > label {
display: none;

View File

@ -83,10 +83,6 @@ var gContextMenu = null;
var gAutoHideTabbarPrefListener = null;
var gBookmarkAllTabsHandler = null;
#ifdef XP_MACOSX
var gClickAndHoldTimer = null;
#endif
#ifndef XP_MACOSX
var gEditUIVisible = true;
#endif
@ -151,19 +147,6 @@ function pageShowEventHandlers(event) {
}
}
/**
* Determine whether or not the content area is displaying a page with frames,
* and if so, toggle the display of the 'save frame as' menu item.
**/
function getContentAreaFrameCount()
{
var saveFrameItem = document.getElementById("menu_saveFrame");
if (!content || !content.frames.length || !isContentFrame(document.commandDispatcher.focusedWindow))
saveFrameItem.setAttribute("hidden", "true");
else
saveFrameItem.removeAttribute("hidden");
}
function UpdateBackForwardCommands(aWebNavigation) {
var backBroadcaster = document.getElementById("Browser:Back");
var forwardBroadcaster = document.getElementById("Browser:Forward");
@ -195,50 +178,47 @@ function UpdateBackForwardCommands(aWebNavigation) {
* Click-and-Hold implementation for the Back and Forward buttons
* XXXmano: should this live in toolbarbutton.xml?
*/
function ClickAndHoldMouseDownCallback(aButton) {
aButton.open = true;
gClickAndHoldTimer = null;
}
function SetClickAndHoldHandlers() {
var timer;
function ClickAndHoldMouseDown(aEvent) {
/**
* 1. Only left click starts the click and hold timer.
* 2. Exclude the dropmarker area. This is done by excluding
* elements which target their events directly to the toolbarbutton
* element, i.e. when the nearest-parent-element which allows-events
* is the toolbarbutton element itself.
* 3. Do not start the click-and-hold timer if the toolbarbutton is disabled.
*/
function timerCallback(aButton) {
aButton.firstChild.hidden = false;
aButton.open = true;
timer = null;
}
function mousedownHandler(aEvent) {
if (aEvent.button != 0 ||
aEvent.originalTarget == aEvent.currentTarget ||
aEvent.currentTarget.open ||
aEvent.currentTarget.disabled)
return;
gClickAndHoldTimer =
setTimeout(ClickAndHoldMouseDownCallback, 500, aEvent.currentTarget);
}
// Prevent the menupopup from opening immediately
aEvent.currentTarget.firstChild.hidden = true;
function MayStopClickAndHoldTimer(aEvent) {
// Note passing null here is a no-op
clearTimeout(gClickAndHoldTimer);
}
timer = setTimeout(timerCallback, 500, aEvent.currentTarget);
}
function ClickAndHoldStopEvent(aEvent) {
if (aEvent.originalTarget.localName != "menuitem" &&
aEvent.currentTarget.open)
aEvent.stopPropagation();
}
function clickHandler(aEvent) {
if (aEvent.button == 0 &&
aEvent.target == aEvent.currentTarget &&
!aEvent.currentTarget.open &&
!aEvent.currentTarget.disabled)
aEvent.currentTarget.doCommand();
}
function stopTimer(aEvent) {
if (timer) {
clearTimeout(timer);
timer = null;
}
}
function SetClickAndHoldHandlers() {
function _addClickAndHoldListenersOnElement(aElm) {
aElm.addEventListener("mousedown", ClickAndHoldMouseDown, false);
aElm.addEventListener("mouseup", MayStopClickAndHoldTimer, false);
aElm.addEventListener("mouseout", MayStopClickAndHoldTimer, false);
// don't propagate onclick and oncommand events after
// click-and-hold opened the drop-down menu
aElm.addEventListener("command", ClickAndHoldStopEvent, true);
aElm.addEventListener("click", ClickAndHoldStopEvent, true);
aElm.addEventListener("mousedown", mousedownHandler, true);
aElm.addEventListener("mouseup", stopTimer, false);
aElm.addEventListener("mouseout", stopTimer, false);
aElm.addEventListener("click", clickHandler, true);
}
// Bug 414797: Clone the dropmarker's menu into both the back and
@ -248,12 +228,12 @@ function SetClickAndHoldHandlers() {
var popup = document.getElementById("back-forward-dropmarker")
.firstChild.cloneNode(true);
var backButton = document.getElementById("back-button");
backButton.setAttribute("type", "menu-button");
backButton.setAttribute("type", "menu");
backButton.appendChild(popup);
_addClickAndHoldListenersOnElement(backButton);
var forwardButton = document.getElementById("forward-button");
popup = popup.cloneNode(true);
forwardButton.setAttribute("type", "menu-button");
forwardButton.setAttribute("type", "menu");
forwardButton.appendChild(popup);
_addClickAndHoldListenersOnElement(forwardButton);
unifiedButton._clickHandlersAttached = true;
@ -1094,6 +1074,7 @@ function prepareForStartup() {
// binding can't fire trusted ones (runs with page privileges).
gBrowser.addEventListener("PluginNotFound", gMissingPluginInstaller.newMissingPlugin, true, true);
gBrowser.addEventListener("PluginBlocklisted", gMissingPluginInstaller.newMissingPlugin, true, true);
gBrowser.addEventListener("PluginOutdated", gMissingPluginInstaller.newMissingPlugin, true, true);
gBrowser.addEventListener("PluginDisabled", gMissingPluginInstaller.newDisabledPlugin, true, true);
gBrowser.addEventListener("NewPluginInstalled", gMissingPluginInstaller.refreshBrowser, false);
gBrowser.addEventListener("NewTab", BrowserOpenTab, false);
@ -1757,15 +1738,22 @@ function loadOneOrMoreURIs(aURIString)
}
}
function openLocation() {
function focusAndSelectUrlBar() {
if (gURLBar && !gURLBar.readOnly) {
if (window.fullScreen)
FullScreen.mouseoverToggle(true);
if (gURLBar && isElementVisible(gURLBar) && !gURLBar.readOnly) {
if (isElementVisible(gURLBar)) {
gURLBar.focus();
gURLBar.select();
return;
return true;
}
}
return false;
}
function openLocation() {
if (focusAndSelectUrlBar())
return;
#ifdef XP_MACOSX
if (window.location.href != getBrowserURL()) {
@ -1803,8 +1791,7 @@ function BrowserOpenTab()
return;
}
gBrowser.loadOneTab("about:blank", {inBackground: false});
if (gURLBar)
gURLBar.focus();
focusAndSelectUrlBar();
}
/* Called from the openLocation dialog. This allows that dialog to instruct
@ -2381,14 +2368,12 @@ function BrowserOnCommand(event) {
// This is the "Why is this site blocked" button. For malware,
// we can fetch a site-specific report, for phishing, we redirect
// to the generic page describing phishing protection.
var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter);
if (isMalware) {
// Get the stop badware "why is this blocked" report url,
// append the current url, and go there.
try {
var reportURL = formatter.formatURLPref("browser.safebrowsing.malware.reportURL");
let reportURL = formatURL("browser.safebrowsing.malware.reportURL", true);
reportURL += errorDoc.location.href;
content.location = reportURL;
} catch (e) {
@ -2397,7 +2382,7 @@ function BrowserOnCommand(event) {
}
else { // It's a phishing site, not malware
try {
content.location = formatter.formatURLPref("browser.safebrowsing.warning.infoURL");
content.location = formatURL("browser.safebrowsing.warning.infoURL", true);
} catch (e) {
Components.utils.reportError("Couldn't get phishing info URL: " + e);
}
@ -5770,14 +5755,6 @@ function BrowserOpenAddonsMgr(aPane)
window.openDialog(EMURL, "", EMFEATURES);
}
function escapeNameValuePair(aName, aValue, aIsFormUrlEncoded)
{
if (aIsFormUrlEncoded)
return escape(aName + "=" + aValue);
else
return escape(aName) + "=" + escape(aValue);
}
function AddKeywordForSearchField()
{
var node = document.popupNode;
@ -5805,6 +5782,13 @@ function AddKeywordForSearchField()
var el, type;
var formData = [];
function escapeNameValuePair(aName, aValue, aIsFormUrlEncoded) {
if (aIsFormUrlEncoded)
return escape(aName + "=" + aValue);
else
return escape(aName) + "=" + escape(aValue);
}
for (var i=0; i < node.form.elements.length; i++) {
el = node.form.elements[i];
@ -5919,16 +5903,18 @@ missingPluginInstaller.prototype.newMissingPlugin = function(aEvent){
// so don't stomp on the page developers toes.
if (aEvent.type != "PluginBlocklisted" &&
aEvent.type != "PluginOutdated" &&
!(aEvent.target instanceof HTMLObjectElement)) {
aEvent.target.addEventListener("click",
gMissingPluginInstaller.installSinglePlugin,
true);
}
try {
if (gPrefService.getBoolPref("plugins.hide_infobar_for_missing_plugin"))
let hideBarPrefName = aEvent.type == "PluginOutdated" ?
"plugins.hide_infobar_for_outdated_plugin" :
"plugins.hide_infobar_for_missing_plugin";
if (gPrefService.getBoolPref(hideBarPrefName))
return;
} catch (ex) {} // if the pref is missing, treat it as false, which shows the infobar
var browser = gBrowser.getBrowserForDocument(aEvent.target.ownerDocument
.defaultView.top.document);
@ -5941,14 +5927,40 @@ missingPluginInstaller.prototype.newMissingPlugin = function(aEvent){
var notificationBox = gBrowser.getNotificationBox(browser);
// If there is already a missing plugin notification then do nothing
if (notificationBox.getNotificationWithValue("missing-plugins"))
// Should only display one of these warnings per page.
// In order of priority, they are: outdated > missing > blocklisted
// If there is already an outdated plugin notification then do nothing
if (notificationBox.getNotificationWithValue("outdated-plugins"))
return;
var blockedNotification = notificationBox.getNotificationWithValue("blocked-plugins");
var missingNotification = notificationBox.getNotificationWithValue("missing-plugins");
var priority = notificationBox.PRIORITY_WARNING_MEDIUM;
function showBlocklistInfo() {
var url = formatURL("extensions.blocklist.detailsURL", true);
gBrowser.loadOneTab(url, {inBackground: false});
return true;
}
function showOutdatedPluginsInfo() {
var url = formatURL("plugins.update.url", true);
gBrowser.loadOneTab(url, {inBackground: false});
return true;
}
function showPluginsMissing() {
// get the urls of missing plugins
var missingPluginsArray = gBrowser.selectedBrowser.missingPlugins;
if (missingPluginsArray) {
window.openDialog("chrome://mozapps/content/plugins/pluginInstallerWizard.xul",
"PFSWindow", "chrome,centerscreen,resizable=yes",
{plugins: missingPluginsArray, browser: gBrowser.selectedBrowser});
}
}
if (aEvent.type == "PluginBlocklisted") {
if (blockedNotification)
if (blockedNotification || missingNotification)
return;
let iconURL = "chrome://mozapps/skin/plugins/pluginBlocked-16.png";
@ -5957,19 +5969,41 @@ missingPluginInstaller.prototype.newMissingPlugin = function(aEvent){
label: gNavigatorBundle.getString("blockedpluginsMessage.infoButton.label"),
accessKey: gNavigatorBundle.getString("blockedpluginsMessage.infoButton.accesskey"),
popup: null,
callback: blocklistInfo
callback: showBlocklistInfo
}, {
label: gNavigatorBundle.getString("blockedpluginsMessage.searchButton.label"),
accessKey: gNavigatorBundle.getString("blockedpluginsMessage.searchButton.accesskey"),
popup: null,
callback: pluginsMissing
callback: showOutdatedPluginsInfo
}];
notificationBox.appendNotification(messageString, "blocked-plugins",
iconURL, priority, buttons);
}
else if (aEvent.type == "PluginOutdated") {
// Cancel any notification about blocklisting/missing plugins
if (blockedNotification)
blockedNotification.close();
if (missingNotification)
missingNotification.close();
let iconURL = "chrome://mozapps/skin/plugins/pluginOutdated-16.png";
let messageString = gNavigatorBundle.getString("outdatedpluginsMessage.title");
let buttons = [{
label: gNavigatorBundle.getString("outdatedpluginsMessage.updateButton.label"),
accessKey: gNavigatorBundle.getString("outdatedpluginsMessage.updateButton.accesskey"),
popup: null,
callback: showOutdatedPluginsInfo
}];
notificationBox.appendNotification(messageString, "outdated-plugins",
iconURL, priority, buttons);
}
else if (aEvent.type == "PluginNotFound") {
// Cancel any notification about blocklisting
if (missingNotification)
return;
// Cancel any notification about blocklisting plugins
if (blockedNotification)
blockedNotification.close();
@ -5979,7 +6013,7 @@ missingPluginInstaller.prototype.newMissingPlugin = function(aEvent){
label: gNavigatorBundle.getString("missingpluginsMessage.button.label"),
accessKey: gNavigatorBundle.getString("missingpluginsMessage.button.accesskey"),
popup: null,
callback: pluginsMissing
callback: showPluginsMissing
}];
notificationBox.appendNotification(messageString, "missing-plugins",
@ -6014,26 +6048,6 @@ missingPluginInstaller.prototype.refreshBrowser = function(aEvent) {
browser.reload();
}
function blocklistInfo()
{
var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter);
var url = formatter.formatURLPref("extensions.blocklist.detailsURL");
gBrowser.loadOneTab(url, {inBackground: false});
return true;
}
function pluginsMissing()
{
// get the urls of missing plugins
var missingPluginsArray = gBrowser.selectedBrowser.missingPlugins;
if (missingPluginsArray) {
window.openDialog("chrome://mozapps/content/plugins/pluginInstallerWizard.xul",
"PFSWindow", "chrome,centerscreen,resizable=yes",
{plugins: missingPluginsArray, browser: gBrowser.selectedBrowser});
}
}
var gMissingPluginInstaller = new missingPluginInstaller();
function convertFromUnicode(charset, str)

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

@ -0,0 +1,203 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<!--
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is the Mozilla Foundation.
# Portions created by the Initial Developer are Copyright (C) 2008
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Dão Gottwald <dao@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
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# 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 *****
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css"><![CDATA[
html,
body,
video {
height: 100%;
}
body {
margin: 0;
background: black;
overflow: -moz-hidden-unscrollable;
}
body.userIdle {
cursor: none;
}
video {
width: 100%;
max-height: 100%;
}
body.loadingdata > video,
body.loadingdata > #close,
body.userIdle > #close {
visibility: hidden;
}
]]></style>
<link href="chrome://browser/skin/fullscreen-video.css"
rel="stylesheet" type="text/css"/>
<script type="application/javascript"><![CDATA[
var contentVideo = window.arguments[0];
var video;
var title = (contentVideo.currentSrc || contentVideo.src).replace(/^.*\//, "");
try {
title = decodeURI(title);
} catch (e) {}
document.title = title;
window.addEventListener("focus", function () {
window.removeEventListener("focus", arguments.callee, false);
window.fullScreen = true;
video = document.querySelector("video");
video.addEventListener("loadeddata", function () {
video.removeEventListener("loadeddata", arguments.callee, false);
video.volume = contentVideo.volume;
video.muted = contentVideo.muted;
video.poster = contentVideo.poster;
if (contentVideo.currentTime && !contentVideo.ended) {
video.addEventListener("seeked", function () {
video.removeEventListener("seeked", arguments.callee, false);
playbackStarts();
}, false);
video.currentTime = contentVideo.currentTime;
} else {
playbackStarts();
}
video.controls = true;
video.play();
}, false);
// Automatically close this window when the playback ended, unless the user
// interacted with it.
video.addEventListener("ended", autoClose, false);
window.addEventListener("click", cancelAutoClose, false);
window.addEventListener("keypress", cancelAutoClose, false);
video.addEventListener("playing", hideUI, false);
video.addEventListener("seeked", hideUI, false);
video.addEventListener("seeking", showUI, false);
video.addEventListener("pause", showUI, false);
video.addEventListener("ended", showUI, false);
window.addEventListener("mousemove", function () {
showUI();
resetIdleTimer();
}, false);
video.mozLoadFrom(contentVideo);
}, false);
window.addEventListener("unload", function () {
if (video.currentSrc) {
contentVideo.currentTime = video.currentTime;
contentVideo.volume = video.volume;
contentVideo.muted = video.muted;
if (!video.paused && !video.ended) {
video.pause();
contentVideo.play();
}
}
}, false);
window.addEventListener("keypress", function (event) {
if (event.keyCode == event.DOM_VK_ESCAPE) {
window.close();
return;
}
resetIdleTimer();
if (!video.controls &&
String.fromCharCode(event.charCode) == " ")
video.pause();
}, false);
function playbackStarts() {
// Loading the data from the content video may take a second or two. We hide
// the video during that period.
document.body.classList.remove("loadingdata");
video.focus();
}
function autoClose() {
window.close();
}
function cancelAutoClose() {
video.removeEventListener("ended", autoClose, false);
window.removeEventListener("click", cancelAutoClose, false);
window.removeEventListener("keypress", cancelAutoClose, false);
}
var idleTimer;
function resetIdleTimer() {
if (idleTimer) {
clearTimeout(idleTimer);
idleTimer = 0;
}
idleTimer = setTimeout(function () {
idleTimer = 0;
hideUI();
}, 2000);
}
function showUI() {
if (!video.controls) {
document.body.classList.remove("userIdle");
video.controls = true;
}
}
function hideUI() {
if (!video.paused && !video.ended && !video.seeking && !video.error) {
document.body.classList.add("userIdle");
video.controls = false;
}
}
]]></script>
</head>
<body class="loadingdata">
<span id="close" onclick="window.close();"/>
<video/>
</body>
</html>

View File

@ -414,8 +414,9 @@ nsContextMenu.prototype = {
this.showItem("context-media-pause", onMedia && !this.target.paused && !this.target.ended);
this.showItem("context-media-mute", onMedia && !this.target.muted);
this.showItem("context-media-unmute", onMedia && this.target.muted);
this.showItem("context-media-showcontrols", onMedia && !this.target.controls)
this.showItem("context-media-hidecontrols", onMedia && this.target.controls)
this.showItem("context-media-showcontrols", onMedia && !this.target.controls);
this.showItem("context-media-hidecontrols", onMedia && this.target.controls);
this.showItem("context-video-fullscreen", this.onVideo);
// Disable them when there isn't a valid media source loaded.
if (onMedia) {
var hasError = (this.target.error != null);
@ -425,6 +426,8 @@ nsContextMenu.prototype = {
this.setItemAttr("context-media-unmute", "disabled", hasError);
this.setItemAttr("context-media-showcontrols", "disabled", hasError);
this.setItemAttr("context-media-hidecontrols", "disabled", hasError);
if (this.onVideo)
this.setItemAttr("context-video-fullscreen", "disabled", hasError);
}
this.showItem("context-media-sep-commands", onMedia);
},
@ -803,6 +806,13 @@ nsContextMenu.prototype = {
openUILink(viewURL, e, null, null, null, null, doc.documentURIObject );
},
fullScreenVideo: function () {
this.target.pause();
openDialog("chrome://browser/content/fullscreen-video.xhtml",
"", "chrome,dialog=no", this.target);
},
// Change current window to the URL of the background image.
viewBGImage: function(e) {
urlSecurityCheck(this.bgImageURL,
@ -1370,17 +1380,11 @@ nsContextMenu.prototype = {
if (itemId == -1) {
var title = doc.title;
var description = PlacesUIUtils.getDescriptionFromDocument(doc);
var descAnno = { name: DESCRIPTION_ANNO, value: description };
var txn = PlacesUIUtils.ptm.createItem(uri,
PlacesUtils.bookmarksMenuFolderId,
-1, title, null, [descAnno]);
PlacesUIUtils.ptm.doTransaction(txn);
itemId = PlacesUtils.getMostRecentBookmarkForURI(uri);
StarUI.beginBatch();
PlacesUIUtils.showMinimalAddBookmarkUI(uri, title, description);
}
window.top.StarUI.showEditBookmarkPopup(itemId, this.browser, "overlap");
else
PlacesUIUtils.showItemProperties(itemId,
PlacesUtils.bookmarks.TYPE_BOOKMARK);
},
savePageAs: function CM_savePageAs() {

View File

@ -305,6 +305,14 @@
// count of open requests (should always be 0 or 1)
mRequestCount: 0,
destroy: function () {
this._cancelStalledTimer();
this.mTab.removeAttribute("stalled");
delete this.mTab;
delete this.mBrowser;
delete this.mTabBrowser;
},
onProgressChange : function (aWebProgress, aRequest,
aCurSelfProgress, aMaxSelfProgress,
aCurTotalProgress, aMaxTotalProgress)
@ -314,6 +322,16 @@
if (this.mBlank)
return;
if (this.mTotalProgress) {
const STATES = 8;
let state = Math.ceil(STATES * this.mTotalProgress);
if (state != this.mTab.getAttribute("progress")) {
this.mTab.setAttribute("progress", state);
this.mTab.removeAttribute("stalled");
this._startStalledTimer();
}
}
if (this.mTabBrowser.mCurrentTab == this.mTab) {
for (let i = 0; i < this.mTabBrowser.mProgressListeners.length; i++) {
let p = this.mTabBrowser.mProgressListeners[i];
@ -393,6 +411,7 @@
if (!this.mBlank) {
if (!(aStateFlags & nsIWebProgressListener.STATE_RESTORING)) {
this.mTab.setAttribute("busy", "true");
this._startStalledTimer();
this.mTabBrowser.updateIcon(this.mTab);
this.mTabBrowser.setTabTitleLoading(this.mTab);
}
@ -419,6 +438,9 @@
this.mBlank = false;
this.mTab.removeAttribute("busy");
this.mTab.removeAttribute("progress");
this.mTab.removeAttribute("stalled");
this._cancelStalledTimer();
this.mTabBrowser.updateIcon(this.mTab);
var location = aRequest.QueryInterface(nsIChannel).URI;
@ -613,6 +635,20 @@
aIID.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;
},
_startStalledTimer: function () {
this._cancelStalledTimer();
this._stalledTimer = setTimeout(function (self) {
self.mTab.setAttribute("stalled", "true");
}, 700, this);
},
_cancelStalledTimer: function () {
if (this._stalledTimer) {
clearTimeout(this._stalledTimer);
this._stalledTimer = 0;
}
}
});
]]>
@ -1496,6 +1532,7 @@
const filter = this.mTabFilters[aTab._tPos];
browser.webProgress.removeProgressListener(filter);
filter.removeProgressListener(this.mTabListeners[aTab._tPos]);
this.mTabListeners[aTab._tPos].destroy();
// Remove our title change and blocking listeners
browser.removeEventListener("DOMTitleChanged", this.onTitleChanged, true);
@ -1539,8 +1576,8 @@
while (this._removingTabs.length)
this._endRemoveTab([this._removingTabs[0], false]);
} else if (!this._windowIsClosing) {
if (aNewTab && gURLBar)
gURLBar.focus();
if (aNewTab)
focusAndSelectUrlBar();
// workaround for bug 345399
this.tabContainer.mTabstrip._updateScrollButtonsDisabledState();
@ -2736,6 +2773,7 @@
this.getBrowserAtIndex(i).webProgress.removeProgressListener(this.mTabFilters[i]);
this.mTabFilters[i].removeProgressListener(this.mTabListeners[i]);
this.mTabFilters[i] = null;
this.mTabListeners[i].destroy();
this.mTabListeners[i] = null;
this.getBrowserAtIndex(i).removeEventListener("DOMTitleChanged", this.onTitleChanged, true);
}

View File

@ -138,6 +138,7 @@ _BROWSER_FILES = \
browser_bug304198.js \
browser_drag.js \
browser_relatedTabs.js \
browser_contextSearchTabPosition.js \
$(NULL)
ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))

View File

@ -11,15 +11,14 @@
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is HTML Parser C++ Translator code.
* The Original Code is browser test code.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* John Morkel <jmorkel@gmail.com>.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Henri Sivonen <hsivonen@iki.fi>
*
* 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
@ -35,36 +34,25 @@
*
* ***** END LICENSE BLOCK ***** */
package nu.validator.htmlparser.cpptranslate;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class GkAtomParser {
private static final Pattern ATOM = Pattern.compile("^GK_ATOM\\(([^,]+),\\s*\"([^\"]*)\"\\).*$");
private final BufferedReader reader;
public GkAtomParser(Reader reader) {
this.reader = new BufferedReader(reader);
function test() {
function tabAdded(event) {
let tab = event.target;
tabs.push(tab);
}
public Map<String, String> parse() throws IOException {
Map<String, String> map = new HashMap<String, String>();
String line;
while((line = reader.readLine()) != null) {
Matcher m = ATOM.matcher(line);
if (m.matches()) {
map.put(m.group(2), m.group(1));
}
}
return map;
}
let tabs = [];
let container = gBrowser.tabContainer;
container.addEventListener("TabOpen", tabAdded, false);
gBrowser.addTab("about:blank");
BrowserSearch.loadSearch("mozilla", true);
BrowserSearch.loadSearch("firefox", true);
is(tabs[0], gBrowser.mTabs[3], "blank tab has been pushed to the end");
is(tabs[1], gBrowser.mTabs[1], "first search tab opens next to the current tab");
is(tabs[2], gBrowser.mTabs[2], "second search tab opens next to the first search tab");
container.removeEventListener("TabOpen", tabAdded, false);
tabs.forEach(gBrowser.removeTab, gBrowser);
}

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

@ -28,7 +28,7 @@ function openContextMenuFor(element) {
// Context menu should be closed before we open it again.
is(contextMenu.state, "closed", "checking if popup is closed");
var eventDetails = { type : "contextmenu", button : 2 }
var eventDetails = { type : "contextmenu", button : 2 };
synthesizeMouse(element, 2, 2, eventDetails, element.ownerDocument.defaultView);
}
@ -54,7 +54,7 @@ function getVisibleMenuItems(aMenu) {
if (accessKeys[key])
ok(false, "menuitem " + item.id + " has same accesskey as " + accessKeys[key]);
else
accessKeys[key] = item.id
accessKeys[key] = item.id;
items.push(item.id);
items.push(!item.disabled);
} else if (item.nodeName == "menuseparator") {
@ -67,7 +67,7 @@ function getVisibleMenuItems(aMenu) {
if (accessKeys[key])
ok(false, "menu " + item.id + " has same accesskey as " + accessKeys[key]);
else
accessKeys[key] = item.id
accessKeys[key] = item.id;
items.push(item.id);
items.push(!item.disabled);
// Add a dummy item to that the indexes in checkMenu are the same
@ -161,7 +161,7 @@ function runTest(testNum) {
"---", null,
"context-viewsource", true,
"context-viewinfo", true]);
closeContextMenu()
closeContextMenu();
openContextMenuFor(link); // Invoke context menu for next test.
break;
@ -174,14 +174,14 @@ function runTest(testNum) {
"context-savelink", true,
"context-sendlink", true,
"context-copylink", true]);
closeContextMenu()
closeContextMenu();
openContextMenuFor(mailto); // Invoke context menu for next test.
break;
case 4:
// Context menu for text mailto-link
checkContextMenu(["context-copyemail", true]);
closeContextMenu()
closeContextMenu();
openContextMenuFor(input); // Invoke context menu for next test.
break;
@ -197,7 +197,7 @@ function runTest(testNum) {
"context-selectall", true,
"---", null,
"spell-check-enabled", true]);
closeContextMenu()
closeContextMenu();
openContextMenuFor(img); // Invoke context menu for next test.
break;
@ -230,6 +230,7 @@ function runTest(testNum) {
checkContextMenu(["context-media-play", true,
"context-media-mute", true,
"context-media-showcontrols", true,
"context-video-fullscreen", true,
"---", null,
"context-viewvideo", true,
"context-copyvideourl", true,
@ -245,6 +246,7 @@ function runTest(testNum) {
checkContextMenu(["context-media-play", false,
"context-media-mute", false,
"context-media-showcontrols", false,
"context-video-fullscreen", false,
"---", null,
"context-viewvideo", true,
"context-copyvideourl", true,
@ -260,6 +262,7 @@ function runTest(testNum) {
checkContextMenu(["context-media-play", false,
"context-media-mute", false,
"context-media-showcontrols", false,
"context-video-fullscreen", false,
"---", null,
"context-viewvideo", false,
"context-copyvideourl", false,

View File

@ -431,6 +431,15 @@ function openReleaseNotes()
openUILinkIn(relnotesURL, "tab");
}
/**
* Opens the troubleshooting information (about:support) page for this version
* of the application.
*/
function openTroubleshootingPage()
{
openUILinkIn("about:support", "tab");
}
#ifdef MOZ_UPDATER
/**
* Opens the update manager and checks for updates to the application.

View File

@ -18,11 +18,13 @@ browser.jar:
content/browser/aboutRobots-icon-rtl.png (content/aboutRobots-icon-rtl.png)
content/browser/aboutRobots-widget-left.png (content/aboutRobots-widget-left.png)
content/browser/aboutRobots-widget-right.png (content/aboutRobots-widget-right.png)
* content/browser/aboutSupport.xhtml (content/aboutSupport.xhtml)
* content/browser/browser.css (content/browser.css)
* content/browser/browser.js (content/browser.js)
* content/browser/browser.xul (content/browser.xul)
* content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml)
* content/browser/credits.xhtml (content/credits.xhtml)
* content/browser/fullscreen-video.xhtml (content/fullscreen-video.xhtml)
* content/browser/pageinfo/pageInfo.xul (content/pageinfo/pageInfo.xul)
* content/browser/pageinfo/pageInfo.js (content/pageinfo/pageInfo.js)
* content/browser/pageinfo/pageInfo.css (content/pageinfo/pageInfo.css)

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",
@ -92,7 +92,9 @@ static RedirEntry kRedirMap[] = {
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::ALLOW_SCRIPT },
{ "sessionrestore", "chrome://browser/content/aboutSessionRestore.xhtml",
nsIAboutModule::ALLOW_SCRIPT }
nsIAboutModule::ALLOW_SCRIPT },
{ "support", "chrome://browser/content/aboutSupport.xhtml",
nsIAboutModule::ALLOW_SCRIPT },
};
static const int kRedirTotal = NS_ARRAY_LENGTH(kRedirMap);

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

@ -187,6 +187,11 @@ static const nsModuleComponentInfo components[] =
NS_ABOUT_MODULE_CONTRACTID_PREFIX "sessionrestore",
AboutRedirector::Create },
{ "about:support",
NS_BROWSER_ABOUT_REDIRECTOR_CID,
NS_ABOUT_MODULE_CONTRACTID_PREFIX "support",
AboutRedirector::Create },
#ifndef WINCE
{ "Profile Migrator",

View File

@ -44,9 +44,7 @@ include $(DEPTH)/config/autoconf.mk
MODULE = browsercomps
LIBRARY_NAME = browserdirprovider
ifeq (,$(filter WINNT WINCE,$(OS_ARCH)))
SHORT_LIBNAME = brwsrdir
endif
IS_COMPONENT = 1
MODULE_NAME = BrowserDirProvider
FORCE_SHARED_LIB = 1
@ -57,7 +55,6 @@ ifndef MOZ_MEMORY
USE_STATIC_LIBS = 1
endif
CPPSRCS = nsBrowserDirectoryProvider.cpp
EXTRA_DSO_LDOPTS = \

View File

@ -19,6 +19,7 @@
*
* Contributor(s):
* Dan Mills <thunder@mozilla.com>
* Marco Bonardo <mak77@bonardo.net>
*
* 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
@ -41,87 +42,94 @@ const Cc = Components.classes;
const Cr = Components.results;
const Cu = Components.utils;
const DISTRIBUTION_CUSTOMIZATION_COMPLETE_TOPIC =
"distribution-customization-complete";
function DistributionCustomizer() {
this._distroDir = this._dirSvc.get("XCurProcD", Ci.nsIFile);
this._distroDir.append("distribution");
let iniFile = this._distroDir.clone();
iniFile.append("distribution.ini");
this._iniExists = iniFile.exists();
if (!this._iniExists)
return;
this._ini = Cc["@mozilla.org/xpcom/ini-parser-factory;1"].
getService(Ci.nsIINIParserFactory).createINIParser(iniFile);
this._prefs = this._prefSvc.getBranch(null);
this._locale = this._prefs.getCharPref("general.useragent.locale");
}
DistributionCustomizer.prototype = {
__bmSvc: null,
get _bmSvc() {
if (!this.__bmSvc)
this.__bmSvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Ci.nsINavBookmarksService);
return this.__bmSvc;
},
__annoSvc: null,
get _annoSvc() {
if (!this.__annoSvc)
this.__annoSvc = Cc["@mozilla.org/browser/annotation-service;1"].
getService(Ci.nsIAnnotationService);
return this.__annoSvc;
},
__livemarkSvc: null,
get _livemarkSvc() {
if (!this.__livemarkSvc)
this.__livemarkSvc = Cc["@mozilla.org/browser/livemark-service;2"].
getService(Ci.nsILivemarkService);
return this.__livemarkSvc;
},
__dirSvc: null,
get _dirSvc() {
if (!this.__dirSvc)
this.__dirSvc = Cc["@mozilla.org/file/directory_service;1"].
let dirSvc = Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIProperties);
return this.__dirSvc;
let iniFile = dirSvc.get("XCurProcD", Ci.nsIFile);
iniFile.append("distribution");
iniFile.append("distribution.ini");
if (iniFile.exists())
this._iniFile = iniFile;
}
DistributionCustomizer.prototype = {
_iniFile: null,
get _ini() {
let ini = Cc["@mozilla.org/xpcom/ini-parser-factory;1"].
getService(Ci.nsIINIParserFactory).
createINIParser(this._iniFile);
this.__defineGetter__("_ini", function() ini);
return this._ini;
},
get _locale() {
let locale;
try {
locale = this._prefs.getCharPref("general.useragent.locale");
}
catch (e) {
locale = "en-US";
}
this.__defineGetter__("_locale", function() locale);
return this._locale;
},
get _bmSvc() {
let svc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Ci.nsINavBookmarksService);
this.__defineGetter__("_bmSvc", function() svc);
return this._bmSvc;
},
get _annoSvc() {
let svc = Cc["@mozilla.org/browser/annotation-service;1"].
getService(Ci.nsIAnnotationService);
this.__defineGetter__("_annoSvc", function() svc);
return this._annoSvc;
},
get _livemarkSvc() {
let svc = Cc["@mozilla.org/browser/livemark-service;2"].
getService(Ci.nsILivemarkService);
this.__defineGetter__("_livemarkSvc", function() svc);
return this._livemarkSvc;
},
__prefSvc: null,
get _prefSvc() {
if (!this.__prefSvc)
this.__prefSvc = Cc["@mozilla.org/preferences-service;1"].
let svc = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefService);
return this.__prefSvc;
this.__defineGetter__("_prefSvc", function() svc);
return this._prefSvc;
},
__iosvc: null,
get _iosvc() {
if (!this.__iosvc)
this.__iosvc = Cc["@mozilla.org/network/io-service;1"].
get _prefs() {
let branch = this._prefSvc.getBranch(null);
this.__defineGetter__("_prefs", function() branch);
return this._prefs;
},
get _ioSvc() {
let svc = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
return this.__iosvc;
this.__defineGetter__("_ioSvc", function() svc);
return this._ioSvc;
},
_locale: "en-US",
_distroDir: null,
_iniExists: false,
_ini: null,
_makeURI: function DIST__makeURI(spec) {
return this._iosvc.newURI(spec, null, null);
return this._ioSvc.newURI(spec, null, null);
},
_parseBookmarksSection: function DIST_parseBookmarksSection(parentId, section) {
_parseBookmarksSection:
function DIST_parseBookmarksSection(parentId, section) {
let keys = [];
for (let i in enumerate(this._ini.getKeys(section)))
keys.push(i);
keys.sort();
let items = {};
let defaultItemId = -1;
let maxItemId = -1;
@ -158,7 +166,7 @@ DistributionCustomizer.prototype = {
if (!items[iid])
continue;
let index = -1;
let index = this._bmSvc.DEFAULT_INDEX;
let newId;
switch (items[iid]["type"]) {
@ -175,7 +183,8 @@ DistributionCustomizer.prototype = {
items[iid]["folderId"]);
if (items[iid]["description"])
this._annoSvc.setItemAnnotation(newId, "bookmarkProperties/description",
this._annoSvc.setItemAnnotation(newId,
"bookmarkProperties/description",
items[iid]["description"], 0,
this._annoSvc.EXPIRE_NEVER);
@ -191,8 +200,9 @@ DistributionCustomizer.prototype = {
if (iid < defaultItemId)
index = prependIndex++;
// Don't bother updating the livemark contents on creation.
newId = this._livemarkSvc.
createLivemark(parentId,
createLivemarkFolderOnly(parentId,
items[iid]["title"],
this._makeURI(items[iid]["siteLink"]),
this._makeURI(items[iid]["feedLink"]),
@ -209,48 +219,61 @@ DistributionCustomizer.prototype = {
index, items[iid]["title"]);
if (items[iid]["description"])
this._annoSvc.setItemAnnotation(newId, "bookmarkProperties/description",
this._annoSvc.setItemAnnotation(newId,
"bookmarkProperties/description",
items[iid]["description"], 0,
this._annoSvc.EXPIRE_NEVER);
break;
}
}
return this._checkCustomizationComplete();
},
_customizationsApplied: false,
applyCustomizations: function DIST_applyCustomizations() {
if (!this._iniExists)
return;
this._customizationsApplied = true;
if (!this._iniFile)
return this._checkCustomizationComplete();
// nsPrefService loads very early. Reload prefs so we can set
// distribution defaults during the prefservice:after-app-defaults
// notification (see applyPrefDefaults below)
this._prefSvc.QueryInterface(Ci.nsIObserver);
this._prefSvc.observe(null, "reload-default-prefs", null);
},
_bookmarksApplied: false,
applyBookmarks: function DIST_applyBookarks() {
this._bookmarksApplied = true;
if (!this._iniFile)
return this._checkCustomizationComplete();
let sections = enumToObject(this._ini.getSections());
// The global section, and several of its fields, is required
// (we also check here to be consistent with applyPrefDefaults below)
if (!sections["Global"])
return;
return this._checkCustomizationComplete();
let globalPrefs = enumToObject(this._ini.getKeys("Global"));
if (!(globalPrefs["id"] && globalPrefs["version"] && globalPrefs["about"]))
return;
return this._checkCustomizationComplete();
let bmProcessed = false;
let bmProcessedPref;
try {
bmProcessedPref = this._ini.getString("Global",
"bookmarks.initialized.pref");
} catch (e) {
}
catch (e) {
bmProcessedPref = "distribution." +
this._ini.getString("Global", "id") + ".bookmarksProcessed";
}
let bmProcessed = false;
try {
bmProcessed = this._prefs.getBoolPref(bmProcessedPref);
} catch (e) {}
}
catch (e) {}
if (!bmProcessed) {
if (sections["BookmarksMenu"])
@ -261,19 +284,23 @@ DistributionCustomizer.prototype = {
"BookmarksToolbar");
this._prefs.setBoolPref(bmProcessedPref, true);
}
return this._checkCustomizationComplete();
},
_prefDefaultsApplied: false,
applyPrefDefaults: function DIST_applyPrefDefaults() {
if (!this._iniExists)
return;
this._prefDefaultsApplied = true;
if (!this._iniFile)
return this._checkCustomizationComplete();
let sections = enumToObject(this._ini.getSections());
// The global section, and several of its fields, is required
if (!sections["Global"])
return;
return this._checkCustomizationComplete();
let globalPrefs = enumToObject(this._ini.getKeys("Global"));
if (!(globalPrefs["id"] && globalPrefs["version"] && globalPrefs["about"]))
return;
return this._checkCustomizationComplete();
let defaults = this._prefSvc.getDefaultBranch(null);
@ -343,6 +370,18 @@ DistributionCustomizer.prototype = {
} catch (e) { /* ignore bad prefs and move on */ }
}
}
return this._checkCustomizationComplete();
},
_checkCustomizationComplete: function DIST__checkCustomizationComplete() {
let prefDefaultsApplied = this._prefDefaultsApplied || !this._iniFile;
if (this._customizationsApplied && this._bookmarksApplied &&
prefDefaultsApplied) {
let os = Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService);
os.notifyObservers(null, DISTRIBUTION_CUSTOMIZATION_COMPLETE_TOPIC, null);
}
}
};

View File

@ -37,6 +37,8 @@
#
# ***** END LICENSE BLOCK ***** */
Components.utils.import("resource://gre/modules/debug.js");
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
@ -684,5 +686,4 @@ function NSGetModule(cm, file) {
return Module;
}
#include ../../../../toolkit/content/debug.js
#include GenericFactory.js

View File

@ -940,5 +940,3 @@ function NSGetModule(cm, file) {
return XPCOMUtils.generateModule([WebContentConverterRegistrar]);
}
#include ../../../../toolkit/content/debug.js

View File

@ -69,8 +69,18 @@ const MAX_SUMMARY_LENGTH = 4096;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
__defineGetter__("NetUtil", function() {
delete this.NetUtil;
Cu.import("resource://gre/modules/NetUtil.jsm");
return NetUtil;
});
XPCOMUtils.defineLazyServiceGetter(this, "gObsSvc",
"@mozilla.org/observer-service;1",
"nsIObserverService");
function MicrosummaryService() {
this._obs.addObserver(this, "xpcom-shutdown", true);
gObsSvc.addObserver(this, "xpcom-shutdown", true);
this._ans.addObserver(this, false);
Cc["@mozilla.org/preferences-service;1"].
@ -100,32 +110,6 @@ MicrosummaryService.prototype = {
return this._ans;
},
// IO Service
get _ios() {
var svc = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
this.__defineGetter__("_ios", function() svc);
return this._ios;
},
// Observer Service
get _obs() {
var svc = Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService);
this.__defineGetter__("_obs", function() svc);
return this._obs;
},
/**
* Make a URI from a spec.
* @param spec
* The string spec of the URI.
* @returns An nsIURI object.
*/
_uri: function MSS__uri(spec) {
return this._ios.newURI(spec, null, null);
},
// Directory Locator
__dirs: null,
get _dirs() {
@ -202,7 +186,7 @@ MicrosummaryService.prototype = {
},
_destroy: function MSS__destroy() {
this._obs.removeObserver(this, "xpcom-shutdown", true);
gObsSvc.removeObserver(this, "xpcom-shutdown", true);
this._ans.removeObserver(this);
this._timer.cancel();
this._timer = null;
@ -263,7 +247,7 @@ MicrosummaryService.prototype = {
LOG("updated live title for " + bookmarkIdentity +
" from '" + (title == null ? "<no live title>" : title) +
"' to '" + microsummary.content + "'");
this._obs.notifyObservers(subject, "microsummary-livetitle-updated", title);
gObsSvc.notifyObservers(subject, "microsummary-livetitle-updated", title);
}
else {
LOG("didn't update live title for " + bookmarkIdentity + "; it hasn't changed");
@ -325,7 +309,7 @@ MicrosummaryService.prototype = {
*
*/
_cacheLocalGeneratorFile: function MSS__cacheLocalGeneratorFile(file) {
var uri = this._ios.newFileURI(file);
var uri = NetUtil.ioService.newFileURI(file);
var t = this;
var callback =
@ -433,7 +417,8 @@ MicrosummaryService.prototype = {
var file = this._dirs.get("UsrMicsumGens", Ci.nsIFile);
file.append(fileName);
file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, PERMS_FILE);
generator = new MicrosummaryGenerator(null, this._ios.newFileURI(file));
generator = new MicrosummaryGenerator(null,
NetUtil.ioService.newFileURI(file));
this._localGenerators[generatorID] = generator;
}
@ -444,7 +429,7 @@ MicrosummaryService.prototype = {
LOG("installed generator " + generatorID);
this._obs.notifyObservers(generator, topic, null);
gObsSvc.notifyObservers(generator, topic, null);
return generator;
},
@ -609,7 +594,7 @@ MicrosummaryService.prototype = {
return null;
var pageURI = this._bms.getBookmarkURI(bookmarkID);
var generatorURI = this._uri(this._ans.getItemAnnotation(bookmarkID,
var generatorURI = NetUtil.newURI(this._ans.getItemAnnotation(bookmarkID,
ANNO_MICSUM_GEN_URI));
var generator = this.getGenerator(generatorURI);
@ -741,7 +726,7 @@ MicrosummaryService.prototype = {
var pageURI = this._bms.getBookmarkURI(bookmarkID);
if (!pageURI)
throw("can't get URL for bookmark with ID " + bookmarkID);
var generatorURI = this._uri(this._ans.getItemAnnotation(bookmarkID,
var generatorURI = NetUtil.newURI(this._ans.getItemAnnotation(bookmarkID,
ANNO_MICSUM_GEN_URI));
var generator = this._localGenerators[generatorURI.spec] ||
@ -840,25 +825,6 @@ Microsummary.prototype = {
return this.__mss;
},
// IO Service
__ios: null,
get _ios() {
if (!this.__ios)
this.__ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
return this.__ios;
},
/**
* Make a URI from a spec.
* @param spec
* The string spec of the URI.
* @returns An nsIURI object.
*/
_uri: function MSS__uri(spec) {
return this._ios.newURI(spec, null, null);
},
// nsISupports
QueryInterface: XPCOMUtils.generateQI([Ci.nsIMicrosummary]),
@ -1061,7 +1027,7 @@ Microsummary.prototype = {
try {
// Extract the URI from which the generator was originally installed.
var sourceURL = this.generator.uri.path.replace(/^source:/, "");
var sourceURI = this._uri(sourceURL);
var sourceURI = NetUtil.newURI(sourceURL);
var resource = new MicrosummaryResource(sourceURI);
resource.load(loadCallback, errorCallback);
@ -1153,16 +1119,6 @@ function MicrosummaryGenerator(aURI, aLocalURI, aName) {
}
MicrosummaryGenerator.prototype = {
// IO Service
__ios: null,
get _ios() {
if (!this.__ios)
this.__ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
return this.__ios;
},
// nsISupports
QueryInterface: XPCOMUtils.generateQI([Ci.nsIMicrosummaryGenerator]),
@ -1267,7 +1223,7 @@ MicrosummaryGenerator.prototype = {
// We have to retrieve the URI from local generators via the "uri" attribute
// of its generator tag.
if (this.localURI && generatorNode.hasAttribute("uri"))
this._uri = this._ios.newURI(generatorNode.getAttribute("uri"), null, null);
this._uri = NetUtil.newURI(generatorNode.getAttribute("uri"), null, null);
function getFirstChildByTagName(tagName, parentNode, namespace) {
var nodeList = parentNode.getElementsByTagNameNS(namespace, tagName);
@ -1427,7 +1383,7 @@ MicrosummaryGenerator.prototype = {
var genURI = this.uri;
if (genURI && /^urn:source:/i.test(genURI.spec)) {
let genURL = genURI.spec.replace(/^urn:source:/, "");
genURI = this._ios.newURI(genURL, null, null);
genURI = NetUtil.newURI(genURL, null, null);
}
// Only continue if we have a valid remote URI
@ -1488,9 +1444,7 @@ MicrosummaryGenerator.prototype = {
this.saveXMLToFile(resource.content);
// Let observers know we've updated this generator
var obs = Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService);
obs.notifyObservers(this, "microsummary-generator-updated", null);
gObsSvc.notifyObservers(this, "microsummary-generator-updated", null);
}
};
@ -1509,15 +1463,6 @@ function MicrosummarySet() {
}
MicrosummarySet.prototype = {
// IO Service
__ios: null,
get _ios() {
if (!this.__ios)
this.__ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
return this.__ios;
},
QueryInterface: XPCOMUtils.generateQI([Ci.nsIMicrosummarySet,
Ci.nsIMicrosummaryObserver]),
@ -1591,8 +1536,7 @@ MicrosummarySet.prototype = {
// Unlike the "href" attribute, the "href" property contains
// an absolute URI spec, so we use it here to create the URI.
var generatorURI = this._ios.newURI(link.href,
resource.content.characterSet,
var generatorURI = NetUtil.newURI(link.href, resource.content.characterSet,
null);
if (!/^https?$/i.test(generatorURI.scheme)) {
@ -1738,15 +1682,6 @@ function MicrosummaryResource(uri) {
}
MicrosummaryResource.prototype = {
// IO Service
__ios: null,
get _ios() {
if (!this.__ios)
this.__ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
return this.__ios;
},
get uri() {
return this._uri;
},

View File

@ -52,13 +52,16 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource:///modules/distribution.js");
const PREF_EM_NEW_ADDONS_LIST = "extensions.newAddons";
const PREF_PLUGINS_NOTIFYUSER = "plugins.update.notifyUser";
const PREF_PLUGINS_UPDATEURL = "plugins.update.url";
// Check to see if bookmarks need backing up once per
// day on 1 hour idle.
const BOOKMARKS_ARCHIVE_IDLE_TIME = 60 * 60;
// Backup bookmarks once every 24 hours.
const BOOKMARKS_ARCHIVE_INTERVAL = 86400 * 1000;
// We try to backup bookmarks at idle times, to avoid doing that at shutdown.
// Number of idle seconds before trying to backup bookmarks. 15 minutes.
const BOOKMARKS_BACKUP_IDLE_TIME = 15 * 60;
// Minimum interval in milliseconds between backups.
const BOOKMARKS_BACKUP_INTERVAL = 86400 * 1000;
// Maximum number of backups to create. Old ones will be purged.
const BOOKMARKS_BACKUP_MAX_BACKUPS = 10;
// Factory object
const BrowserGlueServiceFactory = {
@ -76,28 +79,24 @@ const BrowserGlueServiceFactory = {
function BrowserGlue() {
this.__defineGetter__("_prefs", function() {
delete this._prefs;
return this._prefs = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch);
});
XPCOMUtils.defineLazyServiceGetter(this, "_prefs",
"@mozilla.org/preferences-service;1",
"nsIPrefBranch");
this.__defineGetter__("_bundleService", function() {
delete this._bundleService;
return this._bundleService = Cc["@mozilla.org/intl/stringbundle;1"].
getService(Ci.nsIStringBundleService);
});
XPCOMUtils.defineLazyServiceGetter(this, "_bundleService",
"@mozilla.org/intl/stringbundle;1",
"nsIStringBundleService");
this.__defineGetter__("_idleService", function() {
delete this._idleService;
return this._idleService = Cc["@mozilla.org/widget/idleservice;1"].
getService(Ci.nsIIdleService);
});
XPCOMUtils.defineLazyServiceGetter(this, "_idleService",
"@mozilla.org/widget/idleservice;1",
"nsIIdleService");
this.__defineGetter__("_observerService", function() {
delete this._observerService;
return this._observerService = Cc['@mozilla.org/observer-service;1'].
getService(Ci.nsIObserverService);
XPCOMUtils.defineLazyServiceGetter(this, "_observerService",
"@mozilla.org/observer-service;1",
"nsIObserverService");
XPCOMUtils.defineLazyGetter(this, "_distributionCustomizer", function() {
return new DistributionCustomizer();
});
this._init();
@ -112,6 +111,10 @@ function BrowserGlue() {
BrowserGlue.prototype = {
_saveSession: false,
_isIdleObserver: false,
_isPlacesInitObserver: false,
_isPlacesLockedObserver: false,
_isPlacesDatabaseLocked: false,
_setPrefToSaveSession: function()
{
@ -177,20 +180,31 @@ BrowserGlue.prototype = {
case "places-init-complete":
this._initPlaces();
this._observerService.removeObserver(this, "places-init-complete");
this._isPlacesInitObserver = false;
// no longer needed, since history was initialized completely.
this._observerService.removeObserver(this, "places-database-locked");
this._isPlacesLockedObserver = false;
// Now apply distribution customized bookmarks.
// This should always run after Places initialization.
this._distributionCustomizer.applyBookmarks();
break;
case "places-database-locked":
this._isPlacesDatabaseLocked = true;
// stop observing, so further attempts to load history service
// do not show the prompt.
this._observerService.removeObserver(this, "places-database-locked");
this._isPlacesLockedObserver = false;
break;
case "idle":
if (this._idleService.idleTime > BOOKMARKS_ARCHIVE_IDLE_TIME * 1000) {
// Back up bookmarks.
this._archiveBookmarks();
}
if (this._idleService.idleTime > BOOKMARKS_BACKUP_IDLE_TIME * 1000)
this._backupBookmarks();
break;
case "distribution-customization-complete":
this._observerService
.removeObserver(this, "distribution-customization-complete");
// Customization has finished, we don't need the customizer anymore.
delete this._distributionCustomizer;
break;
}
},
@ -213,7 +227,10 @@ BrowserGlue.prototype = {
#endif
osvr.addObserver(this, "session-save", false);
osvr.addObserver(this, "places-init-complete", false);
this._isPlacesInitObserver = true;
osvr.addObserver(this, "places-database-locked", false);
this._isPlacesLockedObserver = true;
osvr.addObserver(this, "distribution-customization-complete", false);
},
// cleanup (called on application shutdown)
@ -227,20 +244,25 @@ BrowserGlue.prototype = {
osvr.removeObserver(this, "sessionstore-windows-restored");
osvr.removeObserver(this, "browser:purge-session-history");
osvr.removeObserver(this, "quit-application-requested");
osvr.removeObserver(this, "quit-application-granted");
#ifdef OBSERVE_LASTWINDOW_CLOSE_TOPICS
osvr.removeObserver(this, "browser-lastwindow-close-requested");
osvr.removeObserver(this, "browser-lastwindow-close-granted");
#endif
osvr.removeObserver(this, "quit-application-granted");
osvr.removeObserver(this, "session-save");
if (this._isIdleObserver)
this._idleService.removeIdleObserver(this, BOOKMARKS_BACKUP_IDLE_TIME);
if (this._isPlacesInitObserver)
osvr.removeObserver(this, "places-init-complete");
if (this._isPlacesLockedObserver)
osvr.removeObserver(this, "places-database-locked");
},
_onAppDefaults: function()
{
// apply distribution customizations (prefs)
// other customizations are applied in _onProfileStartup()
var distro = new DistributionCustomizer();
distro.applyPrefDefaults();
this._distributionCustomizer.applyPrefDefaults();
},
// profile startup handler (contains profile initialization routines)
@ -259,8 +281,7 @@ BrowserGlue.prototype = {
// apply distribution customizations
// prefs are applied in _onAppDefaults()
var distro = new DistributionCustomizer();
distro.applyCustomizations();
this._distributionCustomizer.applyCustomizations();
// handle any UI migration
this._migrateUI();
@ -288,7 +309,8 @@ BrowserGlue.prototype = {
_onProfileShutdown: function()
{
this._shutdownPlaces();
this._idleService.removeIdleObserver(this, BOOKMARKS_ARCHIVE_IDLE_TIME);
this._idleService.removeIdleObserver(this, BOOKMARKS_BACKUP_IDLE_TIME);
this._isIdleObserver = false;
this.Sanitizer.onShutdown();
},
@ -327,6 +349,11 @@ BrowserGlue.prototype = {
if (this._isPlacesDatabaseLocked) {
this._showPlacesLockedNotificationBox();
}
// If there are plugins installed that are outdated, and the user hasn't
// been warned about them yet, open the plugins update page.
if (this._prefs.getBoolPref(PREF_PLUGINS_NOTIFYUSER))
this._showPluginUpdatePage();
},
_onQuitRequest: function(aCancelQuit, aQuitType)
@ -520,6 +547,18 @@ BrowserGlue.prototype = {
box.persistence = 3; // arbitrary number, just so bar sticks around for a bit
},
_showPluginUpdatePage : function () {
this._prefs.setBoolPref(PREF_PLUGINS_NOTIFYUSER, false);
var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].
getService(Ci.nsIURLFormatter);
var updateUrl = formatter.formatURLPref(PREF_PLUGINS_UPDATEURL);
var win = this.getMostRecentBrowserWindow();
var browser = win.gBrowser;
browser.selectedTab = browser.addTab(updateUrl);
},
// returns the (cached) Sanitizer constructor
get Sanitizer()
{
@ -592,8 +631,8 @@ BrowserGlue.prototype = {
restoreDefaultBookmarks =
this._prefs.getBoolPref("browser.bookmarks.restore_default_bookmarks");
if (restoreDefaultBookmarks) {
// Ensure that we already have a bookmarks backup for today
this._archiveBookmarks();
// Ensure that we already have a bookmarks backup for today.
this._backupBookmarks();
importBookmarks = true;
}
} catch(ex) {}
@ -603,10 +642,10 @@ BrowserGlue.prototype = {
if (importBookmarks && !restoreDefaultBookmarks && !importBookmarksHTML) {
// get latest JSON backup
Cu.import("resource://gre/modules/utils.js");
var bookmarksBackupFile = PlacesUtils.getMostRecentBackup();
if (bookmarksBackupFile && bookmarksBackupFile.leafName.match("\.json$")) {
var bookmarksBackupFile = PlacesUtils.backups.getMostRecent("json");
if (bookmarksBackupFile) {
// restore from JSON backup
PlacesUtils.restoreBookmarksFromJSONFile(bookmarksBackupFile);
PlacesUtils.backups.restoreBookmarksFromJSONFile(bookmarksBackupFile);
importBookmarks = false;
}
else {
@ -683,29 +722,29 @@ BrowserGlue.prototype = {
// Initialize bookmark archiving on idle.
// Once a day, either on idle or shutdown, bookmarks are backed up.
this._idleService.addIdleObserver(this, BOOKMARKS_ARCHIVE_IDLE_TIME);
if (!this._isIdleObserver) {
this._idleService.addIdleObserver(this, BOOKMARKS_BACKUP_IDLE_TIME);
this._isIdleObserver = true;
}
},
/**
* Places shut-down tasks
* - back up and archive bookmarks
* - export bookmarks as HTML, if so configured
* - back up bookmarks if needed.
* - export bookmarks as HTML, if so configured.
*
* Note: quit-application-granted notification is received twice
* so replace this method with a no-op when first called.
*/
_shutdownPlaces: function bg__shutdownPlaces() {
// Backup and archive Places bookmarks.
this._archiveBookmarks();
this._backupBookmarks();
// Backup bookmarks to bookmarks.html to support apps that depend
// on the legacy format.
var autoExportHTML = false;
try {
autoExportHTML = this._prefs.getBoolPref("browser.bookmarks.autoExportHTML");
} catch(ex) {
Components.utils.reportError(ex);
}
} catch(ex) { /* Don't export */ }
if (autoExportHTML) {
Cc["@mozilla.org/browser/places/import-export-service;1"].
@ -715,23 +754,24 @@ BrowserGlue.prototype = {
},
/**
* Back up and archive bookmarks
* Backup bookmarks if needed.
*/
_archiveBookmarks: function nsBrowserGlue__archiveBookmarks() {
_backupBookmarks: function nsBrowserGlue__backupBookmarks() {
Cu.import("resource://gre/modules/utils.js");
var lastBackup = PlacesUtils.getMostRecentBackup();
let lastBackupFile = PlacesUtils.backups.getMostRecent();
// Backup bookmarks if there aren't any backups or
// they haven't been backed up in the last 24 hrs.
if (!lastBackup ||
Date.now() - lastBackup.lastModifiedTime > BOOKMARKS_ARCHIVE_INTERVAL) {
var maxBackups = 5;
// Backup bookmarks if there are no backups or the maximum interval between
// backups elapsed.
if (!lastBackupFile ||
new Date() - PlacesUtils.backups.getDateForFile(lastBackupFile) > BOOKMARKS_BACKUP_INTERVAL) {
let maxBackups = BOOKMARKS_BACKUP_MAX_BACKUPS;
try {
maxBackups = this._prefs.getIntPref("browser.bookmarks.max_backups");
} catch(ex) {}
}
catch(ex) { /* Use default. */ }
PlacesUtils.archiveBookmarksFile(maxBackups, false /* don't force */);
PlacesUtils.backups.create(maxBackups); // Don't force creation.
}
},

View File

@ -151,13 +151,10 @@ 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":
case "placesCmd_open:window":
@ -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;
this._self.insertNewItem(aNode, popup, before);
// parentElt is the <menu> element for the container,
// we need the <menupopup>
let popup = parentElt.firstChild;
let index = popup._startMarker + 1 + aIndex;
this._self.insertNewItem(aNode, popup, popup.childNodes[index]);
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]);
// 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)) {
popup.firstChild == popup._emptyMenuItem))
this._self._showEmptyMenuItem(popup);
}
return;
}
}
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;
let index = popup._startMarker + 1 + aNewIndex;
popup.removeChild(nodeElt);
popup.insertBefore(nodeElt, popup.childNodes[index]);
},
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]);
// 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);
return;
}
}
},
containerOpened: function PMV_containerOpened(aNode) {
@ -856,43 +872,17 @@
},
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

@ -423,54 +423,36 @@ var PlacesOrganizer = {
* Populates the restore menu with the dates of the backups available.
*/
populateRestoreMenu: function PO_populateRestoreMenu() {
var restorePopup = document.getElementById("fileRestorePopup");
let restorePopup = document.getElementById("fileRestorePopup");
var dateSvc = Cc["@mozilla.org/intl/scriptabledateformat;1"].
let dateSvc = Cc["@mozilla.org/intl/scriptabledateformat;1"].
getService(Ci.nsIScriptableDateFormat);
// remove existing menu items
// last item is the restoreFromFile item
// Remove existing menu items. Last item is the restoreFromFile item.
while (restorePopup.childNodes.length > 1)
restorePopup.removeChild(restorePopup.firstChild);
// get list of files
var localizedFilename = PlacesUtils.getString("bookmarksArchiveFilename");
var localizedFilenamePrefix = localizedFilename.substr(0, localizedFilename.indexOf("-"));
var fileList = [];
var files = this.bookmarksBackupDir.directoryEntries;
while (files.hasMoreElements()) {
var f = files.getNext().QueryInterface(Ci.nsIFile);
var rx = new RegExp("^(bookmarks|" + localizedFilenamePrefix +
")-([0-9]{4}-[0-9]{2}-[0-9]{2})\.json$");
if (!f.isHidden() && f.leafName.match(rx)) {
var date = f.leafName.match(rx)[2].replace(/-/g, "/");
var dateObj = new Date(date);
fileList.push({date: dateObj, filename: f.leafName});
}
}
fileList.sort(function PO_fileList_compare(a, b) {
return b.date - a.date;
});
if (fileList.length == 0)
let backupFiles = PlacesUtils.backups.entries;
if (backupFiles.length == 0)
return;
// populate menu
for (var i = 0; i < fileList.length; i++) {
var m = restorePopup.insertBefore
(document.createElement("menuitem"),
// Populate menu with backups.
for (let i = 0; i < backupFiles.length; i++) {
let backupDate = PlacesUtils.backups.getDateForFile(backupFiles[i]);
let m = restorePopup.insertBefore(document.createElement("menuitem"),
document.getElementById("restoreFromFile"));
m.setAttribute("label",
dateSvc.FormatDate("",
Ci.nsIScriptableDateFormat.dateFormatLong,
fileList[i].date.getFullYear(),
fileList[i].date.getMonth() + 1,
fileList[i].date.getDate()));
m.setAttribute("value", fileList[i].filename);
backupDate.getFullYear(),
backupDate.getMonth() + 1,
backupDate.getDate()));
m.setAttribute("value", backupFiles[i].leafName);
m.setAttribute("oncommand",
"PlacesOrganizer.onRestoreMenuItemClick(this);");
}
// Add the restoreFromFile item.
restorePopup.insertBefore(document.createElement("menuseparator"),
document.getElementById("restoreFromFile"));
},
@ -479,14 +461,14 @@ var PlacesOrganizer = {
* Called when a menuitem is selected from the restore menu.
*/
onRestoreMenuItemClick: function PO_onRestoreMenuItemClick(aMenuItem) {
var dirSvc = Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIProperties);
var bookmarksFile = dirSvc.get("ProfD", Ci.nsIFile);
bookmarksFile.append("bookmarkbackups");
bookmarksFile.append(aMenuItem.getAttribute("value"));
if (!bookmarksFile.exists())
return;
this.restoreBookmarksFromFile(bookmarksFile);
let backupName = aMenuItem.getAttribute("value");
let backupFiles = PlacesUtils.backups.entries;
for (let i = 0; i < backupFiles.length; i++) {
if (backupFiles[i].leafName == backupName) {
this.restoreBookmarksFromFile(backupFiles[i]);
break;
}
}
},
/**
@ -529,7 +511,7 @@ var PlacesOrganizer = {
return;
try {
PlacesUtils.restoreBookmarksFromJSONFile(aFile);
PlacesUtils.backups.restoreBookmarksFromJSONFile(aFile);
}
catch(ex) {
this._showErrorAlert(PlacesUIUtils.getString("bookmarksRestoreParseError"));
@ -562,30 +544,10 @@ var PlacesOrganizer = {
var backupsDir = dirSvc.get("Desk", Ci.nsILocalFile);
fp.displayDirectory = backupsDir;
fp.defaultString = PlacesUtils.getBackupFilename();
fp.defaultString = PlacesUtils.backups.getFilenameForDate();
if (fp.show() != Ci.nsIFilePicker.returnCancel) {
PlacesUtils.backupBookmarksToFile(fp.file);
// copy new backup to /backups dir (bug 424389)
var latestBackup = PlacesUtils.getMostRecentBackup();
if (!latestBackup || latestBackup != fp.file) {
latestBackup.remove(false);
var name = PlacesUtils.getBackupFilename();
fp.file.copyTo(this.bookmarksBackupDir, name);
}
}
},
get bookmarksBackupDir() {
delete this.bookmarksBackupDir;
var dirSvc = Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIProperties);
var bookmarksBackupDir = dirSvc.get("ProfD", Ci.nsIFile);
bookmarksBackupDir.append("bookmarkbackups");
if (!bookmarksBackupDir.exists())
bookmarksBackupDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0700);
return this.bookmarksBackupDir = bookmarksBackupDir;
if (fp.show() != Ci.nsIFilePicker.returnCancel)
PlacesUtils.backups.saveBookmarksToJSONFile(fp.file);
},
_paneDisabled: false,

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
@ -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.
// 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.
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>
@ -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>
@ -455,7 +467,7 @@
<getter><![CDATA[
// 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;
@ -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]);
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)) {
popup.firstChild == popup._emptyMenuItem))
this._self._showEmptyMenuItem(popup);
}
if (popup._endMarker != -1)
popup._endMarker--;
return;
}
}
}
},
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]);
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) {
var chevronPopup = this._self._chevronPopup;
var menuitem = chevronPopup.childNodes[i];
let chevronPopup = this._self._chevronPopup;
let menuitem = chevronPopup.childNodes[aOldIndex];
chevronPopup.removeChild(menuitem);
chevronPopup.insertBefore(menuitem,
chevronPopup.childNodes[aNewIndex]);
}
this._self.updateChevron();
return;
}
}
}
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)
// Node is within a built menu.
nodeElt.label = aNewTitle || PlacesUIUtils.getBestTitle(aNode);
}
},
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;
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);
}
var iconURI = aNode.icon;
if (iconURI) {
var spec = iconURI.spec;
if (element.getAttribute("image") != spec)
element.setAttribute("image", spec);
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]);
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();
return;
}
}
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;
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);
}
return false;
}
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;
}

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

@ -0,0 +1,21 @@
# Distribution Configuration File
# Bug 516444 demo
[Global]
id=516444
version=1.0
about=Test distribution file
[BookmarksToolbar]
item.1.title=Toolbar Link Before
item.1.link=http://mozilla.com/
item.2.type=default
item.3.title=Toolbar Link After
item.3.link=http://mozilla.com/
[BookmarksMenu]
item.1.title=Menu Link Before
item.1.link=http://mozilla.com/
item.2.type=default
item.3.title=Menu Link After
item.3.link=http://mozilla.com/

View File

@ -157,10 +157,14 @@ const FILENAME_BOOKMARKS_HTML = "bookmarks.html";
let backup_date = new Date().toLocaleFormat("%Y-%m-%d");
const FILENAME_BOOKMARKS_JSON = "bookmarks-" + backup_date + ".json";
// Smart bookmarks constants
// Smart bookmarks constants.
const SMART_BOOKMARKS_VERSION = 2;
const SMART_BOOKMARKS_ON_TOOLBAR = 1;
const SMART_BOOKMARKS_ON_MENU = 2;
const SMART_BOOKMARKS_ON_MENU = 3; // Takes in count the additional separator.
// Default bookmarks constants.
const DEFAULT_BOOKMARKS_ON_TOOLBAR = 2;
const DEFAULT_BOOKMARKS_ON_MENU = 3;
/**
* Creates a bookmarks.html file in the profile folder from a given source file.

View File

@ -99,11 +99,11 @@ function run_test() {
// 3. import bookmarks.exported.json
// 4. run the test-suite
try {
PlacesUtils.backupBookmarksToFile(jsonFile);
PlacesUtils.backups.saveBookmarksToJSONFile(jsonFile);
} catch(ex) { do_throw("couldn't export to file: " + ex); }
LOG("exported json");
try {
PlacesUtils.restoreBookmarksFromJSONFile(jsonFile);
PlacesUtils.backups.restoreBookmarksFromJSONFile(jsonFile);
} catch(ex) { do_throw("couldn't import the exported file: " + ex); }
LOG("imported json");
validate();

View File

@ -80,10 +80,10 @@ var tests = [
run: function () {
this.file = createFile("bookmarks-test_restoreNotification.json");
addBookmarks();
PlacesUtils.backupBookmarksToFile(this.file);
PlacesUtils.backups.saveBookmarksToJSONFile(this.file);
remove_all_bookmarks();
try {
PlacesUtils.restoreBookmarksFromJSONFile(this.file);
PlacesUtils.backups.restoreBookmarksFromJSONFile(this.file);
}
catch (e) {
do_throw(" Restore should not have failed");
@ -100,7 +100,7 @@ var tests = [
run: function () {
this.file = createFile("bookmarks-test_restoreNotification.json");
try {
PlacesUtils.restoreBookmarksFromJSONFile(this.file);
PlacesUtils.backups.restoreBookmarksFromJSONFile(this.file);
}
catch (e) {
do_throw(" Restore should not have failed");
@ -118,7 +118,7 @@ var tests = [
this.file = dirSvc.get("ProfD", Ci.nsILocalFile);
this.file.append("this file doesn't exist because nobody created it");
try {
PlacesUtils.restoreBookmarksFromJSONFile(this.file);
PlacesUtils.backups.restoreBookmarksFromJSONFile(this.file);
do_throw(" Restore should have failed");
}
catch (e) {}

View File

@ -0,0 +1,143 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et: */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Places Unit Test code.
*
* The Initial Developer of the Original Code is Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2009
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Marco Bonardo <mak77@bonardo.net>
*
* 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
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* 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 ***** */
/**
* Tests that nsBrowserGlue does not overwrite bookmarks imported from the
* migrators. They usually run before nsBrowserGlue, so if we find any
* bookmark on init, we should not try to import.
*/
const PREF_SMART_BOOKMARKS_VERSION = "browser.places.smartBookmarksVersion";
const PREF_BMPROCESSED = "distribution.516444.bookmarksProcessed";
const PREF_DISTRIBUTION_ID = "distribution.id";
const TOPIC_FINAL_UI_STARTUP = "final-ui-startup";
const TOPIC_PLACES_INIT_COMPLETE = "places-init-complete";
const TOPIC_CUSTOMIZATION_COMPLETE = "distribution-customization-complete";
let os = Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService);
let observer = {
observe: function(aSubject, aTopic, aData) {
if (aTopic == TOPIC_CUSTOMIZATION_COMPLETE) {
os.removeObserver(this, TOPIC_CUSTOMIZATION_COMPLETE);
do_timeout(0, "continue_test();");
}
}
}
os.addObserver(observer, TOPIC_CUSTOMIZATION_COMPLETE, false);
function run_test() {
// Copy distribution.ini file to our app dir.
let distroDir = dirSvc.get("XCurProcD", Ci.nsIFile);
distroDir.append("distribution");
let iniFile = distroDir.clone();
iniFile.append("distribution.ini");
if (iniFile.exists()) {
iniFile.remove(false);
print("distribution.ini already exists, did some test forget to cleanup?");
}
let testDistributionFile = gTestDir.clone();
testDistributionFile.append("distribution.ini");
testDistributionFile.copyTo(distroDir, "distribution.ini");
do_check_true(testDistributionFile.exists());
// Disable Smart Bookmarks creation.
let ps = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch);
ps.setIntPref(PREF_SMART_BOOKMARKS_VERSION, -1);
// Initialize Places through the History Service, so it won't trigger
// browserGlue::_initPlaces since browserGlue is not yet in context.
let hs = Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsINavHistoryService);
// Check a new database has been created.
// nsBrowserGlue will use databaseStatus to manage initialization.
do_check_eq(hs.databaseStatus, hs.DATABASE_STATUS_CREATE);
// Initialize nsBrowserGlue.
Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsIBrowserGlue);
// Places initialization has already happened, so we need to simulate a new
// one. This will force browserGlue::_initPlaces().
os.notifyObservers(null, TOPIC_FINAL_UI_STARTUP, null);
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
do_test_pending();
// Test will continue on customization complete notification.
}
function continue_test() {
let bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Ci.nsINavBookmarksService);
// Check the custom bookmarks exist on menu.
let menuItemId = bs.getIdForItemAt(bs.bookmarksMenuFolder, 0);
do_check_neq(menuItemId, -1);
do_check_eq(bs.getItemTitle(menuItemId), "Menu Link Before");
menuItemId = bs.getIdForItemAt(bs.bookmarksMenuFolder, 1 + DEFAULT_BOOKMARKS_ON_MENU);
do_check_neq(menuItemId, -1);
do_check_eq(bs.getItemTitle(menuItemId), "Menu Link After");
// Check the custom bookmarks exist on toolbar.
let toolbarItemId = bs.getIdForItemAt(bs.toolbarFolder, 0);
do_check_neq(toolbarItemId, -1);
do_check_eq(bs.getItemTitle(toolbarItemId), "Toolbar Link Before");
toolbarItemId = bs.getIdForItemAt(bs.toolbarFolder, 1 + DEFAULT_BOOKMARKS_ON_TOOLBAR);
do_check_neq(toolbarItemId, -1);
do_check_eq(bs.getItemTitle(toolbarItemId), "Toolbar Link After");
// Check the bmprocessed pref has been created.
let ps = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch);
do_check_true(ps.getBoolPref(PREF_BMPROCESSED));
// Check distribution prefs have been created.
do_check_eq(ps.getCharPref(PREF_DISTRIBUTION_ID), "516444");
// Remove the distribution file.
let iniFile = dirSvc.get("XCurProcD", Ci.nsIFile);
iniFile.append("distribution");
iniFile.append("distribution.ini");
iniFile.remove(false);
do_check_false(iniFile.exists());
do_test_finished();
}

View File

@ -82,9 +82,9 @@ tests.push({
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
// Count items on toolbar.
do_check_eq(countFolderChildren(bs.toolbarFolder), SMART_BOOKMARKS_ON_TOOLBAR);
do_check_eq(countFolderChildren(bs.toolbarFolder), SMART_BOOKMARKS_ON_TOOLBAR + DEFAULT_BOOKMARKS_ON_TOOLBAR);
// Count items on menu (+1 for the separator).
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder), SMART_BOOKMARKS_ON_MENU + 1);
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder), SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU);
// Check version has been updated.
do_check_eq(ps.getIntPref(PREF_SMART_BOOKMARKS_VERSION), SMART_BOOKMARKS_VERSION);
@ -113,9 +113,9 @@ tests.push({
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
// Count items on toolbar.
do_check_eq(countFolderChildren(bs.toolbarFolder), SMART_BOOKMARKS_ON_TOOLBAR);
do_check_eq(countFolderChildren(bs.toolbarFolder), SMART_BOOKMARKS_ON_TOOLBAR + DEFAULT_BOOKMARKS_ON_TOOLBAR);
// Count items on menu (+1 for the separator).
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder), SMART_BOOKMARKS_ON_MENU + 1);
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder), SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU);
// check smart bookmark has been replaced, itemId has changed.
itemId = bs.getIdForItemAt(bs.toolbarFolder, 0);
@ -138,15 +138,15 @@ tests.push({
// Set preferences.
ps.setIntPref(PREF_SMART_BOOKMARKS_VERSION, 1);
// Remove toolbar's smart bookmarks
bs.removeFolderChildren(bs.toolbarFolder);
bs.removeItem(bs.getIdForItemAt(bs.toolbarFolder, 0));
// Force nsBrowserGlue::_initPlaces().
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
// Count items on toolbar, we should not have recreated the smart bookmark.
do_check_eq(countFolderChildren(bs.toolbarFolder), 0);
do_check_eq(countFolderChildren(bs.toolbarFolder), DEFAULT_BOOKMARKS_ON_TOOLBAR);
// Count items on menu (+1 for the separator).
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder), SMART_BOOKMARKS_ON_MENU + 1);
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder), SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU);
// Check version has been updated.
do_check_eq(ps.getIntPref(PREF_SMART_BOOKMARKS_VERSION), SMART_BOOKMARKS_VERSION);
@ -167,9 +167,9 @@ tests.push({
os.notifyObservers(null, TOPIC_PLACES_INIT_COMPLETE, null);
// Count items on toolbar, we should not have recreated the smart bookmark.
do_check_eq(countFolderChildren(bs.toolbarFolder), SMART_BOOKMARKS_ON_TOOLBAR);
do_check_eq(countFolderChildren(bs.toolbarFolder), SMART_BOOKMARKS_ON_TOOLBAR + DEFAULT_BOOKMARKS_ON_TOOLBAR);
// Count items on menu (+1 for the separator).
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder), SMART_BOOKMARKS_ON_MENU + 1);
do_check_eq(countFolderChildren(bs.bookmarksMenuFolder), SMART_BOOKMARKS_ON_MENU + DEFAULT_BOOKMARKS_ON_MENU);
// Check version has been updated.
do_check_eq(ps.getIntPref(PREF_SMART_BOOKMARKS_VERSION), SMART_BOOKMARKS_VERSION);
@ -193,23 +193,19 @@ function countFolderChildren(aFolderItemId) {
function finish_test() {
// Clean up database from all bookmarks.
remove_all_bookmarks();
// Simulate application closing to remove the idle observer and avoid leaks.
os.notifyObservers(null, "quit-application-granted", null);
do_test_finished();
}
var testIndex = 0;
function next_test() {
// Simulate application closing to remove the idle observer and avoid leaks.
os.notifyObservers(null, "quit-application-granted", null);
// nsBrowserGlue stops observing topics after first notification,
// so we add back the observer to test additional runs.
os.addObserver(bg, TOPIC_PLACES_INIT_COMPLETE, false);
// Execute next test.
var test = tests.shift();
dump("\nTEST " + (++testIndex) + ": " + test.description);
let test = tests.shift();
print("\nTEST " + (++testIndex) + ": " + test.description);
test.exec();
}

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

@ -1734,9 +1734,7 @@ var gApplicationsPane = {
"chrome,modal,centerscreen,titlebar,dialog=yes",
params);
if (params.handlerApp &&
params.handlerApp.executable &&
params.handlerApp.executable.isFile()) {
if (this.isValidHandlerApp(params.handlerApp)) {
handlerApp = params.handlerApp;
// Add the app to the type's list of possible handlers.

View File

@ -61,7 +61,7 @@ function test() {
win.addEventListener("load", function() {
win.removeEventListener("load", arguments.callee, false);
let browser = win.getBrowser();
let browser = win.gBrowser;
browser.addEventListener("load", function() {
browser.removeEventListener("load", arguments.callee, true);
@ -133,7 +133,7 @@ function test() {
win.addEventListener("load", function() {
win.removeEventListener("load", arguments.callee, false);
let browser = win.getBrowser();
let browser = win.gBrowser;
browser.addEventListener("load", function() {
browser.removeEventListener("load", arguments.callee, true);
@ -168,7 +168,7 @@ function test() {
win.addEventListener("load", function() {
win.removeEventListener("load", arguments.callee, false);
let browser = win.getBrowser();
let browser = win.gBrowser;
browser.addEventListener("load", function() {
browser.removeEventListener("load", arguments.callee, true);

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

@ -135,12 +135,7 @@
@BINPATH@/components/contentprefs.xpt
@BINPATH@/components/cookie.xpt
@BINPATH@/components/directory.xpt
#ifdef XP_WIN32
;XXX: this is stupid. fix this.
@BINPATH@/components/docshell_base.xpt
#else
@BINPATH@/components/docshell.xpt
#endif
@BINPATH@/components/dom.xpt
@BINPATH@/components/dom_base.xpt
@BINPATH@/components/dom_canvas.xpt
@ -182,6 +177,7 @@
@BINPATH@/components/inspector.xpt
@BINPATH@/components/intl.xpt
@BINPATH@/components/jar.xpt
@BINPATH@/components/jsctypes.xpt
@BINPATH@/components/jsdservice.xpt
@BINPATH@/components/layout_base.xpt
#ifdef NS_PRINTING
@ -221,12 +217,7 @@
@BINPATH@/components/pref.xpt
@BINPATH@/components/prefetch.xpt
@BINPATH@/components/profile.xpt
;XXX: stupid, fix this!
#ifdef XP_WIN32
@BINPATH@/components/proxyObject.xpt
#else
@BINPATH@/components/proxyObjInst.xpt
#endif
@BINPATH@/components/rdf.xpt
@BINPATH@/components/satchel.xpt
@BINPATH@/components/saxparser.xpt
@ -261,12 +252,7 @@
@BINPATH@/components/xpcom_components.xpt
@BINPATH@/components/xpcom_ds.xpt
@BINPATH@/components/xpcom_io.xpt
;XXX: stupid, fix this!
#ifdef XP_WIN32
@BINPATH@/components/xpcom_thread.xpt
#else
@BINPATH@/components/xpcom_threads.xpt
#endif
@BINPATH@/components/xpcom_xpti.xpt
@BINPATH@/components/xpconnect.xpt
@BINPATH@/components/xpinstall.xpt
@ -314,12 +300,7 @@
@BINPATH@/components/nsSessionStore.js
@BINPATH@/components/nsURLFormatter.js
@BINPATH@/components/@DLL_PREFIX@browserdirprovider@DLL_SUFFIX@
#ifdef XP_WIN32
;XXX: lame, kill use_short_libname
@BINPATH@/components/brwsrcmp.dll
#else
@BINPATH@/components/@DLL_PREFIX@browsercomps@DLL_SUFFIX@
#endif
@BINPATH@/components/txEXSLTRegExFunctions.js
@BINPATH@/components/nsLivemarkService.js
@BINPATH@/components/nsTaggingService.js
@ -382,9 +363,7 @@
@BINPATH@/@PREF_DIR@/firefox.js
@BINPATH@/@PREF_DIR@/firefox-branding.js
@BINPATH@/@PREF_DIR@/channel-prefs.js
@BINPATH@/greprefs/all.js
@BINPATH@/greprefs/security-prefs.js
@BINPATH@/greprefs/xpinstall.js
@BINPATH@/greprefs.js
@BINPATH@/defaults/autoconfig/platform.js
@BINPATH@/defaults/autoconfig/prefcalls.js

View File

@ -780,6 +780,9 @@ components/xuldoc.xpt
components/xultmpl.xpt
components/zipwriter.xpt
components/firefox.xpt
greprefs/all.js
greprefs/security-prefs.js
greprefs/xpinstall.js
run-mozilla.sh
firefox
dependentlibs.list
@ -808,3 +811,6 @@ xpicleanup@BIN_SUFFIX@
chrome.manifest
install.rdf
@DLL_PREFIX@jsj@DLL_SUFFIX@
#ifdef XP_WIN
components/brwsrcmp.dll
#endif

View File

@ -82,6 +82,7 @@ PWD := $(CURDIR)
# work in that case.
ZIP_IN ?= $(_ABS_DIST)/$(PACKAGE)
WIN32_INSTALLER_IN ?= $(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
RETRIEVE_WINDOWS_INSTALLER = 1
MOZ_LANGPACK_EID=langpack-$(AB_CD)@firefox.mozilla.org

View File

@ -11,7 +11,6 @@
<!ENTITY aboutSupport.extensionName "Name">
<!ENTITY aboutSupport.extensionEnabled "Enabled">
<!ENTITY aboutSupport.extensionVersion "Version">
<!ENTITY aboutSupport.extensionFirstRun "FirstRun">
<!ENTITY aboutSupport.extensionId "ID">
<!ENTITY aboutSupport.appBasicsTitle "Application Basics">

View File

@ -10,8 +10,8 @@
for the help button in the menubar but Gnome does not. -->
<!ENTITY helpMenuWin.label "Help">
<!ENTITY helpMenuWin.accesskey "H">
<!ENTITY aboutCmd.label "About &brandFullName;">
<!ENTITY aboutCmd.accesskey "A">
<!ENTITY aboutProduct.label "About &brandShortName;">
<!ENTITY aboutProduct.accesskey "A">
<!ENTITY productHelp.label "&brandShortName; Help">
<!ENTITY productHelp.accesskey "H">
<!ENTITY helpForIEUsers.label "For Internet Explorer Users">

View File

@ -335,6 +335,8 @@
<!ENTITY mediaShowControls.accesskey "C">
<!ENTITY mediaHideControls.label "Hide Controls">
<!ENTITY mediaHideControls.accesskey "C">
<!ENTITY videoFullScreen.label "Full Screen">
<!ENTITY videoFullScreen.accesskey "F">
<!-- LOCALIZATION NOTE :

View File

@ -7,6 +7,7 @@
locale/browser/aboutPrivateBrowsing.dtd (%chrome/browser/aboutPrivateBrowsing.dtd)
locale/browser/aboutRobots.dtd (%chrome/browser/aboutRobots.dtd)
locale/browser/aboutSessionRestore.dtd (%chrome/browser/aboutSessionRestore.dtd)
locale/browser/aboutSupport.dtd (%chrome/browser/aboutSupport.dtd)
locale/browser/credits.dtd (%chrome/browser/credits.dtd)
* locale/browser/browser.dtd (%chrome/browser/browser.dtd)
locale/browser/baseMenuOverlay.dtd (%chrome/browser/baseMenuOverlay.dtd)

View File

@ -70,13 +70,13 @@
padding-top: 0;
}
#main-window[lwtheme="true"] #urlbar:not([focused="true"]),
#main-window[lwtheme="true"] #searchbar > textbox:not([focused="true"]),
#main-window[lwtheme="true"] .tabbrowser-tab:not([selected="true"]) {
#urlbar:-moz-lwtheme:not([focused="true"]),
#searchbar:-moz-lwtheme > textbox:not([focused="true"]),
.tabbrowser-tab:-moz-lwtheme:not([selected="true"]) {
opacity: .85;
}
#main-window[lwtheme="true"] .tabbrowser-tab {
.tabbrowser-tab:-moz-lwtheme {
text-shadow: none;
}
@ -1127,7 +1127,35 @@ tabpanels {
}
.tabbrowser-tab[busy] > .tab-icon-image {
list-style-image: url("chrome://global/skin/icons/loading_16.png") !important;
list-style-image: url("chrome://browser/skin/tabbrowser/progress.png") !important;
-moz-image-region: rect(0, 16px, 16px, 0);
}
.tabbrowser-tab[busy][stalled] > .tab-icon-image {
list-style-image: url("chrome://browser/skin/tabbrowser/progress-pulsing.png") !important;
}
.tabbrowser-tab[busy][progress="1"] > .tab-icon-image {
-moz-image-region: rect(0, 32px, 16px, 16px);
}
.tabbrowser-tab[busy][progress="2"] > .tab-icon-image {
-moz-image-region: rect(0, 48px, 16px, 32px);
}
.tabbrowser-tab[busy][progress="3"] > .tab-icon-image {
-moz-image-region: rect(0, 64px, 16px, 48px);
}
.tabbrowser-tab[busy][progress="4"] > .tab-icon-image {
-moz-image-region: rect(0, 80px, 16px, 64px);
}
.tabbrowser-tab[busy][progress="5"] > .tab-icon-image {
-moz-image-region: rect(0, 96px, 16px, 80px);
}
.tabbrowser-tab[busy][progress="6"] > .tab-icon-image {
-moz-image-region: rect(0, 112px, 16px, 96px);
}
.tabbrowser-tab[busy][progress="7"] > .tab-icon-image {
-moz-image-region: rect(0, 128px, 16px, 112px);
}
.tabbrowser-tab[busy][progress="8"] > .tab-icon-image {
-moz-image-region: rect(0, 144px, 16px, 128px);
}
.tabs-bottom {

View File

@ -0,0 +1,8 @@
#close {
position: absolute;
top: 0;
right: 0;
width: 32px;
height: 32px;
background: url(KUI-close.png) center center no-repeat;
}

View File

@ -8,6 +8,7 @@ browser.jar:
skin/classic/browser/aboutCertError.css (aboutCertError.css)
* skin/classic/browser/browser.css (browser.css)
* skin/classic/browser/engineManager.css (engineManager.css)
skin/classic/browser/fullscreen-video.css
skin/classic/browser/Geo.png
skin/classic/browser/Go-arrow.png
skin/classic/browser/identity.png
@ -59,4 +60,6 @@ browser.jar:
* skin/classic/browser/preferences/preferences.css (preferences/preferences.css)
skin/classic/browser/preferences/applications.css (preferences/applications.css)
skin/classic/browser/tabbrowser/alltabs.png (tabbrowser/alltabs.png)
skin/classic/browser/tabbrowser/progress.png (tabbrowser/progress.png)
skin/classic/browser/tabbrowser/progress-pulsing.png (tabbrowser/progress-pulsing.png)
skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -46,42 +46,36 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@namespace html url("http://www.w3.org/1999/xhtml");
#main-window[lwtheme="true"] #urlbar:not([focused="true"]),
#main-window[lwtheme="true"] #searchbar > textbox:not([focused="true"]) {
#urlbar:-moz-lwtheme:not([focused="true"]),
#searchbar:-moz-lwtheme > textbox:not([focused="true"]) {
opacity: .9;
}
#main-window[lwtheme="true"] > #navigator-toolbox toolbarbutton {
#navigator-toolbox:-moz-lwtheme toolbarbutton {
color: inherit !important;
text-shadow: inherit;
}
#main-window[lwtheme="true"] #PersonalToolbar,
#main-window[lwtheme="true"] #nav-bar {
#PersonalToolbar:-moz-lwtheme,
#nav-bar:-moz-lwtheme {
-moz-appearance: none !important;
background: none !important;
border-style: none !important;
}
#main-window[lwtheme="true"] .tabbrowser-strip,
#main-window[lwtheme="true"] .tabbrowser-tabs {
.tabbrowser-strip:-moz-lwtheme,
.tabbrowser-tabs:-moz-lwtheme {
background: none !important;
}
#main-window[lwtheme="true"] .tabbrowser-tab,
#main-window[lwtheme="true"]:not([active="true"]) .tabbrowser-tab {
color: inherit;
text-shadow: inherit;
}
#main-window[lwtheme="true"] .tabbrowser-tab[selected="true"] {
.tabbrowser-tab[selected="true"]:-moz-lwtheme {
background-color: transparent !important;
}
#main-window[lwtheme="true"] .tabbrowser-tab:not([selected="true"]):not(:hover) > .tab-text {
.tabbrowser-tab:not([selected="true"]):-moz-lwtheme:not(:hover) > .tab-text {
opacity: .8;
}
#main-window[lwtheme="true"] .tabbrowser-arrowscrollbox > .tabs-newtab-button {
.tabbrowser-arrowscrollbox:-moz-lwtheme > .tabs-newtab-button {
width: auto;
-moz-box-flex: 1;
-moz-box-pack: start;
@ -89,33 +83,33 @@
background: none;
}
#main-window[lwthemetextcolor="bright"] .tabbrowser-tab {
.tabbrowser-tab:-moz-lwtheme-brighttext {
-moz-border-left-colors: rgba(255,255,255,.1) rgba(255,255,255,.6) rgba(255,255,255,.2);
-moz-border-bottom-colors: rgba(255,255,255,.1) rgba(255,255,255,.6) rgba(255,255,255,.2);
-moz-border-right-colors: rgba(255,255,255,.1) rgba(255,255,255,.6) rgba(255,255,255,.2);
}
#main-window[lwthemetextcolor="bright"] .tabbrowser-tab[selected="true"] {
.tabbrowser-tab[selected="true"]:-moz-lwtheme-brighttext {
-moz-border-left-colors: rgba(255,255,255,.6) rgba(255,255,255,.2);
-moz-border-bottom-colors: rgba(255,255,255,.6) rgba(255,255,255,.2);
-moz-border-right-colors: rgba(255,255,255,.6) rgba(255,255,255,.2);
}
#main-window[lwthemetextcolor="dark"] .tabs-newtab-button,
#main-window[lwthemetextcolor="dark"] .tabs-alltabs-button,
#main-window[lwthemetextcolor="dark"] .tabs-container > .tabs-closebutton,
#main-window[lwthemetextcolor="dark"] .tabbrowser-arrowscrollbox > .scrollbutton-up,
#main-window[lwthemetextcolor="dark"] .tabbrowser-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down,
#main-window[lwthemetextcolor="dark"] .tabbrowser-tab:not([selected="true"]) {
.tabs-newtab-button:-moz-lwtheme-darktext,
.tabs-alltabs-button:-moz-lwtheme-darktext,
.tabs-container:-moz-lwtheme-darktext > .tabs-closebutton,
.tabbrowser-arrowscrollbox:-moz-lwtheme-darktext > .scrollbutton-up,
.tabbrowser-arrowscrollbox:-moz-lwtheme-darktext > .scrollbutton-down-stack > .scrollbutton-down,
.tabbrowser-tab:-moz-lwtheme-darktext:not([selected="true"]) {
-moz-box-shadow: inset 0 1px 0 rgba(50,50,50,.5);
}
#main-window[lwthemetextcolor="bright"] .tabs-newtab-button,
#main-window[lwthemetextcolor="bright"] .tabs-alltabs-button,
#main-window[lwthemetextcolor="bright"] .tabs-container > .tabs-closebutton,
#main-window[lwthemetextcolor="bright"] .tabbrowser-arrowscrollbox > .scrollbutton-up,
#main-window[lwthemetextcolor="bright"] .tabbrowser-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down,
#main-window[lwthemetextcolor="bright"] .tabbrowser-tab:not([selected="true"]) {
.tabs-newtab-button:-moz-lwtheme-brighttext,
.tabs-alltabs-button:-moz-lwtheme-brighttext,
.tabs-container:-moz-lwtheme-brighttext > .tabs-closebutton,
.tabbrowser-arrowscrollbox:-moz-lwtheme-brighttext > .scrollbutton-up,
.tabbrowser-arrowscrollbox:-moz-lwtheme-brighttext > .scrollbutton-down-stack > .scrollbutton-down,
.tabbrowser-tab:-moz-lwtheme-brighttext:not([selected="true"]) {
-moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
@ -387,26 +381,6 @@ menubutton:not([disabled="true"]):hover:active {
color: ButtonText !important;
}
toolbar:not([mode="text"]) #back-button .toolbarbutton-menubutton-button,
toolbar:not([mode="text"]) #forward-button .toolbarbutton-menubutton-button {
margin: 0;
padding: 0;
border-left: 0;
border-right: 0;
}
toolbar:not([mode="text"]) #back-button .toolbarbutton-menubutton-dropmarker,
toolbar:not([mode="text"]) #forward-button .toolbarbutton-menubutton-dropmarker {
margin-top: 1px;
}
toolbar[mode="icons"] #back-button .toolbarbutton-text-box,
toolbar[mode="icons"] #forward-button .toolbarbutton-text-box,
#back-button > dropmarker,
#forward-button > dropmarker {
display: none;
}
#back-button:-moz-locale-dir(rtl) > .toolbarbutton-icon,
#forward-button:-moz-locale-dir(rtl) > .toolbarbutton-icon,
#back-forward-dropmarker:-moz-locale-dir(rtl) > .toolbarbutton-icon {
@ -1497,7 +1471,35 @@ tabbrowser > tabbox {
}
.tabbrowser-tab[busy] > .tab-icon-image {
list-style-image: url("chrome://global/skin/icons/loading_16.png") !important;
list-style-image: url("chrome://browser/skin/tabbrowser/progress.png") !important;
-moz-image-region: rect(0, 16px, 16px, 0);
}
.tabbrowser-tab[busy][stalled] > .tab-icon-image {
list-style-image: url("chrome://browser/skin/tabbrowser/progress-pulsing.png") !important;
}
.tabbrowser-tab[busy][progress="1"] > .tab-icon-image {
-moz-image-region: rect(0, 32px, 16px, 16px);
}
.tabbrowser-tab[busy][progress="2"] > .tab-icon-image {
-moz-image-region: rect(0, 48px, 16px, 32px);
}
.tabbrowser-tab[busy][progress="3"] > .tab-icon-image {
-moz-image-region: rect(0, 64px, 16px, 48px);
}
.tabbrowser-tab[busy][progress="4"] > .tab-icon-image {
-moz-image-region: rect(0, 80px, 16px, 64px);
}
.tabbrowser-tab[busy][progress="5"] > .tab-icon-image {
-moz-image-region: rect(0, 96px, 16px, 80px);
}
.tabbrowser-tab[busy][progress="6"] > .tab-icon-image {
-moz-image-region: rect(0, 112px, 16px, 96px);
}
.tabbrowser-tab[busy][progress="7"] > .tab-icon-image {
-moz-image-region: rect(0, 128px, 16px, 112px);
}
.tabbrowser-tab[busy][progress="8"] > .tab-icon-image {
-moz-image-region: rect(0, 144px, 16px, 128px);
}
.tabbrowser-tab:not(:hover):not([selected="true"]) > .tab-icon-image {
@ -1559,6 +1561,12 @@ tabbrowser > tabbox {
color: #000000;
}
.tabbrowser-tab:-moz-lwtheme,
#main-window:-moz-lwtheme:not([active="true"]) .tabbrowser-tab {
color: inherit;
text-shadow: inherit;
}
.tabbrowser-strip {
margin-top: -1px;
border-bottom: 1px solid #404040;

View File

@ -0,0 +1,8 @@
#close {
position: absolute;
top: 0;
left: 0;
width: 32px;
height: 32px;
background: url(KUI-close.png) center center no-repeat;
}

View File

@ -12,6 +12,7 @@ browser.jar:
* skin/classic/browser/browser.css (browser.css)
* skin/classic/browser/engineManager.css (engineManager.css)
skin/classic/browser/feed-icons.png
skin/classic/browser/fullscreen-video.css
skin/classic/browser/Geo.png
skin/classic/browser/Go-arrow.png
skin/classic/browser/home.png
@ -68,24 +69,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)
@ -112,6 +101,8 @@ browser.jar:
skin/classic/browser/tabbrowser/alltabs-box-bkgnd-icon.png (tabbrowser/alltabs-box-bkgnd-icon.png)
skin/classic/browser/tabbrowser/alltabs-box-overflow-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-bkgnd-animate.png)
skin/classic/browser/tabbrowser/newtab.png (tabbrowser/newtab.png)
skin/classic/browser/tabbrowser/progress.png (tabbrowser/progress.png)
skin/classic/browser/tabbrowser/progress-pulsing.png (tabbrowser/progress-pulsing.png)
skin/classic/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left.png)
skin/classic/browser/tabbrowser/tab-arrow-right.png (tabbrowser/tab-arrow-right.png)
skin/classic/browser/tabbrowser/tabbrowser-tabs-bkgnd.png (tabbrowser/tabbrowser-tabs-bkgnd.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 {
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 {
#placesToolbar > toolbarbutton > .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

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -63,8 +63,7 @@
z-index: 10;
}
/*XXX Bug 473152 - Aero Glass clips panel content
#allTabs-panel:-moz-system-metric(windows-compositor),*/
#allTabs-panel:-moz-system-metric(windows-compositor),
#ctrlTab-panel:-moz-system-metric(windows-compositor) {
background: transparent;
-moz-appearance: -moz-win-glass;

View File

@ -46,16 +46,22 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@namespace html url("http://www.w3.org/1999/xhtml");
#main-window[lwtheme="true"] #urlbar:not([focused="true"]),
#main-window[lwtheme="true"] #searchbar > textbox:not([focused="true"]) {
#urlbar:-moz-lwtheme:not([focused="true"]),
#searchbar:-moz-lwtheme > textbox:not([focused="true"]) {
opacity: .85;
}
#main-window[lwtheme="true"] .tabbrowser-tab[selected="true"] {
.tabbrowser-tab[selected="true"]:-moz-lwtheme {
text-shadow: none;
}
#main-window[lwtheme="true"] .tabbrowser-tab:not([selected="true"]) {
.tabbrowser-tabs:-moz-lwtheme {
-moz-appearance: none;
background: none;
border-style: none;
}
.tabbrowser-tab:-moz-lwtheme:not([selected="true"]) {
color: inherit;
}
@ -1201,7 +1207,35 @@ statusbarpanel#statusbar-display {
}
.tabbrowser-tab[busy] > .tab-icon-image {
list-style-image: url("chrome://global/skin/icons/loading_16.png") !important;
list-style-image: url("chrome://browser/skin/tabbrowser/progress.png") !important;
-moz-image-region: rect(0, 16px, 16px, 0);
}
.tabbrowser-tab[busy][stalled] > .tab-icon-image {
list-style-image: url("chrome://browser/skin/tabbrowser/progress-pulsing.png") !important;
}
.tabbrowser-tab[busy][progress="1"] > .tab-icon-image {
-moz-image-region: rect(0, 32px, 16px, 16px);
}
.tabbrowser-tab[busy][progress="2"] > .tab-icon-image {
-moz-image-region: rect(0, 48px, 16px, 32px);
}
.tabbrowser-tab[busy][progress="3"] > .tab-icon-image {
-moz-image-region: rect(0, 64px, 16px, 48px);
}
.tabbrowser-tab[busy][progress="4"] > .tab-icon-image {
-moz-image-region: rect(0, 80px, 16px, 64px);
}
.tabbrowser-tab[busy][progress="5"] > .tab-icon-image {
-moz-image-region: rect(0, 96px, 16px, 80px);
}
.tabbrowser-tab[busy][progress="6"] > .tab-icon-image {
-moz-image-region: rect(0, 112px, 16px, 96px);
}
.tabbrowser-tab[busy][progress="7"] > .tab-icon-image {
-moz-image-region: rect(0, 128px, 16px, 112px);
}
.tabbrowser-tab[busy][progress="8"] > .tab-icon-image {
-moz-image-region: rect(0, 144px, 16px, 128px);
}
.tab-icon-image {
@ -1970,6 +2004,7 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
.allTabs-preview:hover,
.allTabs-preview[closebuttonhover] {
color: white;
text-shadow: none;
background-color: rgba(0,0,0,.4);
-moz-border-radius: .5em;
}

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