mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge mozilla-central to tracemonkey.
This commit is contained in:
commit
6bb82f6b8b
@ -74,6 +74,17 @@ public:
|
||||
virtual nsAccessible* GetAccessibleInShell(nsINode* aNode,
|
||||
nsIPresShell* aPresShell) = 0;
|
||||
|
||||
/**
|
||||
* Return root document accessible that is or contains a document accessible
|
||||
* for the given presshell.
|
||||
*
|
||||
* @param aPresShell [in] the presshell
|
||||
* @param aCanCreate [in] points whether the root document accessible
|
||||
* should be returned from the cache or can be created
|
||||
*/
|
||||
virtual nsAccessible* GetRootDocumentAccessible(nsIPresShell* aPresShell,
|
||||
PRBool aCanCreate) = 0;
|
||||
|
||||
/**
|
||||
* Creates accessible for the given DOM node or frame.
|
||||
*/
|
||||
@ -170,8 +181,7 @@ public:
|
||||
* @param aEvent [in] accessible event type
|
||||
* @param aTarget [in] target of accessible event
|
||||
*/
|
||||
virtual nsresult FireAccessibleEvent(PRUint32 aEvent,
|
||||
nsIAccessible *aTarget) = 0;
|
||||
virtual void FireAccessibleEvent(PRUint32 aEvent, nsAccessible* aTarget) = 0;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIAccessibilityService,
|
||||
|
@ -138,6 +138,7 @@ ACCESSIBILITY_ATOM(object, "object")
|
||||
ACCESSIBILITY_ATOM(ol, "ol")
|
||||
ACCESSIBILITY_ATOM(optgroup, "optgroup")
|
||||
ACCESSIBILITY_ATOM(option, "option")
|
||||
ACCESSIBILITY_ATOM(output, "output")
|
||||
ACCESSIBILITY_ATOM(panel, "panel") // XUL
|
||||
ACCESSIBILITY_ATOM(q, "q")
|
||||
ACCESSIBILITY_ATOM(select, "select")
|
||||
|
@ -165,18 +165,41 @@ nsAccessibilityService::NotifyOfAnchorJumpTo(nsIContent *aTarget)
|
||||
}
|
||||
|
||||
// nsIAccessibilityService
|
||||
nsresult
|
||||
void
|
||||
nsAccessibilityService::FireAccessibleEvent(PRUint32 aEvent,
|
||||
nsIAccessible *aTarget)
|
||||
nsAccessible* aTarget)
|
||||
{
|
||||
nsRefPtr<nsAccessible> accessible(do_QueryObject(aTarget));
|
||||
nsEventShell::FireEvent(aEvent, accessible);
|
||||
return NS_OK;
|
||||
nsEventShell::FireEvent(aEvent, aTarget);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsIAccessibilityService
|
||||
|
||||
nsAccessible*
|
||||
nsAccessibilityService::GetRootDocumentAccessible(nsIPresShell* aPresShell,
|
||||
PRBool aCanCreate)
|
||||
{
|
||||
nsIDocument* documentNode = aPresShell->GetDocument();
|
||||
if (documentNode) {
|
||||
nsCOMPtr<nsISupports> container = documentNode->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container));
|
||||
if (treeItem) {
|
||||
nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
|
||||
treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
|
||||
if (treeItem != rootTreeItem) {
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(rootTreeItem));
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
||||
documentNode = presShell->GetDocument();
|
||||
}
|
||||
|
||||
return aCanCreate ?
|
||||
GetDocAccessible(documentNode) : GetDocAccessibleFromCache(documentNode);
|
||||
}
|
||||
}
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
nsAccessibilityService::CreateOuterDocAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
@ -1648,6 +1671,12 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
|
||||
return accessible;
|
||||
}
|
||||
|
||||
if (tag == nsAccessibilityAtoms::output) {
|
||||
nsAccessible* accessible = new nsHTMLOutputAccessible(aContent, aWeakShell);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
|
@ -60,6 +60,8 @@ public:
|
||||
// nsIAccessibilityService
|
||||
virtual nsAccessible* GetAccessibleInShell(nsINode* aNode,
|
||||
nsIPresShell* aPresShell);
|
||||
virtual nsAccessible* GetRootDocumentAccessible(nsIPresShell* aPresShell,
|
||||
PRBool aCanCreate);
|
||||
|
||||
virtual already_AddRefed<nsAccessible>
|
||||
CreateHTMLBRAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
@ -117,7 +119,7 @@ public:
|
||||
|
||||
virtual void PresShellDestroyed(nsIPresShell* aPresShell);
|
||||
|
||||
virtual nsresult FireAccessibleEvent(PRUint32 aEvent, nsIAccessible *aTarget);
|
||||
virtual void FireAccessibleEvent(PRUint32 aEvent, nsAccessible* aTarget);
|
||||
|
||||
// nsAccessibiltiyService
|
||||
|
||||
|
@ -2158,9 +2158,18 @@ nsAccessible::GetRelationByType(PRUint32 aRelationType,
|
||||
|
||||
case nsIAccessibleRelation::RELATION_CONTROLLER_FOR:
|
||||
{
|
||||
return nsRelUtils::
|
||||
nsresult rv = nsRelUtils::
|
||||
AddTargetFromIDRefsAttr(aRelationType, aRelation, mContent,
|
||||
nsAccessibilityAtoms::aria_controls);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
if (rv != NS_OK_NO_RELATION_TARGET)
|
||||
return NS_OK; // XXX bug 381599, avoid performance problems
|
||||
|
||||
return nsRelUtils::
|
||||
AddTargetFromNeighbour(aRelationType, aRelation, mContent,
|
||||
nsAccessibilityAtoms::_for,
|
||||
nsAccessibilityAtoms::output);
|
||||
}
|
||||
|
||||
case nsIAccessibleRelation::RELATION_FLOWS_TO:
|
||||
|
@ -40,6 +40,8 @@
|
||||
#include "nsHTMLTextAccessible.h"
|
||||
|
||||
#include "nsDocAccessible.h"
|
||||
#include "nsAccUtils.h"
|
||||
#include "nsRelUtils.h"
|
||||
#include "nsTextEquivUtils.h"
|
||||
|
||||
#include "nsIFrame.h"
|
||||
@ -195,6 +197,56 @@ nsHTMLLabelAccessible::NativeRole()
|
||||
return nsIAccessibleRole::ROLE_LABEL;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsHTMLOuputAccessible
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsHTMLOutputAccessible::
|
||||
nsHTMLOutputAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
|
||||
nsHyperTextAccessibleWrap(aContent, aShell)
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED0(nsHTMLOutputAccessible, nsHyperTextAccessible)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOutputAccessible::GetRelationByType(PRUint32 aRelationType,
|
||||
nsIAccessibleRelation** aRelation)
|
||||
{
|
||||
nsresult rv = nsAccessibleWrap::GetRelationByType(aRelationType, aRelation);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (rv != NS_OK_NO_RELATION_TARGET)
|
||||
return NS_OK; // XXX bug 381599, avoid performance problems
|
||||
|
||||
if (aRelationType == nsIAccessibleRelation::RELATION_CONTROLLED_BY) {
|
||||
return nsRelUtils::
|
||||
AddTargetFromIDRefsAttr(aRelationType, aRelation, mContent,
|
||||
nsAccessibilityAtoms::_for);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRUint32
|
||||
nsHTMLOutputAccessible::NativeRole()
|
||||
{
|
||||
return nsIAccessibleRole::ROLE_SECTION;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLOutputAccessible::GetAttributesInternal(nsIPersistentProperties* aAttributes)
|
||||
{
|
||||
nsresult rv = nsAccessibleWrap::GetAttributesInternal(aAttributes);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsAccUtils::SetAccAttr(aAttributes, nsAccessibilityAtoms::live,
|
||||
NS_LITERAL_STRING("polite"));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsHTMLLIAccessible
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -105,6 +105,25 @@ public:
|
||||
virtual PRUint32 NativeRole();
|
||||
};
|
||||
|
||||
/**
|
||||
* Used for HTML output element.
|
||||
*/
|
||||
class nsHTMLOutputAccessible : public nsHyperTextAccessibleWrap
|
||||
{
|
||||
public:
|
||||
nsHTMLOutputAccessible(nsIContent* aContent, nsIWeakReference* aShell);
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIAccessible
|
||||
NS_IMETHOD GetRelationByType(PRUint32 aRelationType,
|
||||
nsIAccessibleRelation** aRelation);
|
||||
|
||||
// nsAccessible
|
||||
virtual PRUint32 NativeRole();
|
||||
virtual nsresult GetAttributesInternal(nsIPersistentProperties* aAttributes);
|
||||
};
|
||||
|
||||
/**
|
||||
* Used for bullet of HTML list item element (for example, HTML li).
|
||||
*/
|
||||
|
@ -3,6 +3,7 @@
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=475006
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=391829
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=581952
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=558036
|
||||
-->
|
||||
<head>
|
||||
<title>Group attributes tests</title>
|
||||
@ -39,6 +40,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=581952
|
||||
testAttrs("sortOther", {"sort" : "other"}, true);
|
||||
|
||||
// live object attribute
|
||||
|
||||
// HTML
|
||||
testAttrs("output", {"live" : "polite"}, true);
|
||||
|
||||
// ARIA
|
||||
testAttrs("live", {"live" : "polite"}, true);
|
||||
testAttrs("live2", {"live" : "polite"}, true);
|
||||
testAbsentAttrs("live3", {"live" : ""});
|
||||
@ -108,6 +114,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=581952
|
||||
title="Make explicit that aria-label is not an object attribute">
|
||||
Mozilla Bug 475006
|
||||
</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=558036"
|
||||
title="make HTML <output> accessible">
|
||||
Mozilla Bug 558036
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
@ -130,6 +141,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=581952
|
||||
<div id="sortNone" role="columnheader" aria-sort="none"></div>
|
||||
<div id="sortOther" role="columnheader" aria-sort="other"></div>
|
||||
|
||||
<!-- html -->
|
||||
<output id="output"></output>
|
||||
|
||||
<!-- back to aria -->
|
||||
<div id="live" aria-live="polite">excuse <div id="liveChild">me</div></div>
|
||||
<div id="live2" role="marquee" aria-live="polite">excuse <div id="live2Child">me</div></div>
|
||||
<div id="live3" role="region">excuse</div>
|
||||
|
@ -85,6 +85,11 @@
|
||||
// 'default button' relation
|
||||
testRelation("input", RELATION_DEFAULT_BUTTON, "submit");
|
||||
|
||||
// output 'for' relations
|
||||
testRelation("output", RELATION_CONTROLLED_BY, ["input", "input2"]);
|
||||
testRelation("input", RELATION_CONTROLLER_FOR, "output");
|
||||
testRelation("input2", RELATION_CONTROLLER_FOR, "output");
|
||||
|
||||
// 'described by'/'description for' relation for html:table and
|
||||
// html:caption
|
||||
testRelation("caption", RELATION_DESCRIPTION_FOR, "table");
|
||||
@ -125,6 +130,11 @@
|
||||
title="mochitests for accessible relations">
|
||||
Mozilla Bug 475298
|
||||
</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=558036"
|
||||
title="make HTML <output> accessible">
|
||||
Mozilla Bug 558036
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
@ -189,9 +199,11 @@
|
||||
<span id="flowfrom1">flow from</span>
|
||||
<span id="flowfrom2">flow from</span>
|
||||
|
||||
<form>
|
||||
<form id="form">
|
||||
<input id="input" />
|
||||
<input id="input2" />
|
||||
<input type="submit" id="submit" />
|
||||
<output id="output" style="display:block" for="input input2"></output>
|
||||
</form>
|
||||
|
||||
<table id="table">
|
||||
|
@ -61,6 +61,16 @@
|
||||
};
|
||||
testAccessibleTree("image_submit", accTree);
|
||||
|
||||
accTree = {
|
||||
role: ROLE_SECTION,
|
||||
children: [
|
||||
{
|
||||
role: ROLE_TEXT_LEAF
|
||||
}
|
||||
]
|
||||
};
|
||||
testAccessibleTree("output", accTree);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
@ -80,6 +90,11 @@
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=524521">
|
||||
Mozilla Bug 524521
|
||||
</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=558036"
|
||||
title="make HTML <output> accessible">
|
||||
Mozilla Bug 558036
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
@ -92,5 +107,6 @@
|
||||
|
||||
<input type="submit" id="submit">
|
||||
<input type="image" id="image_submit">
|
||||
<output id="output">1337</output>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -70,7 +70,7 @@ pref("extensions.blocklist.interval", 86400);
|
||||
// Controls what level the blocklist switches from warning about items to forcibly
|
||||
// blocking them.
|
||||
pref("extensions.blocklist.level", 2);
|
||||
pref("extensions.blocklist.url", "https://addons.mozilla.org/blocklist/3/%APP_ID%/%APP_VERSION%/%PRODUCT%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/");
|
||||
pref("extensions.blocklist.url", "https://addons.mozilla.org/blocklist/3/%APP_ID%/%APP_VERSION%/%PRODUCT%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/%PING_COUNT%/");
|
||||
pref("extensions.blocklist.detailsURL", "https://www.mozilla.com/%LOCALE%/blocklist/");
|
||||
|
||||
pref("extensions.update.autoUpdateDefault", true);
|
||||
@ -415,15 +415,12 @@ pref("general.warnOnAboutConfig", false);
|
||||
pref("dom.max_script_run_time", 20);
|
||||
#endif
|
||||
|
||||
// Make the status bar reliably present and unaffected by pages
|
||||
pref("dom.disable_window_open_feature.status", true);
|
||||
// This is the pref to control the location bar, change this to true to
|
||||
// force this instead of or in addition to the status bar - this makes
|
||||
// the origin of popup windows more obvious to avoid spoofing. We would
|
||||
// rather not do it by default because it affects UE for web applications, but
|
||||
// without it there isn't a really good way to prevent chrome spoofing, see bug 337344
|
||||
// force this - this makes the origin of popup windows more obvious to avoid
|
||||
// spoofing. We would rather not do it by default because it affects UE for web
|
||||
// applications, but without it there isn't a really good way to prevent chrome
|
||||
// spoofing, see bug 337344
|
||||
pref("dom.disable_window_open_feature.location", true);
|
||||
pref("dom.disable_window_status_change", true);
|
||||
// allow JS to move and resize existing windows
|
||||
pref("dom.disable_window_move_resize", false);
|
||||
// prevent JS from monkeying with window focus, etc
|
||||
@ -998,8 +995,6 @@ pref("services.sync.prefs.sync.browser.urlbar.maxRichResults", true);
|
||||
pref("services.sync.prefs.sync.dom.disable_open_during_load", true);
|
||||
pref("services.sync.prefs.sync.dom.disable_window_flip", true);
|
||||
pref("services.sync.prefs.sync.dom.disable_window_move_resize", true);
|
||||
pref("services.sync.prefs.sync.dom.disable_window_open_feature.status", true);
|
||||
pref("services.sync.prefs.sync.dom.disable_window_status_change", true);
|
||||
pref("services.sync.prefs.sync.dom.event.contextmenu.enabled", true);
|
||||
pref("services.sync.prefs.sync.extensions.personas.current", true);
|
||||
pref("services.sync.prefs.sync.extensions.update.enabled", true);
|
||||
@ -1048,3 +1043,8 @@ pref("devtools.errorconsole.enabled", false);
|
||||
|
||||
// disable the Inspector
|
||||
pref("devtools.inspector.enabled", false);
|
||||
|
||||
// Whether the character encoding menu is under the main Firefox button. This
|
||||
// preference is a string so that localizers can alter it.
|
||||
pref("browser.menu.showCharacterEncoding", "chrome://browser/locale/browser.properties");
|
||||
|
||||
|
@ -41,10 +41,7 @@
|
||||
|
||||
#version {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
#released {
|
||||
color: #666666;
|
||||
-moz-margin-start: 0;
|
||||
}
|
||||
|
||||
#distribution,
|
||||
@ -62,7 +59,6 @@
|
||||
-moz-padding-start: 0;
|
||||
}
|
||||
|
||||
.version-label,
|
||||
.trademark-label,
|
||||
.text-link,
|
||||
.text-link:focus {
|
||||
|
@ -77,24 +77,12 @@ function init(aEvent)
|
||||
|
||||
#ifdef MOZ_UPDATER
|
||||
/**
|
||||
* Creates "Last Updated" message and sets up "Check for Updates..." button.
|
||||
* Sets up "Check for Updates..." button.
|
||||
*/
|
||||
function initUpdates()
|
||||
{
|
||||
var um = Components.classes["@mozilla.org/updates/update-manager;1"].
|
||||
getService(Components.interfaces.nsIUpdateManager);
|
||||
var browserBundle = Services.strings.
|
||||
createBundle("chrome://browser/locale/browser.properties");
|
||||
|
||||
if (um.updateCount) {
|
||||
let buildID = um.getUpdateAt(0).buildID;
|
||||
let released = browserBundle.formatStringFromName("aboutdialog.released",
|
||||
[buildID.substring(0, 4),
|
||||
buildID.substring(4, 6),
|
||||
buildID.substring(6, 8)], 3);
|
||||
document.getElementById("released").setAttribute("value", released);
|
||||
}
|
||||
|
||||
var checkForUpdates = document.getElementById("checkForUpdatesButton");
|
||||
setupCheckForUpdates(checkForUpdates, browserBundle);
|
||||
}
|
||||
|
@ -71,9 +71,7 @@
|
||||
<hbox id="clientBox">
|
||||
<vbox id="leftBox" flex="1"/>
|
||||
<vbox id="rightBox" flex="1">
|
||||
<description id="version">
|
||||
#expand <label class="version-label" value="__MOZ_APP_VERSION__"/> <label class="version-label" id="released"/>
|
||||
</description>
|
||||
#expand <label id="version" value="__MOZ_APP_VERSION__"/>
|
||||
<label id="distribution" class="text-blurb"/>
|
||||
<label id="distributionId" class="text-blurb"/>
|
||||
#ifdef MOZ_UPDATER
|
||||
|
@ -108,6 +108,11 @@
|
||||
label="&helpFeedbackPage.label;"
|
||||
oncommand="openFeedbackPage()"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
<menuitem id="helpSafeMode"
|
||||
accesskey="&helpSafeMode.accesskey;"
|
||||
label="&helpSafeMode.label;"
|
||||
oncommand="safeModeRestart();"/>
|
||||
<menuseparator/>
|
||||
<menuseparator id="updateSeparator"/>
|
||||
#ifdef XP_MACOSX
|
||||
#ifdef MOZ_UPDATER
|
||||
|
@ -113,6 +113,7 @@
|
||||
label="&goOfflineCmd.label;"
|
||||
accesskey="&goOfflineCmd.accesskey;"
|
||||
type="checkbox"
|
||||
observes="workOfflineMenuitemState"
|
||||
oncommand="BrowserOffline.toggleOfflineStatus();"/>
|
||||
<menuitem id="menu_FileQuitItem"
|
||||
#ifdef XP_WIN
|
||||
@ -229,16 +230,6 @@
|
||||
command="cmd_CustomizeToolbars"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuitem id="toggle_taskbar"
|
||||
label="&taskbarCmd.label;"
|
||||
accesskey="&taskbarCmd.accesskey;"
|
||||
type="checkbox"
|
||||
command="cmd_toggleTaskbar"
|
||||
#ifndef WINCE
|
||||
checked="true" />
|
||||
#else
|
||||
checked="false" />
|
||||
#endif
|
||||
<menu id="viewSidebarMenuMenu"
|
||||
label="&viewSidebarMenu.label;"
|
||||
accesskey="&viewSidebarMenu.accesskey;">
|
||||
|
@ -635,8 +635,9 @@ HistoryMenu.prototype = {
|
||||
m.setAttribute("value", i);
|
||||
m.setAttribute("oncommand", "undoCloseTab(" + i + ");");
|
||||
|
||||
// Set the targetURI attribute so it will be shown in tooltip and statusbar.
|
||||
// SessionStore uses one-based indexes, so we need to normalize them.
|
||||
// Set the targetURI attribute so it will be shown in tooltip and trigger
|
||||
// onLinkHovered. SessionStore uses one-based indexes, so we need to
|
||||
// normalize them.
|
||||
let tabData = undoItems[i].state;
|
||||
let activeIndex = (tabData.index || tabData.entries.length) - 1;
|
||||
if (activeIndex >= 0 && tabData.entries[activeIndex])
|
||||
@ -716,7 +717,7 @@ HistoryMenu.prototype = {
|
||||
m.setAttribute("class", "menuitem-iconic bookmark-item menuitem-with-favicon");
|
||||
m.setAttribute("oncommand", "undoCloseWindow(" + i + ");");
|
||||
|
||||
// Set the targetURI attribute so it will be shown in tooltip and statusbar.
|
||||
// Set the targetURI attribute so it will be shown in tooltip.
|
||||
// SessionStore uses one-based indexes, so we need to normalize them.
|
||||
let activeIndex = (selectedTab.index || selectedTab.entries.length) - 1;
|
||||
if (activeIndex >= 0 && selectedTab.entries[activeIndex])
|
||||
@ -1164,9 +1165,7 @@ let BookmarksMenuButton = {
|
||||
// First popupshowing event, initialize immutable attributes.
|
||||
this._popupInitialized = true;
|
||||
// Update View bookmarks toolbar checkbox menuitem.
|
||||
viewToolbar.setAttribute("toolbarindex",
|
||||
Array.indexOf(gNavToolbox.childNodes,
|
||||
this.personalToolbar));
|
||||
viewToolbar.setAttribute("toolbarId", this.personalToolbar.id);
|
||||
|
||||
// Need to set the label on Unsorted Bookmarks menu.
|
||||
let unsortedBookmarksElt =
|
||||
|
@ -69,7 +69,6 @@
|
||||
<command id="cmd_printPreview" oncommand="PrintUtils.printPreview(PrintPreviewListener);"/>
|
||||
<command id="cmd_close" oncommand="BrowserCloseTabOrWindow()"/>
|
||||
<command id="cmd_closeWindow" oncommand="BrowserTryToCloseWindow()"/>
|
||||
<command id="cmd_toggleTaskbar" oncommand="goToggleToolbar('status-bar','toggle_taskbar');"/>
|
||||
<command id="cmd_ToggleTabsOnTop" oncommand="TabsOnTop.toggle()"/>
|
||||
<command id="cmd_CustomizeToolbars" oncommand="BrowserCustomizeToolbar()"/>
|
||||
<command id="cmd_quitApplication" oncommand="goQuitApplication()"/>
|
||||
@ -196,6 +195,7 @@
|
||||
<broadcaster id="sync-setup-state"/>
|
||||
<broadcaster id="sync-syncnow-state"/>
|
||||
#endif
|
||||
<broadcaster id="workOfflineMenuitemState"/>
|
||||
</broadcasterset>
|
||||
|
||||
<keyset id="mainKeyset">
|
||||
|
@ -67,7 +67,7 @@ let gSyncUI = {
|
||||
|
||||
// If this is a browser window?
|
||||
if (gBrowser) {
|
||||
obs.push("weave:notification:added", "weave:notification:removed");
|
||||
obs.push("weave:notification:added");
|
||||
}
|
||||
|
||||
let self = this;
|
||||
@ -82,9 +82,28 @@ let gSyncUI = {
|
||||
popup.addEventListener("popupshowing", function() {
|
||||
self.alltabsPopupShowing();
|
||||
}, true);
|
||||
|
||||
if (Weave.Notifications.notifications.length)
|
||||
this.initNotifications();
|
||||
}
|
||||
this.updateUI();
|
||||
},
|
||||
|
||||
initNotifications: function SUI_initNotifications() {
|
||||
const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
let notificationbox = document.createElementNS(XULNS, "notificationbox");
|
||||
notificationbox.id = "sync-notifications";
|
||||
notificationbox.setAttribute("flex", "1");
|
||||
|
||||
let bottombox = document.getElementById("browser-bottombox");
|
||||
bottombox.insertBefore(notificationbox, bottombox.firstChild);
|
||||
|
||||
// Force a style flush to ensure that our binding is attached.
|
||||
notificationbox.clientTop;
|
||||
|
||||
// notificationbox will listen to observers from now on.
|
||||
Services.obs.removeObserver(this, "weave:notification:added");
|
||||
},
|
||||
|
||||
_wasDelayed: false,
|
||||
|
||||
@ -140,7 +159,7 @@ let gSyncUI = {
|
||||
|
||||
// Fake the tab object on the menu entries, so that we don't have to worry
|
||||
// about removing them ourselves. They will just get cleaned up by popup
|
||||
// binding. This also makes sure the statusbar updates with the URL.
|
||||
// binding.
|
||||
menuitem.tab = { "linkedBrowser": { "currentURI": { "spec": label } } };
|
||||
sep.tab = { "linkedBrowser": { "currentURI": { "spec": " " } } };
|
||||
|
||||
@ -173,7 +192,13 @@ let gSyncUI = {
|
||||
// basically, we want to just inform users that stuff is going to take a while
|
||||
let title = this._stringBundle.GetStringFromName("error.sync.no_node_found.title");
|
||||
let description = this._stringBundle.GetStringFromName("error.sync.no_node_found");
|
||||
let notification = new Weave.Notification(title, description, null, Weave.Notifications.PRIORITY_INFO);
|
||||
let buttons = [new Weave.NotificationButton(
|
||||
this._stringBundle.GetStringFromName("error.sync.serverStatusButton.label"),
|
||||
this._stringBundle.GetStringFromName("error.sync.serverStatusButton.accesskey"),
|
||||
function() { gWeaveWin.openServerStatus(); return true; }
|
||||
)];
|
||||
let notification = new Weave.Notification(
|
||||
title, description, null, Weave.Notifications.PRIORITY_INFO, buttons);
|
||||
Weave.Notifications.replaceTitle(notification);
|
||||
this._wasDelayed = true;
|
||||
},
|
||||
@ -237,34 +262,9 @@ let gSyncUI = {
|
||||
Weave.Notifications.replaceTitle(notification);
|
||||
},
|
||||
|
||||
onNotificationAdded: function SUI_onNotificationAdded() {
|
||||
if (!gBrowser)
|
||||
return;
|
||||
|
||||
let notificationsButton = document.getElementById("sync-notifications-button");
|
||||
notificationsButton.hidden = false;
|
||||
let notification = Weave.Notifications.notifications.reduce(function(prev, cur) {
|
||||
return prev.priority > cur.priority ? prev : cur;
|
||||
});
|
||||
|
||||
let image = notification.priority >= Weave.Notifications.PRIORITY_WARNING ?
|
||||
"chrome://global/skin/icons/warning-16.png" :
|
||||
"chrome://global/skin/icons/information-16.png";
|
||||
notificationsButton.image = image;
|
||||
notificationsButton.label = notification.title;
|
||||
},
|
||||
|
||||
onNotificationRemoved: function SUI_onNotificationRemoved() {
|
||||
if (!gBrowser)
|
||||
return;
|
||||
|
||||
if (Weave.Notifications.notifications.length == 0) {
|
||||
document.getElementById("sync-notifications-button").hidden = true;
|
||||
}
|
||||
else {
|
||||
// Display remaining notifications
|
||||
this.onNotificationAdded();
|
||||
}
|
||||
openServerStatus: function () {
|
||||
let statusURL = Services.prefs.getCharPref("services.sync.statusURL");
|
||||
window.openUILinkIn(statusURL, "tab");
|
||||
},
|
||||
|
||||
// Commands
|
||||
@ -356,7 +356,21 @@ let gSyncUI = {
|
||||
let priority = Weave.Notifications.PRIORITY_WARNING;
|
||||
let buttons = [];
|
||||
|
||||
if (Weave.Status.sync == Weave.OVER_QUOTA) {
|
||||
// Check if the client is outdated in some way
|
||||
let outdated = Weave.Status.sync == Weave.VERSION_OUT_OF_DATE;
|
||||
for (let [engine, reason] in Iterator(Weave.Status.engines))
|
||||
outdated = outdated || reason == Weave.VERSION_OUT_OF_DATE;
|
||||
|
||||
if (outdated) {
|
||||
description = this._stringBundle.GetStringFromName(
|
||||
"error.sync.needUpdate.description");
|
||||
buttons.push(new Weave.NotificationButton(
|
||||
this._stringBundle.GetStringFromName("error.sync.needUpdate.label"),
|
||||
this._stringBundle.GetStringFromName("error.sync.needUpdate.accesskey"),
|
||||
function() { window.openUILinkIn("https://services.mozilla.com/update/", "tab"); return true; }
|
||||
));
|
||||
}
|
||||
else if (Weave.Status.sync == Weave.OVER_QUOTA) {
|
||||
description = this._stringBundle.GetStringFromName(
|
||||
"error.sync.quota.description");
|
||||
buttons.push(new Weave.NotificationButton(
|
||||
@ -367,7 +381,15 @@ let gSyncUI = {
|
||||
function() { gSyncUI.openQuotaDialog(); return true; } )
|
||||
);
|
||||
}
|
||||
else if (!Weave.Status.enforceBackoff) {
|
||||
else if (Weave.Status.enforceBackoff) {
|
||||
priority = Weave.Notifications.PRIORITY_INFO;
|
||||
buttons.push(new Weave.NotificationButton(
|
||||
this._stringBundle.GetStringFromName("error.sync.serverStatusButton.label"),
|
||||
this._stringBundle.GetStringFromName("error.sync.serverStatusButton.accesskey"),
|
||||
function() { gSyncUI.openServerStatus(); return true; }
|
||||
));
|
||||
}
|
||||
else {
|
||||
priority = Weave.Notifications.PRIORITY_INFO;
|
||||
buttons.push(new Weave.NotificationButton(
|
||||
this._stringBundle.GetStringFromName("error.sync.tryAgainButton.label"),
|
||||
@ -434,10 +456,7 @@ let gSyncUI = {
|
||||
this.initUI();
|
||||
break;
|
||||
case "weave:notification:added":
|
||||
this.onNotificationAdded();
|
||||
break;
|
||||
case "weave:notification:removed":
|
||||
this.onNotificationRemoved();
|
||||
this.initNotifications();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
@ -101,6 +101,11 @@ let TabView = {
|
||||
Services.obs.addObserver(observer, "quit-application-requested", false);
|
||||
}
|
||||
},
|
||||
|
||||
// ----------
|
||||
getContentWindow: function TabView_getContentWindow() {
|
||||
return this._window;
|
||||
},
|
||||
|
||||
// ----------
|
||||
isVisible: function() {
|
||||
|
@ -158,11 +158,19 @@ html|*.urlbar-input {
|
||||
|
||||
/* over-link in location bar */
|
||||
|
||||
/* Delay transitions on mouseout. (Mouseover transitions are delayed by a
|
||||
timeout in urlbarBindings.xml.) */
|
||||
.urlbar-textbox-container:not([overlinkstate]),
|
||||
.urlbar-over-link-layer:not([overlinkstate]),
|
||||
.urlbar-textbox-container-children:not([overlinkstate]),
|
||||
.urlbar-over-link-box:not([overlinkstate]) {
|
||||
-moz-transition-delay: 100ms;
|
||||
}
|
||||
|
||||
.urlbar-over-link-layer[overlinkstate="fade-in"],
|
||||
.urlbar-textbox-container:not([overlinkstate]) {
|
||||
-moz-transition-property: color;
|
||||
-moz-transition-duration: 150ms;
|
||||
-moz-transition-delay: 50ms;
|
||||
-moz-transition-timing-function: cubic-bezier(0.0, 0.6, 1.0, 1.0);
|
||||
}
|
||||
|
||||
@ -170,7 +178,6 @@ html|*.urlbar-input {
|
||||
.urlbar-over-link-layer:not([overlinkstate]) {
|
||||
-moz-transition-property: color;
|
||||
-moz-transition-duration: 150ms;
|
||||
-moz-transition-delay: 50ms;
|
||||
-moz-transition-timing-function: linear;
|
||||
color: transparent;
|
||||
}
|
||||
@ -179,8 +186,6 @@ html|*.urlbar-input {
|
||||
.urlbar-textbox-container-children:not([overlinkstate]) {
|
||||
-moz-transition-property: opacity;
|
||||
-moz-transition-duration: 150ms;
|
||||
-moz-transition-delay: 50ms;
|
||||
-moz-transition-timing-function: cubic-bezier(0.0, 0.6, 1.0, 1.0);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
@ -188,8 +193,6 @@ html|*.urlbar-input {
|
||||
.urlbar-over-link-box:not([overlinkstate]) {
|
||||
-moz-transition-property: opacity;
|
||||
-moz-transition-duration: 150ms;
|
||||
-moz-transition-delay: 50ms;
|
||||
-moz-transition-timing-function: linear;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
@ -315,13 +318,14 @@ window[chromehidden~="toolbar"] toolbar:not(.toolbar-primary):not(.chromeclass-m
|
||||
min-width: 1px;
|
||||
}
|
||||
|
||||
/* Sync statusbar UI */
|
||||
%ifdef MOZ_SERVICES_SYNC
|
||||
#sync-notifications-box {
|
||||
/* Sync notification UI */
|
||||
#sync-notifications {
|
||||
-moz-binding: url("chrome://browser/content/syncNotification.xml#notificationbox");
|
||||
overflow-y: visible !important;
|
||||
}
|
||||
|
||||
#sync-notifications-box notification {
|
||||
#sync-notifications notification {
|
||||
-moz-binding: url("chrome://browser/content/syncNotification.xml#notification");
|
||||
}
|
||||
%endif
|
||||
|
@ -52,6 +52,8 @@
|
||||
# Gavin Sharp <gavin@gavinsharp.com>
|
||||
# Justin Dolske <dolske@mozilla.com>
|
||||
# Rob Campbell <rcampbell@mozilla.com>
|
||||
# David Dahl <ddahl@mozilla.com>
|
||||
# Patrick Walton <pcwalton@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
|
||||
@ -373,24 +375,14 @@ function findChildShell(aDocument, aDocShell, aSoughtURI) {
|
||||
}
|
||||
|
||||
const gPopupBlockerObserver = {
|
||||
_reportButton: null,
|
||||
|
||||
onUpdatePageReport: function (aEvent)
|
||||
{
|
||||
if (aEvent.originalTarget != gBrowser.selectedBrowser)
|
||||
return;
|
||||
|
||||
if (!this._reportButton)
|
||||
this._reportButton = document.getElementById("page-report-button");
|
||||
|
||||
if (!gBrowser.pageReport) {
|
||||
// Hide the popup blocker statusbar button
|
||||
this._reportButton.hidden = true;
|
||||
|
||||
if (!gBrowser.pageReport)
|
||||
return;
|
||||
}
|
||||
|
||||
this._reportButton.hidden = false;
|
||||
|
||||
// Only show the notification again if we've not already shown it. Since
|
||||
// notifications are per-browser, we don't need to worry about re-adding
|
||||
@ -548,10 +540,7 @@ const gPopupBlockerObserver = {
|
||||
var blockedPopupDontShowMessage = document.getElementById("blockedPopupDontShowMessage");
|
||||
var showMessage = gPrefService.getBoolPref("privacy.popups.showBrowserMessage");
|
||||
blockedPopupDontShowMessage.setAttribute("checked", !showMessage);
|
||||
if (aEvent.target.localName == "popup")
|
||||
blockedPopupDontShowMessage.setAttribute("label", gNavigatorBundle.getString("popupWarningDontShowFromMessage"));
|
||||
else
|
||||
blockedPopupDontShowMessage.setAttribute("label", gNavigatorBundle.getString("popupWarningDontShowFromStatusbar"));
|
||||
blockedPopupDontShowMessage.setAttribute("label", gNavigatorBundle.getString("popupWarningDontShowFromMessage"));
|
||||
},
|
||||
|
||||
showBlockedPopup: function (aEvent)
|
||||
@ -598,6 +587,8 @@ const gPopupBlockerObserver = {
|
||||
|
||||
dontShowMessage: function ()
|
||||
{
|
||||
#if 0
|
||||
// Disabled until bug 594294 is fixed.
|
||||
var showMessage = gPrefService.getBoolPref("privacy.popups.showBrowserMessage");
|
||||
var firstTime = gPrefService.getBoolPref("privacy.popups.firstTime");
|
||||
|
||||
@ -608,6 +599,7 @@ const gPopupBlockerObserver = {
|
||||
this._displayPageReportFirstTime();
|
||||
|
||||
gPrefService.setBoolPref("privacy.popups.showBrowserMessage", !showMessage);
|
||||
#endif
|
||||
|
||||
gBrowser.getNotificationBox().removeCurrentNotification();
|
||||
},
|
||||
@ -816,8 +808,8 @@ const gFormSubmitObserver = {
|
||||
}
|
||||
|
||||
// Don't show the popup if the current tab doesn't contain the invalid form.
|
||||
if (gBrowser.selectedTab.linkedBrowser.contentDocument !=
|
||||
aFormElement.ownerDocument) {
|
||||
if (gBrowser.contentDocument !=
|
||||
aFormElement.ownerDocument.defaultView.top.document) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1536,9 +1528,6 @@ function delayedStartup(isLoadingBlank, mustLoadSidebar) {
|
||||
gDownloadMgr = Cc["@mozilla.org/download-manager;1"].
|
||||
getService(Ci.nsIDownloadManager);
|
||||
|
||||
// Initialize the downloads monitor panel listener
|
||||
DownloadMonitorPanel.init();
|
||||
|
||||
if (Win7Features) {
|
||||
let tempScope = {};
|
||||
Cu.import("resource://gre/modules/DownloadTaskbarProgress.jsm",
|
||||
@ -1599,6 +1588,18 @@ function delayedStartup(isLoadingBlank, mustLoadSidebar) {
|
||||
document.getElementById("key_errorConsole").removeAttribute("disabled");
|
||||
}
|
||||
|
||||
// If the user (or the locale) hasn't enabled the top-level "Character
|
||||
// Encoding" menu via the "browser.menu.showCharacterEncoding" preference,
|
||||
// hide it.
|
||||
const showCharacterEncodingPref = "browser.menu.showCharacterEncoding";
|
||||
let extraCharacterEncodingMenuEnabled = gPrefService.
|
||||
getComplexValue(showCharacterEncodingPref, Ci.nsIPrefLocalizedString).data;
|
||||
if (extraCharacterEncodingMenuEnabled !== "true") {
|
||||
let charsetMenu = document.getElementById("appmenu_charsetMenu");
|
||||
if (charsetMenu)
|
||||
charsetMenu.setAttribute("hidden", "true");
|
||||
}
|
||||
|
||||
Services.obs.notifyObservers(window, "browser-delayed-startup-finished", "");
|
||||
}
|
||||
|
||||
@ -1648,7 +1649,6 @@ function BrowserShutdown()
|
||||
|
||||
BrowserOffline.uninit();
|
||||
OfflineApps.uninit();
|
||||
DownloadMonitorPanel.uninit();
|
||||
gPrivateBrowsingUI.uninit();
|
||||
IndexedDBPromptHelper.uninit();
|
||||
|
||||
@ -1681,7 +1681,7 @@ function nonBrowserWindowStartup()
|
||||
// Disable inappropriate commands / submenus
|
||||
var disabledItems = ['Browser:SavePage',
|
||||
'Browser:SendLink', 'cmd_pageSetup', 'cmd_print', 'cmd_find', 'cmd_findAgain',
|
||||
'viewToolbarsMenu', 'cmd_toggleTaskbar', 'viewSidebarMenuMenu', 'Browser:Reload',
|
||||
'viewToolbarsMenu', 'viewSidebarMenuMenu', 'Browser:Reload',
|
||||
'viewFullZoomMenu', 'pageStyleMenu', 'charsetMenu', 'View:PageSource', 'View:FullScreen',
|
||||
'viewHistorySidebar', 'Browser:AddBookmarkAs', 'View:PageInfo', 'Tasks:InspectPage'];
|
||||
var element;
|
||||
@ -2747,23 +2747,33 @@ var PrintPreviewListener = {
|
||||
notificationBox.notificationsHidden = true;
|
||||
|
||||
document.getElementById("sidebar").setAttribute("src", "about:blank");
|
||||
var statusbar = document.getElementById("status-bar");
|
||||
this._chromeState.statusbarOpen = !statusbar.hidden;
|
||||
statusbar.hidden = true;
|
||||
var addonBar = document.getElementById("addon-bar");
|
||||
this._chromeState.addonBarOpen = !addonBar.collapsed;
|
||||
addonBar.collapsed = true;
|
||||
|
||||
this._chromeState.findOpen = gFindBarInitialized && !gFindBar.hidden;
|
||||
if (gFindBarInitialized)
|
||||
gFindBar.close();
|
||||
|
||||
this._chromeState.syncNotificationsOpen = false;
|
||||
var syncNotifications = document.getElementById("sync-notifications");
|
||||
if (syncNotifications) {
|
||||
this._chromeState.syncNotificationsOpen = !syncNotifications.notificationsHidden;
|
||||
syncNotifications.notificationsHidden = true;
|
||||
}
|
||||
},
|
||||
_showChrome: function () {
|
||||
if (this._chromeState.notificationsOpen)
|
||||
gBrowser.getNotificationBox().notificationsHidden = false;
|
||||
|
||||
if (this._chromeState.statusbarOpen)
|
||||
document.getElementById("status-bar").hidden = false;
|
||||
if (this._chromeState.addonBarOpen)
|
||||
document.getElementById("addon-bar").collapsed = false;
|
||||
|
||||
if (this._chromeState.findOpen)
|
||||
gFindBar.open();
|
||||
|
||||
if (this._chromeState.syncNotificationsOpen)
|
||||
document.getElementById("sync-notifications").notificationsHidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2887,8 +2897,7 @@ var browserDragAndDrop = {
|
||||
aEvent.preventDefault();
|
||||
|
||||
if (statusString) {
|
||||
var statusTextFld = document.getElementById("statusbar-display");
|
||||
statusTextFld.label = gNavigatorBundle.getString(statusString);
|
||||
XULBrowserWindow.setStatusText(gNavigatorBundle.getString(statusString));
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -2909,8 +2918,7 @@ var homeButtonObserver = {
|
||||
},
|
||||
onDragLeave: function (aEvent)
|
||||
{
|
||||
var statusTextFld = document.getElementById("statusbar-display");
|
||||
statusTextFld.label = "";
|
||||
XULWindowBrowser.setStatusText("");
|
||||
}
|
||||
}
|
||||
|
||||
@ -2953,8 +2961,7 @@ var bookmarksButtonObserver = {
|
||||
|
||||
onDragLeave: function (aEvent)
|
||||
{
|
||||
var statusTextFld = document.getElementById("statusbar-display");
|
||||
statusTextFld.label = "";
|
||||
XULWindowBrowser.setStatusText("");
|
||||
}
|
||||
}
|
||||
|
||||
@ -2966,8 +2973,7 @@ var newTabButtonObserver = {
|
||||
|
||||
onDragLeave: function (aEvent)
|
||||
{
|
||||
var statusTextFld = document.getElementById("statusbar-display");
|
||||
statusTextFld.label = "";
|
||||
XULWindowBrowser.setStatusText("");
|
||||
},
|
||||
|
||||
onDrop: function (aEvent)
|
||||
@ -2989,8 +2995,7 @@ var newWindowButtonObserver = {
|
||||
},
|
||||
onDragLeave: function (aEvent)
|
||||
{
|
||||
var statusTextFld = document.getElementById("statusbar-display");
|
||||
statusTextFld.label = "";
|
||||
XULWindowBrowser.setStatusText("");
|
||||
},
|
||||
onDrop: function (aEvent)
|
||||
{
|
||||
@ -3007,8 +3012,7 @@ var newWindowButtonObserver = {
|
||||
var DownloadsButtonDNDObserver = {
|
||||
onDragOver: function (aEvent)
|
||||
{
|
||||
var statusTextFld = document.getElementById("statusbar-display");
|
||||
statusTextFld.label = gNavigatorBundle.getString("dropondownloadsbutton");
|
||||
XULWindowBrowser.setStatusText(gNavigatorBundle.getString("dropondownloadsbutton"));
|
||||
var types = aEvent.dataTransfer.types;
|
||||
if (types.contains("text/x-moz-url") ||
|
||||
types.contains("text/uri-list") ||
|
||||
@ -3018,8 +3022,7 @@ var DownloadsButtonDNDObserver = {
|
||||
|
||||
onDragLeave: function (aEvent)
|
||||
{
|
||||
var statusTextFld = document.getElementById("statusbar-display");
|
||||
statusTextFld.label = "";
|
||||
XULWindowBrowser.setStatusText("");
|
||||
},
|
||||
|
||||
onDrop: function (aEvent)
|
||||
@ -3614,9 +3617,8 @@ var FullScreen = {
|
||||
if (event && event.type == "fullscreen")
|
||||
enterFS = !enterFS;
|
||||
|
||||
// show/hide all menubars, toolbars, and statusbars (except the full screen toolbar)
|
||||
// show/hide all menubars, toolbars (except the full screen toolbar)
|
||||
this.showXULChrome("toolbar", !enterFS);
|
||||
this.showXULChrome("statusbar", !enterFS);
|
||||
document.getElementById("View:FullScreen").setAttribute("checked", enterFS);
|
||||
|
||||
if (enterFS) {
|
||||
@ -3962,14 +3964,6 @@ var XULBrowserWindow = {
|
||||
delete this.reloadCommand;
|
||||
return this.reloadCommand = document.getElementById("Browser:Reload");
|
||||
},
|
||||
get statusTextField () {
|
||||
delete this.statusTextField;
|
||||
return this.statusTextField = document.getElementById("statusbar-display");
|
||||
},
|
||||
get securityButton () {
|
||||
delete this.securityButton;
|
||||
return this.securityButton = document.getElementById("security-button");
|
||||
},
|
||||
get isImage () {
|
||||
delete this.isImage;
|
||||
return this.isImage = document.getElementById("isImage");
|
||||
@ -3996,24 +3990,19 @@ var XULBrowserWindow = {
|
||||
delete this.statusMeter;
|
||||
delete this.stopCommand;
|
||||
delete this.reloadCommand;
|
||||
delete this.statusTextField;
|
||||
delete this.securityButton;
|
||||
delete this.statusText;
|
||||
},
|
||||
|
||||
setJSStatus: function (status) {
|
||||
this.jsStatus = status;
|
||||
this.updateStatusField();
|
||||
},
|
||||
|
||||
setJSDefaultStatus: function (status) {
|
||||
this.jsDefaultStatus = status;
|
||||
this.updateStatusField();
|
||||
},
|
||||
|
||||
setDefaultStatus: function (status) {
|
||||
this.defaultStatus = status;
|
||||
this.updateStatusField();
|
||||
},
|
||||
|
||||
setOverLink: function (link) {
|
||||
@ -4024,17 +4013,6 @@ var XULBrowserWindow = {
|
||||
gURLBar.setOverLink(link);
|
||||
},
|
||||
|
||||
updateStatusField: function () {
|
||||
var text = this.status || this.jsStatus || this.jsDefaultStatus || this.defaultStatus;
|
||||
|
||||
// check the current value so we don't trigger an attribute change
|
||||
// and cause needless (slow!) UI updates
|
||||
if (this.statusText != text) {
|
||||
this.statusTextField.label = text;
|
||||
this.statusText = text;
|
||||
}
|
||||
},
|
||||
|
||||
onLinkIconAvailable: function (aIconURL) {
|
||||
if (gProxyFavIcon && gBrowser.userTypedValue === null)
|
||||
PageProxySetIcon(aIconURL); // update the favicon in the URL bar
|
||||
@ -4293,7 +4271,6 @@ var XULBrowserWindow = {
|
||||
|
||||
onStatusChange: function (aWebProgress, aRequest, aStatus, aMessage) {
|
||||
this.status = aMessage;
|
||||
this.updateStatusField();
|
||||
},
|
||||
|
||||
// Properties used to cache security state used to update the UI
|
||||
@ -4358,21 +4335,15 @@ var XULBrowserWindow = {
|
||||
}
|
||||
|
||||
if (level) {
|
||||
this.securityButton.setAttribute("level", level);
|
||||
this.securityButton.hidden = false;
|
||||
// We don't style the Location Bar based on the the 'level' attribute
|
||||
// anymore, but still set it for third-party themes.
|
||||
if (gURLBar)
|
||||
gURLBar.setAttribute("level", level);
|
||||
} else {
|
||||
this.securityButton.hidden = true;
|
||||
this.securityButton.removeAttribute("level");
|
||||
if (gURLBar)
|
||||
gURLBar.removeAttribute("level");
|
||||
}
|
||||
|
||||
this.securityButton.setAttribute("tooltiptext", this._tooltipText);
|
||||
|
||||
// Don't pass in the actual location object, since it can cause us to
|
||||
// hold on to the window object too long. Just pass in the fields we
|
||||
// care about. (bug 424829)
|
||||
@ -4391,7 +4362,7 @@ var XULBrowserWindow = {
|
||||
},
|
||||
|
||||
// simulate all change notifications after switching tabs
|
||||
onUpdateCurrentBrowser: function (aStateFlags, aStatus, aMessage, aTotalProgress) {
|
||||
onUpdateCurrentBrowser: function XWB_onUpdateCurrentBrowser(aStateFlags, aStatus, aMessage, aTotalProgress) {
|
||||
if (FullZoom.updateBackgroundTabs)
|
||||
FullZoom.onLocationChange(gBrowser.currentURI, true);
|
||||
var nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
|
||||
@ -4412,7 +4383,7 @@ var XULBrowserWindow = {
|
||||
this.onProgressChange(gBrowser.webProgress, 0, 0, aTotalProgress, 1);
|
||||
},
|
||||
|
||||
startDocumentLoad: function (aRequest) {
|
||||
startDocumentLoad: function XWB_startDocumentLoad(aRequest) {
|
||||
// clear out feed data
|
||||
gBrowser.selectedBrowser.feeds = null;
|
||||
|
||||
@ -4426,7 +4397,7 @@ var XULBrowserWindow = {
|
||||
}
|
||||
},
|
||||
|
||||
endDocumentLoad: function (aRequest, aStatus) {
|
||||
endDocumentLoad: function XWB_endDocumentLoad(aRequest, aStatus) {
|
||||
var urlStr = aRequest.QueryInterface(Ci.nsIChannel).originalURI.spec;
|
||||
|
||||
var notification = Components.isSuccessCode(aStatus) ? "EndDocumentLoad" : "FailDocumentLoad";
|
||||
@ -4698,20 +4669,23 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) {
|
||||
// Empty the menu
|
||||
for (i = popup.childNodes.length-1; i >= 0; --i) {
|
||||
var deadItem = popup.childNodes[i];
|
||||
if (deadItem.hasAttribute("toolbarindex"))
|
||||
if (deadItem.hasAttribute("toolbarId"))
|
||||
popup.removeChild(deadItem);
|
||||
}
|
||||
|
||||
var firstMenuItem = aInsertPoint || popup.firstChild;
|
||||
|
||||
for (i = 0; i < gNavToolbox.childNodes.length; ++i) {
|
||||
var toolbar = gNavToolbox.childNodes[i];
|
||||
let toolbarNodes = [document.getElementById("addon-bar")];
|
||||
for (i = 0; i < gNavToolbox.childNodes.length; ++i)
|
||||
toolbarNodes.push(gNavToolbox.childNodes[i]);
|
||||
toolbarNodes.forEach(function(toolbar) {
|
||||
var toolbarName = toolbar.getAttribute("toolbarname");
|
||||
if (toolbarName) {
|
||||
let menuItem = document.createElement("menuitem");
|
||||
let hidingAttribute = toolbar.getAttribute("type") == "menubar" ?
|
||||
"autohide" : "collapsed";
|
||||
menuItem.setAttribute("toolbarindex", i);
|
||||
menuItem.setAttribute("id", "toggle_" + toolbar.id);
|
||||
menuItem.setAttribute("toolbarId", toolbar.id);
|
||||
menuItem.setAttribute("type", "checkbox");
|
||||
menuItem.setAttribute("label", toolbarName);
|
||||
menuItem.setAttribute("checked", toolbar.getAttribute(hidingAttribute) != "true");
|
||||
@ -4721,22 +4695,21 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) {
|
||||
|
||||
menuItem.addEventListener("command", onViewToolbarCommand, false);
|
||||
}
|
||||
toolbar = toolbar.nextSibling;
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
|
||||
function onViewToolbarCommand(aEvent) {
|
||||
var index = aEvent.originalTarget.getAttribute("toolbarindex");
|
||||
var toolbar = gNavToolbox.childNodes[index];
|
||||
var visible = aEvent.originalTarget.getAttribute("checked") == "true";
|
||||
setToolbarVisibility(toolbar, visible);
|
||||
var toolbarId = aEvent.originalTarget.getAttribute("toolbarId");
|
||||
var toolbar = document.getElementById(toolbarId);
|
||||
var isVisible = aEvent.originalTarget.getAttribute("checked") == "true";
|
||||
setToolbarVisibility(toolbar, isVisible);
|
||||
}
|
||||
|
||||
function setToolbarVisibility(toolbar, visible) {
|
||||
function setToolbarVisibility(toolbar, isVisible) {
|
||||
var hidingAttribute = toolbar.getAttribute("type") == "menubar" ?
|
||||
"autohide" : "collapsed";
|
||||
|
||||
toolbar.setAttribute(hidingAttribute, !visible);
|
||||
toolbar.setAttribute(hidingAttribute, !isVisible);
|
||||
document.persist(toolbar.id, hidingAttribute);
|
||||
|
||||
PlacesToolbarHelper.init();
|
||||
@ -5484,7 +5457,7 @@ var BrowserOffline = {
|
||||
init: function ()
|
||||
{
|
||||
if (!this._uiElement)
|
||||
this._uiElement = document.getElementById("goOfflineMenuitem");
|
||||
this._uiElement = document.getElementById("workOfflineMenuitemState");
|
||||
|
||||
Services.obs.addObserver(this, "network:offline-status-changed", false);
|
||||
|
||||
@ -7562,10 +7535,6 @@ let gPrivateBrowsingUI = {
|
||||
gBrowser.updateTitlebar();
|
||||
}
|
||||
|
||||
setTimeout(function () {
|
||||
DownloadMonitorPanel.updateStatus();
|
||||
}, 0);
|
||||
|
||||
if (!aOnWindowOpen && this._disableUIOnToggle)
|
||||
document.getElementById("Tools:PrivateBrowsing")
|
||||
.setAttribute("disabled", "true");
|
||||
@ -7624,10 +7593,6 @@ let gPrivateBrowsingUI = {
|
||||
|
||||
gLastOpenDirectory.reset();
|
||||
|
||||
setTimeout(function () {
|
||||
DownloadMonitorPanel.updateStatus();
|
||||
}, 0);
|
||||
|
||||
if (this._disableUIOnToggle)
|
||||
document.getElementById("Tools:PrivateBrowsing")
|
||||
.setAttribute("disabled", "true");
|
||||
@ -7980,6 +7945,22 @@ XPCOMUtils.defineLazyGetter(this, "HUDConsoleUI", function () {
|
||||
}
|
||||
});
|
||||
|
||||
// Prompt user to restart the browser in safe mode
|
||||
function safeModeRestart()
|
||||
{
|
||||
// prompt the user to confirm
|
||||
let promptTitle = gNavigatorBundle.getString("safeModeRestartPromptTitle");
|
||||
let promptMessage =
|
||||
gNavigatorBundle.getString("safeModeRestartPromptMessage");
|
||||
let rv = Services.prompt.confirm(window, promptTitle, promptMessage);
|
||||
if (rv) {
|
||||
let environment = Components.classes["@mozilla.org/process/environment;1"].
|
||||
getService(Components.interfaces.nsIEnvironment);
|
||||
environment.set("MOZ_SAFE_MODE_RESTART", "1");
|
||||
Application.restart();
|
||||
}
|
||||
}
|
||||
|
||||
/* duplicateTabIn duplicates tab in a place specified by the parameter |where|.
|
||||
*
|
||||
* |where| can be:
|
||||
|
@ -35,6 +35,7 @@
|
||||
# Robert Strong <robert.bugzilla@gmail.com>
|
||||
# Rob Campbell <rcampbell@mozilla.com>
|
||||
# Patrick Walton <pcwalton@mozilla.com>
|
||||
# David Dahl <ddahl@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
|
||||
@ -548,9 +549,9 @@
|
||||
</menu>
|
||||
</hbox>
|
||||
<menuseparator class="appmenu-menuseparator"/>
|
||||
<menu id="appmenu_developer"
|
||||
label="&developerMenu.label;">
|
||||
<menupopup id="appmenu_developer_popup">
|
||||
<menu id="appmenu_webDeveloper"
|
||||
label="&appMenuWebDeveloper.label;">
|
||||
<menupopup id="appmenu_webDeveloper_popup">
|
||||
<menuitem id="appmenu_webConsole"
|
||||
label="&webConsoleCmd.label;"
|
||||
type="checkbox"
|
||||
@ -568,16 +569,20 @@
|
||||
command="View:PageSource"
|
||||
key="key_viewSource"/>
|
||||
<menuseparator/>
|
||||
#define ID_PREFIX appmenu_
|
||||
#define ID_PREFIX appmenu_developer_
|
||||
#include browser-charsetmenu.inc
|
||||
#undef ID_PREFIX
|
||||
<menuseparator/>
|
||||
<menuitem label="&goOfflineCmd.label;"
|
||||
type="checkbox"
|
||||
observes="workOfflineMenuitemState"
|
||||
oncommand="BrowserOffline.toggleOfflineStatus();"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuseparator class="appmenu-menuseparator"/>
|
||||
#define ID_PREFIX appmenu_
|
||||
#include browser-charsetmenu.inc
|
||||
#undef ID_PREFIX
|
||||
<menuitem id="appmenu_fullScreen"
|
||||
class="menuitem-tooltip"
|
||||
label="&fullScreenCmd.label;"
|
||||
@ -721,7 +726,7 @@
|
||||
<menu class="split-menuitem-menu"
|
||||
label="&preferencesCmd.label;">
|
||||
<menupopup id="appmenu_customizeMenu"
|
||||
onpopupshowing="onViewToolbarsPopupShowing(event, document.getElementById('appmenu_toggleStatusbar'));">
|
||||
onpopupshowing="onViewToolbarsPopupShowing(event, document.getElementById('appmenu_toggleTabsOnTop').previousSibling);">
|
||||
<menuitem id="appmenu_preferences"
|
||||
#ifdef XP_UNIX
|
||||
label="&preferencesCmdUnix.label;"
|
||||
@ -730,10 +735,6 @@
|
||||
#endif
|
||||
oncommand="openPreferences();"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appmenu_toggleStatusbar"
|
||||
type="checkbox"
|
||||
command="cmd_toggleTaskbar"
|
||||
observes="toggle_taskbar"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appmenu_toggleTabsOnTop"
|
||||
label="&viewTabsOnTop.label;"
|
||||
@ -761,6 +762,15 @@
|
||||
label="&appMenuGettingStarted.label;"
|
||||
oncommand="gBrowser.loadOneTab('http://www.mozilla.com/firefox/central/', {inBackground: false});"
|
||||
onclick="checkForMiddleClick(this, event);"/>
|
||||
<menuitem id="appmenu_troubleshootingInfo"
|
||||
label="&helpTroubleshootingInfo.label;"
|
||||
oncommand="openTroubleshootingPage()"
|
||||
onclick="checkForMiddleClick(this,event);"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appmenu_safeMode"
|
||||
accesskey="&appMenuSafeMode.accesskey;"
|
||||
label="&appMenuSafeMode.label;"
|
||||
oncommand="safeModeRestart();"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="appmenu_about"
|
||||
label="&aboutProduct.label;"
|
||||
@ -940,7 +950,7 @@
|
||||
tooltiptext="&goEndCap.tooltip;"
|
||||
onclick="gURLBar.handleCommand(event);"/>
|
||||
</hbox>
|
||||
<progressmeter id="urlbar-progress" mode="normal"/>
|
||||
<progressmeter id="urlbar-progress" mode="normal" value="0" collapsed="true"/>
|
||||
<toolbarbutton id="urlbar-go-button"
|
||||
onclick="gURLBar.handleCommand(event);"
|
||||
tooltiptext="&goEndCap.tooltip;"/>
|
||||
@ -1282,41 +1292,16 @@
|
||||
</hbox>
|
||||
|
||||
<vbox id="browser-bottombox" layer="true">
|
||||
<statusbar class="chromeclass-status" id="status-bar"
|
||||
#ifdef WINCE
|
||||
hidden="true"
|
||||
#endif
|
||||
>
|
||||
<statusbarpanel id="statusbar-display" label="" flex="1"/>
|
||||
<statusbarpanel id="download-monitor" class="statusbarpanel-iconic-text"
|
||||
tooltiptext="&downloadMonitor2.tooltip;" hidden="true"
|
||||
command="Tools:Downloads"/>
|
||||
<statusbarpanel id="security-button" class="statusbarpanel-iconic"
|
||||
hidden="true"
|
||||
onclick="if (event.button == 0 && event.detail == 1) displaySecurityInfo();"/>
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
<statusbarpanel id="sync-notifications-button"
|
||||
class="statusbarpanel-iconic-text"
|
||||
hidden="true"
|
||||
popup="sync-notifications-panel">
|
||||
</statusbarpanel>
|
||||
<panel id="sync-notifications-panel" position="before_end">
|
||||
<notificationbox id="sync-notifications-box"/>
|
||||
</panel>
|
||||
#endif
|
||||
<statusbarpanel id="page-report-button" type="menu"
|
||||
class="statusbarpanel-menu-iconic"
|
||||
hidden="true"
|
||||
tooltiptext="&pageReportIcon.tooltip;">
|
||||
<menupopup onpopupshowing="gPopupBlockerObserver.fillPopupList(event);">
|
||||
<menuitem observes="blockedPopupAllowSite"/>
|
||||
<menuitem observes="blockedPopupEditSettings"/>
|
||||
<menuitem observes="blockedPopupDontShowMessage"/>
|
||||
<menuseparator observes="blockedPopupsSeparator"/>
|
||||
</menupopup>
|
||||
</statusbarpanel>
|
||||
</statusbar>
|
||||
<toolbar id="addon-bar" toolbarname="&addonBarCmd.label;" collapsed="true"
|
||||
class="toolbar-primary chromeclass-toolbar"
|
||||
context="toolbar-context-menu" toolboxid="navigator-toolbox"
|
||||
mode="icons" iconsize="small" defaulticonsize="small"
|
||||
lockiconsize="true"
|
||||
customizable="true" align="right">
|
||||
<statusbar id="status-bar"/>
|
||||
</toolbar>
|
||||
</vbox>
|
||||
|
||||
#ifndef XP_UNIX
|
||||
<svg:svg height="0">
|
||||
<svg:mask id="winstripe-keyhole-forward-mask" maskContentUnits="objectBoundingBox">
|
||||
|
@ -56,16 +56,13 @@
|
||||
screenX="24" screenY="24">
|
||||
|
||||
<description>
|
||||
&startDescription.label;
|
||||
&startDescriptionText.label;
|
||||
</description>
|
||||
|
||||
<separator class="thin"/>
|
||||
|
||||
<hbox pack="center">
|
||||
<statusbar style="width:20em">
|
||||
<statusbarpanel flex="1" pack="left"><description>&done.label;</description></statusbarpanel>
|
||||
<statusbarpanel class="statusbarpanel-iconic" style="min-height:18px" id="page-report-button"/>
|
||||
</statusbar>
|
||||
<!-- insert example here! (bug 594294) -->
|
||||
</hbox>
|
||||
|
||||
<separator class="thin"/>
|
||||
|
@ -75,6 +75,7 @@ let Change = {
|
||||
this._dialogType = window.arguments[0];
|
||||
this._status = document.getElementById("status");
|
||||
this._statusIcon = document.getElementById("statusIcon");
|
||||
this._statusRow = document.getElementById("statusRow");
|
||||
this._firstBox = document.getElementById("textBox1");
|
||||
this._secondBox = document.getElementById("textBox2");
|
||||
|
||||
@ -173,6 +174,7 @@ let Change = {
|
||||
let passphrase = gSyncUtils.generatePassphrase();
|
||||
let el = document.getElementById("passphraseBox");
|
||||
el.value = gSyncUtils.hyphenatePassphrase(passphrase);
|
||||
document.getElementById("passphraseStrengthRow").hidden = true;
|
||||
this._dialog.getButton("accept").disabled = false;
|
||||
},
|
||||
|
||||
@ -234,10 +236,13 @@ let Change = {
|
||||
[valid, errorString] = gSyncUtils.validatePassword(this._firstBox, this._secondBox);
|
||||
}
|
||||
else {
|
||||
if (this._updatingPassphrase)
|
||||
if (this._updatingPassphrase) {
|
||||
[valid, errorString] = gSyncUtils.validatePassphrase(this._passphraseBox);
|
||||
else
|
||||
} else {
|
||||
[valid, errorString] = gSyncUtils.validatePassphrase(this._passphraseBox, true);
|
||||
if (valid)
|
||||
this.displayPassphraseStrength();
|
||||
}
|
||||
}
|
||||
|
||||
if (errorString == "")
|
||||
@ -245,9 +250,25 @@ let Change = {
|
||||
else
|
||||
this._updateStatusWithString(errorString, "error");
|
||||
|
||||
this._statusRow.hidden = valid;
|
||||
this._dialog.getButton("accept").disabled = !valid;
|
||||
},
|
||||
|
||||
displayPassphraseStrength: function () {
|
||||
let bits = Weave.Utils.passphraseStrength(this._passphraseBox.value);
|
||||
let meter = document.getElementById("passphraseStrength");
|
||||
meter.value = bits;
|
||||
// The generated 20 character passphrase has an entropy of 94 bits
|
||||
// which we consider "strong".
|
||||
if (bits > 94)
|
||||
meter.className = "strong";
|
||||
else if (bits > 47)
|
||||
meter.className = "medium";
|
||||
else
|
||||
meter.className = "";
|
||||
document.getElementById("passphraseStrengthRow").hidden = false;
|
||||
},
|
||||
|
||||
_str: function Change__string(str) {
|
||||
return this._stringBundle.GetStringFromName(str);
|
||||
}
|
||||
|
@ -107,10 +107,34 @@
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<hbox id="passphraseBackupButtons">
|
||||
<button label="&button.syncKeyBackup.email.label;"
|
||||
accesskey="&button.syncKeyBackup.email.accesskey;"
|
||||
oncommand="gSyncUtils.passphraseEmail('passphraseBox');"/>
|
||||
|
||||
<vbox id="feedback" pack="center">
|
||||
<hbox id="statusRow" align="center">
|
||||
<image id="statusIcon" class="statusIcon"/>
|
||||
<label id="status" class="status" value=" "/>
|
||||
</hbox>
|
||||
|
||||
<vbox id="passphraseStrengthRow" hidden="true" pack="end">
|
||||
<hbox>
|
||||
<label id="passphraseStrengthLabel"
|
||||
control="passphraseStrength"
|
||||
value="&syncKeyStrength.label;"/>
|
||||
<progressmeter id="passphraseStrength"
|
||||
aria-labelledby="passphraseStrengthLabel"
|
||||
max="128"
|
||||
value="0"
|
||||
flex="1"/>
|
||||
</hbox>
|
||||
<hbox align="right" flex="1">
|
||||
<label class="text-link inline-link"
|
||||
onclick="event.stopPropagation();
|
||||
gSyncUtils.openSyncKeyHelp();"
|
||||
value="&syncKeyHelp.label;"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</vbox>
|
||||
|
||||
<hbox id="passphraseBackupButtons" pack="center">
|
||||
<button label="&button.syncKeyBackup.print.label;"
|
||||
accesskey="&button.syncKeyBackup.print.accesskey;"
|
||||
oncommand="gSyncUtils.passphrasePrint('passphraseBox');"/>
|
||||
@ -122,10 +146,5 @@
|
||||
<description>
|
||||
<html:p class="data" id="warningText"/>
|
||||
</description>
|
||||
|
||||
<hbox align="center">
|
||||
<image id="statusIcon" class="statusIcon"/>
|
||||
<label id="status" class="status" value=" "/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</dialog>
|
||||
|
@ -91,32 +91,17 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If the user has just closed the last notification, close the panel.
|
||||
// FIXME: this is not quite right, because it might not have been
|
||||
// the user that caused weave:notification:removed to get called.
|
||||
// We need to differentiate between "notification removed" and "user
|
||||
// closed the notification" and only close the panel if it was
|
||||
// the user who closed the last notification. Maybe we should make
|
||||
// the notification's close method handle closing the panel,
|
||||
// but should the notification box or its notifications really know
|
||||
// they are located inside the panel?
|
||||
var panel = document.getElementById("sync-notifications-panel");
|
||||
if (panel.state == "open" &&
|
||||
Notifications.notifications.length == 0)
|
||||
panel.hidePopup();
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="_appendNotification">
|
||||
<parameter name="notification"/>
|
||||
<body><![CDATA[
|
||||
var node = this.appendNotification(notification.title,
|
||||
notification.description,
|
||||
var node = this.appendNotification(notification.description,
|
||||
notification.title,
|
||||
notification.iconURL,
|
||||
notification.priority,
|
||||
notification.buttons);
|
||||
node.className = notification.constructor.name;
|
||||
node.notification = notification;
|
||||
]]></body>
|
||||
</method>
|
||||
@ -126,23 +111,17 @@
|
||||
|
||||
<binding id="notification" extends="chrome://global/content/bindings/notification.xml#notification">
|
||||
<content>
|
||||
<xul:hbox class="notification-inner outset" flex="1" xbl:inherits="type" align="start">
|
||||
<xul:image anonid="messageImage" class="messageImage" xbl:inherits="src=image" style="padding: 3px;"/>
|
||||
<xul:vbox flex="1">
|
||||
<xul:hbox anonid="details" align="center" flex="1">
|
||||
<xul:description anonid="messageText" class="messageText" flex="1" xbl:inherits="xbl:text=label"/>
|
||||
<xul:spacer flex="1"/>
|
||||
</xul:hbox>
|
||||
<xul:description xbl:inherits="xbl:text=value"/>
|
||||
<xul:hbox class="notification-inner outset" flex="1" xbl:inherits="type">
|
||||
<xul:hbox anonid="details" align="center" flex="1">
|
||||
<xul:image anonid="messageImage" class="messageImage" xbl:inherits="src=image"/>
|
||||
<xul:description anonid="messageText" class="messageText" xbl:inherits="xbl:text=label"/>
|
||||
|
||||
<!-- The children are the buttons defined by the notification. -->
|
||||
<xul:hbox oncommand="document.getBindingParent(this)._doButtonCommand(event);">
|
||||
<xul:spacer flex="1"/>
|
||||
<children/>
|
||||
</xul:hbox>
|
||||
|
||||
</xul:vbox>
|
||||
<xul:spacer flex="1"/>
|
||||
<xul:spacer flex="1"/>
|
||||
</xul:hbox>
|
||||
<xul:toolbarbutton ondblclick="event.stopPropagation();"
|
||||
class="messageCloseButton tabbable"
|
||||
xbl:inherits="hidden=hideclose"
|
||||
|
@ -81,11 +81,11 @@
|
||||
fixed="true"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="collection"
|
||||
label="Type"
|
||||
label=""a.typeColumn.label;"
|
||||
flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="size"
|
||||
label="Size"
|
||||
label=""a.sizeColumn.label;"
|
||||
flex="1"/>
|
||||
</treecols>
|
||||
<treechildren flex="1"/>
|
||||
|
@ -321,6 +321,7 @@ var gSyncSetup = {
|
||||
|
||||
el = document.getElementById("generatePassphraseButton");
|
||||
el.hidden = true;
|
||||
document.getElementById("passphraseStrengthRow").hidden = true;
|
||||
let feedback = document.getElementById("passphraseFeedbackRow");
|
||||
this._setFeedback(feedback, true, "");
|
||||
},
|
||||
@ -344,6 +345,23 @@ var gSyncSetup = {
|
||||
|
||||
let feedback = document.getElementById("passphraseFeedbackRow");
|
||||
this._setFeedback(feedback, valid, str);
|
||||
if (!valid)
|
||||
return valid;
|
||||
|
||||
// Display passphrase strength
|
||||
let pp = document.getElementById("weavePassphrase").value;
|
||||
let bits = Weave.Utils.passphraseStrength(pp);
|
||||
let meter = document.getElementById("passphraseStrength");
|
||||
meter.value = bits;
|
||||
// The generated 20 character passphrase has an entropy of 94 bits
|
||||
// which we consider "strong".
|
||||
if (bits > 94)
|
||||
meter.className = "strong";
|
||||
else if (bits > 47)
|
||||
meter.className = "medium";
|
||||
else
|
||||
meter.className = "";
|
||||
document.getElementById("passphraseStrengthRow").hidden = false;
|
||||
return valid;
|
||||
},
|
||||
|
||||
|
@ -207,6 +207,7 @@
|
||||
<label value="&syncKeyEntry.label;"
|
||||
accesskey="&syncKeyEntry.accesskey;"
|
||||
control="weavePassphrase"/>
|
||||
<spacer flex="1" />
|
||||
<label id="generatePassphraseButton"
|
||||
value="&syncKeyGenerate.label;"
|
||||
class="text-link inline-link"
|
||||
@ -217,22 +218,40 @@
|
||||
onkeyup="gSyncSetup.onPassphraseChange()"
|
||||
onchange="gSyncSetup.onPassphraseChange()"
|
||||
onfocus="this.select()"/>
|
||||
<hbox id="passphraseFeedbackRow" align="center" hidden="true">
|
||||
<spacer/>
|
||||
<hbox>
|
||||
<image class="statusIcon"/>
|
||||
<label class="status" value=" "/>
|
||||
|
||||
<vbox id="passphraseFeedback" pack="center">
|
||||
<hbox id="passphraseFeedbackRow" hidden="true" align="center">
|
||||
<spacer/>
|
||||
<hbox>
|
||||
<image class="statusIcon"/>
|
||||
<label class="status" value=" "/>
|
||||
</hbox>
|
||||
</hbox>
|
||||
</hbox>
|
||||
|
||||
<vbox id="passphraseStrengthRow" hidden="true" pack="end">
|
||||
<hbox>
|
||||
<label id="passphraseStrengthLabel"
|
||||
control="passphraseStrength"
|
||||
value="&syncKeyStrength.label;"/>
|
||||
<progressmeter id="passphraseStrength"
|
||||
aria-labelledby="passphraseStrengthLabel"
|
||||
max="128"
|
||||
value="0"
|
||||
flex="1"/>
|
||||
</hbox>
|
||||
<hbox align="right" flex="1">
|
||||
<label class="text-link inline-link"
|
||||
onclick="event.stopPropagation();
|
||||
gSyncUtils.openSyncKeyHelp();"
|
||||
value="&syncKeyHelp.label;"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</vbox>
|
||||
</groupbox>
|
||||
|
||||
<groupbox align="center">
|
||||
<description>&syncKeyBackup.description;</description>
|
||||
<hbox>
|
||||
<button label="&button.syncKeyBackup.email.label;"
|
||||
accesskey="&button.syncKeyBackup.email.accesskey;"
|
||||
oncommand="gSyncUtils.passphraseEmail('weavePassphrase');
|
||||
gSyncSetup.afterBackup();"/>
|
||||
<button label="&button.syncKeyBackup.print.label;"
|
||||
accesskey="&button.syncKeyBackup.print.accesskey;"
|
||||
oncommand="gSyncUtils.passphrasePrint('weavePassphrase');
|
||||
|
@ -54,6 +54,9 @@ let gSyncUtils = {
|
||||
openUILinkIn(url, "window");
|
||||
else if (thisDocEl.id == "BrowserPreferences" && !thisDocEl.instantApply)
|
||||
openUILinkIn(url, "window");
|
||||
else if (document.documentElement.id == "change-dialog")
|
||||
Weave.Svc.WinMediator.getMostRecentWindow("navigator:browser")
|
||||
.openUILinkIn(url, "tab");
|
||||
else
|
||||
openUILinkIn(url, "tab");
|
||||
},
|
||||
@ -102,6 +105,10 @@ let gSyncUtils = {
|
||||
this._openLink(Weave.Svc.Prefs.get("privacyURL"));
|
||||
},
|
||||
|
||||
openSyncKeyHelp: function () {
|
||||
this._openLink(Weave.Svc.Prefs.get("syncKeyHelpURL"));
|
||||
},
|
||||
|
||||
// xxxmpc - fix domain before 1.3 final (bug 583652)
|
||||
_baseURL: "http://www.mozilla.com/firefox/sync/",
|
||||
|
||||
@ -146,31 +153,6 @@ let gSyncUtils = {
|
||||
return pp;
|
||||
},
|
||||
|
||||
/**
|
||||
* Trigger the mailto protocol handler to send a passphrase backup email.
|
||||
*
|
||||
* @param elid : ID of the form element containing the passphrase.
|
||||
*/
|
||||
passphraseEmail: function(elid) {
|
||||
let pp = document.getElementById(elid).value;
|
||||
let subject = this.bundle.GetStringFromName("email.syncKey.subject");
|
||||
let label = this.bundle.formatStringFromName("email.syncKey.label", [pp], 1);
|
||||
let body = "&body=" + label + "%0A%0A" +
|
||||
this.bundle.GetStringFromName("email.syncKey.description")
|
||||
+ "%0A%0A" +
|
||||
this.bundle.GetStringFromName("email.keepItSecret.label") +
|
||||
this.bundle.GetStringFromName("email.keepItSecret.description")
|
||||
+ "%0A%0A" +
|
||||
this.bundle.GetStringFromName("email.keepItSafe.label") +
|
||||
this.bundle.GetStringFromName("email.keepItSafe.description")
|
||||
+ "%0A%0A" +
|
||||
this.bundle.GetStringFromName("email.findOutMore.label");
|
||||
let uri = Weave.Utils.makeURI("mailto:?subject=" + subject + body);
|
||||
let protoSvc = Cc["@mozilla.org/uriloader/external-protocol-service;1"]
|
||||
.getService(Ci.nsIExternalProtocolService);
|
||||
protoSvc.loadURI(uri);
|
||||
},
|
||||
|
||||
/**
|
||||
* Prepare an invisible iframe with the passphrase backup document.
|
||||
* Used by both the print and saving methods.
|
||||
|
@ -70,8 +70,10 @@
|
||||
onselect="if (event.target.localName == 'tabpanels') this.parentNode.updateCurrentBrowser();">
|
||||
<xul:tabpanels flex="1" class="plain" selectedIndex="0" anonid="panelcontainer">
|
||||
<xul:notificationbox flex="1">
|
||||
<xul:browser flex="1" type="content-primary" message="true" disablehistory="true"
|
||||
xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup"/>
|
||||
<xul:stack flex="1" anonid="browserStack">
|
||||
<xul:browser type="content-primary" message="true" disablehistory="true"
|
||||
xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup"/>
|
||||
</xul:stack>
|
||||
</xul:notificationbox>
|
||||
</xul:tabpanels>
|
||||
</xul:tabbox>
|
||||
@ -276,7 +278,7 @@
|
||||
<parameter name="aBrowser"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
return (aBrowser || this.mCurrentBrowser).parentNode;
|
||||
return (aBrowser || this.mCurrentBrowser).parentNode.parentNode;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
@ -341,7 +343,7 @@
|
||||
mBrowser: aBrowser,
|
||||
mBlank: aStartsBlank,
|
||||
|
||||
// cache flags for correct status bar update after tab switching
|
||||
// cache flags for correct status UI update after tab switching
|
||||
mStateFlags: 0,
|
||||
mStatus: 0,
|
||||
mMessage: "",
|
||||
@ -888,6 +890,9 @@
|
||||
<method name="_tabAttrModified">
|
||||
<parameter name="aTab"/>
|
||||
<body><![CDATA[
|
||||
if (this._removingTabs.indexOf(aTab) > -1)
|
||||
return;
|
||||
|
||||
// This event should be dispatched when any of these attributes change:
|
||||
// label, crop, busy, image, selected
|
||||
var event = document.createEvent("Events");
|
||||
@ -1192,13 +1197,20 @@
|
||||
b.setAttribute("autocompletepopup", this.getAttribute("autocompletepopup"));
|
||||
b.setAttribute("autoscrollpopup", this._autoScrollPopup.id);
|
||||
|
||||
// Create the browserStack container
|
||||
var stack = document.createElementNS(
|
||||
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
|
||||
"stack");
|
||||
stack.setAttribute("anonid", "browserStack");
|
||||
stack.appendChild(b);
|
||||
stack.setAttribute("flex", "1");
|
||||
|
||||
// Add the Message and the Browser to the box
|
||||
var notificationbox = document.createElementNS(
|
||||
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
|
||||
"notificationbox");
|
||||
notificationbox.setAttribute("flex", "1");
|
||||
notificationbox.appendChild(b);
|
||||
b.setAttribute("flex", "1");
|
||||
notificationbox.appendChild(stack);
|
||||
|
||||
var position = this.tabs.length - 1;
|
||||
var uniqueId = "panel" + Date.now() + position;
|
||||
@ -1580,12 +1592,12 @@
|
||||
// (see below), which would be hindered by the potentially expensive
|
||||
// browser removal. So we remove the browser and the panel in two
|
||||
// steps.
|
||||
var panel = browser.parentNode;
|
||||
var panel = browser.parentNode.parentNode;
|
||||
|
||||
// This will unload the document. An unload handler could remove
|
||||
// dependant tabs, so it's important that the tabbrowser is now in
|
||||
// a consistent state (tab removed, tab positions updated, etc.).
|
||||
panel.removeChild(browser);
|
||||
panel.removeChild(browser.parentNode);
|
||||
|
||||
// As the browser is removed, the removal of a dependent document can
|
||||
// cause the whole window to close. So at this point, it's possible
|
||||
@ -2358,7 +2370,7 @@
|
||||
|
||||
<constructor>
|
||||
<![CDATA[
|
||||
this.mCurrentBrowser = this.mPanelContainer.childNodes[0].firstChild;
|
||||
this.mCurrentBrowser = this.mPanelContainer.childNodes[0].firstChild.firstChild;
|
||||
this.mCurrentTab = this.tabContainer.firstChild;
|
||||
document.addEventListener("keypress", this, false);
|
||||
|
||||
|
@ -109,6 +109,43 @@ function scorePatternMatch(pattern, matched, offset) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
// ##########
|
||||
// Class: TabUtils
|
||||
//
|
||||
// A collection of helper functions for dealing with both
|
||||
// <TabItem>s and <xul:tab>s without having to worry which
|
||||
// one is which.
|
||||
var TabUtils = {
|
||||
// ---------
|
||||
// Function: _nameOfTab
|
||||
// Given a <TabItem> or a <xul:tab> returns the tab's name.
|
||||
nameOf: function TabUtils_nameOfTab(tab) {
|
||||
// We can have two types of tabs: A <TabItem> or a <xul:tab>
|
||||
// because we have to deal with both tabs represented inside
|
||||
// of active Panoramas as well as for windows in which
|
||||
// Panorama has yet to be activated. We uses object sniffing to
|
||||
// determine the type of tab and then returns its name.
|
||||
return tab.label != undefined ? tab.label : tab.nameEl.innerHTML;
|
||||
},
|
||||
|
||||
// ---------
|
||||
// Function: favURLOf
|
||||
// Given a <TabItem> or a <xul:tab> returns the URL of tab's favicon.
|
||||
faviconURLOf: function TabUtils_faviconURLOf(tab) {
|
||||
return tab.image != undefined ? tab.image : tab.favEl.src;
|
||||
},
|
||||
|
||||
// ---------
|
||||
// Function: focus
|
||||
// Given a <TabItem> or a <xul:tab>, focuses it and it's window.
|
||||
focus: function TabUtils_focus(tab) {
|
||||
// Convert a <TabItem> to a <xul:tab>
|
||||
if (tab.tab != undefined) tab = tab.tab;
|
||||
tab.ownerDocument.defaultView.gBrowser.selectedTab = tab;
|
||||
tab.ownerDocument.defaultView.focus();
|
||||
}
|
||||
};
|
||||
|
||||
// ##########
|
||||
// Class: TabMatcher
|
||||
//
|
||||
@ -119,66 +156,141 @@ function TabMatcher(term) {
|
||||
this.term = term;
|
||||
}
|
||||
|
||||
TabMatcher.prototype = {
|
||||
TabMatcher.prototype = {
|
||||
// ---------
|
||||
// Function: _filterAndSortMatches
|
||||
// Given an array of <TabItem>s and <xul:tab>s returns a new array
|
||||
// of tabs whose name matched the search term, sorted by lexical
|
||||
// closeness.
|
||||
_filterAndSortForMatches: function TabMatcher__filterAndSortForMatches(tabs) {
|
||||
var self = this;
|
||||
tabs = tabs.filter(function(tab){
|
||||
var name = TabUtils.nameOf(tab);
|
||||
return name.match(self.term, "i");
|
||||
});
|
||||
|
||||
tabs.sort(function sorter(x, y){
|
||||
var yScore = scorePatternMatch(self.term, TabUtils.nameOf(y));
|
||||
var xScore = scorePatternMatch(self.term, TabUtils.nameOf(x));
|
||||
return yScore - xScore;
|
||||
});
|
||||
|
||||
return tabs;
|
||||
},
|
||||
|
||||
// ---------
|
||||
// Function: _filterForUnmatches
|
||||
// Given an array of <TabItem>s returns an unsorted array of tabs whose name
|
||||
// does not match the the search term.
|
||||
_filterForUnmatches: function TabMatcher__filterForUnmatches(tabs) {
|
||||
var self = this;
|
||||
return tabs.filter(function(tab) {
|
||||
var name = tab.nameEl.innerHTML;
|
||||
return !name.match(self.term, "i");
|
||||
});
|
||||
},
|
||||
|
||||
// ---------
|
||||
// Function: _getTabsForOtherWindows
|
||||
// Returns an array of <TabItem>s and <xul:tabs>s representing that
|
||||
// tabs from all windows but the currently focused window. <TabItem>s
|
||||
// will be returned for windows in which Panorama has been activated at
|
||||
// least once, while <xul:tab>s will be return for windows in which
|
||||
// Panorama has never been activated.
|
||||
_getTabsForOtherWindows: function TabMatcher__getTabsForOtherWindows(){
|
||||
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Components.interfaces.nsIWindowMediator);
|
||||
var enumerator = wm.getEnumerator("navigator:browser");
|
||||
var currentWindow = wm.getMostRecentWindow("navigator:browser");
|
||||
|
||||
var allTabs = [];
|
||||
while (enumerator.hasMoreElements()) {
|
||||
var win = enumerator.getNext();
|
||||
// This function gets tabs from other windows: not the one you currently
|
||||
// have focused.
|
||||
if (win != currentWindow) {
|
||||
// If TabView is around iterate over all tabs, else get the currently
|
||||
// shown tabs...
|
||||
|
||||
tvWindow = win.TabView.getContentWindow();
|
||||
if (tvWindow)
|
||||
allTabs = allTabs.concat( tvWindow.TabItems.getItems() );
|
||||
else
|
||||
// win.gBrowser.tabs isn't a proper array, so we can't use concat
|
||||
for (var i=0; i<win.gBrowser.tabs.length; i++) allTabs.push( win.gBrowser.tabs[i] );
|
||||
}
|
||||
}
|
||||
return allTabs;
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: matchedTabsFromOtherWindows
|
||||
// Returns an array of <TabItem>s and <xul:tab>s that match the search term
|
||||
// from all windows but the currently focused window. <TabItem>s will be
|
||||
// returned for windows in which Panorama has been activated at least once,
|
||||
// while <xul:tab>s will be return for windows in which Panorama has never
|
||||
// been activated.
|
||||
// (new TabMatcher("app")).matchedTabsFromOtherWindows();
|
||||
matchedTabsFromOtherWindows: function TabMatcher_matchedTabsFromOtherWindows(){
|
||||
if (this.term.length < 2)
|
||||
return [];
|
||||
|
||||
var tabs = this._getTabsForOtherWindows();
|
||||
tabs = this._filterAndSortForMatches(tabs);
|
||||
return tabs;
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: matched
|
||||
// Returns an array of <TabItem>s which match the current search term.
|
||||
// If the term is less than 2 characters in length, it returns
|
||||
// nothing.
|
||||
matched: function matched() {
|
||||
var self = this;
|
||||
matched: function TabMatcher_matched() {
|
||||
if (this.term.length < 2)
|
||||
return [];
|
||||
|
||||
|
||||
var tabs = TabItems.getItems();
|
||||
tabs = tabs.filter(function(tab){
|
||||
var name = tab.nameEl.innerHTML;
|
||||
return name.match(self.term, "i");
|
||||
});
|
||||
|
||||
tabs.sort(function sorter(x, y){
|
||||
var yScore = scorePatternMatch(self.term, y.nameEl.innerHTML);
|
||||
var xScore = scorePatternMatch(self.term, x.nameEl.innerHTML);
|
||||
return yScore - xScore;
|
||||
});
|
||||
|
||||
tabs = this._filterAndSortForMatches(tabs);
|
||||
return tabs;
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: unmatched
|
||||
// Returns all of <TabItem>s that .matched() doesn't return.
|
||||
unmatched: function unmatched() {
|
||||
var self = this;
|
||||
unmatched: function TabMatcher_unmatched() {
|
||||
var tabs = TabItems.getItems();
|
||||
|
||||
if ( this.term.length < 2 )
|
||||
return tabs;
|
||||
|
||||
return tabs.filter(function(tab) {
|
||||
var name = tab.nameEl.innerHTML;
|
||||
return !name.match(self.term, "i");
|
||||
});
|
||||
|
||||
return this._filterForUnmatches(tabs);
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: doSearch
|
||||
// Performs the search. Lets you provide two functions, one that is called
|
||||
// on all matched tabs, and one that is called on all unmatched tabs.
|
||||
// Both functions take two parameters: A <TabItem> and its integer index
|
||||
// Performs the search. Lets you provide three functions.
|
||||
// The first is on all matched tabs in the window, the second on all unmatched
|
||||
// tabs in the window, and the third on all matched tabs in other windows.
|
||||
// The first two functions take two parameters: A <TabItem> and its integer index
|
||||
// indicating the absolute rank of the <TabItem> in terms of match to
|
||||
// the search term.
|
||||
doSearch: function(matchFunc, unmatchFunc) {
|
||||
// the search term. The last function also takes two paramaters, but can be
|
||||
// passed both <TabItem>s and <xul:tab>s and the index is offset by the
|
||||
// number of matched tabs inside the window.
|
||||
doSearch: function TabMatcher_doSearch(matchFunc, unmatchFunc, otherFunc) {
|
||||
var matches = this.matched();
|
||||
var unmatched = this.unmatched();
|
||||
var otherMatches = this.matchedTabsFromOtherWindows();
|
||||
|
||||
matches.forEach(function(tab, i) {
|
||||
matchFunc(tab, i);
|
||||
});
|
||||
|
||||
otherMatches.forEach(function(tab,i){
|
||||
otherFunc(tab, i+matches.length);
|
||||
});
|
||||
|
||||
unmatched.forEach(function(tab, i) {
|
||||
unmatchFunc(tab, i);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@ -247,9 +359,14 @@ SearchEventHandlerClass.prototype = {
|
||||
if (event.which == event.DOM_VK_BACK_SPACE && term.length <= 1)
|
||||
hideSearch(event);
|
||||
|
||||
var matches = (new TabMatcher(term)).matched();
|
||||
if (event.which == event.DOM_VK_RETURN && matches.length > 0) {
|
||||
matches[0].zoomIn();
|
||||
var matcher = new TabMatcher(term);
|
||||
var matches = matcher.matched();
|
||||
var others = matcher.matchedTabsFromOtherWindows();
|
||||
if (event.which == event.DOM_VK_RETURN && (matches.length > 0 || others.length > 0)) {
|
||||
if (matches.length > 0)
|
||||
matches[0].zoomIn();
|
||||
else
|
||||
TabUtils.focus(others[0]);
|
||||
hideSearch(event);
|
||||
}
|
||||
},
|
||||
@ -281,24 +398,23 @@ SearchEventHandlerClass.prototype = {
|
||||
|
||||
var TabHandlers = {
|
||||
onMatch: function(tab, index){
|
||||
tab.setZ(1010);
|
||||
index != 0 ? tab.addClass("notMainMatch") : tab.removeClass("notMainMatch");
|
||||
|
||||
// Remove any existing handlers before adding the new ones.
|
||||
// If we don't do this, then we may add more handlers than
|
||||
// we remove.
|
||||
iQ(tab.canvasEl)
|
||||
tab.addClass("onTop");
|
||||
index != 0 ? tab.addClass("notMainMatch") : tab.removeClass("notMainMatch");
|
||||
|
||||
// Remove any existing handlers before adding the new ones.
|
||||
// If we don't do this, then we may add more handlers than
|
||||
// we remove.
|
||||
iQ(tab.canvasEl)
|
||||
.unbind("mousedown", TabHandlers._hideHandler)
|
||||
.unbind("mouseup", TabHandlers._showHandler);
|
||||
|
||||
iQ(tab.canvasEl)
|
||||
|
||||
iQ(tab.canvasEl)
|
||||
.mousedown(TabHandlers._hideHandler)
|
||||
.mouseup(TabHandlers._showHandler);
|
||||
},
|
||||
|
||||
onUnmatch: function(tab, index){
|
||||
// TODO: Set back as value per tab. bug 593902
|
||||
tab.setZ(500);
|
||||
iQ(tab.container).removeClass("onTop");
|
||||
tab.removeClass("notMainMatch");
|
||||
|
||||
iQ(tab.canvasEl)
|
||||
@ -306,6 +422,30 @@ var TabHandlers = {
|
||||
.unbind("mouseup", TabHandlers._showHandler);
|
||||
},
|
||||
|
||||
onOther: function(tab, index){
|
||||
// Unlike the other on* functions, in this function tab can
|
||||
// either be a <TabItem> or a <xul:tab>. In other functions
|
||||
// it is always a <TabItem>. Also note that index is offset
|
||||
// by the number of matches within the window.
|
||||
var item = iQ("<div/>")
|
||||
.addClass("inlineMatch")
|
||||
.click(function(){
|
||||
TabUtils.focus(tab);
|
||||
});
|
||||
|
||||
iQ("<img/>")
|
||||
.attr("src", TabUtils.faviconURLOf(tab) )
|
||||
.appendTo(item);
|
||||
|
||||
iQ("<span/>")
|
||||
.text( TabUtils.nameOf(tab) )
|
||||
.appendTo(item);
|
||||
|
||||
index != 0 ? item.addClass("notMainMatch") : item.removeClass("notMainMatch");
|
||||
item.appendTo("#results");
|
||||
iQ("#otherresults").show();
|
||||
},
|
||||
|
||||
_hideHandler: function(event){
|
||||
iQ("#search").fadeOut();
|
||||
TabHandlers._mouseDownLocation = {x:event.clientX, y:event.clientY};
|
||||
@ -358,7 +498,14 @@ function hideSearch(event){
|
||||
|
||||
function performSearch() {
|
||||
var matcher = new TabMatcher(iQ("#searchbox").val());
|
||||
matcher.doSearch(TabHandlers.onMatch, TabHandlers.onUnmatch);
|
||||
|
||||
// Remove any previous other-window search results and
|
||||
// hide the display area.
|
||||
iQ("#results").empty();
|
||||
iQ("#otherresults").hide();
|
||||
iQ("#otherresults>.label").text(tabviewString("search.otherWindowTabs"));
|
||||
|
||||
matcher.doSearch(TabHandlers.onMatch, TabHandlers.onUnmatch, TabHandlers.onOther);
|
||||
}
|
||||
|
||||
function ensureSearchShown(event){
|
||||
|
@ -226,3 +226,22 @@ body {
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
#otherresults{
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.onTop{
|
||||
z-index: 1010 !important;
|
||||
}
|
||||
|
||||
.inlineMatch{
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.inlineMatch>span{
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
@ -20,6 +20,10 @@
|
||||
|
||||
<div id="search">
|
||||
<input id="searchbox" type="text"/>
|
||||
<div id="otherresults">
|
||||
<span class="label"></span>
|
||||
<span id="results"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript;version=1.8" src="tabview.js"></script>
|
||||
|
@ -32,6 +32,12 @@ XPCOMUtils.defineLazyGetter(this, "tabviewBundle", function() {
|
||||
|
||||
function tabviewString(name) tabviewBundle.GetStringFromName('tabview.' + name);
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "gPrefBranch", function() {
|
||||
return Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(Ci.nsIPrefService).
|
||||
getBranch("browser.panorama.");
|
||||
});
|
||||
|
||||
# NB: Certain files need to evaluate before others
|
||||
|
||||
#include iq.js
|
||||
|
@ -155,9 +155,11 @@ let UI = {
|
||||
|
||||
GroupItems.init();
|
||||
|
||||
var groupItemsData = Storage.readGroupItemsData(gWindow);
|
||||
var firstTime = !groupItemsData || Utils.isEmptyObject(groupItemsData);
|
||||
var groupItemData = Storage.readGroupItemData(gWindow);
|
||||
let firstTime = true;
|
||||
if (gPrefBranch.prefHasUserValue("experienced_first_run"))
|
||||
firstTime = !gPrefBranch.getBoolPref("experienced_first_run");
|
||||
let groupItemsData = Storage.readGroupItemsData(gWindow);
|
||||
let groupItemData = Storage.readGroupItemData(gWindow);
|
||||
GroupItems.reconstitute(groupItemsData, groupItemData);
|
||||
GroupItems.killNewTabGroup(); // temporary?
|
||||
|
||||
@ -165,45 +167,9 @@ let UI = {
|
||||
TabItems.init();
|
||||
TabItems.pausePainting();
|
||||
|
||||
if (firstTime) {
|
||||
var padding = 10;
|
||||
var infoWidth = 350;
|
||||
var infoHeight = 232;
|
||||
var pageBounds = Items.getPageBounds();
|
||||
pageBounds.inset(padding, padding);
|
||||
|
||||
// ___ make a fresh groupItem
|
||||
var box = new Rect(pageBounds);
|
||||
box.width =
|
||||
Math.min(box.width * 0.667, pageBounds.width - (infoWidth + padding));
|
||||
box.height = box.height * 0.667;
|
||||
var options = {
|
||||
bounds: box
|
||||
};
|
||||
|
||||
var groupItem = new GroupItem([], options);
|
||||
|
||||
var items = TabItems.getItems();
|
||||
items.forEach(function(item) {
|
||||
if (item.parent)
|
||||
item.parent.remove(item);
|
||||
|
||||
groupItem.add(item);
|
||||
});
|
||||
|
||||
// ___ make info item
|
||||
let video = "http://videos-cdn.mozilla.net/firefox4beta/tabcandy_howto.webm";
|
||||
var html =
|
||||
"<div class='intro'>"
|
||||
+ "<video src='" + video + "' width='100%' preload controls>"
|
||||
+ "</div>";
|
||||
|
||||
box.left = box.right + padding;
|
||||
box.width = infoWidth;
|
||||
box.height = infoHeight;
|
||||
var infoItem = new InfoItem(box);
|
||||
infoItem.html(html);
|
||||
}
|
||||
// if first time in Panorama or no group data:
|
||||
if (firstTime || !groupItemsData || Utils.isEmptyObject(groupItemsData))
|
||||
this.reset(firstTime);
|
||||
|
||||
// ___ resizing
|
||||
if (this._pageBounds)
|
||||
@ -263,6 +229,51 @@ let UI = {
|
||||
this._reorderTabsOnHide = null;
|
||||
this._frameInitialized = false;
|
||||
},
|
||||
|
||||
// Function: reset
|
||||
// Resets the Panorama view to have just one group with all tabs
|
||||
// and, if firstTime == true, add the welcome video/tab
|
||||
reset: function UI_reset(firstTime) {
|
||||
let padding = 10;
|
||||
let infoWidth = 350;
|
||||
let infoHeight = 232;
|
||||
let pageBounds = Items.getPageBounds();
|
||||
pageBounds.inset(padding, padding);
|
||||
|
||||
// ___ make a fresh groupItem
|
||||
let box = new Rect(pageBounds);
|
||||
box.width =
|
||||
Math.min(box.width * 0.667, pageBounds.width - (infoWidth + padding));
|
||||
box.height = box.height * 0.667;
|
||||
|
||||
GroupItems.groupItems.forEach(function(group) {
|
||||
group.close();
|
||||
});
|
||||
|
||||
let groupItem = new GroupItem([], {bounds: box});
|
||||
let items = TabItems.getItems();
|
||||
items.forEach(function(item) {
|
||||
if (item.parent)
|
||||
item.parent.remove(item);
|
||||
groupItem.add(item);
|
||||
});
|
||||
|
||||
if (firstTime) {
|
||||
gPrefBranch.setBoolPref("experienced_first_run", true);
|
||||
|
||||
// ___ make info item
|
||||
let video =
|
||||
"http://videos-cdn.mozilla.net/firefox4beta/tabcandy_howto.webm";
|
||||
let html =
|
||||
"<div class='intro'>"
|
||||
+ "<video src='" + video + "' width='100%' preload controls>"
|
||||
+ "</div>";
|
||||
let infoBox = new Rect(box.right + padding, box.top,
|
||||
infoWidth, infoHeight);
|
||||
let infoItem = new InfoItem(infoBox);
|
||||
infoItem.html(html);
|
||||
}
|
||||
},
|
||||
|
||||
// Function: blurAll
|
||||
// Blurs any currently focused element
|
||||
@ -1006,7 +1017,7 @@ let UI = {
|
||||
}, {
|
||||
name: "reset",
|
||||
code: function() {
|
||||
self._reset();
|
||||
self.reset();
|
||||
}
|
||||
}, {
|
||||
*/
|
||||
@ -1029,14 +1040,6 @@ let UI = {
|
||||
}
|
||||
},
|
||||
|
||||
// -----------
|
||||
// Function: _reset
|
||||
// Wipes all TabView storage and refreshes, giving you the "first-run" state.
|
||||
_reset: function UI__reset() {
|
||||
Storage.wipe();
|
||||
location.href = "";
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: storageSanity
|
||||
// Given storage data for this object, returns true if it looks valid.
|
||||
|
@ -152,6 +152,9 @@ _BROWSER_FILES = \
|
||||
browser_bug581947.js \
|
||||
browser_bug585830.js \
|
||||
browser_bug592338.js \
|
||||
browser_bug594131.js \
|
||||
browser_bug595507.js \
|
||||
browser_bug596687.js \
|
||||
browser_contextSearchTabPosition.js \
|
||||
browser_ctrlTab.js \
|
||||
browser_discovery.js \
|
||||
@ -213,7 +216,6 @@ _BROWSER_FILES = \
|
||||
file_bug550565_popup.html \
|
||||
file_bug550565_favicon.ico \
|
||||
browser_overLinkInLocationBar.js \
|
||||
browser_overLinkInLocationBar.html \
|
||||
$(NULL)
|
||||
|
||||
ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||
|
95
browser/base/content/test/browser_addon_bar.js
Normal file
95
browser/base/content/test/browser_addon_bar.js
Normal file
@ -0,0 +1,95 @@
|
||||
/* ***** 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 browser add-on bar test code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is the Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Dietrich Ayala <dietrich@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 ***** */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let addonbar = document.getElementById("addon-bar");
|
||||
ok(addonbar.collapsed, "addon bar is collapsed by default");
|
||||
|
||||
let topMenu, toolbarMenu;
|
||||
|
||||
function onTopMenuShown(event) {
|
||||
ok(1, "top menu popupshown listener called");
|
||||
event.currentTarget.removeEventListener("popupshown", arguments.callee, false);
|
||||
// open the customize or toolbars menu
|
||||
toolbarMenu = document.getElementById("appmenu_customizeMenu") ||
|
||||
document.getElementById("viewToolbarsMenu").firstElementChild;
|
||||
toolbarMenu.addEventListener("popupshown", onToolbarMenuShown, false);
|
||||
toolbarMenu.addEventListener("popuphidden", onToolbarMenuHidden, false);
|
||||
toolbarMenu.openPopup();
|
||||
}
|
||||
|
||||
function onTopMenuHidden(event) {
|
||||
ok(1, "top menu popuphidden listener called");
|
||||
event.currentTarget.removeEventListener("popuphidden", arguments.callee, false);
|
||||
finish();
|
||||
}
|
||||
|
||||
function onToolbarMenuShown(event) {
|
||||
ok(1, "sub menu popupshown listener called");
|
||||
event.currentTarget.removeEventListener("popupshown", arguments.callee, false);
|
||||
|
||||
// test the menu item's default state
|
||||
let menuitem = document.getElementById("toggle_addon-bar");
|
||||
ok(menuitem, "found the menu item");
|
||||
is(menuitem.getAttribute("checked"), "false", "menuitem is not checked by default");
|
||||
|
||||
// click on the menu item
|
||||
// TODO: there's got to be a way to check+command in one shot
|
||||
menuitem.setAttribute("checked", "true");
|
||||
menuitem.click();
|
||||
|
||||
// now the addon bar should be visible and the menu checked
|
||||
is(addonbar.getAttribute("collapsed"), "false", "addon bar is visible after executing the command");
|
||||
is(menuitem.getAttribute("checked"), "true", "menuitem is checked after executing the command");
|
||||
|
||||
toolbarMenu.hidePopup();
|
||||
}
|
||||
|
||||
function onToolbarMenuHidden(event) {
|
||||
ok(1, "toolbar menu popuphidden listener called");
|
||||
event.currentTarget.removeEventListener("popuphidden", arguments.callee, false);
|
||||
topMenu.hidePopup();
|
||||
}
|
||||
|
||||
// open the appmenu or view menu
|
||||
topMenu = document.getElementById("appmenu-popup") ||
|
||||
document.getElementById("menu_viewPopup");
|
||||
topMenu.addEventListener("popupshown", onTopMenuShown, false);
|
||||
topMenu.addEventListener("popuphidden", onTopMenuHidden, false);
|
||||
topMenu.openPopup();
|
||||
}
|
@ -15,7 +15,7 @@ var runs = [
|
||||
is(tabbrowser.browsers.length, 1, "Window has one browser");
|
||||
is(tabbrowser.selectedTab, newTab, "Remaining tab is selected");
|
||||
is(tabbrowser.selectedBrowser, newBrowser, "Browser for remaining tab is selected");
|
||||
is(tabbrowser.mTabBox.selectedPanel, newBrowser.parentNode, "Panel for remaining tab is selected");
|
||||
is(tabbrowser.mTabBox.selectedPanel, newBrowser.parentNode.parentNode, "Panel for remaining tab is selected");
|
||||
}
|
||||
}
|
||||
];
|
||||
|
58
browser/base/content/test/browser_bug594131.js
Normal file
58
browser/base/content/test/browser_bug594131.js
Normal file
@ -0,0 +1,58 @@
|
||||
/* ***** 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 bug 594131 test.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Sindre Dammann <sindrebugzilla@gmail.com>
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
function test() {
|
||||
let backgroundPref = "browser.tabs.loadBookmarksInBackground";
|
||||
let newTab = gBrowser.addTab("http://example.com");
|
||||
waitForExplicitFinish();
|
||||
newTab.linkedBrowser.addEventListener("load", mainPart, true);
|
||||
|
||||
Services.prefs.setBoolPref(backgroundPref, true);
|
||||
|
||||
function mainPart() {
|
||||
gBrowser.pinTab(newTab);
|
||||
gBrowser.selectedTab = newTab;
|
||||
|
||||
openUILinkIn("http://example.org/", "current");
|
||||
isnot(gBrowser.selectedTab, newTab, "shouldn't load in background");
|
||||
|
||||
if (Services.prefs.prefHasUserValue(backgroundPref))
|
||||
Services.prefs.clearUserPref(backgroundPref);
|
||||
gBrowser.removeTab(newTab);
|
||||
gBrowser.removeTab(gBrowser.tabs[1]); // example.org tab
|
||||
finish();
|
||||
}
|
||||
}
|
39
browser/base/content/test/browser_bug595507.js
Normal file
39
browser/base/content/test/browser_bug595507.js
Normal file
@ -0,0 +1,39 @@
|
||||
var gInvalidFormPopup = document.getElementById('invalid-form-popup');
|
||||
ok(gInvalidFormPopup,
|
||||
"The browser should have a popup to show when a form is invalid");
|
||||
|
||||
/**
|
||||
* Make sure that the form validation error message shows even if the form is in an iframe.
|
||||
*/
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
|
||||
let uri = "data:text/html,<iframe src=\"data:text/html,<iframe name='t'></iframe><form target='t' action='data:text/html,'><input required id='i'><input id='s' type='submit'></form>\"</iframe>";
|
||||
let tab = gBrowser.addTab();
|
||||
|
||||
gInvalidFormPopup.addEventListener("popupshown", function() {
|
||||
gInvalidFormPopup.removeEventListener("popupshown", arguments.callee, false);
|
||||
|
||||
let doc = gBrowser.contentDocument.getElementsByTagName('iframe')[0].contentDocument;
|
||||
is(doc.activeElement, doc.getElementById('i'),
|
||||
"First invalid element should be focused");
|
||||
|
||||
ok(gInvalidFormPopup.state == 'showing' || gInvalidFormPopup.state == 'open',
|
||||
"The invalid form popup should be shown");
|
||||
|
||||
// Clean-up and next test.
|
||||
gBrowser.removeTab(gBrowser.selectedTab, {animate: false});
|
||||
executeSoon(finish);
|
||||
}, false);
|
||||
|
||||
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
gBrowser.contentDocument.getElementsByTagName('iframe')[0].contentDocument
|
||||
.getElementById('s').click();
|
||||
}, true);
|
||||
|
||||
gBrowser.selectedTab = tab;
|
||||
gBrowser.selectedTab.linkedBrowser.loadURI(uri);
|
||||
}
|
20
browser/base/content/test/browser_bug596687.js
Normal file
20
browser/base/content/test/browser_bug596687.js
Normal file
@ -0,0 +1,20 @@
|
||||
function test() {
|
||||
var tab = gBrowser.addTab(null, {skipAnimation: true});
|
||||
gBrowser.selectedTab = tab;
|
||||
|
||||
var gotTabAttrModified = false;
|
||||
var gotTabClose = false;
|
||||
|
||||
tab.addEventListener("TabClose", function () {
|
||||
gotTabClose = true;
|
||||
|
||||
tab.addEventListener("TabAttrModified", function () {
|
||||
gotTabAttrModified = true;
|
||||
}, false);
|
||||
}, false);
|
||||
|
||||
gBrowser.removeTab(tab);
|
||||
|
||||
ok(gotTabClose, "should have got the TabClose event");
|
||||
ok(!gotTabAttrModified, "shouldn't have got the TabAttrModified event after TabClose");
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<html>
|
||||
<body>
|
||||
<p>
|
||||
<a href="http://example.com/" id="link">LINK</a>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
@ -40,28 +40,21 @@
|
||||
* mouses over a link. See bug 587908.
|
||||
*/
|
||||
|
||||
const TEST_URL = "http://mochi.test:8888/browser/browser/base/content/test/browser_overLinkInLocationBar.html";
|
||||
|
||||
var gTestIter;
|
||||
|
||||
// TESTS //////////////////////////////////////////////////////////////////////
|
||||
|
||||
function smokeTestGenerator() {
|
||||
let tab = openTestPage();
|
||||
yield;
|
||||
if (ensureOverLinkHidden())
|
||||
yield;
|
||||
|
||||
let contentDoc = gBrowser.contentDocument;
|
||||
let link = contentDoc.getElementById("link");
|
||||
|
||||
mouseover(link);
|
||||
setOverLink("http://example.com/");
|
||||
yield;
|
||||
checkURLBar(true);
|
||||
|
||||
mouseout(link);
|
||||
setOverLink("");
|
||||
yield;
|
||||
checkURLBar(false);
|
||||
|
||||
gBrowser.removeTab(tab);
|
||||
}
|
||||
|
||||
function test() {
|
||||
@ -112,66 +105,36 @@ function checkURLBar(shouldShowOverLink) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the test URL in a new foreground tab. When the page has finished
|
||||
* loading, the test iterator is advanced, so you should yield after calling.
|
||||
* Sets the over-link. This assumes that aStr will cause the over-link to fade
|
||||
* in or out. When its transition has finished, the test iterator is
|
||||
* incremented, so you should yield after calling.
|
||||
*
|
||||
* @return The opened <tab>.
|
||||
* @param aStr
|
||||
* The over-link will be set to this string or cleared if this is falsey.
|
||||
*/
|
||||
function openTestPage() {
|
||||
gBrowser.addEventListener("load", function onLoad(event) {
|
||||
if (event.target.URL == TEST_URL) {
|
||||
gBrowser.removeEventListener("load", onLoad, true);
|
||||
cont();
|
||||
}
|
||||
}, true);
|
||||
return gBrowser.loadOneTab(TEST_URL, { inBackground: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a mouseover event to a given anchor node. When the over-link fade-in
|
||||
* transition has completed, the test iterator is advanced, so you should yield
|
||||
* after calling.
|
||||
*
|
||||
* @param anchorNode
|
||||
* An anchor node.
|
||||
*/
|
||||
function mouseover(anchorNode) {
|
||||
mouseAnchorNode(anchorNode, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a mouseout event to a given anchor node. When the over-link fade-out
|
||||
* transition has completed, the test iterator is advanced, so you should yield
|
||||
* after calling.
|
||||
*
|
||||
* @param anchorNode
|
||||
* An anchor node.
|
||||
*/
|
||||
function mouseout(anchorNode) {
|
||||
mouseAnchorNode(anchorNode, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper for mouseover and mouseout. Sends a mouse event to a given node.
|
||||
* When the over-link fade-in or -out transition has completed, the test
|
||||
* iterator is advanced, so you should yield after calling.
|
||||
*
|
||||
* @param node
|
||||
* An anchor node in a content document.
|
||||
* @param over
|
||||
* True for "mouseover" and false for "mouseout".
|
||||
*/
|
||||
function mouseAnchorNode(node, over) {
|
||||
function setOverLink(aStr) {
|
||||
let overLink = gURLBar._overLinkBox;
|
||||
overLink.addEventListener("transitionend", function onTrans(event) {
|
||||
if (event.target == overLink) {
|
||||
if (event.target == overLink && event.propertyName == "opacity") {
|
||||
overLink.removeEventListener("transitionend", onTrans, false);
|
||||
cont();
|
||||
}
|
||||
}, false);
|
||||
let offset = over ? 0 : -1;
|
||||
let eventType = over ? "mouseover" : "mouseout";
|
||||
EventUtils.synthesizeMouse(node, offset, offset,
|
||||
{ type: eventType, clickCount: 0 },
|
||||
node.ownerDocument.defaultView);
|
||||
gURLBar.setOverLink(aStr);
|
||||
}
|
||||
|
||||
/**
|
||||
* If the over-link is hidden, returns false. Otherwise, hides the overlink and
|
||||
* returns true. When the overlink is hidden, the test iterator is incremented,
|
||||
* so if this function returns true, you should yield after calling.
|
||||
*
|
||||
* @return True if you should yield and calling and false if not.
|
||||
*/
|
||||
function ensureOverLinkHidden() {
|
||||
let overLink = gURLBar._overLinkBox;
|
||||
if (window.getComputedStyle(overLink, null).opacity == 0)
|
||||
return false;
|
||||
|
||||
setOverLink("");
|
||||
return true;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
var pageInfo, atTest = 0;
|
||||
var pageInfo;
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function () {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
@ -15,22 +15,7 @@ function test() {
|
||||
if (topic != "page-info-dialog-loaded")
|
||||
return;
|
||||
|
||||
switch (atTest) {
|
||||
case 0:
|
||||
atTest++;
|
||||
handlePageInfo();
|
||||
break;
|
||||
case 1:
|
||||
atTest++;
|
||||
pageInfo = win;
|
||||
testLockClick();
|
||||
break;
|
||||
case 2:
|
||||
atTest++;
|
||||
Services.obs.removeObserver(observer, "page-info-dialog-loaded");
|
||||
testLockDoubleClick();
|
||||
break;
|
||||
}
|
||||
handlePageInfo();
|
||||
}
|
||||
|
||||
function $(aId) { return pageInfo.document.getElementById(aId) };
|
||||
@ -53,35 +38,7 @@ function test() {
|
||||
"Name given: " + feedItem.getAttribute("name") + ", should be " + (i+1));
|
||||
}
|
||||
|
||||
pageInfo.addEventListener("unload", function() {
|
||||
pageInfo.removeEventListener("unload", arguments.callee, false);
|
||||
var lockIcon = document.getElementById("security-button");
|
||||
EventUtils.synthesizeMouse(lockIcon, 0, 0, {clickCount: 1});
|
||||
}, false);
|
||||
pageInfo.close();
|
||||
}
|
||||
|
||||
function testLockClick() {
|
||||
var deck = $("mainDeck");
|
||||
is(deck.selectedPanel.id, "securityPanel", "The security tab should open when the lock icon is clicked");
|
||||
pageInfo.addEventListener("unload", function() {
|
||||
pageInfo.removeEventListener("unload", arguments.callee, false);
|
||||
var lockIcon = document.getElementById("security-button");
|
||||
EventUtils.synthesizeMouse(lockIcon, 0, 0, {clickCount: 1});
|
||||
EventUtils.synthesizeMouse(lockIcon, 0, 0, {clickCount: 2});
|
||||
}, false);
|
||||
pageInfo.close();
|
||||
}
|
||||
|
||||
function testLockDoubleClick() {
|
||||
var pageInfoDialogs = Services.wm.getEnumerator("Browser:page-info");
|
||||
var i = 0;
|
||||
while (pageInfoDialogs.hasMoreElements()) {
|
||||
i++;
|
||||
pageInfo = pageInfoDialogs.getNext();
|
||||
pageInfo.close();
|
||||
}
|
||||
is(i, 1, "When the lock is clicked twice there should be only one page info dialog");
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
}
|
||||
|
@ -55,9 +55,11 @@ _BROWSER_FILES = \
|
||||
browser_tabview_exit_button.js \
|
||||
browser_tabview_group.js \
|
||||
browser_tabview_launch.js \
|
||||
browser_tabview_multiwindow_search.js \
|
||||
browser_tabview_search.js \
|
||||
browser_tabview_snapping.js \
|
||||
browser_tabview_undo_group.js \
|
||||
browser_tabview_firstrun_pref.js \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_BROWSER_FILES)
|
||||
|
@ -0,0 +1,103 @@
|
||||
/* ***** 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 Tab View first run (Bug 593157) test.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Michael Yoshitaka Erlewine <mitcho@mitcho.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 ***** */
|
||||
|
||||
var prefsBranch = Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(Ci.nsIPrefService).
|
||||
getBranch("browser.panorama.");
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
ok(!TabView.isVisible(), "Main window TabView is hidden");
|
||||
|
||||
prefsBranch.setBoolPref("experienced_first_run", false);
|
||||
ok(!experienced(), "not experienced");
|
||||
|
||||
newWindowWithTabView(checkFirstRun, part2);
|
||||
}
|
||||
|
||||
function experienced() {
|
||||
return prefsBranch.prefHasUserValue("experienced_first_run") &&
|
||||
prefsBranch.getBoolPref("experienced_first_run");
|
||||
}
|
||||
|
||||
function checkFirstRun(win) {
|
||||
let contentWindow = win.document.getElementById("tab-view").contentWindow;
|
||||
|
||||
let infoItems = contentWindow.iQ(".info-item");
|
||||
is(infoItems.length, 1, "There should be an info item");
|
||||
|
||||
let groupItems = contentWindow.GroupItems.groupItems;
|
||||
is(groupItems.length, 1, "There should be one group");
|
||||
|
||||
ok(experienced(), "we're now experienced");
|
||||
}
|
||||
|
||||
function part2() {
|
||||
newWindowWithTabView(checkNotFirstRun, endGame);
|
||||
}
|
||||
|
||||
function checkNotFirstRun(win) {
|
||||
let contentWindow = win.document.getElementById("tab-view").contentWindow;
|
||||
|
||||
let infoItems = contentWindow.iQ(".info-item");
|
||||
is(infoItems.length, 0, "There should be no info items");
|
||||
}
|
||||
|
||||
function endGame() {
|
||||
ok(!TabView.isVisible(), "Main window TabView is still hidden");
|
||||
finish();
|
||||
}
|
||||
|
||||
function newWindowWithTabView(callback, completeCallback) {
|
||||
let charsetArg = "charset=" + window.content.document.characterSet;
|
||||
let win = window.openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no,height=800,width=800",
|
||||
"about:blank", charsetArg, null, null, true);
|
||||
let onLoad = function() {
|
||||
win.removeEventListener("load", onLoad, false);
|
||||
let onShown = function() {
|
||||
win.removeEventListener("tabviewshown", onShown, false);
|
||||
callback(win);
|
||||
win.close();
|
||||
if (typeof completeCallback == "function")
|
||||
completeCallback();
|
||||
};
|
||||
win.addEventListener("tabviewshown", onShown, false);
|
||||
win.TabView.toggle();
|
||||
}
|
||||
win.addEventListener("load", onLoad, false);
|
||||
}
|
@ -45,26 +45,24 @@ function test() {
|
||||
if (tabViewShownCount == 1) {
|
||||
document.getElementById("menu_tabview").doCommand();
|
||||
} else if (tabViewShownCount == 2) {
|
||||
var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
|
||||
getInterface(Components.interfaces.nsIDOMWindowUtils);
|
||||
if (utils) {
|
||||
var keyCode = 0;
|
||||
var charCode;
|
||||
var eventObject;
|
||||
if (navigator.platform.indexOf("Mac") != -1) {
|
||||
charCode = 160;
|
||||
eventObject = { altKey: true };
|
||||
} else {
|
||||
charCode = 32;
|
||||
eventObject = { ctrlKey: true };
|
||||
}
|
||||
var modifiers = EventUtils._parseModifiers(eventObject);
|
||||
var keyDownDefaultHappened =
|
||||
utils.sendKeyEvent("keydown", keyCode, charCode, modifiers);
|
||||
utils.sendKeyEvent("keypress", keyCode, charCode, modifiers,
|
||||
!keyDownDefaultHappened);
|
||||
utils.sendKeyEvent("keyup", keyCode, charCode, modifiers);
|
||||
let utils = window.QueryInterface(Ci.nsIInterfaceRequestor).
|
||||
getInterface(Ci.nsIDOMWindowUtils);
|
||||
let keyCode = 0;
|
||||
let charCode;
|
||||
let eventObject;
|
||||
if (navigator.platform.indexOf("Mac") != -1) {
|
||||
charCode = 160;
|
||||
eventObject = { altKey: true };
|
||||
} else {
|
||||
charCode = 32;
|
||||
eventObject = { ctrlKey: true };
|
||||
}
|
||||
let modifiers = EventUtils._parseModifiers(eventObject);
|
||||
let keyDownDefaultHappened =
|
||||
utils.sendKeyEvent("keydown", keyCode, charCode, modifiers);
|
||||
utils.sendKeyEvent("keypress", keyCode, charCode, modifiers,
|
||||
!keyDownDefaultHappened);
|
||||
utils.sendKeyEvent("keyup", keyCode, charCode, modifiers);
|
||||
} else if (tabViewShownCount == 3) {
|
||||
window.removeEventListener("tabviewshown", onTabViewShown, false);
|
||||
window.removeEventListener("tabviewhidden", onTabViewHidden, false);
|
||||
@ -72,9 +70,10 @@ function test() {
|
||||
}
|
||||
}
|
||||
let onTabViewShown = function() {
|
||||
ok(TabView.isVisible(), "Tab View is visible");
|
||||
// add the count to the message so we can track things more easily.
|
||||
ok(TabView.isVisible(), "Tab View is visible. Count: " + tabViewShownCount);
|
||||
tabViewShownCount++
|
||||
TabView.toggle();
|
||||
executeSoon(function() { TabView.toggle(); });
|
||||
}
|
||||
window.addEventListener("tabviewshown", onTabViewShown, false);
|
||||
window.addEventListener("tabviewhidden", onTabViewHidden, false);
|
||||
|
@ -0,0 +1,184 @@
|
||||
/* ***** 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 tabview search test.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Raymond Lee <raymond@appcoast.com>
|
||||
* Ehsan Akhgari <ehsan@mozilla.com>
|
||||
* Sean Dunn <seanedunn@yahoo.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 ***** */
|
||||
|
||||
let newWindows = [];
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
let windowOne = openDialog(location, "", "chrome,all,dialog=no", "data:text/html,");
|
||||
let windowTwo;
|
||||
|
||||
windowOne.addEventListener("load", function() {
|
||||
windowOne.gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
windowOne.gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
windowTwo = openDialog(location, "", "chrome,all,dialog=no", "http://mochi.test:8888/");
|
||||
windowTwo.addEventListener("load", function() {
|
||||
windowTwo.gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
windowTwo.gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
newWindows = [ windowOne, windowTwo ];
|
||||
|
||||
// show the tab view
|
||||
window.addEventListener("tabviewshown", onTabViewWindowLoaded, false);
|
||||
ok(!TabView.isVisible(), "Tab View is hidden");
|
||||
TabView.toggle();
|
||||
}, true);
|
||||
}, false);
|
||||
}, true);
|
||||
}, false);
|
||||
}
|
||||
|
||||
function onTabViewWindowLoaded() {
|
||||
window.removeEventListener("tabviewshown", onTabViewWindowLoaded, false);
|
||||
ok(TabView.isVisible(), "Tab View is visible");
|
||||
|
||||
let contentWindow = document.getElementById("tab-view").contentWindow;
|
||||
let search = contentWindow.document.getElementById("search");
|
||||
let searchButton = contentWindow.document.getElementById("searchbutton");
|
||||
|
||||
ok(searchButton, "Search button exists");
|
||||
|
||||
let onSearchEnabled = function() {
|
||||
ok(search.style.display != "none", "Search is enabled");
|
||||
contentWindow.removeEventListener(
|
||||
"tabviewsearchenabled", onSearchEnabled, false);
|
||||
searchTest(contentWindow);
|
||||
}
|
||||
contentWindow.addEventListener("tabviewsearchenabled", onSearchEnabled, false);
|
||||
// enter search mode
|
||||
EventUtils.sendMouseEvent({ type: "mousedown" }, searchButton, contentWindow);
|
||||
}
|
||||
|
||||
// conveniently combine local and other window tab results from a query
|
||||
function getMatchResults(contentWindow, query) {
|
||||
let matcher = new contentWindow.TabMatcher(query);
|
||||
let localMatchResults = matcher.matched();
|
||||
let otherMatchResults = matcher.matchedTabsFromOtherWindows();
|
||||
return localMatchResults.concat(otherMatchResults);
|
||||
}
|
||||
|
||||
function searchTest(contentWindow) {
|
||||
let searchBox = contentWindow.document.getElementById("searchbox");
|
||||
let matcher = null;
|
||||
let matchResults = [];
|
||||
|
||||
// get the titles of tabs.
|
||||
let tabNames = [];
|
||||
|
||||
let tabItems = contentWindow.TabItems.getItems();
|
||||
is(tabItems.length, 1, "Have only one tab in the current window's tab items");
|
||||
tabItems.forEach(function(tab) {
|
||||
tabNames.push(tab.nameEl.innerHTML);
|
||||
});
|
||||
|
||||
newWindows.forEach(function(win) {
|
||||
for(var i=0; i<win.gBrowser.tabs.length; ++i) {
|
||||
tabNames.push(win.gBrowser.tabs[i].label);
|
||||
}
|
||||
});
|
||||
|
||||
ok(tabNames[0] && tabNames[0].length > 2,
|
||||
"The title of tab item is longer than 2 chars")
|
||||
|
||||
// empty string
|
||||
searchBox.setAttribute("value", "");
|
||||
matchResults = getMatchResults(contentWindow, searchBox.getAttribute("value"));
|
||||
ok(matchResults.length == 0, "Match nothing if it's an empty string");
|
||||
|
||||
// one char
|
||||
searchBox.setAttribute("value", tabNames[0].charAt(0));
|
||||
matchResults = getMatchResults(contentWindow, searchBox.getAttribute("value"));
|
||||
ok(matchResults.length == 0,
|
||||
"Match nothing if the length of search term is less than 2");
|
||||
|
||||
// the full title
|
||||
searchBox.setAttribute("value", tabNames[2]);
|
||||
matchResults = getMatchResults(contentWindow, searchBox.getAttribute("value"));
|
||||
is(matchResults.length, 1,
|
||||
"Match something when the whole title exists");
|
||||
|
||||
// part of titled
|
||||
searchBox.setAttribute("value", tabNames[0].substr(1));
|
||||
contentWindow.performSearch();
|
||||
matchResults = getMatchResults(contentWindow, searchBox.getAttribute("value"));
|
||||
is(matchResults.length, 1,
|
||||
"Match something when a part of title exists");
|
||||
|
||||
cleanup(contentWindow);
|
||||
}
|
||||
|
||||
function cleanup(contentWindow) {
|
||||
contentWindow.hideSearch(null);
|
||||
|
||||
let onTabViewHidden = function() {
|
||||
window.removeEventListener("tabviewhidden", onTabViewHidden, false);
|
||||
ok(!TabView.isVisible(), "Tab View is hidden");
|
||||
let numToClose = newWindows.length;
|
||||
newWindows.forEach(function(win) {
|
||||
whenWindowObservesOnce(win, "domwindowclosed", function() {
|
||||
--numToClose;
|
||||
if(numToClose==0) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
win.close();
|
||||
});
|
||||
}
|
||||
window.addEventListener("tabviewhidden", onTabViewHidden, false);
|
||||
EventUtils.synthesizeKey("VK_ENTER", {});
|
||||
}
|
||||
|
||||
function whenWindowObservesOnce(win, topic, func) {
|
||||
let windowWatcher = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
|
||||
.getService(Components.interfaces.nsIWindowWatcher);
|
||||
let origWin = win;
|
||||
let origTopic = topic;
|
||||
let origFunc = func;
|
||||
function windowObserver(aSubject, aTopic, aData) {
|
||||
let theWin = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
if (origWin && theWin != origWin)
|
||||
return;
|
||||
if(aTopic == origTopic) {
|
||||
windowWatcher.unregisterNotification(windowObserver);
|
||||
origFunc.apply(this, []);
|
||||
}
|
||||
}
|
||||
windowWatcher.registerNotification(windowObserver);
|
||||
}
|
@ -20,6 +20,7 @@
|
||||
*
|
||||
* Contributor(s):
|
||||
* Raymond Lee <raymond@appcoast.com>
|
||||
* Sean Dunn <seanedunn@yahoo.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
|
||||
@ -117,6 +118,11 @@ function searchTest(contentWindow) {
|
||||
searchBox.getAttribute("value")).matched().length == 2,
|
||||
"Match something when a part of title exists");
|
||||
|
||||
cleanup(contentWindow);
|
||||
}
|
||||
|
||||
function cleanup(contentWindow) {
|
||||
contentWindow.hideSearch(null);
|
||||
let onTabViewHidden = function() {
|
||||
window.removeEventListener("tabviewhidden", onTabViewHidden, false);
|
||||
ok(!TabView.isVisible(), "Tab View is hidden");
|
||||
|
@ -123,25 +123,36 @@
|
||||
this.inputField.addEventListener("mouseout", this, false);
|
||||
this.inputField.addEventListener("overflow", this, false);
|
||||
this.inputField.addEventListener("underflow", this, false);
|
||||
this._overLinkBox.addEventListener("transitionend", this, false);
|
||||
|
||||
const kXULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
var textBox = document.getAnonymousElementByAttribute(this,
|
||||
"anonid", "textbox-input-box");
|
||||
var cxmenu = document.getAnonymousElementByAttribute(textBox,
|
||||
"anonid", "input-box-contextmenu");
|
||||
var pasteAndGo;
|
||||
cxmenu.addEventListener("popupshowing", function() {
|
||||
if (!pasteAndGo)
|
||||
return;
|
||||
var controller = document.commandDispatcher.getControllerForCommand("cmd_paste");
|
||||
var enabled = controller.isCommandEnabled("cmd_paste");
|
||||
if (enabled)
|
||||
pasteAndGo.removeAttribute("disabled");
|
||||
else
|
||||
pasteAndGo.setAttribute("disabled", "true");
|
||||
}, false);
|
||||
|
||||
var insertLocation = cxmenu.firstChild;
|
||||
while (insertLocation.nextSibling &&
|
||||
insertLocation.getAttribute("cmd") != "cmd_paste")
|
||||
insertLocation = insertLocation.nextSibling;
|
||||
if (insertLocation) {
|
||||
let element = document.createElement("menuitem");
|
||||
pasteAndGo = document.createElement("menuitem");
|
||||
let label = Services.strings.createBundle("chrome://browser/locale/browser.properties").
|
||||
GetStringFromName("pasteAndGo.label");
|
||||
element.setAttribute("label", label);
|
||||
element.setAttribute("cmd", "cmd_paste");
|
||||
element.setAttribute("oncommand", "goDoCommand('cmd_paste'); gURLBar.handleCommand();");
|
||||
cxmenu.insertBefore(element, insertLocation.nextSibling);
|
||||
pasteAndGo.setAttribute("label", label);
|
||||
pasteAndGo.setAttribute("anonid", "paste-and-go");
|
||||
pasteAndGo.setAttribute("oncommand", "goDoCommand('cmd_paste'); gURLBar.handleCommand();");
|
||||
cxmenu.insertBefore(pasteAndGo, insertLocation.nextSibling);
|
||||
}
|
||||
]]></constructor>
|
||||
|
||||
@ -154,7 +165,6 @@
|
||||
this.inputField.removeEventListener("mouseout", this, false);
|
||||
this.inputField.removeEventListener("overflow", this, false);
|
||||
this.inputField.removeEventListener("underflow", this, false);
|
||||
this._overLinkBox.removeEventListener("transitionend", this, false);
|
||||
]]></destructor>
|
||||
|
||||
<field name="_value"></field>
|
||||
@ -524,12 +534,6 @@
|
||||
this._contentIsCropped = false;
|
||||
this._hideURLTooltip();
|
||||
break;
|
||||
case "transitionend":
|
||||
if (aEvent.target == this._overLinkBox &&
|
||||
aEvent.propertyName == "opacity") {
|
||||
this._overLinkTransitioning = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
]]></body>
|
||||
</method>
|
||||
@ -596,15 +600,28 @@
|
||||
"textbox-container");
|
||||
]]></field>
|
||||
|
||||
<field name="_overLinkDelay" readonly="true"><![CDATA[
|
||||
100
|
||||
]]></field>
|
||||
|
||||
<field name="_overLinkDelayTimer"><![CDATA[
|
||||
undefined
|
||||
]]></field>
|
||||
|
||||
<method name="setOverLink">
|
||||
<parameter name="aURL"/>
|
||||
<body><![CDATA[
|
||||
// If the over-link is already scheduled to fade-in, cancel it.
|
||||
if (this._overLinkDelayTimer) {
|
||||
clearTimeout(this._overLinkDelayTimer);
|
||||
delete this._overLinkDelayTimer;
|
||||
}
|
||||
|
||||
// Hide the over-link if aURL is falsey or if the URL bar is focused.
|
||||
if (!aURL || this.focused) {
|
||||
if (this.hasAttribute("overlinkstate")) {
|
||||
// Over-link is fading in or showing. Fade out.
|
||||
if (this.hasAttribute("overlinkstate"))
|
||||
this.removeAttribute("overlinkstate");
|
||||
this._overLinkTransitioning = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -651,13 +668,19 @@
|
||||
|
||||
this._originLabel.value = this.value;
|
||||
|
||||
// Finally, show the over-link. If its animation is currently in
|
||||
// transition, show it immediately rather than animating it again.
|
||||
if (this._overLinkTransitioning)
|
||||
// Finally, show the over-link.
|
||||
if (window.getComputedStyle(overLink, null).opacity != 0) {
|
||||
// It's currently becoming transparent, becoming opaque, or is
|
||||
// opaque. Show it immediately.
|
||||
this.setAttribute("overlinkstate", "showing");
|
||||
}
|
||||
else {
|
||||
this.setAttribute("overlinkstate", "fade-in");
|
||||
this._overLinkTransitioning = true;
|
||||
// It's not showing at all. Start fade-in after some delay.
|
||||
this._overLinkDelayTimer =
|
||||
setTimeout(function overLinkDelayTimer(self) {
|
||||
delete self._overLinkDelayTimer;
|
||||
self.setAttribute("overlinkstate", "fade-in");
|
||||
}, this._overLinkDelay, this);
|
||||
}
|
||||
]]></body>
|
||||
</method>
|
||||
|
@ -50,22 +50,6 @@ function getBrowserURL()
|
||||
return "chrome://browser/content/browser.xul";
|
||||
}
|
||||
|
||||
function goToggleToolbar( id, elementID )
|
||||
{
|
||||
var toolbar = document.getElementById(id);
|
||||
var element = document.getElementById(elementID);
|
||||
if (toolbar)
|
||||
{
|
||||
var isHidden = toolbar.hidden;
|
||||
toolbar.hidden = !isHidden;
|
||||
document.persist(id, 'hidden');
|
||||
if (element) {
|
||||
element.setAttribute("checked", isHidden ? "true" : "false");
|
||||
document.persist(elementID, 'checked');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getTopWin()
|
||||
{
|
||||
return Services.wm.getMostRecentWindow("navigator:browser");
|
||||
@ -234,9 +218,11 @@ function openUILinkIn(url, where, aAllowThirdPartyFixup, aPostData, aReferrerURI
|
||||
if (!uriObj.schemeIs("javascript") &&
|
||||
w.gBrowser.currentURI.host != uriObj.host) {
|
||||
where = "tab";
|
||||
loadInBackground = false;
|
||||
}
|
||||
} catch (err) {
|
||||
where = "tab";
|
||||
loadInBackground = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="init();"
|
||||
onunload="SidebarUtils.clearURLFromStatusBar();">
|
||||
onunload="SidebarUtils.setMouseoverURL('');">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/bookmarks/sidebarUtils.js"/>
|
||||
@ -79,7 +79,7 @@
|
||||
onkeypress="SidebarUtils.handleTreeKeyPress(event);"
|
||||
onclick="SidebarUtils.handleTreeClick(this, event, true);"
|
||||
onmousemove="SidebarUtils.handleTreeMouseMove(event);"
|
||||
onmouseout="SidebarUtils.clearURLFromStatusBar();">
|
||||
onmouseout="SidebarUtils.setMouseoverURL('');">
|
||||
<treecols>
|
||||
<treecol id="title" flex="1" primary="true" hideheader="true"/>
|
||||
</treecols>
|
||||
|
@ -58,7 +58,7 @@
|
||||
<page id="history-panel" orient="vertical"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="HistorySidebarInit();"
|
||||
onunload="SidebarUtils.clearURLFromStatusBar();">
|
||||
onunload="SidebarUtils.setMouseoverURL('');">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/bookmarks/sidebarUtils.js"/>
|
||||
@ -122,7 +122,7 @@
|
||||
onkeypress="SidebarUtils.handleTreeKeyPress(event);"
|
||||
onclick="SidebarUtils.handleTreeClick(this, event, true);"
|
||||
onmousemove="SidebarUtils.handleTreeMouseMove(event);"
|
||||
onmouseout="SidebarUtils.clearURLFromStatusBar();">
|
||||
onmouseout="SidebarUtils.setMouseoverURL('');">
|
||||
<treecols>
|
||||
<treecol id="title" flex="1" primary="true" hideheader="true"/>
|
||||
</treecols>
|
||||
|
@ -117,21 +117,20 @@ var SidebarUtils = {
|
||||
tbo.getCellAt(aEvent.clientX, aEvent.clientY, row, col, obj);
|
||||
|
||||
// row.value is -1 when the mouse is hovering an empty area within the tree.
|
||||
// To avoid showing a URL from a previously hovered node,
|
||||
// for a currently hovered non-url node, we must clear the URL from the
|
||||
// status bar in these cases.
|
||||
// To avoid showing a URL from a previously hovered node for a currently
|
||||
// hovered non-url node, we must clear the moused-over URL in these cases.
|
||||
if (row.value != -1) {
|
||||
var cell = tree.view.nodeForTreeIndex(row.value);
|
||||
if (PlacesUtils.nodeIsURI(cell))
|
||||
window.top.XULBrowserWindow.setOverLink(cell.uri, null);
|
||||
var node = tree.view.nodeForTreeIndex(row.value);
|
||||
if (PlacesUtils.nodeIsURI(node))
|
||||
this.setMouseoverURL(node.uri);
|
||||
else
|
||||
this.clearURLFromStatusBar();
|
||||
this.setMouseoverURL("");
|
||||
}
|
||||
else
|
||||
this.clearURLFromStatusBar();
|
||||
this.setMouseoverURL("");
|
||||
},
|
||||
|
||||
clearURLFromStatusBar: function SU_clearURLFromStatusBar() {
|
||||
window.top.XULBrowserWindow.setOverLink("", null);
|
||||
setMouseoverURL: function SU_setMouseoverURL(aURL) {
|
||||
window.top.XULBrowserWindow.setOverLink(aURL, null);
|
||||
}
|
||||
};
|
||||
|
@ -57,10 +57,6 @@
|
||||
<preference id="dom.event.contextmenu.enabled" name="dom.event.contextmenu.enabled" type="bool"/>
|
||||
<preference id="dom.disable_window_move_resize" name="dom.disable_window_move_resize" type="bool" inverted="true"/>
|
||||
<preference id="dom.disable_window_flip" name="dom.disable_window_flip" type="bool" inverted="true"/>
|
||||
<preference id="dom.disable_window_open_feature.status" inverted="true"
|
||||
name="dom.disable_window_open_feature.status" type="bool"/>
|
||||
<preference id="dom.disable_window_status_change" inverted="true"
|
||||
name="dom.disable_window_status_change" type="bool"/>
|
||||
</preferences>
|
||||
|
||||
<script type="application/javascript" src="chrome://browser/content/preferences/advanced-scripts.js"/>
|
||||
@ -78,12 +74,6 @@
|
||||
<checkbox id="disableContextMenus" label="&disableContextMenus.label;"
|
||||
accesskey="&disableContextMenus.accesskey;"
|
||||
preference="dom.event.contextmenu.enabled"/>
|
||||
<checkbox id="hideStatusBar" label="&hideStatusBar.label;"
|
||||
accesskey="&hideStatusBar.accesskey;"
|
||||
preference="dom.disable_window_open_feature.status"/>
|
||||
<checkbox id="changeStatusBar" label="&changeStatusBar.label;"
|
||||
accesskey="&changeStatusBar.accesskey;"
|
||||
preference="dom.disable_window_status_change"/>
|
||||
|
||||
</prefpane>
|
||||
</prefwindow>
|
||||
|
@ -191,8 +191,7 @@ var gAdvancedPane = {
|
||||
*
|
||||
* browser.cache.disk.capacity
|
||||
* - the size of the browser cache in KB
|
||||
* browser.cache.disk.smart_size.enabled
|
||||
* - If disabled, disk.capacity is used
|
||||
* - Only used if browser.cache.disk.smart_size.enabled is disabled
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -243,8 +242,10 @@ var gAdvancedPane = {
|
||||
|
||||
readSmartSizeEnabled: function ()
|
||||
{
|
||||
var enabled = document.getElementById("browser.cache.disk.smart_size.enabled").value;
|
||||
this.updateCacheSizeUI(enabled);
|
||||
// The smart_size.enabled preference element is inverted="true", so its
|
||||
// value is the opposite of the actual pref value
|
||||
var disabled = document.getElementById("browser.cache.disk.smart_size.enabled").value;
|
||||
this.updateCacheSizeUI(!disabled);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -88,6 +88,7 @@
|
||||
|
||||
<preference id="browser.cache.disk.smart_size.enabled"
|
||||
name="browser.cache.disk.smart_size.enabled"
|
||||
inverted="true"
|
||||
type="bool"/>
|
||||
|
||||
<!-- Update tab -->
|
||||
@ -243,16 +244,18 @@
|
||||
<checkbox preference="browser.cache.disk.smart_size.enabled"
|
||||
id="allowSmartSize" flex="1"
|
||||
onsyncfrompreference="return gAdvancedPane.readSmartSizeEnabled();"
|
||||
label="&smartSizeCache.label;" accesskey="&smartSizeCache.accesskey;"/>
|
||||
label="&overrideSmartCacheSize.label;"
|
||||
accesskey="&overrideSmartCacheSize.accesskey;"/>
|
||||
<hbox align="center" class="indent">
|
||||
<label id="useCacheBefore" control="cacheSize"
|
||||
accesskey="&useCacheBefore.accesskey;" value="&useCacheBefore.label;"/>
|
||||
accesskey="&limitCacheSizeBefore.accesskey;"
|
||||
value="&limitCacheSizeBefore.label;"/>
|
||||
<textbox id="cacheSize" type="number" size="4" max="1024"
|
||||
preference="browser.cache.disk.capacity"
|
||||
onsyncfrompreference="return gAdvancedPane.readCacheSize();"
|
||||
onsynctopreference="return gAdvancedPane.writeCacheSize();"
|
||||
aria-labelledby="useCacheBefore cacheSize useCacheAfter"/>
|
||||
<label id="useCacheAfter" flex="1">&useCacheAfter.label;</label>
|
||||
<label id="useCacheAfter" flex="1">&limitCacheSizeAfter.label;</label>
|
||||
</hbox>
|
||||
<hbox align="center">
|
||||
<checkbox id="offlineNotify" flex="1"
|
||||
|
@ -49,7 +49,6 @@ _BROWSER_TEST_FILES = \
|
||||
browser_privatebrowsing_certexceptionsui.js \
|
||||
browser_privatebrowsing_commandline_toggle.js \
|
||||
browser_privatebrowsing_crh.js \
|
||||
browser_privatebrowsing_downloadmonitor.js \
|
||||
browser_privatebrowsing_fastswitch.js \
|
||||
browser_privatebrowsing_findbar.js \
|
||||
browser_privatebrowsing_forgetthissite.js \
|
||||
@ -84,6 +83,9 @@ _BROWSER_TEST_FILES = \
|
||||
title.sjs \
|
||||
$(NULL)
|
||||
|
||||
# Disabled until bug 564934 is fixed:
|
||||
# browser_privatebrowsing_downloadmonitor.js \
|
||||
|
||||
# Turn off private browsing tests that perma-timeout on Linux.
|
||||
ifneq (Linux,$(OS_ARCH))
|
||||
_BROWSER_TEST_FILES += \
|
||||
|
@ -54,14 +54,14 @@ function test() {
|
||||
gBrowser.addEventListener("DOMUpdatePageReport", function() {
|
||||
gBrowser.removeEventListener("DOMUpdatePageReport", arguments.callee, false);
|
||||
executeSoon(function() {
|
||||
let pageReportButton = document.getElementById("page-report-button");
|
||||
let notification = gBrowser.getNotificationBox().getNotificationWithValue("popup-blocked");
|
||||
|
||||
ok(!pageReportButton.hidden, "The page report button should not be hidden");
|
||||
ok(notification, "The notification box should be displayed");
|
||||
|
||||
function checkMenuItem(callback) {
|
||||
dump("CMI: in\n");
|
||||
document.addEventListener("popupshown", function(event) {
|
||||
dump("CMI: popupshown\n");
|
||||
document.removeEventListener("popupshown", arguments.callee, false);
|
||||
|
||||
if (expectedDisabled)
|
||||
@ -69,18 +69,18 @@ function test() {
|
||||
"The allow popups menu item should be disabled");
|
||||
|
||||
event.originalTarget.hidePopup();
|
||||
dump("CMI: calling back\n");
|
||||
callback();
|
||||
dump("CMI: called back\n");
|
||||
}, false);
|
||||
dump("CMI: out\n");
|
||||
}
|
||||
|
||||
checkMenuItem(function() {
|
||||
checkMenuItem(function() {
|
||||
gBrowser.removeTab(tab);
|
||||
callback();
|
||||
});
|
||||
notification.querySelector("button").doCommand();
|
||||
gBrowser.removeTab(tab);
|
||||
callback();
|
||||
});
|
||||
EventUtils.synthesizeMouse(document.getElementById("page-report-button"), 1, 1, {});
|
||||
notification.querySelector("button").doCommand();
|
||||
});
|
||||
}, false);
|
||||
|
||||
|
@ -578,6 +578,17 @@
|
||||
"anonid", "textbox-input-box");
|
||||
var cxmenu = document.getAnonymousElementByAttribute(textBox,
|
||||
"anonid", "input-box-contextmenu");
|
||||
var pasteAndSearch;
|
||||
cxmenu.addEventListener("popupshowing", function() {
|
||||
if (!pasteAndSearch)
|
||||
return;
|
||||
var controller = document.commandDispatcher.getControllerForCommand("cmd_paste");
|
||||
var enabled = controller.isCommandEnabled("cmd_paste");
|
||||
if (enabled)
|
||||
pasteAndSearch.removeAttribute("disabled");
|
||||
else
|
||||
pasteAndSearch.setAttribute("disabled", "true");
|
||||
}, false);
|
||||
|
||||
var element, label, akey;
|
||||
|
||||
@ -592,9 +603,10 @@
|
||||
element = document.createElementNS(kXULNS, "menuitem");
|
||||
label = this._stringBundle.getString("cmd_pasteAndSearch");
|
||||
element.setAttribute("label", label);
|
||||
element.setAttribute("cmd", "cmd_paste");
|
||||
element.setAttribute("anonid", "paste-and-search");
|
||||
element.setAttribute("oncommand", "goDoCommand('cmd_paste'); document.getElementById('searchbar').handleSearchCommand();");
|
||||
cxmenu.insertBefore(element, insertLocation.nextSibling);
|
||||
pasteAndSearch = element;
|
||||
}
|
||||
|
||||
element = document.createElementNS(kXULNS, "menuitem");
|
||||
|
@ -2032,8 +2032,13 @@ SessionStoreService.prototype = {
|
||||
let lastClosedWindowsCopy = this._closedWindows.slice();
|
||||
|
||||
#ifndef XP_MACOSX
|
||||
// if no non-popup browser window remains open, return the state of the last closed window(s)
|
||||
if (nonPopupCount == 0 && lastClosedWindowsCopy.length > 0) {
|
||||
// If no non-popup browser window remains open, return the state of the last
|
||||
// closed window(s). We only want to do this when we're actually "ending"
|
||||
// the session.
|
||||
//XXXzpao We should do this for _restoreLastWindow == true, but that has
|
||||
// its own check for popups. c.f. bug 597619
|
||||
if (nonPopupCount == 0 && lastClosedWindowsCopy.length > 0 &&
|
||||
this._loadState == STATE_QUITTING) {
|
||||
// prepend the last non-popup browser window, so that if the user loads more tabs
|
||||
// at startup we don't accidentally add them to a popup window
|
||||
do {
|
||||
@ -2321,8 +2326,15 @@ SessionStoreService.prototype = {
|
||||
browser.userTypedValue = activePageData ? activePageData.url || null : null;
|
||||
|
||||
// If the page has a title, set it.
|
||||
if (activePageData && activePageData.title)
|
||||
tab.label = activePageData.title;
|
||||
if (activePageData) {
|
||||
if (activePageData.title) {
|
||||
tab.label = activePageData.title;
|
||||
tab.crop = "end";
|
||||
} else if (activePageData.url != "about:blank") {
|
||||
tab.label = activePageData.url;
|
||||
tab.crop = "center";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (aTabs.length > 0) {
|
||||
|
@ -120,5 +120,11 @@ _BROWSER_TEST_FILES = \
|
||||
browser_586068-cascaded_restore.js \
|
||||
$(NULL)
|
||||
|
||||
ifneq ($(OS_ARCH),Darwin)
|
||||
_BROWSER_TEST_FILES += \
|
||||
browser_597071.js \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
libs:: $(_BROWSER_TEST_FILES)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
|
||||
|
102
browser/components/sessionstore/test/browser/browser_597071.js
Normal file
102
browser/components/sessionstore/test/browser/browser_597071.js
Normal file
@ -0,0 +1,102 @@
|
||||
/* ***** 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 sessionstore test code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Paul O’Shannessy <paul@oshannessy.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 ***** */
|
||||
|
||||
function browserWindowsCount() {
|
||||
let count = 0;
|
||||
let e = Services.wm.getEnumerator("navigator:browser");
|
||||
while (e.hasMoreElements()) {
|
||||
if (!e.getNext().closed)
|
||||
++count;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
function test() {
|
||||
/** Test for Bug 597071 **/
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].
|
||||
getService(Ci.nsISessionStore);
|
||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService);
|
||||
|
||||
// set the pref to 1 greater than it currently is so we have room for an extra
|
||||
// closed window
|
||||
let closedWindowCount = ss.getClosedWindowCount();
|
||||
Services.prefs.setIntPref("browser.sessionstore.max_windows_undo",
|
||||
closedWindowCount + 1);
|
||||
|
||||
let currentState = ss.getBrowserState();
|
||||
let popupState = { windows:[
|
||||
{ tabs:[ {entries:[] }], isPopup: true, hidden: "toolbar" }
|
||||
] };
|
||||
|
||||
// set this window to be a popup.
|
||||
ss.setWindowState(window, JSON.stringify(popupState), true);
|
||||
|
||||
// open a new non-popup window
|
||||
let newWin = openDialog(location, "", "chrome,all,dialog=no", "http://example.com");
|
||||
newWin.addEventListener("load", function(aEvent) {
|
||||
newWin.removeEventListener("load", arguments.callee, false);
|
||||
newWin.gBrowser.addEventListener("load", function(aEvent) {
|
||||
newWin.gBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
newWin.gBrowser.addTab().linkedBrowser.stop();
|
||||
// make sure there are 2 windows open
|
||||
is(browserWindowsCount(), 2, "there should be 2 windows open currently");
|
||||
// make sure sessionstore sees this window
|
||||
let state = JSON.parse(ss.getBrowserState());
|
||||
is(state.windows.length, 2, "sessionstore knows about this window");
|
||||
|
||||
newWin.close();
|
||||
newWin.addEventListener("unload", function(aEvent) {
|
||||
is(ss.getClosedWindowCount(), closedWindowCount + 1,
|
||||
"increased closed window count");
|
||||
is(browserWindowsCount(), 1, "there should be 1 window open currently");
|
||||
|
||||
try {
|
||||
Services.prefs.clearUserPref("browser.sessionstore.max_windows_undo");
|
||||
} catch (e) {}
|
||||
ss.setBrowserState(currentState);
|
||||
executeSoon(finish);
|
||||
|
||||
}, false);
|
||||
}, true);
|
||||
}, false);
|
||||
}
|
||||
|
@ -205,9 +205,6 @@ var WinTaskbarJumpList =
|
||||
|
||||
// jump list refresh timer
|
||||
this._initTimer();
|
||||
|
||||
// build the list
|
||||
this.update();
|
||||
},
|
||||
|
||||
update: function WTBJL_update() {
|
||||
|
@ -17,6 +17,8 @@
|
||||
<!ENTITY helpForIEUsers.label "For Internet Explorer Users">
|
||||
<!ENTITY helpForIEUsers.accesskey "I">
|
||||
<!ENTITY helpMac.commandkey "?">
|
||||
<!ENTITY helpSafeMode.label "Restart with Add-ons Disabled…">
|
||||
<!ENTITY helpSafeMode.accesskey "R">
|
||||
|
||||
<!ENTITY helpReleaseNotes.label "Release Notes">
|
||||
<!ENTITY helpReleaseNotes.accesskey "N">
|
||||
|
@ -70,8 +70,8 @@ can reach it easily. -->
|
||||
<!ENTITY personalbarCmd.label "Bookmarks Toolbar">
|
||||
<!ENTITY personalbarCmd.accesskey "B">
|
||||
<!ENTITY bookmarksToolbarItem.label "Bookmarks Toolbar Items">
|
||||
<!ENTITY taskbarCmd.label "Status Bar">
|
||||
<!ENTITY taskbarCmd.accesskey "B">
|
||||
<!ENTITY addonBarCmd.label "Add-on Bar">
|
||||
<!ENTITY addonBarCmd.accesskey "B">
|
||||
|
||||
<!ENTITY pageSourceCmd.label "Page Source">
|
||||
<!ENTITY pageSourceCmd.accesskey "o">
|
||||
@ -122,7 +122,6 @@ can reach it easily. -->
|
||||
<!ENTITY stopCmd.macCommandKey ".">
|
||||
<!ENTITY stopButton.tooltip "Stop loading this page">
|
||||
<!ENTITY goEndCap.tooltip "Go to the address in the Location Bar">
|
||||
<!ENTITY feedButton.tooltip "Subscribe to this page…">
|
||||
<!ENTITY printButton.label "Print">
|
||||
<!ENTITY printButton.tooltip "Print this page">
|
||||
|
||||
@ -134,11 +133,15 @@ can reach it easily. -->
|
||||
|
||||
<!-- Toolbar items -->
|
||||
<!ENTITY appMenuButton.label "Menu">
|
||||
<!ENTITY appMenuButton.tooltip "Open &brandShortName; menu">
|
||||
<!ENTITY homeButton.label "Home">
|
||||
|
||||
<!ENTITY tabGroupsButton.label "Tab Groups">
|
||||
<!ENTITY tabGroupsButton.tooltip "Group your tabs">
|
||||
|
||||
<!ENTITY feedButton.label "Subscribe">
|
||||
<!ENTITY feedButton.tooltip "Subscribe to this page…">
|
||||
|
||||
<!ENTITY bookmarksButton.label "Bookmarks">
|
||||
<!ENTITY bookmarksButton.tooltip "Display your bookmarks">
|
||||
<!ENTITY bookmarksButton.accesskey "B">
|
||||
@ -279,9 +282,10 @@ can reach it easily. -->
|
||||
<!ENTITY appMenuSidebars.label "Sidebars">
|
||||
<!ENTITY appMenuFind.label "Find…">
|
||||
<!ENTITY appMenuUnsorted.label "Unsorted Bookmarks">
|
||||
<!ENTITY appMenuWebDeveloper.label "Web Developer">
|
||||
<!ENTITY appMenuGettingStarted.label "Getting Started">
|
||||
|
||||
<!ENTITY developerMenu.label "Developer">
|
||||
<!ENTITY appMenuSafeMode.label "Restart with Add-ons Disabled…">
|
||||
<!ENTITY appMenuSafeMode.accesskey "R">
|
||||
|
||||
<!ENTITY openCmd.commandkey "l">
|
||||
<!ENTITY urlbar.placeholder "Go to a Web Site">
|
||||
|
@ -88,7 +88,6 @@ popupWarningButtonUnix.accesskey=P
|
||||
popupAllow=Allow pop-ups for %S
|
||||
popupBlock=Block pop-ups for %S
|
||||
popupWarningDontShowFromMessage=Don't show this message when pop-ups are blocked
|
||||
popupWarningDontShowFromStatusbar=Don't show info message when pop-ups are blocked
|
||||
popupShowPopupPrefix=Show '%S'
|
||||
|
||||
# missing plugin installer
|
||||
@ -319,7 +318,17 @@ tabView2.title=%S - Group Your Tabs
|
||||
extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.name=Default
|
||||
extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.description=The default theme.
|
||||
|
||||
# About Firefox Dialog
|
||||
# LOCALIZATION NOTE (aboutdialog.released): %1$S = year, %2$S = month,
|
||||
# %3$S = day. These are just numbers, and the month/day values are zero-padded.
|
||||
aboutdialog.released=(released %2$S-%3$S-%1$S)
|
||||
# safeModeRestart
|
||||
safeModeRestartPromptTitle=Restart with Add-ons Disabled
|
||||
safeModeRestartPromptMessage=Are you sure you want to disable all add-ons and restart?
|
||||
|
||||
# LOCALIZATION NOTE (browser.menu.showCharacterEncoding): Set to the string
|
||||
# "true" (spelled and capitalized exactly that way) to show the "Character
|
||||
# Encoding" menu in the main Firefox button on Windows. Any other value will
|
||||
# hide it. Regardless of the value of this setting, the "Character Encoding"
|
||||
# menu will always be accessible via the "Web Developer" menu.
|
||||
# This is not a string to translate; it just controls whether the menu shows
|
||||
# up in the Firefox button. If users frequently use the "Character Encoding"
|
||||
# menu, set this to "true". Otherwise, you can leave it as "false".
|
||||
browser.menu.showCharacterEncoding=false
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!ENTITY startDescription.label "A web site has attempted to open a pop-up window without your permission. &brandShortName; has automatically closed the pop-up window. Whenever &brandShortName; blocks these pop-ups, you will see an icon on the status bar.">
|
||||
<!ENTITY startDescriptionText.label "A web site has attempted to open a pop-up window without your permission. &brandShortName; has automatically closed the pop-up window.">
|
||||
|
||||
<!ENTITY endDescription.label "You can click on this icon to see which sites &brandShortName; blocked and to allow those sites to open pop-ups if they are required for the site to function correctly.">
|
||||
|
||||
|
@ -46,7 +46,3 @@
|
||||
<!ENTITY raiseLowerWindows.accesskey "R">
|
||||
<!ENTITY disableContextMenus.label "Disable or replace context menus">
|
||||
<!ENTITY disableContextMenus.accesskey "D">
|
||||
<!ENTITY hideStatusBar.label "Hide the status bar">
|
||||
<!ENTITY hideStatusBar.accesskey "H">
|
||||
<!ENTITY changeStatusBar.label "Change status bar text">
|
||||
<!ENTITY changeStatusBar.accesskey "C">
|
||||
|
@ -41,18 +41,18 @@
|
||||
<!ENTITY offlineStorage.label "Offline Storage">
|
||||
|
||||
<!-- LOCALIZATION NOTE:
|
||||
The entities useCacheBefore.label and useCacheAfter.label appear on a single
|
||||
The entities limitCacheSizeBefore.label and limitCacheSizeAfter.label appear on a single
|
||||
line in preferences as follows:
|
||||
|
||||
&useCacheBefore.label [ textbox for cache size in MB ] &useCacheAfter.label;
|
||||
&limitCacheSizeBefore.label [textbox for cache size in MB] &limitCacheSizeAfter.label;
|
||||
-->
|
||||
<!ENTITY useCacheBefore.label "Use up to">
|
||||
<!ENTITY useCacheBefore.accesskey "U">
|
||||
<!ENTITY useCacheAfter.label "MB of space for the cache">
|
||||
<!ENTITY limitCacheSizeBefore.label "Limit cache to">
|
||||
<!ENTITY limitCacheSizeBefore.accesskey "L">
|
||||
<!ENTITY limitCacheSizeAfter.label "MB of space">
|
||||
<!ENTITY clearCacheNow.label "Clear Now">
|
||||
<!ENTITY clearCacheNow.accesskey "C">
|
||||
<!ENTITY smartSizeCache.label "Let &brandShortName; manage the size of my cache">
|
||||
<!ENTITY smartSizeCache.accesskey "L">
|
||||
<!ENTITY overrideSmartCacheSize.label "Override automatic cache management">
|
||||
<!ENTITY overrideSmartCacheSize.accesskey "O">
|
||||
|
||||
<!ENTITY updateTab.label "Update">
|
||||
|
||||
|
@ -1,2 +1,4 @@
|
||||
<!ENTITY quota.dialogTitle.label "Server Quota">
|
||||
<!ENTITY quota.retrievingInfo.label "Retrieving quota information…">
|
||||
<!ENTITY quota.typeColumn.label "Type">
|
||||
<!ENTITY quota.sizeColumn.label "Size">
|
||||
|
@ -43,10 +43,10 @@
|
||||
<!ENTITY syncKeyEntry.label "Your Sync Key">
|
||||
<!ENTITY syncKeyEntry.accesskey "K">
|
||||
<!ENTITY syncKeyGenerate.label "Generate">
|
||||
<!ENTITY syncKeyStrength.label "Strength:">
|
||||
<!ENTITY syncKeyHelp.label "What does the strength mean?">
|
||||
<!ENTITY syncKeyBackup.description "Your Sync Key is required to access &syncBrand.fullName.label; on other machines. Please create a backup copy. We cannot help you recover your Sync Key.">
|
||||
|
||||
<!ENTITY button.syncKeyBackup.email.label "Email…">
|
||||
<!ENTITY button.syncKeyBackup.email.accesskey "E">
|
||||
<!ENTITY button.syncKeyBackup.print.label "Print…">
|
||||
<!ENTITY button.syncKeyBackup.print.accesskey "P">
|
||||
<!ENTITY button.syncKeyBackup.save.label "Save…">
|
||||
|
@ -25,17 +25,6 @@ historyDaysCount.label = %S day of history;%S days of history
|
||||
# http://developer.mozilla.org/en/docs/Localization_and_Plurals
|
||||
passwordsCount.label = %S password;%S passwords
|
||||
|
||||
# LOCALIZATION NOTE (email.synckey.*): "Firefox Sync" should match
|
||||
# &syncBrand.fullName.label; from syncBrand.dtd
|
||||
email.syncKey.subject = Your Firefox Sync Key
|
||||
email.syncKey.label = Your Firefox Sync Key: %S
|
||||
email.syncKey.description = This key is used to decode the data in your Firefox Sync account. You will need to enter the key each time you configure Firefox Sync on a new computer or device.
|
||||
email.keepItSecret.label = Keep it secret!\u0020
|
||||
email.keepItSecret.description = Your Firefox Sync account is encrypted to protect your privacy. Without this key, it would take years for anyone to decode your personal information. You are the only person who holds this key. This means you're the only one who can access your Firefox Sync data.
|
||||
email.keepItSafe.label = Keep it safe!\u0020
|
||||
email.keepItSafe.description = Do not lose this key. We don't keep a copy of your key (that wouldn't be keeping it secret!) so we can't help you recover it if it's lost. You'll need to use this key any time you connect a new computer or device to Firefox Sync.
|
||||
email.findOutMore.label = Find out more about Firefox Sync and your privacy at https://services.mozilla.com.
|
||||
|
||||
save.synckey.title = Save Sync Key
|
||||
|
||||
newAccount.action.label = Firefox Sync is now set up to automatically sync all of your browser data.
|
||||
|
@ -1,2 +1,3 @@
|
||||
tabview.groupItem.newTabButton=New tab
|
||||
tabview.groupItem.defaultName=Name this tab group…
|
||||
tabview.search.otherWindowTabs=Tabs from other windows
|
@ -53,9 +53,14 @@
|
||||
<!ENTITY netInterrupt.longDesc "&sharedLongDesc;">
|
||||
|
||||
<!ENTITY netOffline.title "Offline mode">
|
||||
<!ENTITY netOffline.longDesc "
|
||||
<!-- LOCALIZATION NOTE (netOffline.overrideLongDesc) - This string should
|
||||
indicate that "Work Offline" is a menu item without being too specific,
|
||||
since it could be in either the normal menu (Mac/Linux) or the Firefox button
|
||||
menu (Windows).
|
||||
-->
|
||||
<!ENTITY netOffline.overrideLongDesc "
|
||||
<ul>
|
||||
<li>Uncheck "Work Offline" in the File menu, then try again.</li>
|
||||
<li>Uncheck the "Work Offline" menu item, then try again.</li>
|
||||
</ul>
|
||||
">
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
<!ENTITY testpilot.brand.label "Test Pilot">
|
||||
<!-- browser window: menu and status bar -->
|
||||
<!ENTITY testpilot.settings.label "Settings">
|
||||
<!ENTITY testpilot.settings.dataSubmission.label "Data Submission">
|
||||
<!ENTITY testpilot.settings.notifications.label "Notifications">
|
||||
|
@ -1,19 +1,25 @@
|
||||
af
|
||||
be
|
||||
bg
|
||||
br
|
||||
ca
|
||||
cs
|
||||
da
|
||||
de
|
||||
el
|
||||
en-US
|
||||
en-ZA
|
||||
eo
|
||||
es-AR
|
||||
es-ES
|
||||
et
|
||||
fi
|
||||
fr
|
||||
fy-NL
|
||||
ga-IE
|
||||
he
|
||||
hu
|
||||
hy-AM
|
||||
id
|
||||
is
|
||||
it
|
||||
@ -26,6 +32,7 @@ lv
|
||||
nb-NO
|
||||
nl
|
||||
nn-NO
|
||||
nso
|
||||
pa-IN
|
||||
pl
|
||||
pt-BR
|
||||
|
@ -1389,28 +1389,6 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||
background-color: Window;
|
||||
}
|
||||
|
||||
#status-bar {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
statusbarpanel#statusbar-display {
|
||||
-moz-padding-start: 0;
|
||||
}
|
||||
|
||||
#security-button[level="high"],
|
||||
#security-button[level="low"] {
|
||||
list-style-image: url("chrome://browser/skin/Secure.png");
|
||||
}
|
||||
|
||||
#security-button[level="broken"] {
|
||||
list-style-image: url("chrome://browser/skin/Security-broken.png");
|
||||
}
|
||||
|
||||
#page-report-button {
|
||||
list-style-image: url("chrome://browser/skin/Info.png");
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
/* Throbber */
|
||||
#navigator-throbber {
|
||||
width: 16px;
|
||||
@ -1504,7 +1482,11 @@ statusbarpanel#statusbar-display {
|
||||
}
|
||||
|
||||
.tabbrowser-tab[pinned][titlechanged]:not([selected="true"]) {
|
||||
background-image: -moz-linear-gradient(rgba(255,0,0,.5), rgba(255,0,0,.5)) !important;
|
||||
background-image: -moz-radial-gradient(40% 3px, circle farthest-corner, rgba(233,242,252,1) 2%, rgba(172,206,255,.75) 25%, rgba(87,151,201,.5) 40%, rgba(87,151,201,0) 80%);
|
||||
}
|
||||
.tabbrowser-tab[pinned][titlechanged]:not([selected="true"]):hover {
|
||||
background-image: -moz-linear-gradient(hsla(0,0%,100%,.8), hsla(0,0%,100%,.6) 2px, hsla(0,0%,75%,.2) 50%),
|
||||
-moz-radial-gradient(40% 3px, circle farthest-corner, rgba(233,242,252,1) 2%, rgba(172,206,255,.75) 25%, rgba(87,151,201,.5) 40%, rgba(87,151,201,0) 80%);
|
||||
}
|
||||
|
||||
.tabbrowser-tab[pinned] {
|
||||
@ -1677,11 +1659,6 @@ toolbar[mode="text"] toolbarbutton.chevron > .toolbarbutton-icon {
|
||||
display: -moz-box; /* display chevron icon in text mode */
|
||||
}
|
||||
|
||||
/* Popup blocking dialog */
|
||||
#pageReportFirstTime statusbarpanel.statusbar-resizerpanel {
|
||||
visibility: collapse;
|
||||
}
|
||||
|
||||
#download-monitor {
|
||||
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
|
||||
-moz-image-region: rect(0px 16px 16px 0px);
|
||||
@ -1784,3 +1761,22 @@ listitem.style-section {
|
||||
panel[dimmed="true"] {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
/* Remove the resizer from the statusbar compatibility shim */
|
||||
#status-bar .statusbar-resizerpanel {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Vertically-center the statusbar compatibility shim, because
|
||||
toolbars, even in small-icon mode, are a bit taller than
|
||||
statusbars. */
|
||||
#status-bar {
|
||||
margin-top: .3em;
|
||||
}
|
||||
|
||||
/* Remove all borders from statusbarpanel children of
|
||||
the statusbar. */
|
||||
#status-bar > statusbarpanel {
|
||||
border-width: 0;
|
||||
-moz-appearance: none;
|
||||
}
|
||||
|
@ -39,3 +39,26 @@ image#syncIcon {
|
||||
#introText {
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
#feedback,
|
||||
#passphraseFeedback {
|
||||
height: 4em;
|
||||
}
|
||||
|
||||
#passphraseStrength {
|
||||
-moz-appearance: none;
|
||||
height: 10px;
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
#passphraseStrength > .progress-bar {
|
||||
background-color: #ff0000;
|
||||
}
|
||||
|
||||
#passphraseStrength.medium > .progress-bar {
|
||||
background-color: #ffcc33;
|
||||
}
|
||||
|
||||
#passphraseStrength.strong > .progress-bar {
|
||||
background-color: #00ff00;
|
||||
}
|
||||
|
@ -449,3 +449,46 @@ input.defaultName {
|
||||
.notMainMatch{
|
||||
opacity: .70;
|
||||
}
|
||||
|
||||
#otherresults{
|
||||
left: 0px;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
background-color: rgba(0,0,0,.3);
|
||||
-moz-box-shadow: 0px -1px 0px rgba(255,255,255,.1), inset 0px 2px 5px rgba(0,0,0,.3);
|
||||
}
|
||||
|
||||
#otherresults .label{
|
||||
color: #999;
|
||||
line-height:30px;
|
||||
margin-left:5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.inlineMatch{
|
||||
background-color: #EBEBEB;
|
||||
border-radius: 0.4em;
|
||||
-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
|
||||
border: 1px solid rgba(255, 255, 255, 0.5);
|
||||
padding-left: 3px;
|
||||
padding-right: 3px;
|
||||
height: 20px;
|
||||
margin-right: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.inlineMatch:hover{
|
||||
opacity: 1.0;
|
||||
}
|
||||
|
||||
.inlineMatch>img{
|
||||
margin-right: 5px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.inlineMatch>span{
|
||||
max-width:200px;
|
||||
height: 15px;
|
||||
}
|
||||
|
@ -877,15 +877,6 @@ toolbar[mode="icons"] #zoom-in-button {
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
statusbarpanel#statusbar-display {
|
||||
-moz-padding-start: 0;
|
||||
}
|
||||
|
||||
.statusbarpanel-text {
|
||||
margin-top: 2px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* over-link in location bar */
|
||||
|
||||
.urlbar-origin-label {
|
||||
@ -1507,24 +1498,6 @@ sidebarheader > .tabs-closebutton > .toolbarbutton-text {
|
||||
}
|
||||
|
||||
|
||||
/* ----- SECURITY DISPLAY ----- */
|
||||
|
||||
#security-button[level="high"] ,
|
||||
#security-button[level="low"] {
|
||||
list-style-image: url("chrome://browser/skin/Secure-statusbar.png");
|
||||
}
|
||||
|
||||
#security-button[level="broken"] {
|
||||
list-style-image: url("chrome://browser/skin/Secure-statusbar-broken.png");
|
||||
}
|
||||
|
||||
/* ----- PAGE REPORT DISPLAY ----- */
|
||||
|
||||
#page-report-button {
|
||||
list-style-image: url("chrome://browser/skin/Popup-blocked.png");
|
||||
padding: 0px 3px 0px 3px;
|
||||
}
|
||||
|
||||
/* ----- THROBBER ----- */
|
||||
|
||||
#navigator-throbber {
|
||||
@ -1637,8 +1610,11 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
|
||||
background-color: -moz-mac-chrome-inactive;
|
||||
}
|
||||
|
||||
#tabbrowser-tabs[tabsontop="true"] > .tabbrowser-tab[pinned][titlechanged]:not([selected="true"]) {
|
||||
background-image: -moz-radial-gradient(center 2px, circle cover, rgba(254,254,255,1) 3%, rgba(210,235,255,.9) 12%, rgba(148,205,253,.6) 30%, rgba(148,205,253,.2) 70%);
|
||||
}
|
||||
.tabbrowser-tab[pinned][titlechanged]:not([selected="true"]) {
|
||||
background-color: rgba(255,0,0,.5) !important;
|
||||
background-image: -moz-radial-gradient(center 99%, circle cover, rgba(254,254,255,1) 3%, rgba(210,235,255,.9) 12%, rgba(148,205,253,.6) 30%, rgba(148,205,253,.2) 70%);
|
||||
}
|
||||
|
||||
#tabbrowser-tabs[tabsontop="true"] > .tabbrowser-tab[selected="true"] {
|
||||
@ -2285,3 +2261,25 @@ listitem.style-section {
|
||||
panel[dimmed="true"] {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
/* Remove the resizer from the statusbar compatibility shim */
|
||||
#status-bar .statusbar-resizerpanel {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Vertically-center the statusbar compatibility shim, because
|
||||
toolbars, even in small-icon mode, are a bit taller than
|
||||
statusbars. Also turn off the statusbar border. On Windows
|
||||
we have to disable borders on statusbar *and* child statusbar
|
||||
elements. */
|
||||
#status-bar {
|
||||
margin-top: 0.3em;
|
||||
-moz-appearance: none;
|
||||
}
|
||||
|
||||
/* Remove all borders from statusbarpanel children of
|
||||
the statusbar. */
|
||||
#status-bar > statusbarpanel {
|
||||
border-width: 0;
|
||||
-moz-appearance: none;
|
||||
}
|
||||
|
@ -39,3 +39,27 @@ image#syncIcon {
|
||||
#introText {
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
#feedback,
|
||||
#passphraseFeedback {
|
||||
height: 4em;
|
||||
}
|
||||
|
||||
#passphraseStrength {
|
||||
-moz-binding: url("chrome://global/content/bindings/progressmeter.xml#progressmeter");
|
||||
-moz-appearance: none;
|
||||
height: 10px;
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
#passphraseStrength > .progress-bar {
|
||||
background-color: #ff0000;
|
||||
}
|
||||
|
||||
#passphraseStrength.medium > .progress-bar {
|
||||
background-color: #ffcc33;
|
||||
}
|
||||
|
||||
#passphraseStrength.strong > .progress-bar {
|
||||
background-color: #00ff00;
|
||||
}
|
||||
|
@ -455,3 +455,89 @@ input.defaultName {
|
||||
.notMainMatch{
|
||||
opacity: .70;
|
||||
}
|
||||
|
||||
#otherresults{
|
||||
left: 0px;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
background-color: rgba(0,0,0,.3);
|
||||
-moz-box-shadow: 0px -1px 0px rgba(255,255,255,.1), inset 0px 2px 5px rgba(0,0,0,.3);
|
||||
}
|
||||
|
||||
#otherresults .label{
|
||||
color: #999;
|
||||
line-height:30px;
|
||||
margin-left:5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.inlineMatch{
|
||||
background-color: #EBEBEB;
|
||||
border-radius: 0.4em;
|
||||
-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
|
||||
border: 1px solid rgba(255, 255, 255, 0.5);
|
||||
padding-left: 3px;
|
||||
padding-right: 3px;
|
||||
height: 20px;
|
||||
margin-right: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.inlineMatch:hover{
|
||||
opacity: 1.0;
|
||||
}
|
||||
|
||||
.inlineMatch>img{
|
||||
margin-right: 5px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.inlineMatch>span{
|
||||
max-width:200px;
|
||||
height: 15px;
|
||||
}
|
||||
|
||||
#otherresults{
|
||||
left: 0px;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
background-color: rgba(0,0,0,.3);
|
||||
-moz-box-shadow: 0px -1px 0px rgba(255,255,255,.1), inset 0px 2px 5px rgba(0,0,0,.3);
|
||||
}
|
||||
|
||||
#otherresults .label{
|
||||
color: #999;
|
||||
line-height:30px;
|
||||
margin-left:5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.inlineMatch{
|
||||
background-color: #EBEBEB;
|
||||
border-radius: 0.4em;
|
||||
-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
|
||||
border: 1px solid rgba(255, 255, 255, 0.5);
|
||||
padding-left: 3px;
|
||||
padding-right: 3px;
|
||||
height: 20px;
|
||||
margin-right: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.inlineMatch:hover{
|
||||
opacity: 1.0;
|
||||
}
|
||||
|
||||
.inlineMatch>img{
|
||||
margin-right: 5px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.inlineMatch>span{
|
||||
max-width:200px;
|
||||
height: 15px;
|
||||
}
|
||||
|
@ -107,10 +107,6 @@
|
||||
-moz-appearance: toolbox;
|
||||
}
|
||||
|
||||
statusbarpanel#statusbar-display {
|
||||
-moz-padding-start: 0;
|
||||
}
|
||||
|
||||
/* ::::: app menu button ::::: */
|
||||
|
||||
#appmenu-button {
|
||||
@ -1456,24 +1452,6 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||
-moz-padding-start: 0px;
|
||||
}
|
||||
|
||||
#status-bar {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
#security-button[level="high"],
|
||||
#security-button[level="low"] {
|
||||
list-style-image: url("chrome://browser/skin/Secure.png");
|
||||
}
|
||||
|
||||
#security-button[level="broken"] {
|
||||
list-style-image: url("chrome://browser/skin/Security-broken.png");
|
||||
}
|
||||
|
||||
#page-report-button {
|
||||
width: 20px;
|
||||
list-style-image: url("chrome://browser/skin/Info.png");
|
||||
}
|
||||
|
||||
/* ::::: throbber ::::: */
|
||||
|
||||
#navigator-throbber {
|
||||
@ -1575,7 +1553,11 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||
}
|
||||
|
||||
.tabbrowser-tab[pinned][titlechanged]:not([selected="true"]) {
|
||||
background-image: -moz-linear-gradient(rgba(255,0,0,.5), rgba(255,0,0,.5)) !important;
|
||||
background-image: -moz-radial-gradient(40% 3px, circle cover, rgba(255,255,255,1) 2%, rgba(186,221,251,.75) 25%, rgba(127,179,255,.5) 50%, rgba(127,179,255,.25));
|
||||
}
|
||||
.tabbrowser-tab[pinned][titlechanged]:not([selected="true"]):hover {
|
||||
background-image: -moz-linear-gradient(hsla(0,0%,100%,.4), hsla(0,0%,75%,.4) 50%),
|
||||
-moz-radial-gradient(40% 3px, circle cover, rgba(255,255,255,1) 2%, rgba(186,221,251,.75) 25%, rgba(127,179,255,.5) 50%, rgba(127,179,255,.25));
|
||||
}
|
||||
|
||||
.tab-icon-image {
|
||||
@ -1810,11 +1792,6 @@ toolbar[mode="text"] toolbarbutton.chevron > .toolbarbutton-icon {
|
||||
-moz-margin-end: 4px;
|
||||
}
|
||||
|
||||
/* ::::: About Popup Blocking dialog ::::: */
|
||||
#pageReportFirstTime statusbarpanel.statusbar-resizerpanel {
|
||||
visibility: collapse;
|
||||
}
|
||||
|
||||
/* Bookmarks toolbar */
|
||||
#PlacesToolbarDropIndicator {
|
||||
list-style-image: url(chrome://browser/skin/places/toolbarDropMarker.png);
|
||||
@ -2186,3 +2163,26 @@ listitem.style-section {
|
||||
panel[dimmed="true"] {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
/* Remove the resizer from the statusbar compatibility shim */
|
||||
#status-bar .statusbar-resizerpanel {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Vertically-center the statusbar compatibility shim, because
|
||||
toolbars, even in small-icon mode, are a bit taller than
|
||||
statusbars. Also turn off the statusbar border. On Windows
|
||||
we have to disable borders on statusbar *and* child statusbar
|
||||
elements. */
|
||||
#status-bar {
|
||||
margin-top: .3em;
|
||||
border-width: 0;
|
||||
-moz-appearance: none;
|
||||
}
|
||||
|
||||
/* Remove all borders from statusbarpanel children of
|
||||
the statusbar. */
|
||||
#status-bar > statusbarpanel {
|
||||
border-width: 0;
|
||||
-moz-appearance: none;
|
||||
}
|
||||
|
@ -39,3 +39,26 @@ image#syncIcon {
|
||||
#introText {
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
#feedback,
|
||||
#passphraseFeedback {
|
||||
height: 4em;
|
||||
}
|
||||
|
||||
#passphraseStrength {
|
||||
-moz-appearance: none;
|
||||
height: 10px;
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
#passphraseStrength > .progress-bar {
|
||||
background-color: #ff0000;
|
||||
}
|
||||
|
||||
#passphraseStrength.medium > .progress-bar {
|
||||
background-color: #ffcc33;
|
||||
}
|
||||
|
||||
#passphraseStrength.strong > .progress-bar {
|
||||
background-color: #00ff00;
|
||||
}
|
||||
|
@ -573,6 +573,12 @@ user_pref("camino.use_system_proxy_settings", false); // Camino-only, harmless t
|
||||
|
||||
env['GNOME_DISABLE_CRASH_DIALOG'] = '1'
|
||||
env['XRE_NO_WINDOWS_CRASH_DIALOG'] = '1'
|
||||
|
||||
# Don't do this for Mac since it makes the Mac OS X 10.5 (32-bit)
|
||||
# trace-malloc leak test hang. (It doesn't make the 10.6 (64-bit)
|
||||
# leak test hang, though.)
|
||||
if not self.IS_MAC:
|
||||
env['NS_TRACE_MALLOC_DISABLE_STACKS'] = '1'
|
||||
return env
|
||||
|
||||
if IS_WIN32:
|
||||
|
@ -235,6 +235,7 @@ MOZ_NATIVE_BZ2 = @SYSTEM_BZ2@
|
||||
MOZ_NATIVE_JPEG = @SYSTEM_JPEG@
|
||||
MOZ_NATIVE_PNG = @SYSTEM_PNG@
|
||||
MOZ_TREE_CAIRO = @MOZ_TREE_CAIRO@
|
||||
MOZ_TREE_PIXMAN = @MOZ_TREE_PIXMAN@
|
||||
|
||||
MOZ_UPDATE_XTERM = @MOZ_UPDATE_XTERM@
|
||||
MOZ_MATHML = @MOZ_MATHML@
|
||||
@ -677,6 +678,9 @@ MOZ_OFFICIAL_BRANDING = @MOZ_OFFICIAL_BRANDING@
|
||||
HAVE_CLOCK_MONOTONIC = @HAVE_CLOCK_MONOTONIC@
|
||||
REALTIME_LIBS = @REALTIME_LIBS@
|
||||
|
||||
MOZ_APP_COMPONENT_LIBS = @MOZ_APP_COMPONENT_LIBS@
|
||||
MOZ_APP_EXTRA_LIBS = @MOZ_APP_EXTRA_LIBS@
|
||||
|
||||
ANDROID_NDK = @ANDROID_NDK@
|
||||
ANDROID_TOOLCHAIN = @ANDROID_TOOLCHAIN@
|
||||
ANDROID_PLATFORM = @ANDROID_PLATFORM@
|
||||
|
@ -1874,7 +1874,7 @@ endif # MOZ_JAVAXPCOM
|
||||
ifneq (,$(filter %.js,$(EXTRA_COMPONENTS) $(EXTRA_PP_COMPONENTS)))
|
||||
ifeq (,$(filter %.manifest,$(EXTRA_COMPONENTS) $(EXTRA_PP_COMPONENTS)))
|
||||
ifndef NO_JS_MANIFEST
|
||||
$(error .js component without matching .manifest)
|
||||
$(error .js component without matching .manifest. See https://developer.mozilla.org/en/XPCOM/XPCOM_changes_in_Gecko_2.0)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
24
configure.in
24
configure.in
@ -8364,6 +8364,12 @@ MOZ_ARG_ENABLE_BOOL(system-cairo,
|
||||
MOZ_TREE_CAIRO=,
|
||||
MOZ_TREE_CAIRO=1 )
|
||||
|
||||
MOZ_TREE_PIXMAN=1
|
||||
MOZ_ARG_ENABLE_BOOL(system-pixman,
|
||||
[ --enable-system-pixman Use system pixman (located with pkgconfig)],
|
||||
MOZ_TREE_PIXMAN=,
|
||||
MOZ_TREE_PIXMAN=1 )
|
||||
|
||||
# Check for headers defining standard int types.
|
||||
AC_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
|
||||
|
||||
@ -8495,7 +8501,16 @@ if test "$MOZ_TREE_CAIRO"; then
|
||||
AC_SUBST(PNG_FUNCTIONS_FEATURE)
|
||||
AC_SUBST(QT_SURFACE_FEATURE)
|
||||
|
||||
MOZ_CAIRO_LIBS='$(call EXPAND_LIBNAME_PATH,mozcairo,$(DEPTH)/gfx/cairo/cairo/src) $(call EXPAND_LIBNAME_PATH,mozlibpixman,$(DEPTH)/gfx/cairo/libpixman/src)'" $CAIRO_FT_LIBS"
|
||||
MOZ_CAIRO_LIBS='$(call EXPAND_LIBNAME_PATH,mozcairo,$(DEPTH)/gfx/cairo/cairo/src)'" $CAIRO_FT_LIBS"
|
||||
|
||||
if test "$MOZ_TREE_PIXMAN"; then
|
||||
MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS"' $(call EXPAND_LIBNAME_PATH,mozlibpixman,$(DEPTH)/gfx/cairo/libpixman/src)'
|
||||
else
|
||||
PKG_CHECK_MODULES(PIXMAN, pixman-1 >= 0.17.3)
|
||||
MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $PIXMAN_CFLAGS"
|
||||
MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $PIXMAN_LIBS"
|
||||
fi
|
||||
|
||||
if test "$MOZ_X11"; then
|
||||
MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender -lfreetype -lfontconfig"
|
||||
fi
|
||||
@ -8517,6 +8532,7 @@ fi
|
||||
AC_SUBST(MOZ_TREE_CAIRO)
|
||||
AC_SUBST(MOZ_CAIRO_CFLAGS)
|
||||
AC_SUBST(MOZ_CAIRO_LIBS)
|
||||
AC_SUBST(MOZ_TREE_PIXMAN)
|
||||
|
||||
dnl ========================================================
|
||||
dnl qcms
|
||||
@ -8711,6 +8727,10 @@ if test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
|
||||
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
|
||||
fi
|
||||
|
||||
if test "$MOZ_APP_COMPONENT_INCLUDE"; then
|
||||
AC_DEFINE_UNQUOTED(MOZ_APP_COMPONENT_INCLUDE, "$MOZ_APP_COMPONENT_INCLUDE")
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl =
|
||||
dnl = Maintainer debug option (no --enable equivalent)
|
||||
@ -8971,6 +8991,8 @@ AC_SUBST(CXX_VERSION)
|
||||
AC_SUBST(MSMANIFEST_TOOL)
|
||||
AC_SUBST(NS_ENABLE_TSF)
|
||||
AC_SUBST(MOZ_NSS_PATCH)
|
||||
AC_SUBST(MOZ_APP_COMPONENT_LIBS)
|
||||
AC_SUBST(MOZ_APP_EXTRA_LIBS)
|
||||
|
||||
AC_SUBST(MOZ_MEDIA)
|
||||
AC_SUBST(MOZ_SYDNEYAUDIO)
|
||||
|
17
content/base/crashtests/595606.html
Normal file
17
content/base/crashtests/595606.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<body onload="
|
||||
document.body.removeChild(document.getElementById('x'));
|
||||
document.documentElement.removeAttribute('class');">
|
||||
|
||||
<div id="x">
|
||||
<div id="a">
|
||||
<form id="a">
|
||||
<select></select>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<select form="a"></select>
|
||||
</body>
|
||||
</html>
|
@ -70,3 +70,4 @@ load 564114.html
|
||||
load 565125-1.html
|
||||
load 582601.html
|
||||
load 575462.svg
|
||||
load 595606.html
|
||||
|
@ -139,7 +139,7 @@ interface nsIFrameLoader : nsISupports
|
||||
* such a way that the <browser>'s visible rect encloses pixels that
|
||||
* the content document does not (yet) define.
|
||||
*
|
||||
* The viewport scroll values are in units of content-document CSS
|
||||
* The viewport scroll values are in units of chrome-document CSS
|
||||
* pixels.
|
||||
*
|
||||
* These APIs are designed to be used with nsIDOMWindowUtils
|
||||
|
@ -163,9 +163,14 @@ EXTRA_COMPONENTS = \
|
||||
contentSecurityPolicy.manifest \
|
||||
contentAreaDropListener.js \
|
||||
contentAreaDropListener.manifest \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_IPC
|
||||
EXTRA_COMPONENTS += \
|
||||
messageWakeupService.js \
|
||||
messageWakeupService.manifest \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
EXTRA_JS_MODULES = \
|
||||
CSPUtils.jsm \
|
||||
|
@ -1735,6 +1735,8 @@ nsIAtom** const kDefaultAllowedTags [] = {
|
||||
&nsGkAtoms::acronym,
|
||||
&nsGkAtoms::address,
|
||||
&nsGkAtoms::area,
|
||||
&nsGkAtoms::article,
|
||||
&nsGkAtoms::aside,
|
||||
#ifdef MOZ_MEDIA
|
||||
&nsGkAtoms::audio,
|
||||
#endif
|
||||
@ -1744,14 +1746,18 @@ nsIAtom** const kDefaultAllowedTags [] = {
|
||||
&nsGkAtoms::blockquote,
|
||||
&nsGkAtoms::br,
|
||||
&nsGkAtoms::button,
|
||||
&nsGkAtoms::canvas,
|
||||
&nsGkAtoms::caption,
|
||||
&nsGkAtoms::center,
|
||||
&nsGkAtoms::cite,
|
||||
&nsGkAtoms::code,
|
||||
&nsGkAtoms::col,
|
||||
&nsGkAtoms::colgroup,
|
||||
&nsGkAtoms::command,
|
||||
&nsGkAtoms::datalist,
|
||||
&nsGkAtoms::dd,
|
||||
&nsGkAtoms::del,
|
||||
&nsGkAtoms::details,
|
||||
&nsGkAtoms::dfn,
|
||||
&nsGkAtoms::dir,
|
||||
&nsGkAtoms::div,
|
||||
@ -1759,7 +1765,10 @@ nsIAtom** const kDefaultAllowedTags [] = {
|
||||
&nsGkAtoms::dt,
|
||||
&nsGkAtoms::em,
|
||||
&nsGkAtoms::fieldset,
|
||||
&nsGkAtoms::figcaption,
|
||||
&nsGkAtoms::figure,
|
||||
&nsGkAtoms::font,
|
||||
&nsGkAtoms::footer,
|
||||
&nsGkAtoms::form,
|
||||
&nsGkAtoms::h1,
|
||||
&nsGkAtoms::h2,
|
||||
@ -1767,6 +1776,8 @@ nsIAtom** const kDefaultAllowedTags [] = {
|
||||
&nsGkAtoms::h4,
|
||||
&nsGkAtoms::h5,
|
||||
&nsGkAtoms::h6,
|
||||
&nsGkAtoms::header,
|
||||
&nsGkAtoms::hgroup,
|
||||
&nsGkAtoms::hr,
|
||||
&nsGkAtoms::i,
|
||||
&nsGkAtoms::img,
|
||||
@ -1778,16 +1789,26 @@ nsIAtom** const kDefaultAllowedTags [] = {
|
||||
&nsGkAtoms::li,
|
||||
&nsGkAtoms::listing,
|
||||
&nsGkAtoms::map,
|
||||
&nsGkAtoms::mark,
|
||||
&nsGkAtoms::menu,
|
||||
&nsGkAtoms::meter,
|
||||
&nsGkAtoms::nav,
|
||||
&nsGkAtoms::nobr,
|
||||
&nsGkAtoms::noscript,
|
||||
&nsGkAtoms::ol,
|
||||
&nsGkAtoms::optgroup,
|
||||
&nsGkAtoms::option,
|
||||
&nsGkAtoms::output,
|
||||
&nsGkAtoms::p,
|
||||
&nsGkAtoms::pre,
|
||||
&nsGkAtoms::progress,
|
||||
&nsGkAtoms::q,
|
||||
&nsGkAtoms::rp,
|
||||
&nsGkAtoms::rt,
|
||||
&nsGkAtoms::ruby,
|
||||
&nsGkAtoms::s,
|
||||
&nsGkAtoms::samp,
|
||||
&nsGkAtoms::section,
|
||||
&nsGkAtoms::select,
|
||||
&nsGkAtoms::small,
|
||||
#ifdef MOZ_MEDIA
|
||||
@ -1797,6 +1818,7 @@ nsIAtom** const kDefaultAllowedTags [] = {
|
||||
&nsGkAtoms::strike,
|
||||
&nsGkAtoms::strong,
|
||||
&nsGkAtoms::sub,
|
||||
&nsGkAtoms::summary,
|
||||
&nsGkAtoms::sup,
|
||||
&nsGkAtoms::table,
|
||||
&nsGkAtoms::tbody,
|
||||
@ -1805,7 +1827,9 @@ nsIAtom** const kDefaultAllowedTags [] = {
|
||||
&nsGkAtoms::tfoot,
|
||||
&nsGkAtoms::th,
|
||||
&nsGkAtoms::thead,
|
||||
&nsGkAtoms::time,
|
||||
&nsGkAtoms::tr,
|
||||
&nsGkAtoms::track,
|
||||
&nsGkAtoms::tt,
|
||||
&nsGkAtoms::u,
|
||||
&nsGkAtoms::ul,
|
||||
@ -1813,6 +1837,7 @@ nsIAtom** const kDefaultAllowedTags [] = {
|
||||
#ifdef MOZ_MEDIA
|
||||
&nsGkAtoms::video,
|
||||
#endif
|
||||
&nsGkAtoms::wbr,
|
||||
nsnull
|
||||
};
|
||||
|
||||
@ -1825,6 +1850,7 @@ nsIAtom** const kDefaultAllowedAttributes [] = {
|
||||
&nsGkAtoms::align,
|
||||
&nsGkAtoms::alt,
|
||||
&nsGkAtoms::autocomplete,
|
||||
&nsGkAtoms::autofocus,
|
||||
#ifdef MOZ_MEDIA
|
||||
&nsGkAtoms::autoplay,
|
||||
#endif
|
||||
@ -1844,6 +1870,8 @@ nsIAtom** const kDefaultAllowedAttributes [] = {
|
||||
&nsGkAtoms::cols,
|
||||
&nsGkAtoms::colspan,
|
||||
&nsGkAtoms::color,
|
||||
&nsGkAtoms::contenteditable,
|
||||
&nsGkAtoms::contextmenu,
|
||||
#ifdef MOZ_MEDIA
|
||||
&nsGkAtoms::controls,
|
||||
#endif
|
||||
@ -1852,34 +1880,57 @@ nsIAtom** const kDefaultAllowedAttributes [] = {
|
||||
&nsGkAtoms::datetime,
|
||||
&nsGkAtoms::dir,
|
||||
&nsGkAtoms::disabled,
|
||||
&nsGkAtoms::draggable,
|
||||
&nsGkAtoms::enctype,
|
||||
&nsGkAtoms::face,
|
||||
&nsGkAtoms::_for,
|
||||
&nsGkAtoms::frame,
|
||||
&nsGkAtoms::headers,
|
||||
&nsGkAtoms::height,
|
||||
&nsGkAtoms::hidden,
|
||||
&nsGkAtoms::high,
|
||||
&nsGkAtoms::href,
|
||||
&nsGkAtoms::hreflang,
|
||||
&nsGkAtoms::hspace,
|
||||
&nsGkAtoms::icon,
|
||||
&nsGkAtoms::id,
|
||||
&nsGkAtoms::ismap,
|
||||
&nsGkAtoms::itemid,
|
||||
&nsGkAtoms::itemprop,
|
||||
&nsGkAtoms::itemref,
|
||||
&nsGkAtoms::itemscope,
|
||||
&nsGkAtoms::itemtype,
|
||||
&nsGkAtoms::kind,
|
||||
&nsGkAtoms::label,
|
||||
&nsGkAtoms::lang,
|
||||
&nsGkAtoms::list,
|
||||
&nsGkAtoms::longdesc,
|
||||
#ifdef MOZ_MEDIA
|
||||
&nsGkAtoms::loop,
|
||||
&nsGkAtoms::loopend,
|
||||
&nsGkAtoms::loopstart,
|
||||
#endif
|
||||
&nsGkAtoms::low,
|
||||
&nsGkAtoms::max,
|
||||
&nsGkAtoms::maxlength,
|
||||
&nsGkAtoms::media,
|
||||
&nsGkAtoms::method,
|
||||
&nsGkAtoms::min,
|
||||
&nsGkAtoms::mozdonotsend,
|
||||
&nsGkAtoms::multiple,
|
||||
&nsGkAtoms::name,
|
||||
&nsGkAtoms::nohref,
|
||||
&nsGkAtoms::noshade,
|
||||
&nsGkAtoms::novalidate,
|
||||
&nsGkAtoms::nowrap,
|
||||
&nsGkAtoms::open,
|
||||
&nsGkAtoms::optimum,
|
||||
&nsGkAtoms::pattern,
|
||||
#ifdef MOZ_MEDIA
|
||||
&nsGkAtoms::pixelratio,
|
||||
#endif
|
||||
&nsGkAtoms::placeholder,
|
||||
#ifdef MOZ_MEDIA
|
||||
&nsGkAtoms::playbackrate,
|
||||
&nsGkAtoms::playcount,
|
||||
#endif
|
||||
@ -1889,19 +1940,26 @@ nsIAtom** const kDefaultAllowedAttributes [] = {
|
||||
&nsGkAtoms::preload,
|
||||
#endif
|
||||
&nsGkAtoms::prompt,
|
||||
&nsGkAtoms::pubdate,
|
||||
&nsGkAtoms::radiogroup,
|
||||
&nsGkAtoms::readonly,
|
||||
&nsGkAtoms::rel,
|
||||
&nsGkAtoms::required,
|
||||
&nsGkAtoms::rev,
|
||||
&nsGkAtoms::reversed,
|
||||
&nsGkAtoms::role,
|
||||
&nsGkAtoms::rows,
|
||||
&nsGkAtoms::rowspan,
|
||||
&nsGkAtoms::rules,
|
||||
&nsGkAtoms::scoped,
|
||||
&nsGkAtoms::scope,
|
||||
&nsGkAtoms::selected,
|
||||
&nsGkAtoms::shape,
|
||||
&nsGkAtoms::size,
|
||||
&nsGkAtoms::span,
|
||||
&nsGkAtoms::spellcheck,
|
||||
&nsGkAtoms::src,
|
||||
&nsGkAtoms::srclang,
|
||||
&nsGkAtoms::start,
|
||||
&nsGkAtoms::summary,
|
||||
&nsGkAtoms::tabindex,
|
||||
@ -1913,5 +1971,6 @@ nsIAtom** const kDefaultAllowedAttributes [] = {
|
||||
&nsGkAtoms::value,
|
||||
&nsGkAtoms::vspace,
|
||||
&nsGkAtoms::width,
|
||||
&nsGkAtoms::wrap,
|
||||
nsnull
|
||||
};
|
||||
|
@ -1431,6 +1431,8 @@ nsDOMImplementation::CreateDocument(const nsAString& aNamespaceURI,
|
||||
|
||||
nsCOMPtr<nsIScriptGlobalObject> scriptHandlingObject =
|
||||
do_QueryReferent(mScriptObject);
|
||||
|
||||
NS_ENSURE_STATE(!mScriptObject || scriptHandlingObject);
|
||||
|
||||
return nsContentUtils::CreateDocument(aNamespaceURI, aQualifiedName, aDoctype,
|
||||
mDocumentURI, mBaseURI, mPrincipal,
|
||||
@ -1443,31 +1445,34 @@ nsDOMImplementation::CreateHTMLDocument(const nsAString& aTitle,
|
||||
{
|
||||
*aReturn = NULL;
|
||||
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
nsresult rv = NS_NewHTMLDocument(getter_AddRefs(doc));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIHTMLDocument> HTMLdoc = do_QueryInterface(doc);
|
||||
HTMLdoc->SetCompatibilityMode(eCompatibility_FullStandards);
|
||||
|
||||
nsCOMPtr<nsIDOMDocumentType> doctype;
|
||||
// Indicate that there is no internal subset (not just an empty one)
|
||||
nsAutoString voidString;
|
||||
voidString.SetIsVoid(true);
|
||||
rv = NS_NewDOMDocumentType(getter_AddRefs(doctype),
|
||||
NULL, // aNodeInfoManager
|
||||
mPrincipal, // aPrincipal
|
||||
nsGkAtoms::html, // aName
|
||||
NULL, // aEntities
|
||||
NULL, // aNotations
|
||||
EmptyString(), // aPublicId
|
||||
EmptyString(), // aSystemId
|
||||
voidString); // aInternalSubset
|
||||
nsresult rv = NS_NewDOMDocumentType(getter_AddRefs(doctype),
|
||||
NULL, // aNodeInfoManager
|
||||
mPrincipal, // aPrincipal
|
||||
nsGkAtoms::html, // aName
|
||||
NULL, // aEntities
|
||||
NULL, // aNotations
|
||||
EmptyString(), // aPublicId
|
||||
EmptyString(), // aSystemId
|
||||
voidString); // aInternalSubset
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIContent> doctypeAsContent = do_QueryInterface(doctype);
|
||||
rv = doc->AppendChildTo(doctypeAsContent, false);
|
||||
|
||||
nsCOMPtr<nsIScriptGlobalObject> scriptHandlingObject =
|
||||
do_QueryReferent(mScriptObject);
|
||||
|
||||
NS_ENSURE_STATE(!mScriptObject || scriptHandlingObject);
|
||||
|
||||
nsCOMPtr<nsIDOMDocument> document;
|
||||
rv = nsContentUtils::CreateDocument(EmptyString(), EmptyString(),
|
||||
doctype, mDocumentURI, mBaseURI,
|
||||
mPrincipal, scriptHandlingObject,
|
||||
getter_AddRefs(document));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsCOMPtr<nsIDocument> doc = do_QueryInterface(document);
|
||||
|
||||
nsCOMPtr<nsIContent> root;
|
||||
rv = doc->CreateElem(NS_LITERAL_STRING("html"), NULL, kNameSpaceID_XHTML,
|
||||
@ -1505,14 +1510,6 @@ nsDOMImplementation::CreateHTMLDocument(const nsAString& aTitle,
|
||||
rv = root->AppendChildTo(body, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIScriptGlobalObject> scriptHandlingObject =
|
||||
do_QueryReferent(mScriptObject);
|
||||
doc->SetScriptHandlingObject(scriptHandlingObject);
|
||||
|
||||
// created documents are immediately "complete" (ready to use)
|
||||
doc->SetReadyStateInternal(nsIDocument::READYSTATE_COMPLETE);
|
||||
|
||||
nsCOMPtr<nsIDOMDocument> document = do_QueryInterface(doc);
|
||||
document.forget(aReturn);
|
||||
|
||||
return NS_OK;
|
||||
@ -2399,6 +2396,44 @@ nsresult nsDocument::CheckFrameOptions()
|
||||
if (thisWindow == topWindow)
|
||||
return NS_OK;
|
||||
|
||||
// Find the top docshell in our parent chain that doesn't have the system
|
||||
// principal and use it for the principal comparison. Finding the top
|
||||
// content-type docshell doesn't work because some chrome documents are
|
||||
// loaded in content docshells (see bug 593387).
|
||||
nsIPrincipal* thisPrincipal = NodePrincipal();
|
||||
nsCOMPtr<nsIDocShellTreeItem> thisDocShellItem(do_QueryInterface(docShell));
|
||||
nsCOMPtr<nsIDocShellTreeItem> parentDocShellItem,
|
||||
curDocShellItem = thisDocShellItem;
|
||||
nsCOMPtr<nsIDocument> topDoc;
|
||||
nsIScriptSecurityManager *ssm = nsContentUtils::GetSecurityManager();
|
||||
if (!ssm)
|
||||
return NS_ERROR_CONTENT_BLOCKED;
|
||||
|
||||
// Traverse up the parent chain to the top docshell that doesn't have
|
||||
// a system principal
|
||||
curDocShellItem->GetParent(getter_AddRefs(parentDocShellItem));
|
||||
while (parentDocShellItem) {
|
||||
PRBool system = PR_FALSE;
|
||||
topDoc = do_GetInterface(parentDocShellItem);
|
||||
if (topDoc) {
|
||||
if (NS_SUCCEEDED(ssm->IsSystemPrincipal(topDoc->NodePrincipal(),
|
||||
&system)) && system) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return NS_ERROR_CONTENT_BLOCKED;
|
||||
}
|
||||
curDocShellItem = parentDocShellItem;
|
||||
curDocShellItem->GetParent(getter_AddRefs(parentDocShellItem));
|
||||
}
|
||||
|
||||
// If this document has the top non-SystemPrincipal docshell it is not being
|
||||
// framed or it is being framed by a chrome document, which we allow.
|
||||
nsCOMPtr<nsIDocShellTreeItem> item(do_QueryInterface(docShell));
|
||||
if (curDocShellItem == thisDocShellItem)
|
||||
return NS_OK;
|
||||
|
||||
// If the value of the header is DENY, then the document
|
||||
// should never be permitted to load as a subdocument.
|
||||
if (xfoHeaderValue.LowerCaseEqualsLiteral("deny")) {
|
||||
@ -2411,11 +2446,10 @@ nsresult nsDocument::CheckFrameOptions()
|
||||
nsCOMPtr<nsIURI> uri = static_cast<nsIDocument*>(this)->GetDocumentURI();
|
||||
nsCOMPtr<nsIDOMDocument> topDOMDoc;
|
||||
topWindow->GetDocument(getter_AddRefs(topDOMDoc));
|
||||
nsCOMPtr<nsIDocument> topDoc = do_QueryInterface(topDOMDoc);
|
||||
topDoc = do_QueryInterface(topDOMDoc);
|
||||
if (topDoc) {
|
||||
nsCOMPtr<nsIURI> topUri = topDoc->GetDocumentURI();
|
||||
nsresult rv = nsContentUtils::GetSecurityManager()->
|
||||
CheckSameOriginURI(uri, topUri, PR_TRUE);
|
||||
nsresult rv = ssm->CheckSameOriginURI(uri, topUri, PR_TRUE);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
framingAllowed = false;
|
||||
|
@ -613,18 +613,13 @@ nsFrameLoader::Show(PRInt32 marginWidth, PRInt32 marginHeight,
|
||||
AutoResetInShow resetInShow(this);
|
||||
mInShow = PR_TRUE;
|
||||
|
||||
nsContentType contentType;
|
||||
|
||||
nsresult rv = MaybeCreateDocShell();
|
||||
if (NS_FAILED(rv)) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
#ifdef MOZ_IPC
|
||||
if (mRemoteFrame) {
|
||||
contentType = eContentTypeContent;
|
||||
}
|
||||
else
|
||||
if (!mRemoteFrame)
|
||||
#endif
|
||||
{
|
||||
if (!mDocShell)
|
||||
@ -644,22 +639,6 @@ nsFrameLoader::Show(PRInt32 marginWidth, PRInt32 marginHeight,
|
||||
sc->SetDefaultScrollbarPreferences(nsIScrollable::ScrollOrientation_Y,
|
||||
scrollbarPrefY);
|
||||
}
|
||||
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem = do_QueryInterface(mDocShell);
|
||||
NS_ASSERTION(treeItem,
|
||||
"Found a nsIDocShell that isn't a nsIDocShellTreeItem.");
|
||||
|
||||
PRInt32 itemType;
|
||||
treeItem->GetItemType(&itemType);
|
||||
|
||||
if (itemType == nsIDocShellTreeItem::typeChrome)
|
||||
contentType = eContentTypeUI;
|
||||
else {
|
||||
nsCOMPtr<nsIDocShellTreeItem> sameTypeParent;
|
||||
treeItem->GetSameTypeParent(getter_AddRefs(sameTypeParent));
|
||||
contentType = sameTypeParent ? eContentTypeContentFrame : eContentTypeContent;
|
||||
}
|
||||
}
|
||||
|
||||
nsIView* view = frame->EnsureInnerView();
|
||||
|
@ -65,6 +65,7 @@ GK_ATOM(_empty, "")
|
||||
GK_ATOM(moz, "_moz")
|
||||
GK_ATOM(moztype, "_moz-type")
|
||||
GK_ATOM(mozdirty, "_moz_dirty")
|
||||
GK_ATOM(mozdonotsend, "moz-do-not-send")
|
||||
GK_ATOM(mozeditorbogusnode, "_moz_editor_bogus_node")
|
||||
GK_ATOM(mozgeneratedcontentbefore, "_moz_generated_content_before")
|
||||
GK_ATOM(mozgeneratedcontentafter, "_moz_generated_content_after")
|
||||
@ -291,6 +292,7 @@ GK_ATOM(descendantOrSelf, "descendant-or-self")
|
||||
GK_ATOM(descending, "descending")
|
||||
GK_ATOM(description, "description")
|
||||
GK_ATOM(destructor, "destructor")
|
||||
GK_ATOM(details, "details")
|
||||
GK_ATOM(deviceAspectRatio, "device-aspect-ratio")
|
||||
GK_ATOM(deviceHeight, "device-height")
|
||||
GK_ATOM(deviceWidth, "device-width")
|
||||
@ -429,6 +431,7 @@ GK_ATOM(height, "height")
|
||||
GK_ATOM(hgroup, "hgroup")
|
||||
GK_ATOM(hidden, "hidden")
|
||||
GK_ATOM(hidechrome, "hidechrome")
|
||||
GK_ATOM(high, "high")
|
||||
GK_ATOM(highest, "highest")
|
||||
GK_ATOM(horizontal, "horizontal")
|
||||
GK_ATOM(hover, "hover")
|
||||
@ -439,6 +442,7 @@ GK_ATOM(hspace, "hspace")
|
||||
GK_ATOM(html, "html")
|
||||
GK_ATOM(httpEquiv, "http-equiv")
|
||||
GK_ATOM(i, "i")
|
||||
GK_ATOM(icon, "icon")
|
||||
GK_ATOM(id, "id")
|
||||
GK_ATOM(_if, "if")
|
||||
GK_ATOM(iframe, "iframe")
|
||||
@ -476,6 +480,11 @@ GK_ATOM(iscontainer, "iscontainer")
|
||||
GK_ATOM(isempty, "isempty")
|
||||
GK_ATOM(isindex, "isindex")
|
||||
GK_ATOM(ismap, "ismap")
|
||||
GK_ATOM(itemid, "itemid")
|
||||
GK_ATOM(itemprop, "itemprop")
|
||||
GK_ATOM(itemref, "itemref")
|
||||
GK_ATOM(itemscope, "itemscope")
|
||||
GK_ATOM(itemtype, "itemtype")
|
||||
GK_ATOM(kbd, "kbd")
|
||||
GK_ATOM(noautofocus, "noautofocus")
|
||||
GK_ATOM(keepcurrentinview, "keepcurrentinview")
|
||||
@ -486,6 +495,7 @@ GK_ATOM(keypress, "keypress")
|
||||
GK_ATOM(keyset, "keyset")
|
||||
GK_ATOM(keytext, "keytext")
|
||||
GK_ATOM(keyup, "keyup")
|
||||
GK_ATOM(kind, "kind")
|
||||
GK_ATOM(label, "label")
|
||||
GK_ATOM(lang, "lang")
|
||||
GK_ATOM(last, "last")
|
||||
@ -520,9 +530,11 @@ GK_ATOM(localedir, "localedir")
|
||||
GK_ATOM(localName, "local-name")
|
||||
GK_ATOM(longdesc, "longdesc")
|
||||
#ifdef MOZ_MEDIA
|
||||
GK_ATOM(loop, "loop")
|
||||
GK_ATOM(loopend, "loopend")
|
||||
GK_ATOM(loopstart, "loopstart")
|
||||
#endif
|
||||
GK_ATOM(low, "low")
|
||||
GK_ATOM(lowerFirst, "lower-first")
|
||||
GK_ATOM(lowest, "lowest")
|
||||
GK_ATOM(lowsrc, "lowsrc")
|
||||
@ -555,6 +567,7 @@ GK_ATOM(menulist, "menulist")
|
||||
GK_ATOM(menupopup, "menupopup")
|
||||
GK_ATOM(message, "message")
|
||||
GK_ATOM(meta, "meta")
|
||||
GK_ATOM(meter, "meter")
|
||||
GK_ATOM(method, "method")
|
||||
GK_ATOM(middle, "middle")
|
||||
GK_ATOM(min, "min")
|
||||
@ -705,6 +718,7 @@ GK_ATOM(onunderflow, "onunderflow")
|
||||
GK_ATOM(onunload, "onunload")
|
||||
GK_ATOM(open, "open")
|
||||
GK_ATOM(optgroup, "optgroup")
|
||||
GK_ATOM(optimum, "optimum")
|
||||
GK_ATOM(option, "option")
|
||||
GK_ATOM(_or, "or")
|
||||
GK_ATOM(order, "order")
|
||||
@ -791,6 +805,7 @@ GK_ATOM(prompt, "prompt")
|
||||
GK_ATOM(propagate, "propagate")
|
||||
GK_ATOM(properties, "properties")
|
||||
GK_ATOM(property, "property")
|
||||
GK_ATOM(pubdate, "pubdate")
|
||||
GK_ATOM(pushedFloatsList, "PushedFloats-list")
|
||||
GK_ATOM(q, "q")
|
||||
GK_ATOM(query, "query")
|
||||
@ -821,6 +836,7 @@ GK_ATOM(result, "result")
|
||||
GK_ATOM(resultPrefix, "result-prefix")
|
||||
GK_ATOM(rev, "rev")
|
||||
GK_ATOM(reverse, "reverse")
|
||||
GK_ATOM(reversed, "reversed")
|
||||
GK_ATOM(richlistbox, "richlistbox")
|
||||
GK_ATOM(right, "right")
|
||||
GK_ATOM(rightmargin, "rightmargin")
|
||||
@ -830,7 +846,10 @@ GK_ATOM(round, "round")
|
||||
GK_ATOM(row, "row")
|
||||
GK_ATOM(rows, "rows")
|
||||
GK_ATOM(rowspan, "rowspan")
|
||||
GK_ATOM(rp, "rp")
|
||||
GK_ATOM(rt, "rt")
|
||||
GK_ATOM(rtl, "rtl")
|
||||
GK_ATOM(ruby, "ruby")
|
||||
GK_ATOM(rule, "rule")
|
||||
GK_ATOM(rules, "rules")
|
||||
GK_ATOM(s, "s")
|
||||
@ -839,6 +858,7 @@ GK_ATOM(scale, "scale")
|
||||
GK_ATOM(scan, "scan")
|
||||
GK_ATOM(scheme, "scheme")
|
||||
GK_ATOM(scope, "scope")
|
||||
GK_ATOM(scoped, "scoped")
|
||||
GK_ATOM(screen, "screen")
|
||||
GK_ATOM(screenX, "screenX")
|
||||
GK_ATOM(screenY, "screenY")
|
||||
@ -894,6 +914,7 @@ GK_ATOM(split, "split")
|
||||
GK_ATOM(splitter, "splitter")
|
||||
GK_ATOM(spring, "spring")
|
||||
GK_ATOM(src, "src")
|
||||
GK_ATOM(srclang, "srclang")
|
||||
GK_ATOM(stack, "stack")
|
||||
GK_ATOM(standalone, "standalone")
|
||||
GK_ATOM(standby, "standby")
|
||||
@ -949,6 +970,7 @@ GK_ATOM(tfoot, "tfoot")
|
||||
GK_ATOM(th, "th")
|
||||
GK_ATOM(thead, "thead")
|
||||
GK_ATOM(thumb, "thumb")
|
||||
GK_ATOM(time, "time")
|
||||
GK_ATOM(title, "title")
|
||||
GK_ATOM(titlebar, "titlebar")
|
||||
GK_ATOM(titletip, "titletip")
|
||||
@ -967,6 +989,7 @@ GK_ATOM(topmargin, "topmargin")
|
||||
GK_ATOM(toppadding, "toppadding")
|
||||
GK_ATOM(topright, "topright")
|
||||
GK_ATOM(tr, "tr")
|
||||
GK_ATOM(track, "track")
|
||||
GK_ATOM(trailing, "trailing")
|
||||
GK_ATOM(transform, "transform")
|
||||
GK_ATOM(transformiix, "transformiix")
|
||||
|
@ -119,7 +119,7 @@ nsPlainTextSerializer::nsPlainTextSerializer()
|
||||
|
||||
// Flow
|
||||
mEmptyLines = 1; // The start of the document is an "empty line" in itself,
|
||||
mInWhitespace = PR_TRUE;
|
||||
mInWhitespace = PR_FALSE;
|
||||
mPreFormatted = PR_FALSE;
|
||||
mStartedOutput = PR_FALSE;
|
||||
|
||||
@ -638,6 +638,8 @@ nsPlainTextSerializer::DoOpenContainer(const nsIParserNode* aNode, PRInt32 aTag)
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* See comment at end of function. */
|
||||
mInWhitespace = PR_TRUE;
|
||||
mPreFormatted = PR_FALSE;
|
||||
}
|
||||
|
||||
@ -807,6 +809,13 @@ nsPlainTextSerializer::DoOpenContainer(const nsIParserNode* aNode, PRInt32 aTag)
|
||||
Write(NS_LITERAL_STRING("_"));
|
||||
}
|
||||
|
||||
/* Container elements are always block elements, so we shouldn't
|
||||
output any whitespace immediately after the container tag even if
|
||||
there's extra whitespace there because the HTML is pretty-printed
|
||||
or something. To ensure that happens, tell the serializer we're
|
||||
already in whitespace so it won't output more. */
|
||||
mInWhitespace = PR_TRUE;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1073,38 +1082,26 @@ nsPlainTextSerializer::DoAddLeaf(const nsIParserNode *aNode, PRInt32 aTag,
|
||||
EnsureVerticalSpace(mEmptyLines+1);
|
||||
}
|
||||
}
|
||||
else if (type == eHTMLTag_whitespace) {
|
||||
else if (type == eHTMLTag_whitespace || type == eHTMLTag_newline) {
|
||||
// The only times we want to pass along whitespace from the original
|
||||
// html source are if we're forced into preformatted mode via flags,
|
||||
// or if we're prettyprinting and we're inside a <pre>.
|
||||
// Otherwise, either we're collapsing to minimal text, or we're
|
||||
// prettyprinting to mimic the html format, and in neither case
|
||||
// does the formatting of the html source help us.
|
||||
// One exception: at the very beginning of a selection,
|
||||
// we want to preserve whitespace.
|
||||
if (mFlags & nsIDocumentEncoder::OutputPreformatted ||
|
||||
(mPreFormatted && !mWrapColumn) ||
|
||||
IsInPre()) {
|
||||
Write(aText);
|
||||
if (type == eHTMLTag_newline)
|
||||
EnsureVerticalSpace(mEmptyLines+1);
|
||||
else
|
||||
Write(aText);
|
||||
}
|
||||
else if(!mInWhitespace ||
|
||||
(!mStartedOutput
|
||||
&& mFlags | nsIDocumentEncoder::OutputSelectionOnly)) {
|
||||
mInWhitespace = PR_FALSE;
|
||||
else if(!mInWhitespace) {
|
||||
Write(kSpace);
|
||||
mInWhitespace = PR_TRUE;
|
||||
}
|
||||
}
|
||||
else if (type == eHTMLTag_newline) {
|
||||
if (mFlags & nsIDocumentEncoder::OutputPreformatted ||
|
||||
(mPreFormatted && !mWrapColumn) ||
|
||||
IsInPre()) {
|
||||
EnsureVerticalSpace(mEmptyLines+1);
|
||||
}
|
||||
else {
|
||||
Write(kSpace);
|
||||
}
|
||||
}
|
||||
else if (type == eHTMLTag_hr &&
|
||||
(mFlags & nsIDocumentEncoder::OutputFormatted)) {
|
||||
EnsureVerticalSpace(0);
|
||||
@ -1161,10 +1158,12 @@ nsPlainTextSerializer::EnsureVerticalSpace(PRInt32 noOfRows)
|
||||
// realize that we should start a new line.
|
||||
if(noOfRows >= 0 && !mInIndentString.IsEmpty()) {
|
||||
EndLine(PR_FALSE);
|
||||
mInWhitespace = PR_TRUE;
|
||||
}
|
||||
|
||||
while(mEmptyLines < noOfRows) {
|
||||
EndLine(PR_FALSE);
|
||||
mInWhitespace = PR_TRUE;
|
||||
}
|
||||
mLineBreakDue = PR_FALSE;
|
||||
mFloatingLines = -1;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user