Merge last PGO-green changeset of mozilla-inbound to mozilla-central

This commit is contained in:
Ed Morley 2012-10-12 11:59:59 +01:00
Родитель 2cdba3cfd5 6f00411a92
Коммит ee9067e40d
288 изменённых файлов: 2646 добавлений и 1319 удалений

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

@ -162,13 +162,17 @@ LogDocState(nsIDocument* aDocumentNode)
printf(", %sshowing", aDocumentNode->IsShowing() ? "" : "not ");
printf(", %svisible", aDocumentNode->IsVisible() ? "" : "not ");
printf(", %sactive", aDocumentNode->IsActive() ? "" : "not ");
printf(", %sresource", aDocumentNode->IsResourceDoc() ? "" : "not ");
printf(", has %srole content",
nsCoreUtils::GetRoleContent(aDocumentNode) ? "" : "no ");
}
static void
LogPresShell(nsIDocument* aDocumentNode)
{
nsIPresShell* ps = aDocumentNode->GetShell();
printf("presshell: %p", static_cast<void*>(ps));
printf("presshell: %p, is %s destroying", static_cast<void*>(ps),
(ps->IsDestroying() ? "" : "not"));
nsIScrollableFrame *sf = ps ?
ps->GetRootScrollFrameAsScrollableExternal() : nullptr;
printf(", root scroll frame: %p", static_cast<void*>(sf));
@ -426,11 +430,11 @@ logging::DocCompleteLoad(DocAccessible* aDocument, bool aIsLoadEventTarget)
MsgBegin(sDocLoadTitle, "document loaded *completely*");
printf(" DOM document: %p, acc document: %p\n",
static_cast<void*>(aDocument->GetDocumentNode()),
static_cast<void*>(aDocument->DocumentNode()),
static_cast<void*>(aDocument));
printf(" ");
LogDocURI(aDocument->GetDocumentNode());
LogDocURI(aDocument->DocumentNode());
printf("\n");
printf(" ");
@ -531,7 +535,7 @@ logging::FocusNotificationTarget(const char* aMsg, const char* aTargetDescr,
if (aTargetThing) {
nsCOMPtr<nsINode> targetNode(do_QueryInterface(aTargetThing));
if (targetNode)
Node(aTargetDescr, targetNode);
AccessibleNNode(aTargetDescr, targetNode);
else
printf(" %s: %p, window\n", aTargetDescr,
static_cast<void*>(aTargetThing));
@ -656,7 +660,7 @@ logging::Address(const char* aDescr, Accessible* aAcc)
}
DocAccessible* doc = aAcc->Document();
nsIDocument* docNode = aAcc->GetDocumentNode();
nsIDocument* docNode = doc->DocumentNode();
printf(" document: %p, node: %p\n",
static_cast<void*>(doc), static_cast<void*>(docNode));
@ -709,6 +713,18 @@ logging::Node(const char* aDescr, nsINode* aNode)
aDescr, static_cast<void*>(elm), tag.get(), id.get(), idxInParent);
}
void
logging::Document(DocAccessible* aDocument)
{
printf(" Document: %p, document node: %p\n",
static_cast<void*>(aDocument),
static_cast<void*>(aDocument->DocumentNode()));
printf(" Document ");
LogDocURI(aDocument->DocumentNode());
printf("\n");
}
void
logging::AccessibleNNode(const char* aDescr, Accessible* aAccessible)
{
@ -728,13 +744,7 @@ logging::AccessibleNNode(const char* aDescr, Accessible* aAccessible)
nodeDescr.AppendLiteral(" node");
Node(nodeDescr.get(), aAccessible->GetNode());
printf(" Document: %p, document node: %p\n",
static_cast<void*>(aAccessible->Document()),
static_cast<void*>(aAccessible->GetDocumentNode()));
printf(" Document ");
LogDocURI(static_cast<nsIDocument*>(aAccessible->GetDocumentNode()));
printf("\n");
Document(aAccessible->Document());
}
void
@ -751,9 +761,18 @@ logging::AccessibleNNode(const char* aDescr, nsINode* aNode)
}
}
nsAutoCString nodeDescr("Not accessible ");
nsAutoCString nodeDescr("[not accessible] ");
nodeDescr.Append(aDescr);
Node(nodeDescr.get(), aNode);
if (document) {
Document(document);
return;
}
printf(" [contained by not accessible document]:\n");
LogDocInfo(aNode->OwnerDoc(), document);
printf("\n");
}
void

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

@ -150,6 +150,11 @@ void Address(const char* aDescr, Accessible* aAcc);
*/
void Node(const char* aDescr, nsINode* aNode);
/**
* Log the document accessible info as message entry.
*/
void Document(DocAccessible* aDocument);
/**
* Log the accessible and its DOM node as a message entry.
*/

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

@ -243,8 +243,8 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
if (childDoc->IsDefunct())
continue;
nsIContent* ownerContent = mDocument->GetDocumentNode()->
FindContentForSubDocument(childDoc->GetDocumentNode());
nsIContent* ownerContent = mDocument->DocumentNode()->
FindContentForSubDocument(childDoc->DocumentNode());
if (ownerContent) {
Accessible* outerDocAcc = mDocument->GetAccessible(ownerContent);
if (outerDocAcc && outerDocAcc->AppendChild(childDoc)) {

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

@ -111,12 +111,6 @@ nsAccessNode::GetNode() const
return mContent;
}
nsIDocument*
nsAccessNode::GetDocumentNode() const
{
return mContent ? mContent->OwnerDoc() : nullptr;
}
void
nsAccessNode::Language(nsAString& aLanguage)
{

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

@ -64,7 +64,6 @@ public:
*/
virtual nsINode* GetNode() const;
nsIContent* GetContent() const { return mContent; }
virtual nsIDocument* GetDocumentNode() const;
/**
* Return node type information of DOM node associated with the accessible.

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

@ -896,7 +896,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
return nullptr;
}
if (aNode->OwnerDoc() != aDoc->GetDocumentNode()) {
if (aNode->OwnerDoc() != aDoc->DocumentNode()) {
NS_ERROR("Creating accessible for wrong document");
return nullptr;
}

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

@ -83,7 +83,7 @@ public:
virtual void Shutdown();
virtual nsIFrame* GetFrame() const;
virtual nsINode* GetNode() const { return mDocument; }
virtual nsIDocument* GetDocumentNode() const { return mDocument; }
nsIDocument* DocumentNode() const { return mDocument; }
// Accessible
virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);

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

@ -1485,7 +1485,7 @@ HyperTextAccessible::GetEditor() const
return nullptr; // No editing session interface
nsCOMPtr<nsIEditor> editor;
nsIDocument* docNode = mDoc->GetDocumentNode();
nsIDocument* docNode = mDoc->DocumentNode();
editingSession->GetEditorForWindow(docNode->GetWindow(),
getter_AddRefs(editor));
return editor.forget();
@ -1531,7 +1531,7 @@ HyperTextAccessible::SetSelectionRange(int32_t aStartPos, int32_t aEndPos)
nsFocusManager* DOMFocusManager = nsFocusManager::GetFocusManager();
if (DOMFocusManager) {
NS_ENSURE_TRUE(mDoc, NS_ERROR_FAILURE);
nsIDocument* docNode = mDoc->GetDocumentNode();
nsIDocument* docNode = mDoc->DocumentNode();
NS_ENSURE_TRUE(docNode, NS_ERROR_FAILURE);
nsCOMPtr<nsPIDOMWindow> window = docNode->GetWindow();
nsCOMPtr<nsIDOMElement> result;

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

@ -133,7 +133,7 @@ OuterDocAccessible::Shutdown()
#ifdef A11Y_LOG
if (logging::IsEnabled(logging::eDocDestroy)) {
logging::DocDestroy("outerdoc's child document shutdown",
childAcc->GetDocumentNode());
childAcc->AsDoc()->DocumentNode());
}
#endif
childAcc->Shutdown();
@ -177,7 +177,7 @@ OuterDocAccessible::AppendChild(Accessible* aAccessible)
#ifdef A11Y_LOG
if (logging::IsEnabled(logging::eDocCreate)) {
logging::DocCreate("append document to outerdoc",
aAccessible->GetDocumentNode());
aAccessible->AsDoc()->DocumentNode());
logging::Address("outerdoc", this);
}
#endif
@ -196,8 +196,8 @@ OuterDocAccessible::RemoveChild(Accessible* aAccessible)
#ifdef A11Y_LOG
if (logging::IsEnabled(logging::eDocDestroy)) {
logging::DocDestroy("remove document from outerdoc", child->GetDocumentNode(),
child->AsDoc());
logging::DocDestroy("remove document from outerdoc",
child->AsDoc()->DocumentNode(), child->AsDoc());
logging::Address("outerdoc", this);
}
#endif

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

@ -166,7 +166,7 @@ __try {
// accessibles.
if (!doc->ParentDocument() ||
nsWinUtils::IsWindowEmulationStarted() &&
nsCoreUtils::IsTabDocument(doc->GetDocumentNode())) {
nsCoreUtils::IsTabDocument(doc->DocumentNode())) {
HWND hwnd = static_cast<HWND>(doc->GetNativeWindow());
if (hwnd && SUCCEEDED(::AccessibleObjectFromWindow(hwnd, OBJID_WINDOW,
IID_IAccessible,

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

@ -35,7 +35,7 @@ void
RootAccessibleWrap::DocumentActivated(DocAccessible* aDocument)
{
if (Compatibility::IsDolphin() &&
nsCoreUtils::IsTabDocument(aDocument->GetDocumentNode())) {
nsCoreUtils::IsTabDocument(aDocument->DocumentNode())) {
uint32_t count = mChildDocuments.Length();
for (uint32_t idx = 0; idx < count; idx++) {
DocAccessible* childDoc = mChildDocuments[idx];

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

@ -18,9 +18,7 @@ ifdef MOZ_EXTENSIONS
tier_app_dirs += extensions
endif
ifdef MOZ_SERVICES_SYNC
tier_app_dirs += services
endif
tier_app_dirs += \
$(MOZ_BRANDING_DIRECTORY) \

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

@ -17,7 +17,7 @@ MOZ_OFFICIAL_BRANDING_DIRECTORY=b2g/branding/official
# MOZ_APP_DISPLAYNAME is set by branding/configure.sh
MOZ_SAFE_BROWSING=
MOZ_SERVICES_SYNC=
MOZ_SERVICES_COMMON=1
MOZ_WEBSMS_BACKEND=1
MOZ_DISABLE_DOMCRYPTO=1

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

@ -359,6 +359,8 @@
@BINPATH@/components/nsLoginInfo.js
@BINPATH@/components/nsLoginManager.js
@BINPATH@/components/nsLoginManagerPrompter.js
@BINPATH@/components/SiteSpecificUserAgent.js
@BINPATH@/components/SiteSpecificUserAgent.manifest
@BINPATH@/components/storage-Legacy.js
@BINPATH@/components/storage-mozStorage.js
@BINPATH@/components/crypto-SDR.js

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

@ -482,7 +482,9 @@
accesskey="&toolsMenu.accesskey;">
<menupopup id="menu_ToolsPopup"
#ifdef MOZ_SERVICES_SYNC
onpopupshowing="gSyncUI.updateUI();"
onpopupshowing="gSyncUI.updateUI(); SocialMenu.populate();"
#else
onpopupshowing="SocialMenu.populate();"
#endif
>
<menuitem id="menu_search"
@ -507,6 +509,11 @@
type="checkbox"
autocheck="false"
command="Social:Toggle"/>
<menu id="menu_socialAmbientMenu"
class="show-only-for-keyboard"
command="Social:Toggle">
<menupopup id="menu_socialAmbientMenuPopup"/>
</menu>
#ifdef MOZ_SERVICES_SYNC
<!-- only one of sync-setup or sync-menu will be showing at once -->
<menuitem id="sync-setup"

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

@ -62,6 +62,7 @@ let SocialUI = {
break;
case "social:ambient-notification-changed":
SocialToolbar.updateButton();
SocialMenu.updateMenu();
break;
case "social:profile-changed":
SocialToolbar.updateProfile();
@ -107,7 +108,7 @@ let SocialUI = {
// FIXME: bug 772808: menu items don't inherit the "hidden" state properly,
// need to update them manually.
// This should just be: toggleCommand.hidden = !Social.active;
for (let id of ["appmenu_socialToggle", "menu_socialToggle"]) {
for (let id of ["appmenu_socialToggle", "menu_socialToggle", "menu_socialAmbientMenu"]) {
let el = document.getElementById(id);
if (!el)
continue;
@ -584,6 +585,31 @@ let SocialShareButton = {
}
};
var SocialMenu = {
populate: function SocialMenu_populate() {
// This menu is only accessible through keyboard navigation.
let submenu = document.getElementById("menu_socialAmbientMenuPopup");
while (submenu.hasChildNodes())
submenu.removeChild(submenu.firstChild);
let provider = Social.provider;
if (Social.active && provider) {
let iconNames = Object.keys(provider.ambientNotificationIcons);
for (let name of iconNames) {
let icon = provider.ambientNotificationIcons[name];
if (!icon.label || !icon.menuURL)
continue;
let menuitem = document.createElement("menuitem");
menuitem.setAttribute("label", icon.label);
menuitem.addEventListener("command", function() {
openUILinkIn(icon.menuURL, "tab");
}, false);
submenu.appendChild(menuitem);
}
}
document.getElementById("menu_socialAmbientMenu").hidden = !submenu.querySelector("menuitem");
}
};
var SocialToolbar = {
// Called once, after window load, when the Social.provider object is initialized
init: function SocialToolbar_init() {
@ -717,6 +743,9 @@ var SocialToolbar = {
let box = document.createElement("box");
box.classList.add("toolbarbutton-1");
box.setAttribute("id", iconId);
// Use the accessibility menuitem label as tooltiptext.
if (icon.label)
box.setAttribute("tooltiptext", icon.label);
box.addEventListener("mousedown", function (e) {
if (e.button == 0)
SocialToolbar.showAmbientPopup(box);

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

@ -7068,9 +7068,6 @@ function getNavToolbox() gNavToolbox;
# make it work in both modes, the amount of duplicated code is small and the
# code is much more readable this way.
let gPrivateBrowsingUI = {
_inited: false,
_initCallbacks: [],
init: function PBUI_init() {
// Do nothing for normal windows
if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
@ -7091,26 +7088,6 @@ let gPrivateBrowsingUI = {
docElement.setAttribute("privatebrowsingmode", "temporary");
gBrowser.updateTitlebar();
}
this._inited = true;
this._initCallbacks.forEach(function (callback) callback.apply());
this._initCallbacks = [];
},
get autoStarted() {
return false; // auto-started PB not supported for now
},
get initialized() {
return this._inited;
},
addInitializationCallback: function PBUI_addInitializationCallback(aCallback) {
if (this._inited)
return;
this._initCallbacks.push(aCallback);
}
};
@ -7121,7 +7098,6 @@ let gPrivateBrowsingUI = {
_searchBarValue: null,
_findBarValue: null,
_inited: false,
_initCallbacks: [],
init: function PBUI_init() {
Services.obs.addObserver(this, "private-browsing", false);
@ -7134,9 +7110,6 @@ let gPrivateBrowsingUI = {
this.onEnterPrivateBrowsing(true);
this._inited = true;
this._initCallbacks.forEach(function (callback) callback.apply());
this._initCallbacks = [];
},
uninit: function PBUI_unint() {
@ -7147,17 +7120,6 @@ let gPrivateBrowsingUI = {
Services.obs.removeObserver(this, "private-browsing-transition-complete");
},
get initialized() {
return this._inited;
},
addInitializationCallback: function PBUI_addInitializationCallback(aCallback) {
if (this._inited)
return;
this._initCallbacks.push(aCallback);
},
get _disableUIOnToggle() {
if (this._privateBrowsingService.autoStarted)
return false;
@ -7360,10 +7322,6 @@ let gPrivateBrowsingUI = {
!this.privateBrowsingEnabled;
},
get autoStarted() {
return this._privateBrowsingService.autoStarted;
},
get privateBrowsingEnabled() {
return this._privateBrowsingService.privateBrowsingEnabled;
}

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

@ -836,8 +836,11 @@
if (this.mCurrentBrowser == newBrowser && !aForceUpdate)
return;
if (!aForceUpdate)
if (!aForceUpdate) {
TelemetryStopwatch.start("FX_TAB_SWITCH_UPDATE_MS");
window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils)
.beginTabSwitch();
}
var oldTab = this.mCurrentTab;

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

@ -33,12 +33,33 @@ var tests = {
is(userButton.value, profile.userName, "username is set");
next();
},
testNoAmbientNotificationsIsNoKeyboardMenu: function(next) {
// The menu bar isn't as easy to instrument on Mac.
if (navigator.platform.contains("Mac")) {
info("Skipping checking the menubar on Mac OS");
next();
}
// Test that keyboard accessible menuitem doesn't exist when no ambient icons specified.
let toolsPopup = document.getElementById("menu_ToolsPopup");
toolsPopup.addEventListener("popupshown", function ontoolspopupshownNoAmbient() {
toolsPopup.removeEventListener("popupshown", ontoolspopupshownNoAmbient);
let socialToggleMore = document.getElementById("menu_socialAmbientMenu");
ok(socialToggleMore, "Keyboard accessible social menu should exist");
is(socialToggleMore.hidden, true, "Menu should be hidden when no ambient notifications.");
toolsPopup.hidePopup();
next();
}, false);
document.getElementById("menu_ToolsPopup").openPopup();
},
testAmbientNotifications: function(next) {
let ambience = {
name: "testIcon",
iconURL: "https://example.com/browser/browser/base/content/test/moz.png",
contentPanel: "about:blank",
counter: 42
counter: 42,
label: "Test Ambient 1",
menuURL: "https://example.com/testAmbient1"
};
Social.provider.setAmbientNotification(ambience);
@ -53,7 +74,24 @@ var tests = {
ambience.counter = 0;
Social.provider.setAmbientNotification(ambience);
is(statusIconLabel.value, "", "status value is correct");
next();
// The menu bar isn't as easy to instrument on Mac.
if (navigator.platform.contains("Mac"))
next();
// Test that keyboard accessible menuitem was added.
let toolsPopup = document.getElementById("menu_ToolsPopup");
toolsPopup.addEventListener("popupshown", function ontoolspopupshownAmbient() {
toolsPopup.removeEventListener("popupshown", ontoolspopupshownAmbient);
let socialToggleMore = document.getElementById("menu_socialAmbientMenu");
ok(socialToggleMore, "Keyboard accessible social menu should exist");
is(socialToggleMore.hidden, false, "Menu is visible when ambient notifications have label & menuURL");
let menuitem = socialToggleMore.querySelector("menuitem");
is(menuitem.getAttribute("label"), "Test Ambient 1", "Keyboard accessible ambient menuitem should have specified label");
toolsPopup.hidePopup();
next();
}, false);
document.getElementById("menu_ToolsPopup").openPopup();
}, "statusIcon was never found");
},
testProfileUnset: function(next) {

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

@ -132,6 +132,7 @@ function runSocialTestWithProvider(manifest, callback) {
// Now that we've set the UI's provider, enable the social functionality
Services.prefs.setBoolPref("social.enabled", true);
Services.prefs.setBoolPref("social.active", true);
// Need to re-call providerReady since it is actually called before the test
// framework is loaded and the provider state won't be set in the browser yet.
@ -149,6 +150,7 @@ function runSocialTestWithProvider(manifest, callback) {
}
Social.provider = oldProvider;
Services.prefs.clearUserPref("social.enabled");
Services.prefs.clearUserPref("social.active");
});
function finishSocialTest() {

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

@ -13,14 +13,9 @@ XPCOMUtils.defineLazyGetter(this, "BROWSER_NEW_TAB_URL", function () {
const TOPIC = "private-browsing-transition-complete";
function getNewTabPageURL() {
if (("gPrivateBrowsingUI" in window) &&
!Services.prefs.prefHasUserValue(PREF)) {
// gPrivateBrowsingUI may not be initialized yet, in that case we'll
// update BROWSER_NEW_TAB_URL when it gets initialized.
if (!gPrivateBrowsingUI.initialized)
gPrivateBrowsingUI.addInitializationCallback(update);
else if (PrivateBrowsingUtils.isWindowPrivate(window) &&
!gPrivateBrowsingUI.autoStarted)
if (!Services.prefs.prefHasUserValue(PREF)) {
if (PrivateBrowsingUtils.isWindowPrivate(window) &&
!PrivateBrowsingUtils.permanentPrivateBrowsing)
return "about:privatebrowsing";
}
return Services.prefs.getCharPref(PREF) || "about:blank";

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

@ -5,7 +5,6 @@
#include "nsFeedSniffer.h"
#include "prmem.h"
#include "nsNetCID.h"
#include "nsXPCOM.h"

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

@ -12,7 +12,14 @@ include $(DEPTH)/config/autoconf.mk
MODULE = test_privatebrowsing
# Most xpcshell PB tests use the global PB service, which means that we should
# not attempt to run them in regular builds. We should look at the list and
# decide which ones of them should be ported to the browser/perwindow suite
# in the future.
ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
XPCSHELL_TESTS = unit
endif
DIRS += browser \
$(NULL)

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

@ -10,65 +10,23 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MOCHITEST_BROWSER_FILES = \
head.js \
browser_console_clear.js \
browser_privatebrowsing_certexceptionsui.js \
browser_privatebrowsing_commandline_toggle.js \
browser_privatebrowsing_concurrent.js \
browser_privatebrowsing_concurrent_page.html \
browser_privatebrowsing_crh.js \
browser_privatebrowsing_fastswitch.js \
browser_privatebrowsing_findbar.js \
browser_privatebrowsing_forgetthissite.js \
browser_privatebrowsing_geoprompt.js \
browser_privatebrowsing_geoprompt_page.html \
browser_privatebrowsing_import.js \
browser_privatebrowsing_lastpbcontextexited.js \
browser_privatebrowsing_localStorage.js \
browser_privatebrowsing_localStorage_before_after.js \
browser_privatebrowsing_localStorage_before_after_page.html \
browser_privatebrowsing_localStorage_before_after_page2.html \
browser_privatebrowsing_localStorage_page1.html \
browser_privatebrowsing_localStorage_page2.html \
browser_privatebrowsing_newwindow_stopcmd.js \
browser_privatebrowsing_opendir.js \
browser_privatebrowsing_openlocation.js \
browser_privatebrowsing_openLocationLastURL.js \
browser_privatebrowsing_pageinfo.js \
browser_privatebrowsing_placestitle.js \
browser_privatebrowsing_popupblocker.js \
browser_privatebrowsing_popupmode.js \
browser_privatebrowsing_protocolhandler.js \
browser_privatebrowsing_protocolhandler_page.html \
browser_privatebrowsing_searchbar.js \
browser_privatebrowsing_sslsite_transition.js \
browser_privatebrowsing_theming.js \
browser_privatebrowsing_transition.js \
browser_privatebrowsing_ui.js \
browser_privatebrowsing_urlbarfocus.js \
browser_privatebrowsing_urlbarundo.js \
browser_privatebrowsing_viewsource.js \
browser_privatebrowsing_windowtitle.js \
browser_privatebrowsing_windowtitle_page.html \
browser_privatebrowsing_zoom.js \
browser_privatebrowsing_zoomrestore.js \
ctxmenu.html \
ctxmenu-image.png \
popup.html \
staller.sjs \
title.sjs \
$(NULL)
MODULE = test_privatebrowsing
# Disabled until bug 564934 is fixed:
# browser_privatebrowsing_downloadmonitor.js \
# We have three category of browser-chrome tests:
# global: these tests focus on the global PB service implementation.
# perwindow: these tests focus on the per-window PB implementation.
# obsolete: these tests focus on the global mode, but the functionality
# that they are testing is specific to the global mode, and
# will never have a per-window counterpart.
#
# As a transition plan, we have divided the existing tests into the
# global and obsolete categories, and we'll then focus on rewriting the
# global tests to test the per-window mode.
# Turn off private browsing tests that perma-timeout on Linux.
ifneq (Linux,$(OS_ARCH))
MOCHITEST_BROWSER_FILES += \
browser_privatebrowsing_beforeunload.js \
browser_privatebrowsing_cookieacceptdialog.js \
$(NULL)
ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
DIRS += perwindow
else
DIRS += global obsolete
endif
include $(topsrcdir)/config/rules.mk

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

@ -0,0 +1,53 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MOCHITEST_BROWSER_FILES = \
head.js \
browser_privatebrowsing_certexceptionsui.js \
browser_privatebrowsing_crh.js \
browser_privatebrowsing_geoprompt.js \
browser_privatebrowsing_geoprompt_page.html \
browser_privatebrowsing_localStorage.js \
browser_privatebrowsing_localStorage_before_after.js \
browser_privatebrowsing_localStorage_before_after_page.html \
browser_privatebrowsing_localStorage_before_after_page2.html \
browser_privatebrowsing_localStorage_page1.html \
browser_privatebrowsing_localStorage_page2.html \
browser_privatebrowsing_opendir.js \
browser_privatebrowsing_openlocation.js \
browser_privatebrowsing_openLocationLastURL.js \
browser_privatebrowsing_placestitle.js \
browser_privatebrowsing_popupblocker.js \
browser_privatebrowsing_protocolhandler.js \
browser_privatebrowsing_protocolhandler_page.html \
browser_privatebrowsing_sslsite_transition.js \
browser_privatebrowsing_theming.js \
browser_privatebrowsing_ui.js \
browser_privatebrowsing_urlbarfocus.js \
browser_privatebrowsing_windowtitle.js \
browser_privatebrowsing_windowtitle_page.html \
browser_privatebrowsing_zoom.js \
browser_privatebrowsing_zoomrestore.js \
ctxmenu.html \
ctxmenu-image.png \
popup.html \
title.sjs \
$(NULL)
# Turn off private browsing tests that perma-timeout on Linux.
ifneq (Linux,$(OS_ARCH))
MOCHITEST_BROWSER_FILES += \
browser_privatebrowsing_cookieacceptdialog.js \
$(NULL)
endif
include $(topsrcdir)/config/rules.mk

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

@ -11,7 +11,7 @@ function test() {
getService(Ci.nsIPrivateBrowsingService);
const testPageURL = "http://mochi.test:8888/browser/" +
"browser/components/privatebrowsing/test/browser/browser_privatebrowsing_geoprompt_page.html";
"browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_geoprompt_page.html";
waitForExplicitFinish();
gBrowser.selectedTab = gBrowser.addTab();

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

@ -12,7 +12,7 @@ function test() {
browser.addEventListener('load', function() {
browser.removeEventListener('load', arguments.callee, true);
let tab2 = gBrowser.selectedTab = gBrowser.addTab();
browser.contentWindow.location = 'http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/' +
browser.contentWindow.location = 'http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/global/' +
'browser_privatebrowsing_localStorage_page2.html';
browser.addEventListener('load', function() {
browser.removeEventListener('load', arguments.callee, true);
@ -21,6 +21,6 @@ function test() {
finish();
}, true);
}, true);
browser.loadURI('http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/' +
browser.loadURI('http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/global/' +
'browser_privatebrowsing_localStorage_page1.html');
}

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

@ -11,9 +11,9 @@
// existing.
function test() {
let prefix = 'http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/';
let prefix = 'http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/global/';
waitForExplicitFinish();
// We wait for a GC to ensure that all previous PB docshells in this test suite are destroyed
// so that the PB localStorage instance is clean.
Components.utils.schedulePreciseGC(function() {

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

@ -14,7 +14,7 @@ function test() {
waitForExplicitFinish();
ignoreAllUncaughtExceptions();
const TEST_URL = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/title.sjs";
const TEST_URL = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/global/title.sjs";
function waitForCleanup(aCallback) {
// delete all cookies

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

@ -13,7 +13,7 @@ function test() {
let oldPopupPolicy = gPrefService.getBoolPref("dom.disable_open_during_load");
gPrefService.setBoolPref("dom.disable_open_during_load", true);
const TEST_URI = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/popup.html";
const TEST_URI = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/global/popup.html";
waitForExplicitFinish();

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

@ -11,7 +11,7 @@ function test() {
getService(Ci.nsIPrivateBrowsingService);
const testPageURL = "http://example.com/browser/" +
"browser/components/privatebrowsing/test/browser/browser_privatebrowsing_protocolhandler_page.html";
"browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_protocolhandler_page.html";
waitForExplicitFinish();
const notificationValue = "Protocol Registration: testprotocol";

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

@ -12,7 +12,7 @@ function test() {
getService(Ci.nsIPrivateBrowsingService);
const testPageURL = "http://mochi.test:8888/browser/" +
"browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle_page.html";
"browser/components/privatebrowsing/test/browser/global/browser_privatebrowsing_windowtitle_page.html";
waitForExplicitFinish();
requestLongerTimeout(2);

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

До

Ширина:  |  Высота:  |  Размер: 5.3 KiB

После

Ширина:  |  Высота:  |  Размер: 5.3 KiB

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

@ -0,0 +1,41 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MOCHITEST_BROWSER_FILES = \
head.js \
browser_console_clear.js \
browser_privatebrowsing_commandline_toggle.js \
browser_privatebrowsing_fastswitch.js \
browser_privatebrowsing_findbar.js \
browser_privatebrowsing_forgetthissite.js \
browser_privatebrowsing_import.js \
browser_privatebrowsing_newwindow_stopcmd.js \
browser_privatebrowsing_pageinfo.js \
browser_privatebrowsing_popupmode.js \
browser_privatebrowsing_searchbar.js \
browser_privatebrowsing_transition.js \
browser_privatebrowsing_urlbarundo.js \
browser_privatebrowsing_viewsource.js \
staller.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))
MOCHITEST_BROWSER_FILES += \
browser_privatebrowsing_beforeunload.js \
$(NULL)
endif
include $(topsrcdir)/config/rules.mk

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

@ -115,7 +115,7 @@ function addDownload(dm, aParams)
aParams.targetFile.append(aParams.resultFileName);
}
if (!("sourceURI" in aParams))
aParams.sourceURI = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/staller.sjs";
aParams.sourceURI = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/global/staller.sjs";
if (!("downloadName" in aParams))
aParams.downloadName = null;
if (!("runBeforeStart" in aParams))

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

@ -5,8 +5,6 @@
// This test makes sure that the "Import and Backup->Import From Another Browser"
// menu item in the Places Organizer is disabled inside private browsing mode.
// TEST_PATH=browser/components/privatebrowsing/test/browser/browser_privatebrowsing_import.js make -C $(OBJDIR) mochitest-browser-chrome
let pb = Cc["@mozilla.org/privatebrowsing;1"].
getService(Ci.nsIPrivateBrowsingService);

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

@ -0,0 +1,25 @@
// Make sure that we clean up after each test if it times out, for example.
registerCleanupFunction(function() {
var pb = Cc["@mozilla.org/privatebrowsing;1"].
getService(Ci.nsIPrivateBrowsingService);
ok(!pb.privateBrowsingEnabled, "Private browsing should be terminated after finishing the test");
pb.privateBrowsingEnabled = false;
try {
Services.prefs.clearUserPref("browser.privatebrowsing.keep_current_session");
} catch(e) {}
});
/**
* Waits for completion of a clear history operation, before
* proceeding with aCallback.
*
* @param aCallback
* Function to be called when done.
*/
function waitForClearHistory(aCallback) {
Services.obs.addObserver(function observeCH(aSubject, aTopic, aData) {
Services.obs.removeObserver(observeCH, PlacesUtils.TOPIC_EXPIRATION_FINISHED);
aCallback();
}, PlacesUtils.TOPIC_EXPIRATION_FINISHED, false);
PlacesUtils.bhistory.removeAllPages();
}

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

@ -0,0 +1,20 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MOCHITEST_BROWSER_FILES = \
head.js \
browser_privatebrowsing_concurrent.js \
browser_privatebrowsing_concurrent_page.html \
browser_privatebrowsing_lastpbcontextexited.js \
$(NULL)
include $(topsrcdir)/config/rules.mk

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

@ -12,7 +12,7 @@
// Step 4: load a page in the tab from step 2 that checks the value of test is value and the total count in private storage is 1
function test() {
let prefix = 'http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_concurrent_page.html';
let prefix = 'http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/perwindow/browser_privatebrowsing_concurrent_page.html';
waitForExplicitFinish();
gBrowser.selectedTab = gBrowser.addTab();
let non_private_tab = gBrowser.selectedBrowser;
@ -70,4 +70,4 @@ function test() {
private_tab.loadURI(prefix + '?action=set&name=test2&value=value2');
}, true);
non_private_tab.loadURI(prefix + '?action=set&name=test&value=value&initial=true');
}
}

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

@ -0,0 +1,14 @@
/*
* Function created to put a window in PB mode.
* THIS IS DANGEROUS. DO NOT DO THIS OUTSIDE OF TESTS!
*/
function setPrivateWindow(aWindow, aEnable) {
return aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.treeOwner
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIXULWindow)
.docShell.QueryInterface(Ci.nsILoadContext)
.usePrivateBrowsing = aEnable;
}

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

@ -18,7 +18,8 @@ ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
_NON_MAC_BROWSER_TESTS = browser_bug415846.js
endif
_BROWSER_FILES = browser_bug400731.js \
_BROWSER_FILES = head.js \
browser_bug400731.js \
$(_NON_MAC_BROWSER_TESTS) \
$(NULL)

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

@ -0,0 +1,3 @@
// Force SafeBrowsing to be initialized for the tests
SafeBrowsing.init();

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

@ -19,6 +19,8 @@ MOZ_STUB_INSTALLER=1
MOZ_CHROME_FILE_FORMAT=omni
MOZ_SAFE_BROWSING=1
MOZ_SERVICES_AITC=1
MOZ_SERVICES_COMMON=1
MOZ_SERVICES_CRYPTO=1
MOZ_SERVICES_NOTIFICATIONS=1
MOZ_SERVICES_SYNC=1
MOZ_APP_VERSION=$FIREFOX_VERSION

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

@ -345,6 +345,8 @@
@BINPATH@/components/BrowserPageThumbs.manifest
@BINPATH@/components/nsPrivateBrowsingService.manifest
@BINPATH@/components/nsPrivateBrowsingService.js
@BINPATH@/components/SiteSpecificUserAgent.js
@BINPATH@/components/SiteSpecificUserAgent.manifest
@BINPATH@/components/toolkitsearch.manifest
@BINPATH@/components/nsSearchService.js
@BINPATH@/components/nsSearchSuggestions.js

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

@ -162,6 +162,7 @@ richlistitem[type="download"][state="1"]:hover {
/*** Status and progress indicator ***/
#downloads-button,
#downloads-indicator {
width: 35px;
}
@ -251,7 +252,7 @@ richlistitem[type="download"][state="1"]:hover {
#downloads-indicator-counter {
height: 10px;
margin: 0;
margin: -3px 0 0;
color: hsl(0,0%,30%);
text-shadow: 0 1px 0 hsla(0,0%,100%,.5);
font-size: 10px;
@ -261,7 +262,7 @@ richlistitem[type="download"][state="1"]:hover {
#downloads-indicator-progress {
width: 16px;
height: 6px;
height: 4px;
min-width: 0;
min-height: 0;
margin-top: 1px;

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

@ -1486,13 +1486,11 @@ if test "$GNU_CXX"; then
# -Werror=return-type - catches missing returns, zero false positives
# -Wtype-limits - catches overflow bugs, few false positives
# -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
# -Werror=conversion-null - catches conversions between NULL and non-pointer types
#
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual"
MOZ_CXX_SUPPORTS_WARNING(-W, error=return-type, ac_cxx_has_werror_return_type)
MOZ_CXX_SUPPORTS_WARNING(-W, type-limits, ac_cxx_has_wtype_limits)
MOZ_CXX_SUPPORTS_WARNING(-W, empty-body, ac_cxx_has_wempty_body)
MOZ_CXX_SUPPORTS_WARNING(-W, error=conversion-null, ac_cxx_has_werror_conversion_null)
# Turn off the following warnings that -Wall/-pedantic turn on:
# -Wno-ctor-dtor-privacy - ???
@ -8240,6 +8238,18 @@ if test -n "$MOZ_SERVICES_AITC"; then
AC_DEFINE(MOZ_SERVICES_AITC)
fi
dnl Build Common JS modules provided by services.
AC_SUBST(MOZ_SERVICES_COMMON)
if test -n "$MOZ_SERVICES_COMMON"; then
AC_DEFINE(MOZ_SERVICES_COMMON)
fi
dnl Build Services crypto component (used by Sync)
AC_SUBST(MOZ_SERVICES_CRYPTO)
if test -n "$MOZ_SERVICES_CRYPTO"; then
AC_DEFINE(MOZ_SERVICES_CRYPTO)
fi
dnl Build Notifications if required
AC_SUBST(MOZ_SERVICES_NOTIFICATIONS)
if test -n "$MOZ_SERVICES_NOTIFICATIONS"; then

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

@ -574,6 +574,10 @@ nsImageLoadingContent::BlockOnload(imgIRequest* aRequest)
return NS_OK;
}
NS_ASSERTION(!(mCurrentRequestFlags & REQUEST_BLOCKS_ONLOAD),
"Double BlockOnload!?");
mCurrentRequestFlags |= REQUEST_BLOCKS_ONLOAD;
nsIDocument* doc = GetOurCurrentDoc();
if (doc) {
doc->BlockOnload();
@ -589,6 +593,10 @@ nsImageLoadingContent::UnblockOnload(imgIRequest* aRequest)
return NS_OK;
}
NS_ASSERTION(mCurrentRequestFlags & REQUEST_BLOCKS_ONLOAD,
"Double UnblockOnload!?");
mCurrentRequestFlags &= ~REQUEST_BLOCKS_ONLOAD;
nsIDocument* doc = GetOurCurrentDoc();
if (doc) {
doc->UnblockOnload(false);
@ -1167,6 +1175,9 @@ nsImageLoadingContent::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
aDocument->AddImage(mCurrentRequest);
if (mPendingRequestFlags & REQUEST_SHOULD_BE_TRACKED)
aDocument->AddImage(mPendingRequest);
if (mCurrentRequestFlags & REQUEST_BLOCKS_ONLOAD)
aDocument->BlockOnload();
}
void
@ -1186,6 +1197,9 @@ nsImageLoadingContent::UnbindFromTree(bool aDeep, bool aNullParent)
doc->RemoveImage(mCurrentRequest);
if (mPendingRequestFlags & REQUEST_SHOULD_BE_TRACKED)
doc->RemoveImage(mPendingRequest);
if (mCurrentRequestFlags & REQUEST_BLOCKS_ONLOAD)
doc->UnblockOnload(false);
}
nsresult

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

@ -325,7 +325,9 @@ protected:
REQUEST_NEEDS_ANIMATION_RESET = 0x00000001U,
// Set if the request should be tracked. This is true if the request is
// not tracked iff this node is not in the document.
REQUEST_SHOULD_BE_TRACKED = 0x00000002U
REQUEST_SHOULD_BE_TRACKED = 0x00000002U,
// Set if the request is blocking onload.
REQUEST_BLOCKS_ONLOAD = 0x00000004U
};
// If the image was blocked or if there was an error loading, it's nice to

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

@ -11,7 +11,6 @@
#include "nsMappedAttributes.h"
#include "nsHTMLStyleSheet.h"
#include "nsRuleWalker.h"
#include "prmem.h"
#include "mozilla/HashFunctions.h"
using namespace mozilla;

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

@ -3826,9 +3826,11 @@ nsXMLHttpRequest::GetInterface(const nsIID & aIID, void **aResult)
// If authentication fails, XMLHttpRequest origin and
// the request URL are same origin, ...
/* Disabled - bug: 799540
if (mState & XML_HTTP_REQUEST_USE_XSITE_AC) {
showPrompt = false;
}
*/
// ... Authorization is not in the list of author request headers, ...
if (showPrompt) {

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

@ -1,5 +1,9 @@
function handleRequest(request, response)
{
response.setStatusLine(null, 401, "Unauthorized");
response.setHeader("WWW-Authenticate", "basic realm=\"restricted\"", false);
response.setHeader("Access-Control-Allow-Origin", "*", false);
response.setHeader("Access-Control-Allow-Credentials", "true", false);
}

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

@ -65,10 +65,26 @@ function xhr_auth_header_async() {
xhr.send(null);
}
function xhr_crossorigin_sync() {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'http://example.com/tests/content/base/test/bug282547.sjs', true);
xhr.withCredentials = true;
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
ok(xhr.status == 401, "Status 401");
runTests();
}
}
xhr.send(null);
}
var tests = [ xhr_userpass_sync,
xhr_userpass_async,
xhr_auth_header_sync,
xhr_auth_header_async ];
xhr_auth_header_async,
/* Disabled: bug799540 xhr_crossorigin_sync */ ];
function runTests() {
if (!tests.length) {
SimpleTest.finish();

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

@ -12,7 +12,7 @@ include $(DEPTH)/config/autoconf.mk
PARALLEL_DIRS = public src
TOOLS_DIRS += test
TEST_DIRS += test
include $(topsrcdir)/config/rules.mk

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

@ -6,7 +6,6 @@
#include <stdlib.h>
#include <stdarg.h>
#include "prmem.h"
#include "prprf.h"
#include "nsIServiceManager.h"

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

@ -61,6 +61,18 @@
#define MINVALUE_GL_MAX_RENDERBUFFER_SIZE 1024 // Different from the spec, which sets it to 1 on page 164
#define MINVALUE_GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 8 // Page 164
#define DECL_WEBGL_TYPEDEF(type) typedef type Web##type;
DECL_WEBGL_TYPEDEF(GLenum)
DECL_WEBGL_TYPEDEF(GLbitfield)
DECL_WEBGL_TYPEDEF(GLint)
DECL_WEBGL_TYPEDEF(GLsizei)
DECL_WEBGL_TYPEDEF(GLsizeiptr)
DECL_WEBGL_TYPEDEF(GLintptr)
DECL_WEBGL_TYPEDEF(GLuint)
DECL_WEBGL_TYPEDEF(GLfloat)
DECL_WEBGL_TYPEDEF(GLclampf)
typedef realGLboolean WebGLboolean;
class nsIPropertyBag;
namespace mozilla {

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

@ -146,7 +146,6 @@ public:
, mLastInvalidatedLeaf(0)
{
ResizeToParentSize();
Invalidate(0, mParent.ByteSize() - 1);
}
T GlobalMaximum() const {
@ -157,22 +156,22 @@ public:
// returns the index of the parent node; if treeIndex=1 (the root node),
// the return value is 0.
static size_t ParentNode(size_t treeIndex) {
MOZ_ASSERT(treeIndex);
MOZ_ASSERT(treeIndex > 1);
return treeIndex >> 1;
}
static bool IsRightNode(size_t treeIndex) {
MOZ_ASSERT(treeIndex);
MOZ_ASSERT(treeIndex > 1);
return treeIndex & 1;
}
static bool IsLeftNode(size_t treeIndex) {
MOZ_ASSERT(treeIndex);
MOZ_ASSERT(treeIndex > 1);
return !IsRightNode(treeIndex);
}
static size_t SiblingNode(size_t treeIndex) {
MOZ_ASSERT(treeIndex);
MOZ_ASSERT(treeIndex > 1);
return treeIndex ^ 1;
}
@ -187,12 +186,12 @@ public:
}
static size_t LeftNeighborNode(size_t treeIndex, size_t distance = 1) {
MOZ_ASSERT(treeIndex);
MOZ_ASSERT(treeIndex > 1);
return treeIndex - distance;
}
static size_t RightNeighborNode(size_t treeIndex, size_t distance = 1) {
MOZ_ASSERT(treeIndex);
MOZ_ASSERT(treeIndex > 1);
return treeIndex + distance;
}
@ -287,10 +286,18 @@ public:
size_t numberOfElements = mParent.ByteSize() / sizeof(T);
size_t requiredNumLeaves = (numberOfElements + sElementsPerLeaf - 1) / sElementsPerLeaf;
size_t oldNumLeaves = mNumLeaves;
mNumLeaves = NextPowerOfTwo(requiredNumLeaves);
Invalidate(0, mParent.ByteSize() - 1);
// see class comment for why we the tree storage size is 2 * mNumLeaves
return mTreeData.SetLength(2 * mNumLeaves);
if (!mTreeData.SetLength(2 * mNumLeaves)) {
return false;
}
if (mNumLeaves != oldNumLeaves) {
memset(mTreeData.Elements(), 0, mTreeData.Length() * sizeof(mTreeData[0]));
}
return true;
}
void Invalidate(size_t firstByte, size_t lastByte);
@ -380,23 +387,18 @@ void WebGLElementArrayCacheTree<T>::Update()
// Step #2: propagate the values up the tree. This is simply a matter of walking up
// the tree and setting each node to the max of its two children.
while (true) {
// fast-exit case where only one node is invalidated at the current level
if (firstTreeIndex == lastTreeIndex) {
size_t firstTreeIndexParent = ParentNode(firstTreeIndex);
while (firstTreeIndexParent) {
mTreeData[firstTreeIndexParent] = NS_MAX(mTreeData[firstTreeIndex], mTreeData[SiblingNode(firstTreeIndex)]);
firstTreeIndex = firstTreeIndexParent;
firstTreeIndexParent = ParentNode(firstTreeIndex);
}
break;
}
while (firstTreeIndex > 1) {
// move up 1 level
firstTreeIndex = ParentNode(firstTreeIndex);
lastTreeIndex = ParentNode(lastTreeIndex);
// fast-exit case where only one node is invalidated at the current level
if (firstTreeIndex == lastTreeIndex) {
mTreeData[firstTreeIndex] = NS_MAX(mTreeData[LeftChildNode(firstTreeIndex)], mTreeData[RightChildNode(firstTreeIndex)]);
continue;
}
// initialize local iteration variables: child and parent.
size_t child = LeftChildNode(firstTreeIndex);
size_t parent = firstTreeIndex;

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

@ -65,7 +65,7 @@ private:
void InvalidateTrees(size_t firstByte, size_t lastByte);
template<typename T>
friend class WebGLElementArrayCacheTree;
friend struct WebGLElementArrayCacheTree;
template<typename T>
friend struct TreeForType;

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

@ -8,7 +8,6 @@
#include "nsIDOMXULElement.h"
#include "prmem.h"
#include "prenv.h"
#include "nsIServiceManager.h"

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

@ -8,7 +8,6 @@
#include "nsIDOMXULElement.h"
#include "prmem.h"
#include "prenv.h"
#include "nsIServiceManager.h"

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

@ -10,7 +10,7 @@ VPATH = @srcdir@
relativesrcdir = @relativesrcdir@
DIRS += webgl crossorigin
TOOLS_DIRS += compiled
# TEST_DIRS += compiled
include $(DEPTH)/config/autoconf.mk
MOCHITEST_FILES = \

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

@ -31,14 +31,11 @@ void VerifyImplFunction(bool condition, const char* file, int line)
void MakeRandomVector(nsTArray<uint8_t>& a, size_t size) {
a.SetLength(size);
// only the most-significant bits of rand() are reasonably random
// 16 here is arbitrary, may fail on platforms where RAND_MAX is low,
// but guarded by an assertion.
enum { bitsToIgnore = 16 };
MOZ_STATIC_ASSERT((unsigned int)(RAND_MAX) >> (8 + bitsToIgnore),
"Didn't expect RAND_MAX to be so low");
// only the most-significant bits of rand() are reasonably random.
// RAND_MAX can be as low as 0x7fff, and we need 8 bits for the result, so we can only
// ignore the 7 least significant bits.
for (size_t i = 0; i < size; i++)
a[i] = static_cast<uint8_t>((unsigned int)(rand()) >> bitsToIgnore);
a[i] = static_cast<uint8_t>((unsigned int)(rand()) >> 7);
}
template<typename T>

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше