зеркало из https://github.com/mozilla/gecko-dev.git
Merge MC -> JM
This commit is contained in:
Коммит
3d2972e8bb
1
.hgtags
1
.hgtags
|
@ -69,3 +69,4 @@ a95d426422816513477e5863add1b00ac7041dcb AURORA_BASE_20110412
|
|||
5eb553dd2ceae5f88d80f27afc5ef3935c5d43b0 AURORA_BASE_20110705
|
||||
41b84b87c816403e1b74963d8094cff0406c989e AURORA_BASE_20110816
|
||||
c0983049bcaa9551e5f276d5a77ce154c151e0b0 AURORA_BASE_20110927
|
||||
462c726144bc1fb45b61e774f64ac5d61b4e047c UPDATE_PACKAGING_R15
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "nsAccUtils.h"
|
||||
#include "nsRootAccessible.h"
|
||||
|
||||
#include "nsEventStateManager.h"
|
||||
#include "nsFocusManager.h"
|
||||
|
||||
namespace dom = mozilla::dom;
|
||||
|
@ -352,18 +353,22 @@ FocusManager::ProcessFocusEvent(AccEvent* aEvent)
|
|||
}
|
||||
}
|
||||
|
||||
nsIContent*
|
||||
FocusManager::FocusedDOMElm() const
|
||||
nsINode*
|
||||
FocusManager::FocusedDOMNode() const
|
||||
{
|
||||
nsFocusManager* DOMFocusManager = nsFocusManager::GetFocusManager();
|
||||
return DOMFocusManager->GetFocusedContent();
|
||||
}
|
||||
nsIContent* focusedElm = DOMFocusManager->GetFocusedContent();
|
||||
|
||||
nsIDocument*
|
||||
FocusManager::FocusedDOMDocument() const
|
||||
{
|
||||
nsFocusManager* DOMFocusManager = nsFocusManager::GetFocusManager();
|
||||
// No focus on remote target elements like xul:browser having DOM focus and
|
||||
// residing in chrome process because it means an element in content process
|
||||
// keeps the focus.
|
||||
if (focusedElm) {
|
||||
if (nsEventStateManager::IsRemoteTarget(focusedElm))
|
||||
return nsnull;
|
||||
return focusedElm;
|
||||
}
|
||||
|
||||
// Otherwise the focus can be on DOM document.
|
||||
nsCOMPtr<nsIDOMWindow> focusedWnd;
|
||||
DOMFocusManager->GetFocusedWindow(getter_AddRefs(focusedWnd));
|
||||
if (focusedWnd) {
|
||||
|
@ -374,3 +379,10 @@ FocusManager::FocusedDOMDocument() const
|
|||
}
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
nsIDocument*
|
||||
FocusManager::FocusedDOMDocument() const
|
||||
{
|
||||
nsINode* focusedNode = FocusedDOMNode();
|
||||
return focusedNode ? focusedNode->OwnerDoc() : nsnull;
|
||||
}
|
||||
|
|
|
@ -146,18 +146,7 @@ private:
|
|||
/**
|
||||
* Return DOM node having DOM focus.
|
||||
*/
|
||||
inline nsINode* FocusedDOMNode() const
|
||||
{
|
||||
nsINode* focusedNode = FocusedDOMElm();
|
||||
if (focusedNode)
|
||||
return focusedNode;
|
||||
return FocusedDOMDocument();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return DOM element having DOM focus.
|
||||
*/
|
||||
nsIContent* FocusedDOMElm() const;
|
||||
nsINode* FocusedDOMNode() const;
|
||||
|
||||
/**
|
||||
* Return DOM document having DOM focus.
|
||||
|
|
|
@ -654,7 +654,7 @@ nsAccessible::IsVisible(bool* aIsOffscreen)
|
|||
}
|
||||
|
||||
// The frame intersects the viewport, but we need to check the parent view chain :(
|
||||
bool isVisible = nsCoreUtils::CheckVisibilityInParentChain(frame);
|
||||
bool isVisible = frame->IsVisibleConsideringAncestors(nsIFrame::VISIBILITY_CROSS_CHROME_CONTENT_BOUNDARY);
|
||||
if (isVisible && rectVisibility == nsRectVisibility_kVisible) {
|
||||
*aIsOffscreen = false;
|
||||
}
|
||||
|
|
|
@ -758,31 +758,6 @@ nsCoreUtils::IsColumnHidden(nsITreeColumn *aColumn)
|
|||
nsGkAtoms::_true, eCaseMatters);
|
||||
}
|
||||
|
||||
bool
|
||||
nsCoreUtils::CheckVisibilityInParentChain(nsIFrame* aFrame)
|
||||
{
|
||||
nsIView* view = aFrame->GetClosestView();
|
||||
if (view && !view->IsEffectivelyVisible())
|
||||
return false;
|
||||
|
||||
nsIPresShell* presShell = aFrame->PresContext()->GetPresShell();
|
||||
while (presShell) {
|
||||
if (!presShell->IsActive()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsIFrame* rootFrame = presShell->GetRootFrame();
|
||||
presShell = nsnull;
|
||||
if (rootFrame) {
|
||||
nsIFrame* frame = nsLayoutUtils::GetCrossDocParentFrame(rootFrame);
|
||||
if (frame) {
|
||||
presShell = frame->PresContext()->GetPresShell();
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessibleDOMStringList
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -370,11 +370,6 @@ public:
|
|||
aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::scope);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the visibility across both parent content and chrome.
|
||||
*/
|
||||
static bool CheckVisibilityInParentChain(nsIFrame* aFrame);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -311,7 +311,8 @@ nsDocAccessible::NativeState()
|
|||
state |= states::BUSY;
|
||||
|
||||
nsIFrame* frame = GetFrame();
|
||||
if (!frame || !nsCoreUtils::CheckVisibilityInParentChain(frame)) {
|
||||
if (!frame ||
|
||||
!frame->IsVisibleConsideringAncestors(nsIFrame::VISIBILITY_CROSS_CHROME_CONTENT_BOUNDARY)) {
|
||||
state |= states::INVISIBLE | states::OFFSCREEN;
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ pref("extensions.update.autoUpdateDefault", true);
|
|||
// Disable add-ons installed into the shared user and shared system areas by
|
||||
// default. This does not include the application directory. See the SCOPE
|
||||
// constants in AddonManager.jsm for values to use here
|
||||
pref("extensions.autoDisableScopes", 10);
|
||||
pref("extensions.autoDisableScopes", 15);
|
||||
|
||||
// Dictionary download preference
|
||||
pref("browser.dictionaries.download.url", "https://addons.mozilla.org/%LOCALE%/firefox/dictionaries/");
|
||||
|
|
|
@ -83,6 +83,3 @@ endif
|
|||
ifneq (,$(filter windows gtk2, $(MOZ_WIDGET_TOOLKIT)))
|
||||
DEFINES += -DMENUBAR_CAN_AUTOHIDE=1
|
||||
endif
|
||||
|
||||
libs::
|
||||
$(NSINSTALL) $(srcdir)/content/tabview/modules/* $(FINAL_TARGET)/modules/tabview
|
||||
|
|
|
@ -67,7 +67,8 @@
|
|||
#else
|
||||
title="&aboutDialog.title;"
|
||||
#endif
|
||||
aria-describedby="version distribution distributionId"
|
||||
role="dialog"
|
||||
aria-describedby="version distribution distributionId communityDesc contributeDesc trademark"
|
||||
>
|
||||
|
||||
<script type="application/javascript" src="chrome://browser/content/aboutDialog.js"/>
|
||||
|
@ -80,7 +81,7 @@
|
|||
<label id="distribution" class="text-blurb"/>
|
||||
<label id="distributionId" class="text-blurb"/>
|
||||
|
||||
<vbox id="detailsBox" aria-describedby="communityDesc contributeDesc">
|
||||
<vbox id="detailsBox">
|
||||
<vbox id="updateBox">
|
||||
#ifdef MOZ_UPDATER
|
||||
<deck id="updateDeck" orient="vertical">
|
||||
|
|
|
@ -234,6 +234,10 @@ body[dir=rtl] #searchSubmit:active {
|
|||
cursor: pointer;
|
||||
}
|
||||
|
||||
#snippets:empty {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
@media all and (max-width: 470px) {
|
||||
#snippets { width: 65% }
|
||||
}
|
||||
|
|
|
@ -855,18 +855,13 @@ var PlacesMenuDNDHandler = {
|
|||
if (!this._isStaticContainer(event.target))
|
||||
return;
|
||||
|
||||
let ip = new InsertionPoint(PlacesUtils.bookmarksMenuFolderId,
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
Ci.nsITreeView.DROP_ON);
|
||||
if (ip && PlacesControllerDragHelper.canDrop(ip, event.dataTransfer)) {
|
||||
this._loadTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
this._loadTimer.initWithCallback(function() {
|
||||
PlacesMenuDNDHandler._loadTimer = null;
|
||||
event.target.lastChild.setAttribute("autoopened", "true");
|
||||
event.target.lastChild.showPopup(event.target.lastChild);
|
||||
}, this._springLoadDelay, Ci.nsITimer.TYPE_ONE_SHOT);
|
||||
event.preventDefault();
|
||||
}
|
||||
this._loadTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
this._loadTimer.initWithCallback(function() {
|
||||
PlacesMenuDNDHandler._loadTimer = null;
|
||||
event.target.lastChild.setAttribute("autoopened", "true");
|
||||
event.target.lastChild.showPopup(event.target.lastChild);
|
||||
}, this._springLoadDelay, Ci.nsITimer.TYPE_ONE_SHOT);
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
},
|
||||
|
||||
|
|
|
@ -93,10 +93,9 @@ let TabView = {
|
|||
// ----------
|
||||
init: function TabView_init() {
|
||||
// disable the ToggleTabView command for popup windows
|
||||
if (!window.toolbar.visible) {
|
||||
goSetCommandEnabled("Browser:ToggleTabView", false);
|
||||
goSetCommandEnabled("Browser:ToggleTabView", window.toolbar.visible);
|
||||
if (!window.toolbar.visible)
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._initialized)
|
||||
return;
|
||||
|
|
|
@ -13,7 +13,6 @@ tabbrowser {
|
|||
-moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser-tabs");
|
||||
}
|
||||
|
||||
#tabbrowser-tabs[drag=detach][closebuttons=hidden] > .tabbrowser-arrowscrollbox > .tabs-newtab-button,
|
||||
#tabbrowser-tabs:not([overflow="true"]) + #new-tab-button,
|
||||
#tabbrowser-tabs[overflow="true"] > .tabbrowser-arrowscrollbox > .tabs-newtab-button,
|
||||
#TabsToolbar[currentset]:not([currentset*="tabbrowser-tabs,new-tab-button"]) > #tabbrowser-tabs > .tabbrowser-arrowscrollbox > .tabs-newtab-button,
|
||||
|
@ -63,35 +62,6 @@ tabbrowser {
|
|||
display: block; /* position:fixed already does this (bug 579776), but let's be explicit */
|
||||
}
|
||||
|
||||
.tabbrowser-tabs[drag] > .tabbrowser-tab[selected] {
|
||||
z-index: 2; /* ensure selected tab stays on top despite -moz-transform */
|
||||
}
|
||||
|
||||
.tabbrowser-tabs[drag] > .tabbrowser-tab[dragged] {
|
||||
-moz-transition: 0s; /* suppress opening animation when reattaching tab */
|
||||
}
|
||||
|
||||
/* visibility: collapse might collapse the tab bar, so we use this instead */
|
||||
.tabbrowser-tabs[drag=detach] > .tabbrowser-tab[dragged]:not(:only-child) {
|
||||
min-width: 0 !important;
|
||||
max-width: 0 !important;
|
||||
border: 0 !important;
|
||||
opacity: 0;
|
||||
overflow: hidden;
|
||||
-moz-transition: max-width 150ms ease-out;
|
||||
}
|
||||
.tabbrowser-tabs[drag=detach] > .tabbrowser-tab[dragged]:only-child {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.tabbrowser-tabs[drag=move] > .tabbrowser-tab[fadein]:not([dragged]) {
|
||||
-moz-transition: -moz-transform 200ms ease-out;
|
||||
}
|
||||
|
||||
.tabbrowser-tabs[drag=finish] > .tabbrowser-tab[dragged][fadein] {
|
||||
-moz-transition: -moz-transform 100ms ease-out;
|
||||
}
|
||||
|
||||
#alltabs-popup {
|
||||
-moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser-alltabs-popup");
|
||||
}
|
||||
|
|
|
@ -3429,6 +3429,7 @@ const BrowserSearch = {
|
|||
openLinkIn(submission.uri.spec,
|
||||
useNewTab ? "tab" : "current",
|
||||
{ postData: submission.postData,
|
||||
inBackground: false,
|
||||
relatedToCurrent: true });
|
||||
},
|
||||
|
||||
|
@ -4158,7 +4159,7 @@ var XULBrowserWindow = {
|
|||
startTime: 0,
|
||||
statusText: "",
|
||||
isBusy: false,
|
||||
inContentWhitelist: ["about:addons", "about:permissions"],
|
||||
inContentWhitelist: ["about:addons", "about:permissions", "about:sync-progress"],
|
||||
|
||||
QueryInterface: function (aIID) {
|
||||
if (aIID.equals(Ci.nsIWebProgressListener) ||
|
||||
|
@ -6678,14 +6679,6 @@ var gPluginHandler = {
|
|||
return this.CrashSubmit;
|
||||
},
|
||||
|
||||
get crashReportHelpURL() {
|
||||
delete this.crashReportHelpURL;
|
||||
let url = formatURL("app.support.baseURL", true);
|
||||
url += "plugin-crashed";
|
||||
this.crashReportHelpURL = url;
|
||||
return this.crashReportHelpURL;
|
||||
},
|
||||
|
||||
// Map the plugin's name to a filtered version more suitable for user UI.
|
||||
makeNicePluginName : function (aName, aFilename) {
|
||||
if (aName == "Shockwave Flash")
|
||||
|
@ -6824,10 +6817,25 @@ var gPluginHandler = {
|
|||
BrowserOpenAddonsMgr("addons://list/plugin");
|
||||
},
|
||||
|
||||
// Callback for user clicking "submit a report" link
|
||||
submitReport : function(pluginDumpID, browserDumpID) {
|
||||
// The crash reporter wants a DOM element it can append an IFRAME to,
|
||||
// which it uses to submit a form. Let's just give it gBrowser.
|
||||
// When user clicks try, checks if we should also send crash report in bg
|
||||
retryPluginPage: function (browser, plugin, pluginDumpID, browserDumpID) {
|
||||
let doc = plugin.ownerDocument;
|
||||
|
||||
let statusDiv =
|
||||
doc.getAnonymousElementByAttribute(plugin, "class", "submitStatus");
|
||||
let status = statusDiv.getAttribute("status");
|
||||
|
||||
let submitChk =
|
||||
doc.getAnonymousElementByAttribute(plugin, "class", "pleaseSubmitCheckbox");
|
||||
|
||||
// Check status to make sure we haven't submitted already
|
||||
if (status == "please" && submitChk.checked) {
|
||||
this.submitReport(pluginDumpID, browserDumpID);
|
||||
}
|
||||
this.reloadPage(browser);
|
||||
},
|
||||
|
||||
submitReport: function (pluginDumpID, browserDumpID) {
|
||||
this.CrashSubmit.submit(pluginDumpID);
|
||||
if (browserDumpID)
|
||||
this.CrashSubmit.submit(browserDumpID);
|
||||
|
@ -7045,8 +7053,7 @@ var gPluginHandler = {
|
|||
return;
|
||||
|
||||
let submittedReport = aEvent.getData("submittedCrashReport");
|
||||
let doPrompt = true; // XXX followup for .getData("doPrompt");
|
||||
let submitReports = true; // XXX followup for .getData("submitReports");
|
||||
let doPrompt = true; // XXX followup to get via gCrashReporter
|
||||
let pluginName = aEvent.getData("pluginName");
|
||||
let pluginFilename = aEvent.getData("pluginFilename");
|
||||
let pluginDumpID = aEvent.getData("pluginDumpID");
|
||||
|
@ -7064,6 +7071,7 @@ var gPluginHandler = {
|
|||
let overlay = doc.getAnonymousElementByAttribute(plugin, "class", "mainBox");
|
||||
let statusDiv = doc.getAnonymousElementByAttribute(plugin, "class", "submitStatus");
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
let submitReports = gCrashReporter.submitReports;
|
||||
let status;
|
||||
|
||||
// Determine which message to show regarding crash reports.
|
||||
|
@ -7074,18 +7082,21 @@ var gPluginHandler = {
|
|||
status = "noSubmit";
|
||||
}
|
||||
else { // doPrompt
|
||||
// link submit checkbox to gCrashReporter submitReports preference
|
||||
let submitChk = doc.getAnonymousElementByAttribute(
|
||||
plugin, "class", "pleaseSubmitCheckbox");
|
||||
submitChk.checked = submitReports;
|
||||
submitChk.addEventListener("click", function() {
|
||||
gCrashReporter.submitReports = this.checked;
|
||||
}, false);
|
||||
|
||||
status = "please";
|
||||
// XXX can we make the link target actually be blank?
|
||||
let pleaseLink = doc.getAnonymousElementByAttribute(
|
||||
plugin, "class", "pleaseSubmitLink");
|
||||
this.addLinkClickCallback(pleaseLink, "submitReport",
|
||||
pluginDumpID, browserDumpID);
|
||||
}
|
||||
|
||||
// If we don't have a minidumpID, we can't (or didn't) submit anything.
|
||||
// This can happen if the plugin is killed from the task manager.
|
||||
if (!pluginDumpID) {
|
||||
status = "noReport";
|
||||
status = "noReport";
|
||||
}
|
||||
|
||||
statusDiv.setAttribute("status", status);
|
||||
|
@ -7095,10 +7106,23 @@ var gPluginHandler = {
|
|||
let helpIcon = doc.getAnonymousElementByAttribute(plugin, "class", "helpIcon");
|
||||
this.addLinkClickCallback(helpIcon, "openHelpPage");
|
||||
|
||||
// If we're showing the link to manually trigger report submission, we'll
|
||||
// want to be able to update all the instances of the UI for this crash to
|
||||
// show an updated message when a report is submitted.
|
||||
// If we're showing the checkbox to trigger report submission, we'll want
|
||||
// to be able to update all the instances of the UI for this crash when
|
||||
// one instance of the checkbox is modified or the status is updated.
|
||||
if (doPrompt) {
|
||||
let submitReportsPrefObserver = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
|
||||
Ci.nsISupportsWeakReference]),
|
||||
observe : function(subject, topic, data) {
|
||||
let submitChk = doc.getAnonymousElementByAttribute(
|
||||
plugin, "class", "pleaseSubmitCheckbox");
|
||||
submitChk.checked = gCrashReporter.submitReports;
|
||||
},
|
||||
handleEvent : function(event) {
|
||||
// Not expected to be called, just here for the closure.
|
||||
}
|
||||
};
|
||||
|
||||
let observer = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
|
||||
Ci.nsISupportsWeakReference]),
|
||||
|
@ -7115,16 +7139,21 @@ var gPluginHandler = {
|
|||
handleEvent : function(event) {
|
||||
// Not expected to be called, just here for the closure.
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Use a weak reference, so we don't have to remove it...
|
||||
Services.obs.addObserver(observer, "crash-report-status", true);
|
||||
Services.obs.addObserver(
|
||||
submitReportsPrefObserver, "submit-reports-pref-changed", true);
|
||||
|
||||
// ...alas, now we need something to hold a strong reference to prevent
|
||||
// it from being GC. But I don't want to manually manage the reference's
|
||||
// lifetime (which should be no greater than the page).
|
||||
// Clever solution? Use a closue with an event listener on the document.
|
||||
// Clever solution? Use a closure with an event listener on the document.
|
||||
// When the doc goes away, so do the listener references and the closure.
|
||||
doc.addEventListener("mozCleverClosureHack", observer, false);
|
||||
doc.addEventListener(
|
||||
"mozCleverClosureHack", submitReportsPrefObserver, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -7134,7 +7163,12 @@ var gPluginHandler = {
|
|||
let browser = gBrowser.getBrowserForDocument(doc.defaultView.top.document);
|
||||
|
||||
let link = doc.getAnonymousElementByAttribute(plugin, "class", "reloadLink");
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
this.addLinkClickCallback(
|
||||
link, "retryPluginPage", browser, plugin, pluginDumpID, browserDumpID);
|
||||
#else
|
||||
this.addLinkClickCallback(link, "reloadPage", browser);
|
||||
#endif
|
||||
|
||||
let notificationBox = gBrowser.getNotificationBox(browser);
|
||||
|
||||
|
@ -7200,7 +7234,10 @@ var gPluginHandler = {
|
|||
let link = notification.ownerDocument.createElementNS(XULNS, "label");
|
||||
link.className = "text-link";
|
||||
link.setAttribute("value", gNavigatorBundle.getString("crashedpluginsMessage.learnMore"));
|
||||
link.href = gPluginHandler.crashReportHelpURL;
|
||||
let crashurl = formatURL("app.support.baseURL", true);
|
||||
crashurl += "plugin-crashed-notificationbar";
|
||||
link.href = crashurl;
|
||||
|
||||
let description = notification.ownerDocument.getAnonymousElementByAttribute(notification, "anonid", "messageText");
|
||||
description.appendChild(link);
|
||||
|
||||
|
|
|
@ -973,15 +973,28 @@
|
|||
<toolbar id="inspector-toolbar"
|
||||
nowindowdrag="true"
|
||||
hidden="true">
|
||||
<toolbarbutton id="inspector-inspect-toolbutton"
|
||||
label="&inspectButton.label;"
|
||||
accesskey="&inspectButton.accesskey;"
|
||||
class="toolbarbutton-text"
|
||||
command="Inspector:Inspect"/>
|
||||
<toolbarseparator />
|
||||
<hbox id="inspector-tools">
|
||||
<!-- registered tools go here -->
|
||||
</hbox>
|
||||
<vbox flex="1">
|
||||
<resizer id="inspector-top-resizer" flex="1"
|
||||
class="inspector-resizer"
|
||||
dir="top" disabled="true"
|
||||
element="inspector-tree-box"/>
|
||||
<hbox>
|
||||
<toolbarbutton id="inspector-inspect-toolbutton"
|
||||
label="&inspectButton.label;"
|
||||
accesskey="&inspectButton.accesskey;"
|
||||
command="Inspector:Inspect"/>
|
||||
<arrowscrollbox id="inspector-breadcrumbs"
|
||||
flex="1" orient="horizontal"
|
||||
clicktoscroll="true"/>
|
||||
<hbox id="inspector-tools">
|
||||
<!-- registered tools go here -->
|
||||
</hbox>
|
||||
<resizer id="inspector-end-resizer"
|
||||
class="inspector-resizer"
|
||||
dir="top" disabled="true"
|
||||
element="inspector-tree-box"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</toolbar>
|
||||
<toolbar id="addon-bar"
|
||||
toolbarname="&addonBarCmd.label;" accesskey="&addonBarCmd.accesskey;"
|
||||
|
|
|
@ -36,6 +36,10 @@
|
|||
z-index: 1;
|
||||
}
|
||||
|
||||
.inspector-breadcrumbs-button {
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
/*
|
||||
* Node Infobar
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
/* ***** 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 Firefox Sync.
|
||||
*
|
||||
* The Initial Developer of the Original Code is the Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Allison Naaktgeboren <ally@mozilla.com> (original author)
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://services-sync/main.js");
|
||||
|
||||
let gProgressBar;
|
||||
let gCounter = 0;
|
||||
|
||||
function onLoad(event) {
|
||||
Services.obs.addObserver(increaseProgressBar, "weave:engine:sync:finish", false);
|
||||
Services.obs.addObserver(increaseProgressBar, "weave:engine:sync:error", false);
|
||||
gProgressBar = document.getElementById('uploadProgressBar');
|
||||
|
||||
if (Services.prefs.getPrefType("services.sync.firstSync") != Ci.nsIPrefBranch.PREF_INVALID) {
|
||||
gProgressBar.max = Weave.Engines.getEnabled().length;
|
||||
gProgressBar.style.display = "inline";
|
||||
}
|
||||
else {
|
||||
gProgressBar.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
function onUnload(event) {
|
||||
Services.obs.removeObserver(increaseProgressBar, "weave:engine:sync:finish");
|
||||
Services.obs.removeObserver(increaseProgressBar, "weave:engine:sync:error");
|
||||
}
|
||||
|
||||
function increaseProgressBar(){
|
||||
gCounter += 1;
|
||||
gProgressBar.setAttribute("value", gCounter);
|
||||
}
|
||||
|
||||
function closeTab() {
|
||||
window.close();
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License
|
||||
# Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS"
|
||||
# basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is Firefox Sync.
|
||||
#
|
||||
# The Initial Developer of the Original Code is the Mozilla Foundation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2011
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Allison Naaktgeboren <ally@mozilla.com> (original author)
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
<!DOCTYPE html [
|
||||
<!ENTITY % htmlDTD
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"DTD/xhtml1-strict.dtd">
|
||||
%htmlDTD;
|
||||
<!ENTITY % syncProgressDTD
|
||||
SYSTEM "chrome://browser/locale/syncProgress.dtd">
|
||||
%syncProgressDTD;
|
||||
<!ENTITY % syncSetupDTD
|
||||
SYSTEM "chrome://browser/locale/syncSetup.dtd">
|
||||
%syncSetupDTD;
|
||||
]>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>&syncProgress.pageTitle;</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="all"
|
||||
href="chrome://browser/skin/syncProgress.css"/>
|
||||
|
||||
<link rel="icon" type="image/png" id="favicon"
|
||||
href="chrome://browser/skin/sync-16.png"/>
|
||||
|
||||
<script type="text/javascript;version=1.8"
|
||||
src="chrome://browser/content/syncProgress.js"/>
|
||||
</head>
|
||||
<body onload="onLoad(event)" onunload="onUnload(event)">
|
||||
<title>&setup.successPage.title;</title>
|
||||
<div id="floatingBox" class="main-content">
|
||||
<div id="title">
|
||||
<h1>&setup.successPage.title;</h1>
|
||||
</div>
|
||||
<div id="successLogo">
|
||||
<img id="brandSyncLogo" src="chrome://browser/skin/sync-128.png" alt="&syncProgress.logoAltText;" />
|
||||
</div>
|
||||
<div id="loadingText">
|
||||
<p id="blurb">&syncProgress.textBlurb; </p>
|
||||
</div>
|
||||
<div id="progressBar">
|
||||
<progress id="uploadProgressBar" value="0"/>
|
||||
</div>
|
||||
<div id="bottomRow">
|
||||
<button id="closeButton" onclick="closeTab()">&syncProgress.closeButton; </button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -24,6 +24,7 @@
|
|||
* Philipp von Weitershausen <philipp@weitershausen.de>
|
||||
* Paul O’Shannessy <paul@oshannessy.com>
|
||||
* Richard Newman <rnewman@mozilla.com>
|
||||
* Allison Naaktgeboren <ally@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
|
||||
|
@ -53,7 +54,6 @@ const EXISTING_ACCOUNT_CONNECT_PAGE = 3;
|
|||
const EXISTING_ACCOUNT_LOGIN_PAGE = 4;
|
||||
const OPTIONS_PAGE = 5;
|
||||
const OPTIONS_CONFIRM_PAGE = 6;
|
||||
const SETUP_SUCCESS_PAGE = 7;
|
||||
|
||||
// Broader than we'd like, but after this changed from api-secure.recaptcha.net
|
||||
// we had no choice. At least we only do this for the duration of setup.
|
||||
|
@ -411,6 +411,7 @@ var gSyncSetup = {
|
|||
this.checkFields();
|
||||
break;
|
||||
case EXISTING_ACCOUNT_CONNECT_PAGE:
|
||||
Weave.Svc.Prefs.set("firstSync", "existingAccount");
|
||||
this.wizard.getButton("next").hidden = false;
|
||||
this.wizard.getButton("back").hidden = false;
|
||||
this.wizard.getButton("extra1").hidden = false;
|
||||
|
@ -425,18 +426,6 @@ var gSyncSetup = {
|
|||
this.wizard.canRewind = true;
|
||||
this.checkFields();
|
||||
break;
|
||||
case SETUP_SUCCESS_PAGE:
|
||||
this.wizard.canRewind = false;
|
||||
this.wizard.canAdvance = true;
|
||||
this.wizard.getButton("back").hidden = true;
|
||||
this.wizard.getButton("next").hidden = true;
|
||||
this.wizard.getButton("cancel").hidden = true;
|
||||
this.wizard.getButton("finish").hidden = false;
|
||||
this._handleSuccess();
|
||||
if (this.wizardType == "pair") {
|
||||
this.completePairing();
|
||||
}
|
||||
break;
|
||||
case OPTIONS_PAGE:
|
||||
this.wizard.canRewind = false;
|
||||
this.wizard.canAdvance = true;
|
||||
|
@ -473,7 +462,7 @@ var gSyncSetup = {
|
|||
!Weave.Utils.ensureMPUnlocked()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
switch (this.wizard.pageIndex) {
|
||||
case PAIR_PAGE:
|
||||
this.startPairing();
|
||||
|
@ -519,7 +508,8 @@ var gSyncSetup = {
|
|||
Weave.Service.password = password;
|
||||
Weave.Service.passphrase = Weave.Utils.generatePassphrase();
|
||||
this._handleNoScript(false);
|
||||
this.wizard.pageIndex = SETUP_SUCCESS_PAGE;
|
||||
Weave.Svc.Prefs.set("firstSync", "newAccount");
|
||||
this.wizardFinish();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -532,8 +522,9 @@ var gSyncSetup = {
|
|||
Weave.Service.password = document.getElementById("existingPassword").value;
|
||||
let pp = document.getElementById("existingPassphrase").value;
|
||||
Weave.Service.passphrase = Weave.Utils.normalizePassphrase(pp);
|
||||
if (Weave.Service.login())
|
||||
this.wizard.pageIndex = SETUP_SUCCESS_PAGE;
|
||||
if (Weave.Service.login()) {
|
||||
this.wizardFinish();
|
||||
}
|
||||
return false;
|
||||
case OPTIONS_PAGE:
|
||||
let desc = document.getElementById("mergeChoiceRadio").selectedIndex;
|
||||
|
@ -544,8 +535,7 @@ var gSyncSetup = {
|
|||
return this._handleChoice();
|
||||
case OPTIONS_CONFIRM_PAGE:
|
||||
if (this._resettingSync) {
|
||||
this.onWizardFinish();
|
||||
window.close();
|
||||
this.wizardFinish();
|
||||
return false;
|
||||
}
|
||||
return this.returnFromOptions();
|
||||
|
@ -580,9 +570,13 @@ var gSyncSetup = {
|
|||
return true;
|
||||
},
|
||||
|
||||
onWizardFinish: function () {
|
||||
wizardFinish: function () {
|
||||
this.setupInitialSync();
|
||||
|
||||
if (this.wizardType == "pair") {
|
||||
this.completePairing();
|
||||
}
|
||||
|
||||
if (!this._resettingSync) {
|
||||
function isChecked(element) {
|
||||
return document.getElementById(element).hasAttribute("checked");
|
||||
|
@ -598,22 +592,17 @@ var gSyncSetup = {
|
|||
|
||||
Weave.Service.persistLogin();
|
||||
Weave.Svc.Obs.notify("weave:service:setup-complete");
|
||||
if (this._settingUpNew)
|
||||
gSyncUtils.openFirstClientFirstrun();
|
||||
else
|
||||
gSyncUtils.openAddedClientFirstrun();
|
||||
|
||||
gSyncUtils.openFirstSyncProgressPage();
|
||||
}
|
||||
Weave.Utils.nextTick(Weave.Service.sync, Weave.Service);
|
||||
window.close();
|
||||
},
|
||||
|
||||
onWizardCancel: function () {
|
||||
if (this._resettingSync)
|
||||
return;
|
||||
|
||||
if (this.wizard.pageIndex == SETUP_SUCCESS_PAGE) {
|
||||
this.onWizardFinish();
|
||||
return;
|
||||
}
|
||||
this.abortEasySetup();
|
||||
this._handleNoScript(false);
|
||||
Weave.Service.startOver();
|
||||
|
@ -714,7 +703,7 @@ var gSyncSetup = {
|
|||
Weave.Service.password = credentials.password;
|
||||
Weave.Service.passphrase = credentials.synckey;
|
||||
Weave.Service.serverURL = credentials.serverURL;
|
||||
self.wizard.pageIndex = SETUP_SUCCESS_PAGE;
|
||||
gSyncSetup.wizardFinish();
|
||||
},
|
||||
|
||||
onAbort: function onAbort(error) {
|
||||
|
@ -906,25 +895,6 @@ var gSyncSetup = {
|
|||
return valid;
|
||||
},
|
||||
|
||||
_handleSuccess: function() {
|
||||
let self = this;
|
||||
function fill(id, string)
|
||||
document.getElementById(id).firstChild.nodeValue =
|
||||
string ? self._stringBundle.GetStringFromName(string) : "";
|
||||
|
||||
fill("firstSyncAction", "");
|
||||
fill("firstSyncActionWarning", "");
|
||||
if (this._settingUpNew) {
|
||||
fill("firstSyncAction", "newAccount.action.label");
|
||||
fill("firstSyncActionChange", "newAccount.change.label");
|
||||
return;
|
||||
}
|
||||
fill("firstSyncActionChange", "existingAccount.change.label");
|
||||
let action = document.getElementById("mergeChoiceRadio").selectedItem.id;
|
||||
let id = action == "resetClient" ? "firstSyncAction" : "firstSyncActionWarning";
|
||||
fill(id, action + ".change.label");
|
||||
},
|
||||
|
||||
_handleChoice: function () {
|
||||
let desc = document.getElementById("mergeChoiceRadio").selectedIndex;
|
||||
document.getElementById("chosenActionDeck").selectedIndex = desc;
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
# Mike Connor <mconnor@mozilla.com>
|
||||
# Paul O’Shannessy <paul@oshannessy.com>
|
||||
# Philipp von Weitershausen <philipp@weitershausen.de>
|
||||
# Allison Naaktgeboren <ally@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
|
||||
|
@ -60,7 +61,6 @@
|
|||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
onwizardnext="return gSyncSetup.onWizardAdvance()"
|
||||
onwizardback="return gSyncSetup.onWizardBack()"
|
||||
onwizardfinish="gSyncSetup.onWizardFinish()"
|
||||
onwizardcancel="gSyncSetup.onWizardCancel()"
|
||||
onload="gSyncSetup.init()">
|
||||
|
||||
|
@ -511,24 +511,11 @@
|
|||
</vbox>
|
||||
</deck>
|
||||
</wizardpage>
|
||||
|
||||
<wizardpage label="&setup.successPage.title;"
|
||||
id="successfulSetup"
|
||||
onextra1="gSyncSetup.onSyncOptions()"
|
||||
onpageshow="gSyncSetup.onPageShow()">
|
||||
<vbox align="center">
|
||||
<image id="successPageIcon"/>
|
||||
</vbox>
|
||||
<separator/>
|
||||
<description class="normal">
|
||||
<html:span id="firstSyncAction">replace me</html:span>
|
||||
<html:strong id="firstSyncActionWarning">replace me</html:strong>
|
||||
<html:span id="firstSyncActionChange">replace me</html:span>
|
||||
</description>
|
||||
<description>
|
||||
&continueUsing.label;
|
||||
</description>
|
||||
<separator flex="1"/>
|
||||
# In terms of the wizard flow shown to the user, the 'syncOptionsConfirm'
|
||||
# page above is not the last wizard page. To prevent the wizard binding from
|
||||
# assuming that it is, we're inserting this dummy page here. This also means
|
||||
# that the wizard needs to always be closed manually via wizardFinish().
|
||||
<wizardpage>
|
||||
</wizardpage>
|
||||
</wizard>
|
||||
|
||||
|
|
|
@ -109,17 +109,8 @@ let gSyncUtils = {
|
|||
this._openLink(Weave.Svc.Prefs.get("privacyURL"));
|
||||
},
|
||||
|
||||
// xxxmpc - fix domain before 1.3 final (bug 583652)
|
||||
_baseURL: "http://www.mozilla.com/firefox/sync/",
|
||||
|
||||
openFirstClientFirstrun: function () {
|
||||
let url = this._baseURL + "firstrun.html";
|
||||
this._openLink(url);
|
||||
},
|
||||
|
||||
openAddedClientFirstrun: function () {
|
||||
let url = this._baseURL + "secondrun.html";
|
||||
this._openLink(url);
|
||||
openFirstSyncProgressPage: function () {
|
||||
this._openLink("about:sync-progress");
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -32,16 +32,6 @@ tabpanels {
|
|||
background-color: transparent;
|
||||
}
|
||||
|
||||
.tab-drag-preview {
|
||||
background: -moz-element(#content) left top;
|
||||
background-clip: content-box;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.tab-drag-panel[target] > .tab-drag-preview {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab-drop-indicator {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -40,10 +40,6 @@ srcdir = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
relativesrcdir = browser/base/content/test
|
||||
|
||||
DIRS += \
|
||||
tabview \
|
||||
$(NULL)
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
@ -249,6 +245,7 @@ _BROWSER_FILES = \
|
|||
test_wyciwyg_copying.html \
|
||||
authenticate.sjs \
|
||||
browser_minimize.js \
|
||||
browser_aboutSyncProgress.js \
|
||||
browser_middleMouse_inherit.js \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://services-sync/main.js");
|
||||
|
||||
let gTests = [ {
|
||||
desc: "Makes sure the progress bar appears if firstSync pref is set",
|
||||
setup: function () {
|
||||
Services.prefs.setCharPref("services.sync.firstSync", "newAccount");
|
||||
},
|
||||
run: function () {
|
||||
let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
|
||||
let progressBar = doc.getElementById("uploadProgressBar");
|
||||
|
||||
isnot(progressBar.style.display, "none", "progress bar should be visible");
|
||||
executeSoon(runNextTest);
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
desc: "Makes sure the progress bar is hidden if firstSync pref is not set",
|
||||
setup: function () {
|
||||
Services.prefs.clearUserPref("services.sync.firstSync");
|
||||
is(Services.prefs.getPrefType("services.sync.firstSync"),
|
||||
Ci.nsIPrefBranch.PREF_INVALID, "pref DNE" );
|
||||
},
|
||||
run: function () {
|
||||
let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
|
||||
let progressBar = doc.getElementById("uploadProgressBar");
|
||||
|
||||
is(progressBar.style.display, "none",
|
||||
"progress bar should not be visible");
|
||||
executeSoon(runNextTest);
|
||||
}
|
||||
},
|
||||
{
|
||||
desc: "Makes sure the observer updates are reflected in the progress bar",
|
||||
setup: function () {
|
||||
},
|
||||
run: function () {
|
||||
let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
|
||||
let progressBar = doc.getElementById("uploadProgressBar");
|
||||
|
||||
Services.obs.notifyObservers(null, "weave:engine:sync:finish", null);
|
||||
Services.obs.notifyObservers(null, "weave:engine:sync:error", null);
|
||||
|
||||
let received = progressBar.getAttribute("value");
|
||||
|
||||
is(received, 2, "progress bar received correct notifications");
|
||||
executeSoon(runNextTest);
|
||||
}
|
||||
},
|
||||
{
|
||||
desc: "Close button should close tab",
|
||||
setup: function (){
|
||||
},
|
||||
run: function () {
|
||||
function onTabClosed() {
|
||||
ok(true, "received TabClose notification");
|
||||
gBrowser.tabContainer.removeEventListener("TabClose", onTabClosed, false);
|
||||
executeSoon(runNextTest);
|
||||
}
|
||||
let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
|
||||
let button = doc.getElementById('closeButton');
|
||||
let window = doc.defaultView;
|
||||
gBrowser.tabContainer.addEventListener("TabClose", onTabClosed, false);
|
||||
EventUtils.sendMouseEvent({type: "click"}, button, window);
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
function test () {
|
||||
waitForExplicitFinish();
|
||||
executeSoon(runNextTest);
|
||||
}
|
||||
|
||||
function runNextTest()
|
||||
{
|
||||
while (gBrowser.tabs.length > 1) {
|
||||
gBrowser.removeCurrentTab();
|
||||
}
|
||||
|
||||
if (gTests.length) {
|
||||
let test = gTests.shift();
|
||||
info(test.desc);
|
||||
test.setup();
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab("about:sync-progress");
|
||||
tab.linkedBrowser.addEventListener("load", function (event) {
|
||||
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
// Some part of the page is populated on load, so enqueue on it.
|
||||
executeSoon(test.run);
|
||||
}, true);
|
||||
}
|
||||
else {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
|
@ -247,6 +247,12 @@ function runTest(testNum) {
|
|||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
ok(true, "Starting test #" + testNum);
|
||||
|
||||
var inspectItems = [];
|
||||
if (SpecialPowers.getBoolPref("devtools.inspector.enabled")) {
|
||||
inspectItems = ["---", null,
|
||||
"context-inspect", true];
|
||||
}
|
||||
|
||||
switch (testNum) {
|
||||
case 1:
|
||||
// Invoke context menu for next test.
|
||||
|
@ -268,9 +274,8 @@ function runTest(testNum) {
|
|||
"context-selectall", true,
|
||||
"---", null,
|
||||
"context-viewsource", true,
|
||||
"context-viewinfo", true,
|
||||
"---", null,
|
||||
"context-inspect", true]);
|
||||
"context-viewinfo", true
|
||||
].concat(inspectItems));
|
||||
closeContextMenu();
|
||||
openContextMenuFor(link); // Invoke context menu for next test.
|
||||
break;
|
||||
|
@ -283,18 +288,15 @@ function runTest(testNum) {
|
|||
"context-bookmarklink", true,
|
||||
"context-savelink", true,
|
||||
"context-sendlink", true,
|
||||
"context-copylink", true,
|
||||
"---", null,
|
||||
"context-inspect", true]);
|
||||
"context-copylink", true
|
||||
].concat(inspectItems));
|
||||
closeContextMenu();
|
||||
openContextMenuFor(mailto); // Invoke context menu for next test.
|
||||
break;
|
||||
|
||||
case 4:
|
||||
// Context menu for text mailto-link
|
||||
checkContextMenu(["context-copyemail", true,
|
||||
"---", null,
|
||||
"context-inspect", true]);
|
||||
checkContextMenu(["context-copyemail", true].concat(inspectItems));
|
||||
closeContextMenu();
|
||||
openContextMenuFor(input); // Invoke context menu for next test.
|
||||
break;
|
||||
|
@ -310,9 +312,8 @@ function runTest(testNum) {
|
|||
"---", null,
|
||||
"context-selectall", false,
|
||||
"---", null,
|
||||
"spell-check-enabled", true,
|
||||
"---", null,
|
||||
"context-inspect", true]);
|
||||
"spell-check-enabled", true
|
||||
].concat(inspectItems));
|
||||
closeContextMenu();
|
||||
openContextMenuFor(img); // Invoke context menu for next test.
|
||||
break;
|
||||
|
@ -326,9 +327,8 @@ function runTest(testNum) {
|
|||
"context-saveimage", true,
|
||||
"context-sendimage", true,
|
||||
"context-setDesktopBackground", true,
|
||||
"context-viewimageinfo", true,
|
||||
"---", null,
|
||||
"context-inspect", true]);
|
||||
"context-viewimageinfo", true
|
||||
].concat(inspectItems));
|
||||
closeContextMenu();
|
||||
openContextMenuFor(canvas); // Invoke context menu for next test.
|
||||
break;
|
||||
|
@ -338,9 +338,8 @@ function runTest(testNum) {
|
|||
checkContextMenu(["context-viewimage", true,
|
||||
"context-saveimage", true,
|
||||
"context-bookmarkpage", true,
|
||||
"context-selectall", true,
|
||||
"---", null,
|
||||
"context-inspect", true]);
|
||||
"context-selectall", true
|
||||
].concat(inspectItems));
|
||||
closeContextMenu();
|
||||
openContextMenuFor(video_ok); // Invoke context menu for next test.
|
||||
break;
|
||||
|
@ -358,9 +357,8 @@ function runTest(testNum) {
|
|||
"---", null,
|
||||
"context-savevideo", true,
|
||||
"context-video-saveimage", true,
|
||||
"context-sendvideo", true,
|
||||
"---", null,
|
||||
"context-inspect", true]);
|
||||
"context-sendvideo", true
|
||||
].concat(inspectItems));
|
||||
closeContextMenu();
|
||||
openContextMenuFor(video_bad); // Invoke context menu for next test.
|
||||
break;
|
||||
|
@ -378,9 +376,8 @@ function runTest(testNum) {
|
|||
"---", null,
|
||||
"context-savevideo", true,
|
||||
"context-video-saveimage", false,
|
||||
"context-sendvideo", true,
|
||||
"---", null,
|
||||
"context-inspect", true]);
|
||||
"context-sendvideo", true
|
||||
].concat(inspectItems));
|
||||
closeContextMenu();
|
||||
openContextMenuFor(video_bad2); // Invoke context menu for next test.
|
||||
break;
|
||||
|
@ -398,9 +395,8 @@ function runTest(testNum) {
|
|||
"---", null,
|
||||
"context-savevideo", false,
|
||||
"context-video-saveimage", false,
|
||||
"context-sendvideo", false,
|
||||
"---", null,
|
||||
"context-inspect", true]);
|
||||
"context-sendvideo", false
|
||||
].concat(inspectItems));
|
||||
closeContextMenu();
|
||||
openContextMenuFor(iframe); // Invoke context menu for next test.
|
||||
break;
|
||||
|
@ -434,9 +430,8 @@ function runTest(testNum) {
|
|||
"context-viewframeinfo", true], null,
|
||||
"---", null,
|
||||
"context-viewsource", true,
|
||||
"context-viewinfo", true,
|
||||
"---", null,
|
||||
"context-inspect", true]);
|
||||
"context-viewinfo", true
|
||||
].concat(inspectItems));
|
||||
closeContextMenu();
|
||||
openContextMenuFor(textarea, false, true); // Invoke context menu for next test, but wait for the spellcheck.
|
||||
break;
|
||||
|
@ -460,8 +455,7 @@ function runTest(testNum) {
|
|||
["spell-check-dictionary-en-US", true,
|
||||
"---", null,
|
||||
"spell-add-dictionaries", true], null,
|
||||
"---", null,
|
||||
"context-inspect", true]);
|
||||
].concat(inspectItems));
|
||||
|
||||
closeContextMenu();
|
||||
openContextMenuFor(contenteditable); // Invoke context menu for next test.
|
||||
|
@ -485,9 +479,8 @@ function runTest(testNum) {
|
|||
"spell-dictionaries", true,
|
||||
["spell-check-dictionary-en-US", true,
|
||||
"---", null,
|
||||
"spell-add-dictionaries", true], null,
|
||||
"---", null,
|
||||
"context-inspect", true]);
|
||||
"spell-add-dictionaries", true], null
|
||||
].concat(inspectItems));
|
||||
|
||||
closeContextMenu();
|
||||
openContextMenuFor(inputspell); // Invoke context menu for next test.
|
||||
|
@ -511,9 +504,8 @@ function runTest(testNum) {
|
|||
"spell-dictionaries", true,
|
||||
["spell-check-dictionary-en-US", true,
|
||||
"---", null,
|
||||
"spell-add-dictionaries", true], null,
|
||||
"---", null,
|
||||
"context-inspect", true]);
|
||||
"spell-add-dictionaries", true], null
|
||||
].concat(inspectItems));
|
||||
|
||||
closeContextMenu();
|
||||
openContextMenuFor(link); // Invoke context menu for next test.
|
||||
|
@ -560,9 +552,8 @@ function runTest(testNum) {
|
|||
"context-selectall", true,
|
||||
"---", null,
|
||||
"context-viewsource", true,
|
||||
"context-viewinfo", true,
|
||||
"---", null,
|
||||
"context-inspect", true]);
|
||||
"context-viewinfo", true
|
||||
].concat(inspectItems));
|
||||
|
||||
invokeItemAction("0");
|
||||
closeContextMenu();
|
||||
|
@ -585,9 +576,8 @@ function runTest(testNum) {
|
|||
"context-selectall", true,
|
||||
"---", null,
|
||||
"context-viewsource", true,
|
||||
"context-viewinfo", true,
|
||||
"---", null,
|
||||
"context-inspect", true]);
|
||||
"context-viewinfo", true
|
||||
].concat(inspectItems));
|
||||
|
||||
subwindow.close();
|
||||
SimpleTest.finish();
|
||||
|
|
|
@ -42,6 +42,8 @@
|
|||
// Services = object with smart getters for common XPCOM services
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
var TAB_DROP_TYPE = "application/x-moz-tabbrowser-tab";
|
||||
|
||||
var gBidiUI = false;
|
||||
|
||||
function getBrowserURL()
|
||||
|
|
|
@ -49,10 +49,6 @@ browser.jar:
|
|||
content/browser/sanitizeDialog.css (content/sanitizeDialog.css)
|
||||
* content/browser/tabbrowser.css (content/tabbrowser.css)
|
||||
* content/browser/tabbrowser.xml (content/tabbrowser.xml)
|
||||
content/browser/tabview.css (content/tabview/tabview.css)
|
||||
* content/browser/tabview.js (content/tabview/tabview.js)
|
||||
content/browser/tabview.html (content/tabview/tabview.html)
|
||||
content/browser/tabview-content.js (content/tabview/content.js)
|
||||
* content/browser/urlbarBindings.xml (content/urlbarBindings.xml)
|
||||
* content/browser/utilityOverlay.js (content/utilityOverlay.js)
|
||||
* content/browser/web-panels.js (content/web-panels.js)
|
||||
|
@ -75,6 +71,8 @@ browser.jar:
|
|||
* content/browser/syncQuota.xul (content/syncQuota.xul)
|
||||
content/browser/syncQuota.js (content/syncQuota.js)
|
||||
content/browser/syncUtils.js (content/syncUtils.js)
|
||||
content/browser/syncProgress.js (content/syncProgress.js)
|
||||
* content/browser/syncProgress.xhtml (content/syncProgress.xhtml)
|
||||
#endif
|
||||
# XXX: We should exclude this one as well (bug 71895)
|
||||
* content/browser/hiddenWindow.xul (content/hiddenWindow.xul)
|
||||
|
|
|
@ -70,6 +70,7 @@ PARALLEL_DIRS = \
|
|||
sessionstore \
|
||||
shell \
|
||||
sidebar/src \
|
||||
tabview \
|
||||
migration \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -97,6 +97,8 @@ static RedirEntry kRedirMap[] = {
|
|||
{ "sessionrestore", "chrome://browser/content/aboutSessionRestore.xhtml",
|
||||
nsIAboutModule::ALLOW_SCRIPT },
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
{ "sync-progress", "chrome://browser/content/syncProgress.xhtml",
|
||||
nsIAboutModule::ALLOW_SCRIPT },
|
||||
{ "sync-tabs", "chrome://browser/content/aboutSyncTabs.xul",
|
||||
nsIAboutModule::ALLOW_SCRIPT },
|
||||
#endif
|
||||
|
|
|
@ -156,6 +156,7 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
|
|||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "sessionrestore", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "sync-tabs", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
|
||||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "sync-progress", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
|
||||
#endif
|
||||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "home", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
|
||||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "permissions", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
|
||||
|
|
|
@ -1339,8 +1339,8 @@ nsIEProfileMigrator::CopyFavorites(bool aReplace)
|
|||
do_GetService(NS_NAVBOOKMARKSSERVICE_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
bool batchAction = aReplace ? BATCH_ACTION_BOOKMARKS_REPLACE
|
||||
: BATCH_ACTION_BOOKMARKS;
|
||||
PRUint8 batchAction = aReplace ? BATCH_ACTION_BOOKMARKS_REPLACE
|
||||
: BATCH_ACTION_BOOKMARKS;
|
||||
nsCOMPtr<nsISupportsPRUint8> supports =
|
||||
do_CreateInstance(NS_SUPPORTS_PRUINT8_CONTRACTID);
|
||||
NS_ENSURE_TRUE(supports, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
#include <time.h>
|
||||
#include <windows.h>
|
||||
#include <pstore.h>
|
||||
#include <ole2.h>
|
||||
#include "nsIBrowserProfileMigrator.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsTArray.h"
|
||||
|
@ -61,6 +61,79 @@ struct SignonData {
|
|||
char* realm;
|
||||
};
|
||||
|
||||
// VC11 doesn't ship with pstore.h, so we go ahead and define the stuff that
|
||||
// we need from that file here.
|
||||
class IEnumPStoreItems : public IUnknown {
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE Next(DWORD celt, LPWSTR* rgelt,
|
||||
DWORD* pceltFetched) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE Skip(DWORD celt) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE Reset() = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE Clone(IEnumPStoreItems** ppenum) = 0;
|
||||
};
|
||||
|
||||
class IEnumPStoreTypes; // not used
|
||||
struct PST_PROVIDERINFO; // not used
|
||||
struct PST_TYPEINFO; // not used
|
||||
struct PST_PROMPTINFO; // not used
|
||||
struct PST_ACCESSRULESET; // not used
|
||||
typedef DWORD PST_KEY;
|
||||
typedef DWORD PST_ACCESSMODE;
|
||||
|
||||
class IPStore : public IUnknown {
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE GetInfo(PST_PROVIDERINFO** ppProperties) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE GetProvParam(DWORD dwParam, DWORD* pcbData,
|
||||
BYTE** ppbData, DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE SetProvParam(DWORD dwParam, DWORD cbData,
|
||||
BYTE* pbData, DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE CreateType(PST_KEY Key, const GUID* pType,
|
||||
PST_TYPEINFO* pInfo, DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(PST_KEY Key, const GUID* pType,
|
||||
PST_TYPEINFO** ppInfo, DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE DeleteType(PST_KEY Key, const GUID* pType,
|
||||
DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE CreateSubtype(PST_KEY Key, const GUID* pType,
|
||||
const GUID* pSubtype, PST_TYPEINFO* pInfo,
|
||||
PST_ACCESSRULESET* pRules, DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE GetSubtypeInfo(PST_KEY Key, const GUID* pType,
|
||||
const GUID* pSubtype, PST_TYPEINFO** ppInfo,
|
||||
DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE DeleteSubtype(PST_KEY Key, const GUID* pType,
|
||||
const GUID* pSubtype, DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE ReadAccessRuleset(PST_KEY Key, const GUID* pType,
|
||||
const GUID* pSubtype, PST_ACCESSRULESET** ppRules,
|
||||
DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE WriteAccessRuleset(PST_KEY Key, const GUID* pType,
|
||||
const GUID* pSubtype, PST_ACCESSRULESET* pRules,
|
||||
DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE EnumTypes(PST_KEY Key, DWORD dwFlags, IEnumPStoreTypes** ppenum) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE EnumSubtypes(PST_KEY Key, const GUID* pType,
|
||||
DWORD dwFlags, IEnumPStoreTypes** ppenum) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE DeleteItem(PST_KEY Key, const GUID* pItemType,
|
||||
const GUID* pItemSubtype, LPCWSTR szItemName,
|
||||
PST_PROMPTINFO* pPromptInfo, DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE ReadItem(PST_KEY Key, const GUID* pItemType,
|
||||
const GUID* pItemSubtype, LPCWSTR szItemName,
|
||||
DWORD* pcbData, BYTE** ppbData,
|
||||
PST_PROMPTINFO* pPromptInfo, DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE WriteItem(PST_KEY Key, const GUID* pItemType,
|
||||
const GUID* pItemSubtype, LPCWSTR szItemName,
|
||||
DWORD cbData, BYTE* pbData,
|
||||
PST_PROMPTINFO* pPromptInfo, DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE OpenItem(PST_KEY Key, const GUID* pItemType,
|
||||
const GUID* pItemSubtype, LPCWSTR szItemName,
|
||||
PST_ACCESSMODE ModeFlags, PST_PROMPTINFO* pPromptInfo,
|
||||
DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE CloseItem(PST_KEY Key, const GUID* pItemType,
|
||||
const GUID* pItemSubtype, LPCWSTR szItemName,
|
||||
DWORD dwFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE EnumItems(PST_KEY Key, const GUID* pItemType,
|
||||
const GUID* pItemSubtype, DWORD dwFlags,
|
||||
IEnumPStoreItems** ppenum) = 0;
|
||||
};
|
||||
|
||||
|
||||
class nsIEProfileMigrator : public nsIBrowserProfileMigrator,
|
||||
public nsINavHistoryBatchCallback {
|
||||
public:
|
||||
|
|
|
@ -1403,13 +1403,17 @@ let PlacesControllerDragHelper = {
|
|||
|
||||
// Urls can be dropped on any insertionpoint.
|
||||
// XXXmano: remember that this method is called for each dragover event!
|
||||
// Thus we shouldn't use unwrapNodes here at all if possible. I think it
|
||||
// would be OK to accept bogus data here (this is not in our control and
|
||||
// will just case the actual drop to be a no-op) and only rule out valid
|
||||
// Thus we shouldn't use unwrapNodes here at all if possible.
|
||||
// I think it would be OK to accept bogus data here (e.g. text which was
|
||||
// somehow wrapped as TAB_DROP_TYPE, this is not in our control, and
|
||||
// will just case the actual drop to be a no-op), and only rule out valid
|
||||
// expected cases, which are either unsupported flavors, or items which
|
||||
// cannot be dropped in the current insertionpoint. The last case will
|
||||
// likely force us to use unwrapNodes for the private data types of
|
||||
// places.
|
||||
if (flavor == TAB_DROP_TYPE)
|
||||
continue;
|
||||
|
||||
let data = dt.mozGetDataAt(flavor, i);
|
||||
let dragged;
|
||||
try {
|
||||
|
@ -1523,8 +1527,21 @@ let PlacesControllerDragHelper = {
|
|||
|
||||
let data = dt.mozGetDataAt(flavor, i);
|
||||
let unwrapped;
|
||||
// There's only ever one in the D&D case.
|
||||
unwrapped = PlacesUtils.unwrapNodes(data, flavor)[0];
|
||||
if (flavor != TAB_DROP_TYPE) {
|
||||
// There's only ever one in the D&D case.
|
||||
unwrapped = PlacesUtils.unwrapNodes(data, flavor)[0];
|
||||
}
|
||||
else if (data instanceof XULElement && data.localName == "tab" &&
|
||||
data.ownerDocument.defaultView instanceof ChromeWindow) {
|
||||
let uri = data.linkedBrowser.currentURI;
|
||||
let spec = uri ? uri.spec : "about:blank";
|
||||
let title = data.label;
|
||||
unwrapped = { uri: spec,
|
||||
title: data.label,
|
||||
type: PlacesUtils.TYPE_X_MOZ_URL};
|
||||
}
|
||||
else
|
||||
throw("bogus data was passed as a tab")
|
||||
|
||||
let index = insertionPoint.index;
|
||||
|
||||
|
@ -1578,6 +1595,7 @@ let PlacesControllerDragHelper = {
|
|||
PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR,
|
||||
PlacesUtils.TYPE_X_MOZ_PLACE,
|
||||
PlacesUtils.TYPE_X_MOZ_URL,
|
||||
TAB_DROP_TYPE,
|
||||
PlacesUtils.TYPE_UNICODE],
|
||||
};
|
||||
|
||||
|
|
|
@ -89,6 +89,8 @@ var gCookiesWindow = {
|
|||
this.filter();
|
||||
}
|
||||
|
||||
document.getElementById("removeAllCookies").disabled = this._view._rowCount == 0;
|
||||
|
||||
this._saveState();
|
||||
},
|
||||
|
||||
|
@ -117,6 +119,7 @@ var gCookiesWindow = {
|
|||
this._view._rowCount = 0;
|
||||
this._tree.treeBoxObject.rowCountChanged(0, -oldRowCount);
|
||||
this._view.selection.clearSelection();
|
||||
document.getElementById("removeAllCookies").disabled = true;
|
||||
}
|
||||
else if (aData == "reload") {
|
||||
// first, clear any existing entries
|
||||
|
@ -207,7 +210,10 @@ var gCookiesWindow = {
|
|||
this._view._rowCount += rowCountImpact;
|
||||
this._tree.treeBoxObject.rowCountChanged(oldRowCount - 1, rowCountImpact);
|
||||
|
||||
document.getElementById("removeAllCookies").disabled = this._view._filtered;
|
||||
if (this._view._rowCount > 0 && !this._view._filtered)
|
||||
document.getElementById("removeAllCookies").disabled = false;
|
||||
else
|
||||
document.getElementById("removeAllCookies").disabled = true;
|
||||
},
|
||||
|
||||
_view: {
|
||||
|
|
|
@ -41,15 +41,23 @@
|
|||
function test() {
|
||||
// initialization
|
||||
waitForExplicitFinish();
|
||||
gPrefService.setBoolPref("browser.privatebrowsing.keep_current_session", true);
|
||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService);
|
||||
|
||||
// fill in the search bar with something
|
||||
// fill in the search bar with something, twice to populate undo history
|
||||
const kTestSearchString = "privatebrowsing";
|
||||
let searchBar = BrowserSearch.searchBar;
|
||||
searchBar.value = kTestSearchString + "foo";
|
||||
searchBar.value = kTestSearchString;
|
||||
|
||||
gPrefService.setBoolPref("browser.privatebrowsing.keep_current_session", true);
|
||||
|
||||
registerCleanupFunction(function () {
|
||||
searchBar.textbox.reset();
|
||||
|
||||
gPrefService.clearUserPref("browser.privatebrowsing.keep_current_session");
|
||||
});
|
||||
|
||||
// enter private browsing mode
|
||||
pb.privateBrowsingEnabled = true;
|
||||
|
||||
|
@ -85,8 +93,6 @@ function test() {
|
|||
gBrowser.removeTab(gBrowser.selectedTab);
|
||||
pb.privateBrowsingEnabled = false;
|
||||
|
||||
// cleanup
|
||||
gPrefService.clearUserPref("browser.privatebrowsing.keep_current_session");
|
||||
finish();
|
||||
}, true);
|
||||
}
|
||||
|
|
|
@ -177,6 +177,9 @@ SessionStartup.prototype = {
|
|||
Services.obs.addObserver(this, "domwindowopened", true);
|
||||
|
||||
Services.obs.addObserver(this, "sessionstore-windows-restored", true);
|
||||
|
||||
if (this._sessionType != Ci.nsISessionStartup.NO_SESSION)
|
||||
Services.obs.addObserver(this, "browser:purge-session-history", true);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -197,6 +200,8 @@ SessionStartup.prototype = {
|
|||
// no reason for initializing at this point (cf. bug 409115)
|
||||
Services.obs.removeObserver(this, "final-ui-startup");
|
||||
Services.obs.removeObserver(this, "quit-application");
|
||||
if (this._sessionType != Ci.nsISessionStartup.NO_SESSION)
|
||||
Services.obs.removeObserver(this, "browser:purge-session-history");
|
||||
break;
|
||||
case "domwindowopened":
|
||||
var window = aSubject;
|
||||
|
@ -210,6 +215,10 @@ SessionStartup.prototype = {
|
|||
Services.obs.removeObserver(this, "sessionstore-windows-restored");
|
||||
// free _initialState after nsSessionStore is done with it
|
||||
this._initialState = null;
|
||||
break;
|
||||
case "browser:purge-session-history":
|
||||
Services.obs.removeObserver(this, "browser:purge-session-history");
|
||||
// reset all state on sanitization
|
||||
this._sessionType = Ci.nsISessionStartup.NO_SESSION;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ XPCOMUtils.defineLazyGetter(this, "NetUtil", function() {
|
|||
XPCOMUtils.defineLazyServiceGetter(this, "CookieSvc",
|
||||
"@mozilla.org/cookiemanager;1", "nsICookieManager2");
|
||||
|
||||
#ifdef MOZ_CRASH_REPORTER
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "CrashReporter",
|
||||
"@mozilla.org/xre/app-info;1", "nsICrashReporter");
|
||||
#endif
|
||||
|
@ -1920,9 +1920,7 @@ SessionStoreService.prototype = {
|
|||
catch (ex) { debug(ex); }
|
||||
}
|
||||
|
||||
if (aEntry.docIdentifier) {
|
||||
entry.docIdentifier = aEntry.docIdentifier;
|
||||
}
|
||||
entry.docIdentifier = aEntry.BFCacheEntry.ID;
|
||||
|
||||
if (aEntry.stateData != null) {
|
||||
entry.structuredCloneState = aEntry.stateData.getDataAsBase64();
|
||||
|
@ -2483,7 +2481,19 @@ SessionStoreService.prototype = {
|
|||
if (ix != -1 && total[ix] && total[ix].sizemode == "minimized")
|
||||
ix = -1;
|
||||
|
||||
return { windows: total, selectedWindow: ix + 1, _closedWindows: lastClosedWindowsCopy };
|
||||
let session = {
|
||||
state: this._loadState == STATE_RUNNING ? STATE_RUNNING_STR : STATE_STOPPED_STR,
|
||||
lastUpdate: Date.now(),
|
||||
startTime: this._sessionStartTime,
|
||||
recentCrashes: this._recentCrashes
|
||||
};
|
||||
|
||||
return {
|
||||
windows: total,
|
||||
selectedWindow: ix + 1,
|
||||
_closedWindows: lastClosedWindowsCopy,
|
||||
session: session
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -2567,7 +2577,7 @@ SessionStoreService.prototype = {
|
|||
this._closedWindows = root._closedWindows;
|
||||
|
||||
var winData;
|
||||
if (!root.selectedWindow) {
|
||||
if (!root.selectedWindow || root.selectedWindow > root.windows.length) {
|
||||
root.selectedWindow = 0;
|
||||
} else {
|
||||
// put the selected window at the beginning of the array to ensure that
|
||||
|
@ -3024,16 +3034,11 @@ SessionStoreService.prototype = {
|
|||
browser.webNavigation.setCurrentURI(this._getURIFromString("about:blank"));
|
||||
// Attach data that will be restored on "load" event, after tab is restored.
|
||||
if (activeIndex > -1) {
|
||||
let curSHEntry = browser.webNavigation.sessionHistory.
|
||||
getEntryAtIndex(activeIndex, false).
|
||||
QueryInterface(Ci.nsISHEntry);
|
||||
|
||||
// restore those aspects of the currently active documents which are not
|
||||
// preserved in the plain history entries (mainly scroll state and text data)
|
||||
browser.__SS_restore_data = tabData.entries[activeIndex] || {};
|
||||
browser.__SS_restore_pageStyle = tabData.pageStyle || "";
|
||||
browser.__SS_restore_tab = aTab;
|
||||
browser.__SS_restore_docIdentifier = curSHEntry.docIdentifier;
|
||||
didStartLoad = true;
|
||||
try {
|
||||
// In order to work around certain issues in session history, we need to
|
||||
|
@ -3188,24 +3193,16 @@ SessionStoreService.prototype = {
|
|||
}
|
||||
|
||||
if (aEntry.docIdentifier) {
|
||||
// Get a new document identifier for this entry to ensure that history
|
||||
// entries after a session restore are considered to have different
|
||||
// documents from the history entries before the session restore.
|
||||
// Document identifiers are 64-bit ints, so JS will loose precision and
|
||||
// start assigning all entries the same doc identifier if these ever get
|
||||
// large enough.
|
||||
//
|
||||
// It's a potential security issue if document identifiers aren't
|
||||
// globally unique, but shEntry.setUniqueDocIdentifier() below guarantees
|
||||
// that we won't re-use a doc identifier within a given instance of the
|
||||
// application.
|
||||
let ident = aDocIdentMap[aEntry.docIdentifier];
|
||||
if (!ident) {
|
||||
shEntry.setUniqueDocIdentifier();
|
||||
aDocIdentMap[aEntry.docIdentifier] = shEntry.docIdentifier;
|
||||
// If we have a serialized document identifier, try to find an SHEntry
|
||||
// which matches that doc identifier and adopt that SHEntry's
|
||||
// BFCacheEntry. If we don't find a match, insert shEntry as the match
|
||||
// for the document identifier.
|
||||
let matchingEntry = aDocIdentMap[aEntry.docIdentifier];
|
||||
if (!matchingEntry) {
|
||||
aDocIdentMap[aEntry.docIdentifier] = shEntry;
|
||||
}
|
||||
else {
|
||||
shEntry.docIdentifier = ident;
|
||||
shEntry.adoptBFCacheEntry(matchingEntry);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3278,31 +3275,48 @@ SessionStoreService.prototype = {
|
|||
if (!node)
|
||||
continue;
|
||||
|
||||
let eventType;
|
||||
let value = aData[key];
|
||||
if (typeof value == "string" && node.type != "file") {
|
||||
if (node.value == value)
|
||||
continue; // don't dispatch an input event for no change
|
||||
|
||||
node.value = value;
|
||||
|
||||
let event = aDocument.createEvent("UIEvents");
|
||||
event.initUIEvent("input", true, true, aDocument.defaultView, 0);
|
||||
node.dispatchEvent(event);
|
||||
eventType = "input";
|
||||
}
|
||||
else if (typeof value == "boolean")
|
||||
else if (typeof value == "boolean") {
|
||||
if (node.checked == value)
|
||||
continue; // don't dispatch a change event for no change
|
||||
|
||||
node.checked = value;
|
||||
else if (typeof value == "number")
|
||||
eventType = "change";
|
||||
}
|
||||
else if (typeof value == "number") {
|
||||
try {
|
||||
node.selectedIndex = value;
|
||||
eventType = "change";
|
||||
} catch (ex) { /* throws for invalid indices */ }
|
||||
else if (value && value.fileList && value.type == "file" && node.type == "file")
|
||||
}
|
||||
else if (value && value.fileList && value.type == "file" && node.type == "file") {
|
||||
node.mozSetFileNameArray(value.fileList, value.fileList.length);
|
||||
eventType = "input";
|
||||
}
|
||||
else if (value && typeof value.indexOf == "function" && node.options) {
|
||||
Array.forEach(node.options, function(aOpt, aIx) {
|
||||
aOpt.selected = value.indexOf(aIx) > -1;
|
||||
|
||||
// Only fire the event here if this wasn't selected by default
|
||||
if (!aOpt.defaultSelected)
|
||||
eventType = "change";
|
||||
});
|
||||
}
|
||||
// NB: dispatching "change" events might have unintended side-effects
|
||||
|
||||
// Fire events for this node if applicable
|
||||
if (eventType) {
|
||||
let event = aDocument.createEvent("UIEvents");
|
||||
event.initUIEvent(eventType, true, true, aDocument.defaultView, 0);
|
||||
node.dispatchEvent(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3341,19 +3355,12 @@ SessionStoreService.prototype = {
|
|||
aBrowser.markupDocumentViewer.authorStyleDisabled = selectedPageStyle == "_nostyle";
|
||||
}
|
||||
|
||||
if (aBrowser.__SS_restore_docIdentifier) {
|
||||
let sh = aBrowser.webNavigation.sessionHistory;
|
||||
sh.getEntryAtIndex(sh.index, false).QueryInterface(Ci.nsISHEntry).
|
||||
docIdentifier = aBrowser.__SS_restore_docIdentifier;
|
||||
}
|
||||
|
||||
// notify the tabbrowser that this document has been completely restored
|
||||
this._sendTabRestoredNotification(aBrowser.__SS_restore_tab);
|
||||
|
||||
delete aBrowser.__SS_restore_data;
|
||||
delete aBrowser.__SS_restore_pageStyle;
|
||||
delete aBrowser.__SS_restore_tab;
|
||||
delete aBrowser.__SS_restore_docIdentifier;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -3543,14 +3550,6 @@ SessionStoreService.prototype = {
|
|||
}
|
||||
}
|
||||
|
||||
oState.session = {
|
||||
state: this._loadState == STATE_RUNNING ? STATE_RUNNING_STR : STATE_STOPPED_STR,
|
||||
lastUpdate: Date.now(),
|
||||
startTime: this._sessionStartTime
|
||||
};
|
||||
if (this._recentCrashes)
|
||||
oState.session.recentCrashes = this._recentCrashes;
|
||||
|
||||
// Persist the last session if we deferred restoring it
|
||||
if (this._lastSessionState)
|
||||
oState.lastSessionState = this._lastSessionState;
|
||||
|
@ -3818,7 +3817,7 @@ SessionStoreService.prototype = {
|
|||
* Annotate a breakpad crash report with the currently selected tab's URL.
|
||||
*/
|
||||
_updateCrashReportURL: function sss_updateCrashReportURL(aWindow) {
|
||||
#ifdef MOZ_CRASH_REPORTER
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
try {
|
||||
var currentURI = aWindow.gBrowser.currentURI.clone();
|
||||
// if the current URI contains a username/password, remove it
|
||||
|
|
|
@ -50,6 +50,8 @@ include $(topsrcdir)/config/rules.mk
|
|||
|
||||
_BROWSER_TEST_FILES = \
|
||||
head.js \
|
||||
browser_form_restore_events.js \
|
||||
browser_form_restore_events_sample.html \
|
||||
browser_248970_a.js \
|
||||
browser_248970_b.js \
|
||||
browser_248970_b_sample.html \
|
||||
|
@ -98,8 +100,6 @@ _BROWSER_TEST_FILES = \
|
|||
browser_465223.js \
|
||||
browser_466937.js \
|
||||
browser_466937_sample.html \
|
||||
browser_476161.js \
|
||||
browser_476161_sample.html \
|
||||
browser_477657.js \
|
||||
browser_480148.js \
|
||||
browser_480893.js \
|
||||
|
@ -152,7 +152,9 @@ _BROWSER_TEST_FILES = \
|
|||
browser_645428.js \
|
||||
browser_659591.js \
|
||||
browser_662812.js \
|
||||
browser_665702-state_session.js \
|
||||
browser_682507.js \
|
||||
browser_694378.js \
|
||||
$(NULL)
|
||||
|
||||
ifneq ($(OS_ARCH),Darwin)
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Test for bug 476161</title>
|
||||
|
||||
<script>
|
||||
|
||||
document.addEventListener("input", function(aEvent) {
|
||||
var inputEl = aEvent.originalTarget;
|
||||
var changedEl = document.getElementById("changed");
|
||||
|
||||
changedEl.textContent += " " + inputEl.id;
|
||||
}, false);
|
||||
|
||||
</script>
|
||||
|
||||
<h3>Text fields with changed text</h3>
|
||||
<input type="text" id="modify1">
|
||||
<input type="text" id="modify2" value="preset value">
|
||||
|
||||
<h3>Text fields with unchanged text</h3>
|
||||
<input type="text" id="unchanged1">
|
||||
<input type="text" id="unchanged2" value="preset value">
|
||||
|
||||
<h3>Changed field IDs</h3>
|
||||
<div id="changed"></div>
|
|
@ -116,13 +116,13 @@ function test() {
|
|||
|
||||
// After these push/replaceState calls, the window should have three
|
||||
// history entries:
|
||||
// testURL (state object: null) <-- oldest
|
||||
// testURL (state object: {obj1:1})
|
||||
// page2 (state object: {obj3:/^a$/}) <-- newest
|
||||
// testURL (state object: null) <-- oldest
|
||||
// testURL (state object: {obj1:1})
|
||||
// testURL?page2 (state object: {obj3:/^a$/}) <-- newest
|
||||
let contentWindow = tab.linkedBrowser.contentWindow;
|
||||
let history = contentWindow.history;
|
||||
history.pushState({obj1:1}, "title-obj1");
|
||||
history.pushState({obj2:2}, "title-obj2", "page2");
|
||||
history.pushState({obj2:2}, "title-obj2", "?page2");
|
||||
history.replaceState({obj3:/^a$/}, "title-obj3");
|
||||
|
||||
let state = ss.getTabState(tab);
|
||||
|
|
|
@ -84,14 +84,19 @@ function test() {
|
|||
|
||||
let curState = JSON.parse(ss.getBrowserState());
|
||||
for (let i = 0; i < curState.windows[0].tabs.length; i++) {
|
||||
if (state.windows[0].tabs[i].extData) {
|
||||
is(curState.windows[0].tabs[i].extData["uniq"],
|
||||
state.windows[0].tabs[i].extData["uniq"],
|
||||
let tabState = state.windows[0].tabs[i];
|
||||
let tabCurState = curState.windows[0].tabs[i];
|
||||
if (tabState.extData) {
|
||||
is(tabCurState.extData["uniq"], tabState.extData["uniq"],
|
||||
"sanity check that tab has correct extData");
|
||||
}
|
||||
else
|
||||
ok(!("extData" in curState.windows[0].tabs[i]),
|
||||
"sanity check that tab doesn't have extData");
|
||||
else {
|
||||
// We aren't expecting there to be any data on extData, but panorama
|
||||
// may be setting something, so we need to make sure that if we do have
|
||||
// data, we just don't have anything for "uniq".
|
||||
ok(!("extData" in tabCurState) || !("uniq" in tabCurState.extData),
|
||||
"sanity check that tab doesn't have extData or extData doesn't have 'uniq'");
|
||||
}
|
||||
}
|
||||
|
||||
// Now we'll set a new unique value on 1 of the tabs
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function compareArray(a, b) {
|
||||
if (a.length !== b.length) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < a.length; i++) {
|
||||
if (a[i] !== b[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function test() {
|
||||
let currentState = JSON.parse(ss.getBrowserState());
|
||||
ok(currentState.session, "session data returned by getBrowserState");
|
||||
|
||||
let keys = Object.keys(currentState.session);
|
||||
let expectedKeys = ["state", "lastUpdate", "startTime", "recentCrashes"];
|
||||
ok(compareArray(keys.sort(), expectedKeys.sort()),
|
||||
"session object from getBrowserState has correct keys");
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Test Summary:
|
||||
// 1. call ss.setWindowState with a broken state
|
||||
// 1a. ensure that it doesn't throw.
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let brokenState = {
|
||||
windows: [
|
||||
{ tabs: [{ entries: [{ url: "about:mozilla" }] }] }
|
||||
//{ tabs: [{ entries: [{ url: "about:robots" }] }] },
|
||||
],
|
||||
selectedWindow: 2
|
||||
};
|
||||
let brokenStateString = JSON.stringify(brokenState);
|
||||
|
||||
let gotError = false;
|
||||
try {
|
||||
ss.setWindowState(window, brokenStateString, true);
|
||||
}
|
||||
catch (ex) {
|
||||
gotError = true;
|
||||
info(ex);
|
||||
}
|
||||
|
||||
ok(!gotError, "ss.setWindowState did not throw an error");
|
||||
|
||||
// Make sure that we reset the state. Use a full state just in case things get crazy.
|
||||
let blankState = { windows: [{ tabs: [{ entries: [{ url: "about:blank" }] }]}]};
|
||||
waitForBrowserState(blankState, finish);
|
||||
}
|
||||
|
|
@ -35,33 +35,64 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
function test() {
|
||||
/** Test for Bug 476161 **/
|
||||
|
||||
/** Originally a test for Bug 476161, but then expanded to include all input types in bug 640136 **/
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
|
||||
let file = Components.classes["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Components.interfaces.nsIProperties)
|
||||
.get("TmpD", Components.interfaces.nsIFile);
|
||||
|
||||
let testURL = "http://mochi.test:8888/browser/" +
|
||||
"browser/components/sessionstore/test/browser/browser_476161_sample.html";
|
||||
"browser/components/sessionstore/test/browser/browser_form_restore_events_sample.html";
|
||||
let tab = gBrowser.addTab(testURL);
|
||||
tab.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
let doc = tab.linkedBrowser.contentDocument;
|
||||
|
||||
doc.getElementById("modify1").value += Math.random();
|
||||
doc.getElementById("modify2").value += " " + Date.now();
|
||||
|
||||
|
||||
// text fields
|
||||
doc.getElementById("modify01").value += Math.random();
|
||||
doc.getElementById("modify02").value += " " + Date.now();
|
||||
|
||||
// textareas
|
||||
doc.getElementById("modify03").value += Math.random();
|
||||
doc.getElementById("modify04").value += " " + Date.now();
|
||||
|
||||
// file
|
||||
doc.getElementById("modify05").value = file.path;
|
||||
|
||||
// select
|
||||
doc.getElementById("modify06").selectedIndex = 1;
|
||||
var multipleChange = doc.getElementById("modify07");
|
||||
Array.forEach(multipleChange.options, function(option) option.selected = true);
|
||||
|
||||
// checkbox
|
||||
doc.getElementById("modify08").checked = true;
|
||||
doc.getElementById("modify09").checked = false;
|
||||
|
||||
// radio
|
||||
// select one then another in the same group - only last one should get event on restore
|
||||
doc.getElementById("modify10").checked = true;
|
||||
doc.getElementById("modify11").checked = true;
|
||||
|
||||
|
||||
let tab2 = gBrowser.duplicateTab(tab);
|
||||
tab2.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||
tab2.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
let doc = tab2.linkedBrowser.contentDocument;
|
||||
let changed = doc.getElementById("changed").textContent.trim().split();
|
||||
|
||||
is(changed.sort().join(" "), "modify1 modify2",
|
||||
"input events were only dispatched for modified text fields");
|
||||
|
||||
let inputFired = doc.getElementById("inputFired").textContent.trim().split();
|
||||
let changeFired = doc.getElementById("changeFired").textContent.trim().split();
|
||||
|
||||
is(inputFired.sort().join(" "), "modify01 modify02 modify03 modify04 modify05",
|
||||
"input events were only dispatched for modified input, textarea fields");
|
||||
|
||||
is(changeFired.sort().join(" "), "modify06 unchanged06 modify07 modify08 modify09 modify11",
|
||||
"change events were only dispatched for modified select, checkbox, radio fields");
|
||||
|
||||
// clean up
|
||||
gBrowser.removeTab(tab2);
|
||||
gBrowser.removeTab(tab);
|
||||
|
||||
|
||||
finish();
|
||||
}, true);
|
||||
}, true);
|
|
@ -0,0 +1,98 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Test for form restore events (originally bug 476161)</title>
|
||||
|
||||
<script>
|
||||
|
||||
document.addEventListener("input", function(aEvent) {
|
||||
var inputEl = aEvent.originalTarget;
|
||||
var changedEl = document.getElementById("inputFired");
|
||||
changedEl.textContent += " " + inputEl.id;
|
||||
}, false);
|
||||
|
||||
document.addEventListener("change", function(aEvent) {
|
||||
var inputEl = aEvent.originalTarget;
|
||||
var changedEl = document.getElementById("changeFired");
|
||||
changedEl.textContent += " " + inputEl.id;
|
||||
}, false);
|
||||
|
||||
</script>
|
||||
|
||||
<!-- input events -->
|
||||
<h3>Text fields with changed text</h3>
|
||||
<input type="text" id="modify1">
|
||||
<input type="text" id="modify2" value="preset value">
|
||||
<input type="text" id="modify01">
|
||||
<input type="text" id="modify02" value="preset value">
|
||||
|
||||
<h3>Text fields with unchanged text</h3>
|
||||
<input type="text" id="unchanged1">
|
||||
<input type="text" id="unchanged2" value="preset value">
|
||||
<input type="text" id="unchanged01">
|
||||
<input type="text" id="unchanged02" value="preset value">
|
||||
|
||||
<h3>Textarea with changed text</h3>
|
||||
<textarea id="modify03"></textarea>
|
||||
<textarea id="modify04">preset value</textarea>
|
||||
|
||||
<h3>Textarea with unchanged text</h3>
|
||||
<textarea id="unchanged03"></textarea>
|
||||
<textarea id="unchanged04">preset value</textarea>
|
||||
|
||||
<h3>file field with changed value</h3>
|
||||
<input type="file" id="modify05">
|
||||
|
||||
<h3>file field with unchanged value</h3>
|
||||
<input type="file" id="unchanged05">
|
||||
|
||||
<!-- change events -->
|
||||
|
||||
<h3>Select menu with changed selection</h3>
|
||||
<select id="modify06">
|
||||
<option value="one">one</option>
|
||||
<option value="two">two</option>
|
||||
<option value="three">three</option>
|
||||
</select>
|
||||
|
||||
<h3>Select menu with unchanged selection (change event still fires)</h3>
|
||||
<select id="unchanged06">
|
||||
<option value="one">one</option>
|
||||
<option value="two" selected>two</option>
|
||||
<option value="three">three</option>
|
||||
</select>
|
||||
|
||||
<h3>Multiple Select menu with changed selection</h3>
|
||||
<select id="modify07" multiple>
|
||||
<option value="one">one</option>
|
||||
<option value="two" selected>two</option>
|
||||
<option value="three">three</option>
|
||||
</select>
|
||||
|
||||
<h3>Select menu with unchanged selection</h3>
|
||||
<select id="unchanged07" multiple>
|
||||
<option value="one">one</option>
|
||||
<option value="two" selected>two</option>
|
||||
<option value="three" selected>three</option>
|
||||
</select>
|
||||
|
||||
<h3>checkbox with changed value</h3>
|
||||
<input type="checkbox" id="modify08">
|
||||
<input type="checkbox" id="modify09" checked>
|
||||
|
||||
<h3>checkbox with unchanged value</h3>
|
||||
<input type="checkbox" id="unchanged08">
|
||||
<input type="checkbox" id="unchanged09" checked>
|
||||
|
||||
<h3>radio with changed value</h3>
|
||||
<input type="radio" id="modify10" name="group">Radio 1</input>
|
||||
<input type="radio" id="modify11" name="group">Radio 2</input>
|
||||
<input type="radio" id="modify12" name="group" checked>Radio 3</input>
|
||||
|
||||
<h3>radio with unchanged value</h3>
|
||||
<input type="radio" id="unchanged10" name="group2">Radio 4</input>
|
||||
<input type="radio" id="unchanged11" name="group2">Radio 5</input>
|
||||
<input type="radio" id="unchanged12" name="group2" checked>Radio 6</input>
|
||||
|
||||
<h3>Changed field IDs</h3>
|
||||
<div id="changed"></div>
|
||||
<div id="inputFired"></div>
|
||||
<div id="changeFired"></div>
|
|
@ -0,0 +1,53 @@
|
|||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is Places code
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Google Inc.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2005
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Brett Wilson <brettw@gmail.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 *****
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
DIRS += test
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
libs::
|
||||
$(NSINSTALL) $(srcdir)/modules/* $(FINAL_TARGET)/modules/tabview
|
|
@ -0,0 +1,5 @@
|
|||
browser.jar:
|
||||
content/browser/tabview.css (tabview.css)
|
||||
* content/browser/tabview.js (tabview.js)
|
||||
content/browser/tabview.html (tabview.html)
|
||||
content/browser/tabview-content.js (content.js)
|
|
@ -34,11 +34,11 @@
|
|||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../../../..
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
relativesrcdir = browser/base/content/test/tabview
|
||||
relativesrcdir = browser/components/tabview/test
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
|
@ -1,7 +1,7 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const DUMMY_PAGE_URL = "http://mochi.test:8888/browser/browser/base/content/test/tabview/dummy_page.html";
|
||||
const DUMMY_PAGE_URL = "http://mochi.test:8888/browser/browser/components/tabview/test/dummy_page.html";
|
||||
const DUMMY_PAGE_URL_2 = "http://mochi.test:8888/";
|
||||
|
||||
let state = {
|
|
@ -38,14 +38,15 @@ function onTabViewWindowLoaded() {
|
|||
let secondTabItem = secondTab._tabViewTabItem;
|
||||
ok(group.getChildren().some(function(child) child == secondTabItem),"The second tab was made in our new group");
|
||||
is(group.getChildren().length, 1, "Only one tab in the first group");
|
||||
isnot(firstTab.linkedBrowser.contentWindow.location, secondTab.linkedBrowser.contentWindow.location, "The two tabs must have different locations");
|
||||
isnot(firstTab.linkedBrowser.currentURI.spec, secondTab.linkedBrowser.currentURI.spec, "The two tabs must have different locations");
|
||||
|
||||
// Add the first tab to the group *programmatically*, without specifying a dropPos
|
||||
group.add(firstTabItem);
|
||||
is(group.getChildren().length, 2, "Two tabs in the group");
|
||||
is(group.getChildren()[0].tab.linkedBrowser.contentWindow.location, secondTab.linkedBrowser.contentWindow.location, "The second tab was there first");
|
||||
is(group.getChildren()[1].tab.linkedBrowser.contentWindow.location, firstTab.linkedBrowser.contentWindow.location, "The first tab was just added and went to the end of the line");
|
||||
|
||||
|
||||
is(group.getChildren()[0].tab.linkedBrowser.currentURI.spec, secondTab.linkedBrowser.currentURI.spec, "The second tab was there first");
|
||||
is(group.getChildren()[1].tab.linkedBrowser.currentURI.spec, firstTab.linkedBrowser.currentURI.spec, "The first tab was just added and went to the end of the line");
|
||||
|
||||
group.addSubscriber("close", function onClose() {
|
||||
group.removeSubscriber("close", onClose);
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||
|
||||
let stateStartup = {windows:[
|
||||
{tabs:[{entries:[{url:"about:home"}]}], extData:{"tabview-last-session-group-name":"title"}}
|
||||
]};
|
||||
|
||||
function test() {
|
||||
let assertWindowTitle = function (win, title) {
|
||||
let browser = win.gBrowser.tabs[0].linkedBrowser;
|
||||
let winTitle = win.gBrowser.getWindowTitleForBrowser(browser);
|
||||
|
||||
info('window title is: "' + winTitle + '"');
|
||||
is(winTitle.indexOf(title), 0, "title starts with '" + title + "'");
|
||||
};
|
||||
|
||||
let testGroupNameChange = function (win) {
|
||||
showTabView(function () {
|
||||
let cw = win.TabView.getContentWindow();
|
||||
let groupItem = cw.GroupItems.groupItems[0];
|
||||
groupItem.setTitle("new-title");
|
||||
|
||||
hideTabView(function () {
|
||||
assertWindowTitle(win, "new-title");
|
||||
finish();
|
||||
}, win);
|
||||
}, win);
|
||||
};
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
newWindowWithState(stateStartup, function (win) {
|
||||
registerCleanupFunction(function () win.close());
|
||||
assertWindowTitle(win, "title");
|
||||
testGroupNameChange(win);
|
||||
});
|
||||
}
|
|
@ -16,8 +16,8 @@ function test() {
|
|||
function setupOne(win) {
|
||||
win.TabView.firstUseExperienced = true;
|
||||
|
||||
win.gBrowser.addTab("http://mochi.test:8888/browser/browser/base/content/test/tabview/search1.html");
|
||||
win.gBrowser.addTab("http://mochi.test:8888/browser/browser/base/content/test/tabview/dummy_page.html");
|
||||
win.gBrowser.addTab("http://mochi.test:8888/browser/browser/components/tabview/test/search1.html");
|
||||
win.gBrowser.addTab("http://mochi.test:8888/browser/browser/components/tabview/test/dummy_page.html");
|
||||
|
||||
afterAllTabsLoaded(function () setupTwo(win), win);
|
||||
}
|
|
@ -68,5 +68,5 @@ function onTabViewWindowLoaded() {
|
|||
newTab.addEventListener("error", errorHandler, false);
|
||||
|
||||
newTab.linkedBrowser.loadURI(
|
||||
"http://mochi.test:8888/browser/browser/base/content/test/tabview/test_bug600645.html");
|
||||
"http://mochi.test:8888/browser/browser/components/tabview/test/test_bug600645.html");
|
||||
}
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче