Merge m-c to fx-team

This commit is contained in:
Victor Porof 2012-09-06 17:39:16 +03:00
commit 1c1269c679
634 changed files with 9239 additions and 7950 deletions

View File

@ -60,7 +60,7 @@ FocusManager::IsFocused(const Accessible* aAccessible) const
DocAccessible* doc =
GetAccService()->GetDocAccessible(focusedNode->OwnerDoc());
return aAccessible ==
(doc ? doc->GetAccessibleOrContainer(focusedNode) : nullptr);
(doc ? doc->GetAccessibleOrContainer(focusedNode) : nullptr);
}
}
return false;

View File

@ -2846,7 +2846,21 @@ Accessible::IsWidget() const
bool
Accessible::IsActiveWidget() const
{
return FocusMgr()->IsFocused(this);
if (FocusMgr()->HasDOMFocus(mContent))
return true;
// If text entry of combobox widget has a focus then the combobox widget is
// active.
if (mRoleMapEntry && mRoleMapEntry->Is(nsGkAtoms::combobox)) {
PRUint32 childCount = ChildCount();
for (PRUint32 idx = 0; idx < childCount; idx++) {
Accessible* child = mChildren.ElementAt(idx);
if (child->Role() == roles::ENTRY)
return FocusMgr()->HasDOMFocus(child->GetContent());
}
}
return false;
}
bool

View File

@ -1221,11 +1221,11 @@ DocAccessible::ARIAAttributeChanged(nsIContent* aContent, nsIAtom* aAttribute)
void
DocAccessible::ARIAActiveDescendantChanged(nsIContent* aElm)
{
if (FocusMgr()->HasDOMFocus(aElm)) {
Accessible* widget = GetAccessible(aElm);
if (widget && widget->IsActiveWidget()) {
nsAutoString id;
if (aElm->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_activedescendant, id)) {
nsIDocument* DOMDoc = aElm->OwnerDoc();
dom::Element* activeDescendantElm = DOMDoc->GetElementById(id);
dom::Element* activeDescendantElm = aElm->OwnerDoc()->GetElementById(id);
if (activeDescendantElm) {
Accessible* activeDescendant = GetAccessible(activeDescendantElm);
if (activeDescendant) {

View File

@ -70,6 +70,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=429547
gQueue.push(new synthFocus("container", new focusChecker("item1")));
gQueue.push(new changeARIAActiveDescendant("container", "item2"));
gQueue.push(new synthFocus("combobox_entry", new focusChecker("combobox_entry")));
gQueue.push(new changeARIAActiveDescendant("combobox", "combobox_option2"));
todo(false, "No focus for inserted element, bug 687011");
//gQueue.push(new insertItemNFocus("container", "item3"));
@ -87,6 +91,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=429547
title="Support aria-activedescendant usage in nsIAccesible::TakeFocus()">
Mozilla Bug 429547
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=761102"
title="Focus may be missed when ARIA active-descendant is changed on active composite widget">
Mozilla Bug 761102
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
@ -96,5 +105,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=429547
<div role="listitem" id="item1">item1</div>
<div role="listitem" id="item2">item2</div>
</div>
<div role="combobox" id="combobox">
<input id="combobox_entry">
<ul>
<li role="option" id="combobox_option1">option1</li>
<li role="option" id="combobox_option2">option2</li>
</ul>
</div>
</body>
</html>

View File

@ -44,9 +44,9 @@ pref("network.http.pipelining.ssl", true);
pref("network.http.proxy.pipelining", true);
pref("network.http.pipelining.maxrequests" , 6);
pref("network.http.keep-alive.timeout", 600);
pref("network.http.max-connections", 6);
pref("network.http.max-persistent-connections-per-server", 4);
pref("network.http.max-persistent-connections-per-proxy", 4);
pref("network.http.max-connections", 20);
pref("network.http.max-persistent-connections-per-server", 6);
pref("network.http.max-persistent-connections-per-proxy", 20);
// See bug 545869 for details on why these are set the way they are
pref("network.buffer.cache.count", 24);
@ -507,7 +507,7 @@ pref("dom.ipc.processPriorityManager.enabled", true);
pref("dom.ipc.processPriorityManager.gracePeriodMS", 1000);
pref("hal.processPriorityManager.gonk.masterOomAdjust", 0);
pref("hal.processPriorityManager.gonk.foregroundOomAdjust", 1);
pref("hal.processPriorityManager.gonk.backgroundOomAdjust", 2);
pref("hal.processPriorityManager.gonk.backgroundOomAdjust", 6);
pref("hal.processPriorityManager.gonk.masterNice", -1);
pref("hal.processPriorityManager.gonk.foregroundNice", 0);
pref("hal.processPriorityManager.gonk.backgroundNice", 10);

View File

@ -118,13 +118,28 @@ let FormAssistant = {
case "Forms:Select:Choice":
let options = target.options;
let valueChanged = false;
if ("index" in json) {
options.item(json.index).selected = true;
if (options.selectedIndex != json.index) {
options.selectedIndex = json.index;
valueChanged = true;
}
} else if ("indexes" in json) {
for (let i = 0; i < options.length; i++) {
options.item(i).selected = (json.indexes.indexOf(i) != -1);
let newValue = (json.indexes.indexOf(i) != -1);
if (options.item(i).selected != newValue) {
options.item(i).selected = newValue;
valueChanged = true;
}
}
}
// only fire onchange event if any selected option is changed
if (valueChanged) {
let event = content.document.createEvent('HTMLEvents');
event.initEvent('change', true, true);
target.dispatchEvent(event);
}
break;
}
},

View File

@ -72,7 +72,7 @@ window.addEventListener('load', function() {
}
let setReq =
navigator.mozSettings.getLock().set({'lockscreen.enabled': false});
navigator.mozSettings.createLock().set({'lockscreen.enabled': false});
setReq.onsuccess = function() {
// give the event loop another turn to disable the lock screen
window.setTimeout(function() {

View File

@ -35,7 +35,7 @@ var SettingsListener = {
throw new Error('Callback is not a function');
}
var req = settings.getLock().get(name);
var req = settings.createLock().get(name);
req.addEventListener('success', (function onsuccess() {
callback(typeof(req.result[name]) != 'undefined' ?
req.result[name] : defaultValue);

View File

@ -509,6 +509,9 @@ var CustomEventManager = {
case 'select-choicechange':
FormsHelper.handleEvent(detail);
break;
case 'system-message-listener-ready':
Services.obs.notifyObservers(null, 'system-message-listener-ready', null);
break;
}
}
}

View File

@ -0,0 +1,7 @@
# 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/.
# This file is included at the top of all b2g mozconfigs
. "$topsrcdir/build/mozconfig.common"

View File

@ -0,0 +1,7 @@
# 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/.
# This file is included at the bottom of all b2g mozconfigs
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -1,3 +1,5 @@
. "$topsrcdir/b2g/config/mozconfigs/common"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-b2g
mk_add_options MOZ_MAKE_FLAGS="-j8"
@ -15,3 +17,5 @@ ENABLE_MARIONETTE=1
# Enable dump() from JS.
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
. "$topsrcdir/b2g/config/mozconfigs/common.override"

View File

@ -1,3 +1,5 @@
. "$topsrcdir/b2g/config/mozconfigs/common"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-b2g
mk_add_options MOZ_MAKE_FLAGS="-j8"
@ -15,3 +17,5 @@ ENABLE_MARIONETTE=1
# Enable dump() from JS.
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
. "$topsrcdir/b2g/config/mozconfigs/common.override"

View File

@ -18,3 +18,5 @@ ENABLE_MARIONETTE=1
# Enable dump() from JS.
export CXXFLAGS="-DMOZ_ENABLE_JS_DUMP -include $topsrcdir/gonk-toolchain/gonk-misc/Unicode.h -include $topsrcdir/gonk-toolchain/system/vold/ResponseCode.h"
. "$topsrcdir/b2g/config/mozconfigs/common.override"

View File

@ -1,3 +1,5 @@
. "$topsrcdir/b2g/config/mozconfigs/common"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-b2g
mk_add_options MOZ_MAKE_FLAGS="-j8"
@ -18,3 +20,5 @@ ENABLE_MARIONETTE=1
# Enable dump() from JS.
export CXXFLAGS="-DMOZ_ENABLE_JS_DUMP -include $topsrcdir/gonk-toolchain/gonk-misc/Unicode.h -include $topsrcdir/gonk-toolchain/system/vold/ResponseCode.h"
. "$topsrcdir/b2g/config/mozconfigs/common.override"

View File

@ -1,3 +1,5 @@
. "$topsrcdir/b2g/config/mozconfigs/common"
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging
ac_add_options --enable-codesighs
@ -36,3 +38,5 @@ ac_add_options --enable-application=b2g
ENABLE_MARIONETTE=1
ac_add_options --disable-elf-hack
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
. "$topsrcdir/b2g/config/mozconfigs/common.override"

View File

@ -38,3 +38,5 @@ ac_add_options --enable-application=b2g
ENABLE_MARIONETTE=1
ac_add_options --disable-elf-hack
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
. "$topsrcdir/b2g/config/mozconfigs/common.override"

View File

@ -1,4 +1,4 @@
. $topsrcdir/build/macosx/common
. $topsrcdir/build/macosx/mozconfig.common
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging
@ -26,3 +26,5 @@ ac_add_options --with-ccache
ENABLE_MARIONETTE=1
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
. "$topsrcdir/b2g/config/mozconfigs/common.override"

View File

@ -1,3 +1,5 @@
. "$topsrcdir/b2g/config/mozconfigs/common"
# for pgo
mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py'
@ -27,3 +29,5 @@ ac_add_options --enable-application=b2g
ENABLE_MARIONETTE=1
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
. "$topsrcdir/b2g/config/mozconfigs/common.override"

View File

@ -126,7 +126,7 @@ ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
libs::
cp -p $(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, firefox.js)
GARBAGE += $(addprefix $(FINAL_TARGET)/defaults/pref/, firefox.js)
endif
@ -134,24 +134,24 @@ endif #} LIBXUL_SDK
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
libs::
$(INSTALL) $(IFLAGS1) $(DIST)/branding/mozicon128.png $(DIST)/bin/icons
$(INSTALL) $(IFLAGS1) $(DIST)/branding/default16.png $(DIST)/bin/chrome/icons/default
$(INSTALL) $(IFLAGS1) $(DIST)/branding/default32.png $(DIST)/bin/chrome/icons/default
$(INSTALL) $(IFLAGS1) $(DIST)/branding/default48.png $(DIST)/bin/chrome/icons/default
$(INSTALL) $(IFLAGS1) $(DIST)/branding/mozicon128.png $(FINAL_TARGET)/icons
$(INSTALL) $(IFLAGS1) $(DIST)/branding/default16.png $(FINAL_TARGET)/chrome/icons/default
$(INSTALL) $(IFLAGS1) $(DIST)/branding/default32.png $(FINAL_TARGET)/chrome/icons/default
$(INSTALL) $(IFLAGS1) $(DIST)/branding/default48.png $(FINAL_TARGET)/chrome/icons/default
endif
libs:: $(srcdir)/profile/prefs.js
$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/defaults/profile
$(INSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/defaults/profile
ifndef LIBXUL_SDK
# channel-prefs.js is handled separate from other prefs due to bug 756325
libs:: $(srcdir)/profile/channel-prefs.js
$(NSINSTALL) -D $(DIST)/bin/defaults/pref
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(ACDEFINES) $^ > $(DIST)/bin/defaults/pref/channel-prefs.js
$(NSINSTALL) -D $(FINAL_TARGET)/defaults/pref
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(ACDEFINES) $^ > $(FINAL_TARGET)/defaults/pref/channel-prefs.js
endif
libs:: $(srcdir)/blocklist.xml
$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin
$(INSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))

View File

@ -8,7 +8,7 @@ topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
DISTROEXT = $(call core_abspath,$(DIST))/bin/distribution/extensions
DISTROEXT = $(call core_abspath,$(FINAL_TARGET))/distribution/extensions
include $(DEPTH)/config/autoconf.mk

View File

@ -17,9 +17,6 @@ FILES := \
libs::
$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(srcdir)/install.rdf.in > install.rdf
$(INSTALL) $(FILES) $(DIST)/bin/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
$(INSTALL) $(FILES) $(FINAL_TARGET)/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
install::
$(SYSINSTALL) $(IFLAGS1) $(FILES) $(DESTDIR)$(mozappdir)/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
GARBAGE += $(FILES)

View File

@ -146,14 +146,14 @@ XPCOMUtils.defineLazyModuleGetter(this, "PageThumbs",
#ifdef MOZ_SAFE_BROWSING
XPCOMUtils.defineLazyGetter(this, "SafeBrowsing", function() {
let tmp = {};
Cu.import("resource://gre/modules/SafeBrowsing.jsm", tmp);
Cu.import("resource:///modules/SafeBrowsing.jsm", tmp);
return tmp.SafeBrowsing;
});
#endif
XPCOMUtils.defineLazyGetter(this, "gBrowserNewTabPreloader", function () {
let tmp = {};
Cu.import("resource://gre/modules/BrowserNewTabPreloader.jsm", tmp);
Cu.import("resource:///modules/BrowserNewTabPreloader.jsm", tmp);
return new tmp.BrowserNewTabPreloader();
});

View File

@ -399,10 +399,6 @@
</hbox>
</panel>
<tooltip id="urlTooltip">
<label crop="center" flex="1" class="tooltip-label"/>
</tooltip>
<panel id="ctrlTab-panel" class="KUI-panel" hidden="true" norestorefocus="true" level="top">
<hbox>
<button class="ctrlTab-preview" flex="1"/>

View File

@ -53,3 +53,13 @@ tabpanels {
.tabbrowser-tabs:not(:hover) > .tabbrowser-arrowscrollbox > .closing-tabs-spacer {
transition: width .15s ease-out;
}
/**
* Optimization for tabs that are restored lazily. We can save a good amount of
* memory that to-be-restored tabs would otherwise consume simply by setting
* their browsers to 'display: none' as that will prevent them from having to
* create a presentation and the like.
*/
browser[pending] {
display: none;
}

View File

@ -58,8 +58,6 @@
this._formattingEnabled = this._prefs.getBoolPref("formatting.enabled");
this._mayTrimURLs = this._prefs.getBoolPref("trimURLs");
this._urlTooltip = document.getElementById("urlTooltip");
this.inputField.controllers.insertControllerAt(0, this._copyCutController);
this.inputField.addEventListener("mousedown", this, false);
this.inputField.addEventListener("mousemove", this, false);
@ -410,26 +408,13 @@
<body><![CDATA[
if (this.focused || !this._contentIsCropped)
return;
if (this._tooltipTimer)
clearTimeout(this._tooltipTimer);
this._tooltipTimer = setTimeout(function (self) {
self._tooltipTimer = 0;
var label = self._urlTooltip.firstChild;
label.value = self.value;
var bO = self.boxObject;
self._urlTooltip.maxWidth = bO.width;
self._urlTooltip.showPopup(self, bO.screenX, bO.screenY + bO.height, "tooltip");
}, 700, this);
this.inputField.setAttribute("tooltiptext", this.value);
]]></body>
</method>
<method name="_hideURLTooltip">
<body><![CDATA[
if (this._tooltipTimer) {
clearTimeout(this._tooltipTimer);
this._tooltipTimer = 0;
}
this._urlTooltip.hidePopup();
this.inputField.removeAttribute("tooltiptext");
]]></body>
</method>

View File

@ -346,7 +346,7 @@ nsFeedSniffer::AppendSegmentToString(nsIInputStream* inputStream,
NS_IMETHODIMP
nsFeedSniffer::OnDataAvailable(nsIRequest* request, nsISupports* context,
nsIInputStream* stream, uint32_t offset,
nsIInputStream* stream, uint64_t offset,
uint32_t count)
{
uint32_t read;

View File

@ -3,7 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = ../../..
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

View File

@ -3,11 +3,11 @@
# 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 = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = browser/components/safebrowsing/content/test
relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk

View File

@ -2987,6 +2987,7 @@ let SessionStoreInternal = {
// a tab gets closed before it's been properly restored
browser.__SS_data = tabData;
browser.__SS_restoreState = TAB_STATE_NEEDS_RESTORE;
browser.setAttribute("pending", "true");
tab.setAttribute("pending", "true");
// Make sure that set/getTabValue will set/read the correct data by
@ -3171,6 +3172,7 @@ let SessionStoreInternal = {
// Set this tab's state to restoring
browser.__SS_restoreState = TAB_STATE_RESTORING;
browser.removeAttribute("pending");
aTab.removeAttribute("pending");
// Remove the history listener, since we no longer need it once we start restoring
@ -4335,6 +4337,9 @@ let SessionStoreInternal = {
// The browser is no longer in any sort of restoring state.
delete browser.__SS_restoreState;
aTab.removeAttribute("pending");
browser.removeAttribute("pending");
// We want to decrement window.__SS_tabsToRestore here so that we always
// decrement it AFTER a tab is done restoring or when a tab gets "reset".
window.__SS_tabsToRestore--;

View File

@ -0,0 +1,7 @@
# 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/.
# This file is included by all browser mozconfigs
. "$topsrcdir/build/mozconfig.common"

View File

@ -22,3 +22,5 @@ ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -16,3 +16,5 @@ mk_add_options MOZ_MAKE_FLAGS="-j4"
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -5,3 +5,5 @@ ac_add_options --enable-update-packaging
. $topsrcdir/build/unix/mozconfig.linux
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -36,3 +36,5 @@ ac_add_options --with-ccache=/usr/bin/ccache
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -18,3 +18,5 @@ mk_add_options MOZ_MAKE_FLAGS="-j4"
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -26,3 +26,5 @@ ac_add_options --disable-crashreporter
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -24,3 +24,5 @@ mk_add_options MOZ_MAKE_FLAGS="-j4"
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -29,3 +29,5 @@ ac_add_options --with-ccache=/usr/bin/ccache
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -22,3 +22,5 @@ ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -16,3 +16,5 @@ mk_add_options MOZ_MAKE_FLAGS="-j4"
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -5,3 +5,5 @@ ac_add_options --enable-update-packaging
. $topsrcdir/build/unix/mozconfig.linux
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -36,3 +36,5 @@ ac_add_options --with-ccache=/usr/bin/ccache
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -18,3 +18,5 @@ mk_add_options MOZ_MAKE_FLAGS="-j4"
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -24,3 +24,5 @@ mk_add_options MOZ_MAKE_FLAGS="-j4"
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -29,3 +29,5 @@ ac_add_options --with-ccache=/usr/bin/ccache
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -26,3 +26,5 @@ ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -20,3 +20,5 @@ mk_add_options MOZ_MAKE_FLAGS="-j4"
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -24,3 +24,5 @@ export MOZ_PKG_SPECIAL="shark"
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
ac_add_options --with-ccache
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -1,4 +1,5 @@
. $topsrcdir/build/macosx/mozconfig.leopard
ac_add_options --enable-debug
ac_add_options --enable-trace-malloc
ac_add_options --enable-signmar
@ -14,3 +15,5 @@ ac_add_options --with-macbundlename-prefix=Firefox
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -1,4 +1,4 @@
. $topsrcdir/build/macosx/common
. $topsrcdir/build/macosx/mozconfig.common
ac_add_options --enable-debug
ac_add_options --enable-trace-malloc
@ -19,3 +19,5 @@ ac_add_options --enable-warnings-as-errors
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -12,3 +12,5 @@ mk_add_options MOZ_MAKE_FLAGS="-j12"
export MOZ_PACKAGE_JSSHELL=1
ac_add_options --with-macbundlename-prefix=Firefox
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -1,5 +1,9 @@
. "$topsrcdir/browser/config/mozconfigs/common"
ac_add_options --with-l10n-base=../../l10n-central
ac_add_options --enable-official-branding
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging
ac_add_options --with-ccache
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -1,3 +1,5 @@
. "$topsrcdir/browser/config/mozconfigs/common"
ac_add_options --enable-debug
ac_add_options --enable-trace-malloc
ac_add_options --enable-signmar
@ -20,3 +22,5 @@ fi
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -1,3 +1,5 @@
. "$topsrcdir/browser/config/mozconfigs/common"
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging
ac_add_options --enable-official-branding
@ -8,3 +10,5 @@ if test "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD6
else
. $topsrcdir/build/win32/mozconfig.vs2010
fi
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -1,3 +1,5 @@
. "$topsrcdir/browser/config/mozconfigs/common"
# for pgo
mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py'
@ -29,3 +31,5 @@ fi
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -1,3 +1,5 @@
. "$topsrcdir/browser/config/mozconfigs/common"
# for pgo
mk_add_options MOZ_PGO=1
mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py'
@ -26,3 +28,5 @@ fi
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -15,3 +15,5 @@ mk_add_options MOZ_MAKE_FLAGS=-j1
export MOZ_PACKAGE_JSSHELL=1
. $topsrcdir/build/win64/mozconfig.vs2010
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -24,3 +24,5 @@ mk_add_options MOZ_MAKE_FLAGS=-j1
export MOZ_PACKAGE_JSSHELL=1
. $topsrcdir/build/win64/mozconfig.vs2010
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -18,7 +18,7 @@ XPCOMUtils.defineLazyGetter(this, "prefBranch", function() {
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
"resource://gre/modules/NetUtil.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource:///modules/devtools/Console.jsm");
"resource://gre/modules/devtools/Console.jsm");
const PREF_DIR = "devtools.commands.dir";

View File

@ -10,7 +10,7 @@ Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource:///modules/devtools/Console.jsm");
"resource://gre/modules/devtools/Console.jsm");
// We should really be using nsICookieManager so we can read more than just the
// key/value of cookies. The difficulty is filtering the cookies that are

View File

@ -7,7 +7,7 @@ topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
CHROMEDIR = $(call core_abspath,$(DIST))/bin/chrome
CHROMEDIR = $(call core_abspath,$(FINAL_TARGET))/chrome
include $(DEPTH)/config/autoconf.mk
@ -23,13 +23,13 @@ exclude_files = \
icon64.png \
$(NULL)
$(DIST)/bin/chrome/pdfjs.manifest: $(GLOBAL_DEPS)
$(FINAL_TARGET)/chrome/pdfjs.manifest: $(GLOBAL_DEPS)
printf "manifest pdfjs/chrome.manifest" > $@
libs:: $(DIST)/bin/chrome/pdfjs.manifest
libs:: $(FINAL_TARGET)/chrome/pdfjs.manifest
$(PYTHON) $(topsrcdir)/config/nsinstall.py \
$(srcdir)/pdfjs \
$(foreach exclude,$(exclude_files), -X $(srcdir)/pdfjs/$(exclude)) \
$(DIST)/bin/chrome
$(FINAL_TARGET)/chrome
$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py \
$(DIST)/bin/chrome.manifest "manifest chrome/pdfjs.manifest"
$(FINAL_TARGET)/chrome.manifest "manifest chrome/pdfjs.manifest"

View File

@ -198,17 +198,19 @@ installers-%: clobber-% langpack-% repackage-win32-installer-% repackage-zip-%
@echo "repackaging done"
ifdef MOZ_UPDATER
# Note that we want updater.ini to be in the top directory, not the browser/
# subdirectory, because that's where the updater is installed and runs.
libs:: $(call MERGE_FILE,updater/updater.ini)
ifeq ($(OS_ARCH),WINNT)
cat $< $(srcdir)/../installer/windows/nsis/updater_append.ini | \
sed -e "s/^InfoText=/Info=/" -e "s/^TitleText=/Title=/" | \
sed -e "s/%MOZ_APP_DISPLAYNAME%/$(MOZ_APP_DISPLAYNAME)/" > \
$(FINAL_TARGET)/updater.ini
$(DIST)/bin/updater.ini
else
cat $< | \
sed -e "s/^InfoText=/Info=/" -e "s/^TitleText=/Title=/" | \
sed -e "s/%MOZ_APP_DISPLAYNAME%/$(MOZ_APP_DISPLAYNAME)/" > \
$(FINAL_TARGET)/updater.ini
$(DIST)/bin/updater.ini
endif
endif

View File

@ -1,3 +1,9 @@
# 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/.
. "$topsrcdir/build/mozconfig.common"
if [ -d "$topsrcdir/clang" ]; then
# mozilla-central based build
export CC=$topsrcdir/clang/bin/clang

View File

@ -1,6 +1,6 @@
. $topsrcdir/build/macosx/common
. $topsrcdir/build/macosx/mozconfig.common
# Mac builds don't nomally have to be handled as cross
# Mac builds don't normally have to be handled as cross
# compilation, but some of the libraries on the bots
# (IDL for example) are built only for one arch.

View File

@ -12,7 +12,7 @@ ac_add_app_options x86_64 --target=x86_64-apple-darwin10
ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.6.sdk
. $topsrcdir/build/macosx/common
. $topsrcdir/build/macosx/mozconfig.common
# $MOZ_BUILD_APP is only defined when sourced by configure. That's not a
# problem, because the variables it affects only need to be set for

11
build/mozconfig.common Normal file
View File

@ -0,0 +1,11 @@
# 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/.
# Common mozconfig for all users
#
# Add options to this file that will be inherited by all in-tree mozconfigs.
# This is useful for eg try builds with nondefault options that apply to all
# architectures, though note that if you want to override options set in
# another mozconfig file, you'll need to use mozconfig.common.override instead
# of this file.

View File

@ -0,0 +1,11 @@
# 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/.
# Common mozconfig for all users
#
# Add options to this file that will be inherited by all in-tree mozconfigs.
# This file is included at the *end* of the mozconfigs, and so may be used
# to override anything done previously.
#
# The common expected usage is for try builds with nondefault options.

View File

@ -771,9 +771,8 @@ class ShellFunction(Function):
cline = self._arguments[0].resolvestr(makefile, variables, setting)
log.debug("%s: running shell command '%s'" % (self.loc, cline))
if msys:
cline = [shell, "-c", cline]
p = subprocess.Popen(cline, env=makefile.env, shell=not msys,
cline = [shell, "-c", cline]
p = subprocess.Popen(cline, env=makefile.env, shell=False,
stdout=subprocess.PIPE, cwd=makefile.workdir)
stdout, stderr = p.communicate()

View File

@ -88,8 +88,8 @@ def call(cline, env, cwd, loc, cb, context, echo, justprint=False):
if msys:
if len(cline) > 3 and cline[1] == ':' and cline[2] == '/':
cline = '/' + cline[0] + cline[2:]
cline = [shell, "-c", cline]
context.call(cline, shell=not msys, env=env, cwd=cwd, cb=cb, echo=echo,
cline = [shell, "-c", cline]
context.call(cline, shell=False, env=env, cwd=cwd, cb=cb, echo=echo,
justprint=justprint)
return

View File

@ -1,2 +1,4 @@
. "$topsrcdir/build/mozconfig.common"
CC=/tools/gcc-4.5-0moz3/bin/gcc
CXX=/tools/gcc-4.5-0moz3/bin/g++

View File

@ -20,15 +20,13 @@ VISIBILITY_FLAGS =
STDCXX_COMPAT =
ifneq (WINNT,$(HOST_OS_ARCH))
HOST_PROGRAM = nsinstall$(HOST_BIN_SUFFIX)
HOST_PROGRAM = nsinstall_real$(HOST_BIN_SUFFIX)
HOST_CSRCS = nsinstall.c pathsub.c
endif
TARGETS = $(HOST_PROGRAM) $(SIMPLE_PROGRAMS)
ifndef CROSS_COMPILE
ifdef USE_ELF_DYNSTR_GC
TARGETS += elf-dynstr-gc
export:: elf-dynstr-gc
# Compiling the above will create dependency files.
NEED_MDDEPDIR = 1
endif
@ -49,6 +47,26 @@ include $(topsrcdir)/config/config.mk
# Do not install util programs
NO_INSTALL=1
ifneq (WINNT,$(HOST_OS_ARCH))
# Ensure nsinstall is atomically created
nsinstall$(HOST_BIN_SUFFIX): $(HOST_PROGRAM)
cp $^ $@.tmp
mv $@.tmp $@
NSINSTALL_FILES := nsinstall$(HOST_BIN_SUFFIX)
NSINSTALL_DEST := $(DIST)/bin
NSINSTALL_TARGET := export
INSTALL_TARGETS += NSINSTALL
endif
HEADERS_FILES = \
$(DEPTH)/mozilla-config.h \
$(srcdir)/nsStaticComponents.h \
$(NULL)
HEADERS_DEST := $(DIST)/include
HEADERS_TARGET := export
INSTALL_TARGETS += HEADERS
include $(topsrcdir)/config/rules.mk
HOST_CFLAGS += -DUNICODE -D_UNICODE
@ -57,17 +75,8 @@ ifeq ($(OS_CONFIG),SunOS4.1)
NSPR_CFLAGS += -I$(srcdir)/../nsprpub/pr/include/md
endif
HEADERS = \
$(DEPTH)/mozilla-config.h \
$(srcdir)/nsStaticComponents.h \
$(NULL)
export:: $(TARGETS) $(HEADERS)
$(INSTALL) $(IFLAGS1) $(HEADERS) $(DIST)/include
export::
-$(RM) $(FINAL_LINK_COMPS) $(FINAL_LINK_LIBS) $(FINAL_LINK_COMP_NAMES)
ifdef HOST_PROGRAM
$(INSTALL) $(HOST_PROGRAM) $(DIST)/bin
endif
# Generate a new buildid every time we "export" in config... that's only
# supposed to be once per-build!

View File

@ -27,7 +27,7 @@ $(PARALLEL_DIRS_export): %_export: %/Makefile
+@$(call SUBMAKE,export,$*)
endif
export:: $(SUBMAKEFILES) $(MAKE_DIRS) $(if $(XPIDLSRCS),$(IDL_DIR))
export:: $(SUBMAKEFILES) $(MAKE_DIRS)
$(LOOP_OVER_DIRS)
$(LOOP_OVER_TOOL_DIRS)

View File

@ -20,13 +20,11 @@ check-arglist = $(dir-ts)/arglist.ts
check-autotargets = $(dir-ts)/autotargets_mk.ts
check-export-targets = $(dir-ts)/export-targets-mk.ts
check-XinY = $(dir-ts)/check_XinY_mk.ts
check-xpidl = $(dir-ts)/xpidl-mk.ts
check-tests =\
$(check-arglist) \
$(check-autotargets) \
$(check-export-targets) \
$(check-XinY) \
$(check-xpidl) \
$(NULL)
@ -37,7 +35,6 @@ all::
clean:
$(RM) $(check-tests)
@$(MAKE) --no-print-directory -f $(srcdir)/check-xpidl.mk clean-xpidl topsrcdir=$(topsrcdir)
###########################################################################
## Logic processed at compile time so be selective about when to test
@ -124,23 +121,4 @@ $(check-export-targets): $(check-export-targets-preqs)
@$(TOUCH) $@
# </CHECK: export-targets.mk>
###########################################################################
##{ <CHECK: xpidl.mk>
check-xpidl-preqs=\
$(call mkdir_deps,$(dir-ts)) \
$(topsrcdir)/config/config.mk \
$(topsrcdir)/config/makefiles/makeutils.mk \
$(topsrcdir)/config/makefiles/xpidl.mk \
$(srcdir)/check-xpidl.mk \
$(NULL)
check-xpidl-args =\
"topsrcdir=$(topsrcdir)" \
"srcdir=$(srcdir)" \
$(NULL)
$(check-xpidl): $(check-xpidl-preqs)
$(MAKE) -f $(srcdir)/check-xpidl.mk check-xpidl $(check-xpidl-args)
@$(TOUCH) $@
#} </check-xpidl.mk>
endif #} findstring MAKECMDGOAL

View File

@ -1,43 +0,0 @@
# -*- makefile -*-
#
# 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/.
ifdef VERBOSE
$(warning loading test)
endif
# Limit scope, we only need install_cmd= for testing
INCLUDED_AUTOCONF_MK = 1
include $(topsrcdir)/config/config.mk
USE_AUTOTARGETS_MK = 1
include $(topsrcdir)/config/makefiles/makeutils.mk
basedir = blah
DIST = $(basedir)/dist
DI = $(DIST)/include
IDL_DIR = $(basedir)/idl
INSTALL := cp
XPIDLSRCS = $(srcdir)/check-xpidl.mk
include $(topsrcdir)/config/makefiles/xpidl.mk
$(call requiredfunction,topsrcdir)
$(call requiredfunction,XPIDL_GEN_DIR)
HIDE=@
check-xpidl: xpidl-install-src xpidl-install-headers
$(HIDE)test -d $(DIST) || exit 90
$(HIDE)test -f $(DI)/check-xpidl.mk || exit 91
$(HIDE)test -f $(IDL_DIR)/check-xpidl.mk || exit 92
# Declare targets to avoid including rules.mk
$(DI) $(IDL_DIR):
mkdir -p $@
clean-xpidl:
$(RM) -r $(basedir)

View File

@ -1,60 +0,0 @@
# -*- makefile -*-
# vim:set ts=8 sw=8 sts=8 noet:
#
# 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/.
#
# Always declared, general use by:
# js/xpconnect/tests/idl/Makefile.in:libs
# toolkit/crashreporter/test/Makefile.in
XPIDL_GEN_DIR ?= _xpidlgen
GARBAGE_DIRS += $(XPIDL_GEN_DIR)
###########################################################################
## Conditional logic
###########################################################################
ifndef INCLUDED_XPIDL_MK #{
INCLUDED_XPIDL_MK = 1
ifneq (,$(XPIDLSRCS)) #{
ifndef NO_DIST_INSTALL #{
_xpidl-todo_ += xpidl-install-src
_xpidl-todo_ += xpidl-install-headers
endif #}
endif #} XPIDLSRCS
export:: $(_xpidl-todo_)
$(call requiredfunction,mkdir_deps)
endif #} INCLUDED_XPIDL_MK
###########################################################################
## processing targets
###########################################################################
ifdef _xpidl-todo_ #{
$(call requiredfunction,install_cmd)
## Logic batch #1
xpidl-install-src-preqs=\
$(XPIDLSRCS) \
$(call mkdir_deps,$(IDL_DIR)) \
$(NULL)
xpidl-install-src: $(xpidl-install-src-preqs)
$(call install_cmd,$(IFLAGS1) $(foreach val,$^,$(call mkdir_stem,$(val))))
xpidl-install-headers-preqs =\
$(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(XPIDLSRCS)) \
$(call mkdir_deps,$(DIST)/include) \
$(NULL)
xpidl-install-headers: $(xpidl-install-headers-preqs)
$(call install_cmd,$(IFLAGS1) $(foreach val,$^,$(call mkdir_stem,$(val))))
endif #} _xpidl-todo_

View File

@ -26,10 +26,12 @@ USE_AUTOTARGETS_MK = 1
include $(topsrcdir)/config/makefiles/makeutils.mk
ifdef SDK_XPIDLSRCS
XPIDLSRCS += $(SDK_XPIDLSRCS)
_EXTRA_XPIDLSRCS := $(filter-out $(XPIDLSRCS),$(SDK_XPIDLSRCS))
XPIDLSRCS += $(_EXTRA_XPIDLSRCS)
endif
ifdef SDK_HEADERS
EXPORTS += $(SDK_HEADERS)
_EXTRA_EXPORTS := $(filter-out $(EXPORTS),$(SDK_HEADERS))
EXPORTS += $(_EXTRA_EXPORTS)
endif
REPORT_BUILD = $(info $(notdir $<))
@ -988,13 +990,7 @@ $(CCOBJS): %.$(OBJ_SUFFIX): %.cc
$(CPPOBJS): %.$(OBJ_SUFFIX): %.cpp
$(REPORT_BUILD)
@$(MAKE_DEPS_AUTO_CXX)
ifdef STRICT_CPLUSPLUS_SUFFIX
echo "#line 1 \"$*.cpp\"" | cat - $*.cpp > t_$*.cc
$(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) t_$*.cc
$(RM) t_$*.cc
else
$(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $(_VPATH_SRCS)
endif #STRICT_CPLUSPLUS_SUFFIX
$(CMMOBJS): $(OBJ_PREFIX)%.$(OBJ_SUFFIX): %.mm
$(REPORT_BUILD)
@ -1159,15 +1155,19 @@ endif
ifndef NO_DIST_INSTALL
ifneq (,$(EXPORTS))
export:: $(EXPORTS)
$(call install_cmd,$(IFLAGS1) $^ $(DIST)/include)
EXPORTS_FILES := $(EXPORTS)
EXPORTS_DEST := $(DIST)/include
EXPORTS_TARGET := export
INSTALL_TARGETS += EXPORTS
endif
endif # NO_DIST_INSTALL
define EXPORT_NAMESPACE_RULE
ifndef NO_DIST_INSTALL
export:: $(EXPORTS_$(namespace))
$(call install_cmd,$(IFLAGS1) $$^ $(DIST)/include/$(namespace))
EXPORTS_$(namespace)_FILES := $$(EXPORTS_$(namespace))
EXPORTS_$(namespace)_DEST := $$(DIST)/include/$(namespace)
EXPORTS_$(namespace)_TARGET := export
INSTALL_TARGETS += EXPORTS_$(namespace)
endif # NO_DIST_INSTALL
endef
@ -1203,14 +1203,12 @@ endif
# Copy each element of AUTOCFG_JS_EXPORTS to $(FINAL_TARGET)/defaults/autoconfig
ifneq ($(AUTOCFG_JS_EXPORTS),)
$(FINAL_TARGET)/defaults/autoconfig::
$(NSINSTALL) -D $@
ifndef NO_DIST_INSTALL
export:: $(AUTOCFG_JS_EXPORTS) $(FINAL_TARGET)/defaults/autoconfig
$(call install_cmd,$(IFLAGS1) $^)
AUTOCFG_JS_EXPORTS_FILES := $(AUTOCFG_JS_EXPORTS)
AUTOCFG_JS_EXPORTS_DEST := $(FINAL_TARGET)/defaults/autoconfig
AUTOCFG_JS_EXPORTS_TARGET := export
INSTALL_TARGETS += AUTOCFG_JS_EXPORTS
endif
endif
################################################################################
@ -1271,9 +1269,11 @@ $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.xpt,$(
$(XPIDL_LINK) $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.xpt,$(XPIDLSRCS))
endif # XPIDL_MODULE.xpt != XPIDLSRCS
libs:: $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt
ifndef NO_DIST_INSTALL
$(call install_cmd,$(IFLAGS1) $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt $(FINAL_TARGET)/components)
XPIDL_MODULE_FILES := $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt
XPIDL_MODULE_DEST := $(FINAL_TARGET)/components
INSTALL_TARGETS += XPIDL_MODULE
ifndef NO_INTERFACES_MANIFEST
libs:: $(call mkdir_deps,$(FINAL_TARGET)/components)
@$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_TARGET)/components/interfaces.manifest "interfaces $(XPIDL_MODULE).xpt"
@ -1283,29 +1283,18 @@ endif
GARBAGE_DIRS += $(XPIDL_GEN_DIR)
endif #} XPIDLSRCS
ifndef INCLUDED_XPIDL_MK
include $(topsrcdir)/config/makefiles/xpidl.mk
endif
# General rules for exporting idl files.
$(IDL_DIR):
$(NSINSTALL) -D $@
export-idl:: $(SUBMAKEFILES) $(MAKE_DIRS)
ifneq ($(XPIDLSRCS),)
ifndef NO_DIST_INSTALL
export-idl:: $(XPIDLSRCS) $(IDL_DIR)
$(call install_cmd,$(IFLAGS1) $^)
XPIDL_HEADERS_FILES := $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(XPIDLSRCS))
XPIDL_HEADERS_DEST := $(DIST)/include
XPIDL_HEADERS_TARGET := export
INSTALL_TARGETS += XPIDL_HEADERS
XPIDLSRCS_FILES := $(XPIDLSRCS)
XPIDLSRCS_DEST := $(IDL_DIR)
XPIDLSRCS_TARGET := export
INSTALL_TARGETS += XPIDLSRCS
endif
endif
$(LOOP_OVER_PARALLEL_DIRS)
$(LOOP_OVER_DIRS)
$(LOOP_OVER_TOOL_DIRS)
endif #} XPIDLSRCS
################################################################################
# Copy each element of EXTRA_COMPONENTS to $(FINAL_TARGET)/components
@ -1320,7 +1309,9 @@ endif
ifdef EXTRA_COMPONENTS
libs:: $(EXTRA_COMPONENTS)
ifndef NO_DIST_INSTALL
$(call install_cmd,$(IFLAGS1) $^ $(FINAL_TARGET)/components)
EXTRA_COMPONENTS_FILES := $(EXTRA_COMPONENTS)
EXTRA_COMPONENTS_DEST := $(FINAL_TARGET)/components
INSTALL_TARGETS += EXTRA_COMPONENTS
endif
endif
@ -1344,11 +1335,11 @@ endif
JS_MODULES_PATH ?= $(FINAL_TARGET)/modules
ifdef EXTRA_JS_MODULES
libs:: $(EXTRA_JS_MODULES)
ifndef NO_DIST_INSTALL
$(call install_cmd,$(IFLAGS1) $^ $(JS_MODULES_PATH))
EXTRA_JS_MODULES_FILES := $(EXTRA_JS_MODULES)
EXTRA_JS_MODULES_DEST := $(JS_MODULES_PATH)
INSTALL_TARGETS += EXTRA_JS_MODULES
endif
endif
ifdef EXTRA_PP_JS_MODULES
@ -1370,9 +1361,10 @@ testmodulesdir = $(DEPTH)/_tests/modules/$(TESTING_JS_MODULE_DIR)
GENERATED_DIRS += $(testmodulesdir)
libs:: $(TESTING_JS_MODULES)
ifndef NO_DIST_INSTALL
$(call install_cmd,$(IFLAGS) $^ $(testmodulesdir))
TESTING_JS_MODULES_FILES := $(TESTING_JS_MODULES)
TESTING_JS_MODULES_DEST := $(testmodulesdir)
INSTALL_TARGETS += TESTING_JS_MODULES
endif
endif
@ -1381,25 +1373,19 @@ endif
# SDK
ifneq (,$(SDK_LIBRARY))
$(SDK_LIB_DIR)::
$(NSINSTALL) -D $@
ifndef NO_DIST_INSTALL
libs:: $(SDK_LIBRARY) $(SDK_LIB_DIR)
$(call install_cmd,$(IFLAGS2) $^)
SDK_LIBRARY_FILES := $(SDK_LIBRARY)
SDK_LIBRARY_DEST := $(SDK_LIB_DIR)
INSTALL_TARGETS += SDK_LIBRARY
endif
endif # SDK_LIBRARY
ifneq (,$(strip $(SDK_BINARY)))
$(SDK_BIN_DIR)::
$(NSINSTALL) -D $@
ifndef NO_DIST_INSTALL
libs:: $(SDK_BINARY) $(SDK_BIN_DIR)
$(call install_cmd,$(IFLAGS2) $^)
SDK_BINARY_FILES := $(SDK_BINARY)
SDK_BINARY_DEST := $(SDK_BIN_DIR)
INSTALL_TARGETS += SDK_BINARY
endif
endif # SDK_BINARY
################################################################################
@ -1535,25 +1521,39 @@ endif
# Install/copy rules
#
# The INSTALL_TARGETS variable contains a list of all install target
# categories. Each category defines a list of files, an install destination,
# and whether the files are executables or not.
# categories. Each category defines a list of files and executables, and an
# install destination,
#
# FOO_FILES := foo bar
# FOO_EXECUTABLES := baz
# FOO_DEST := target_path
# INSTALL_TARGETS += FOO
#
# Additionally, a FOO_TARGET variable may be added to indicate the target for
# which the files and executables are installed. Default is "libs".
# If we're using binary nsinstall and it's not built yet, fallback to python nsinstall.
ifneq (,$(filter $(CONFIG_TOOLS)/nsinstall$(HOST_BIN_SUFFIX),$(install_cmd)))
nsinstall_is_usable = $(if $(wildcard $(CONFIG_TOOLS)/nsinstall$(HOST_BIN_SUFFIX)),$(eval nsinstall_is_usable := yes)yes)
define install_cmd_override
$(1): install_cmd = $$(if $$(nsinstall_is_usable),$$(INSTALL),$$(NSINSTALL_PY)) $$(1)
endef
endif
define install_file_template
libs:: $(2)/$(notdir $(1))
$(or $(3),libs):: $(2)/$(notdir $(1))
$(call install_cmd_override,$(2)/$(notdir $(1)))
$(2)/$(notdir $(1)): $(1) $$(call mkdir_deps,$(2))
$(INSTALL) $(3) $$< $${@D}
$$(call install_cmd,$(4) $$< $${@D})
endef
$(foreach category,$(INSTALL_TARGETS),\
$(if $($(category)_DEST),,$(error Missing $(category)_DEST))\
$(foreach file,$($(category)_FILES),\
$(eval $(call install_file_template,$(file),$($(category)_DEST),$(IFLAGS1)))\
$(eval $(call install_file_template,$(file),$($(category)_DEST),$($(category)_TARGET),$(IFLAGS1)))\
)\
$(foreach file,$($(category)_EXECUTABLES),\
$(eval $(call install_file_template,$(file),$($(category)_DEST),$(IFLAGS2)))\
$(eval $(call install_file_template,$(file),$($(category)_DEST),$($(category)_TARGET),$(IFLAGS2)))\
)\
)
@ -1567,19 +1567,22 @@ $(foreach category,$(INSTALL_TARGETS),\
# FOO_PATH := target_path
# FOO_FLAGS := -Dsome_flag
# PP_TARGETS += FOO
#
# Additionally, a FOO_TARGET variable may be added to indicate the target for
# which the files and executables are installed. Default is "libs".
# preprocess_file_template defines preprocessing rules.
# $(call preprocess_file_template, source_file, target_path, extra_flags)
define preprocess_file_template
$(2)/$(notdir $(1)): $(1) $$(call mkdir_deps,$(2)) $$(GLOBAL_DEPS)
$$(RM) $$@
$$(PYTHON) $$(topsrcdir)/config/Preprocessor.py $(3) $$(DEFINES) $$(ACDEFINES) $$(XULPPFLAGS) $$< > $$@
libs:: $(2)/$(notdir $(1))
$$(PYTHON) $$(topsrcdir)/config/Preprocessor.py $(4) $$(DEFINES) $$(ACDEFINES) $$(XULPPFLAGS) $$< > $$@
$(or $(3),libs):: $(2)/$(notdir $(1))
endef
$(foreach category,$(PP_TARGETS),\
$(foreach file,$($(category)),\
$(eval $(call preprocess_file_template,$(file),$($(category)_PATH),$($(category)_FLAGS)))\
$(eval $(call preprocess_file_template,$(file),$($(category)_PATH),$($(category)_TARGET),$($(category)_FLAGS)))\
)\
)

View File

@ -191,7 +191,7 @@ if test -n "$gonkdir" ; then
;;
esac
CPPFLAGS="-DANDROID -isystem $gonkdir/bionic/libc/$ARCH_DIR/include -isystem $gonkdir/bionic/libc/include/ -isystem $gonkdir/bionic/libc/kernel/common -isystem $gonkdir/bionic/libc/kernel/$ARCH_DIR -isystem $gonkdir/bionic/libm/include -I$gonkdir/frameworks/base/opengl/include -I$gonkdir/frameworks/base/native/include -I$gonkdir/hardware/libhardware/include -I$gonkdir/hardware/libhardware_legacy/include -I$gonkdir/system -I$gonkdir/system/core/include -isystem $gonkdir/bionic -I$gonkdir/frameworks/base/include -I$gonkdir/external/dbus $CPPFLAGS -I$gonkdir/frameworks/base/services/sensorservice -I$gonkdir/frameworks/base/services/camera -I$gonkdir/system/media/wilhelm/include"
CPPFLAGS="-DANDROID -isystem $gonkdir/bionic/libc/$ARCH_DIR/include -isystem $gonkdir/bionic/libc/include/ -isystem $gonkdir/bionic/libc/kernel/common -isystem $gonkdir/bionic/libc/kernel/$ARCH_DIR -isystem $gonkdir/bionic/libm/include -I$gonkdir/frameworks/base/opengl/include -I$gonkdir/frameworks/base/native/include -I$gonkdir/hardware/libhardware/include -I$gonkdir/hardware/libhardware_legacy/include -I$gonkdir/system -I$gonkdir/system/core/include -isystem $gonkdir/bionic -I$gonkdir/frameworks/base/include -I$gonkdir/external/dbus -I$gonkdir/external/bluetooth/bluez/lib $CPPFLAGS -I$gonkdir/frameworks/base/services/sensorservice -I$gonkdir/frameworks/base/services/camera -I$gonkdir/system/media/wilhelm/include"
CFLAGS="-mandroid -fno-short-enums -fno-exceptions $CFLAGS"
CXXFLAGS="-mandroid -fno-short-enums -fno-exceptions -Wno-psabi $CXXFLAGS $STLPORT_CPPFLAGS"
dnl Add -llog by default, since we use it all over the place.
@ -3854,7 +3854,7 @@ fi
dnl system libevent Support
dnl ========================================================
MOZ_ARG_WITH_STRING(system-libevent,
[ --with-system-libevent=[PFX]
[ --with-system-libevent[=PFX]
Use system libevent [installed at prefix PFX]],
LIBEVENT_DIR=$withval)
@ -3863,10 +3863,11 @@ _SAVE_LDFLAGS=$LDFLAGS
_SAVE_LIBS=$LIBS
if test -z "$LIBEVENT_DIR" -o "$LIBEVENT_DIR" = no; then
MOZ_NATIVE_LIBEVENT=
elif test "$LIBEVENT_DIR" = yes; then
PKG_CHECK_MODULES(MOZ_LIBEVENT, libevent,
MOZ_NATIVE_LIBEVENT=1,
AC_MSG_ERROR([--with-system-libevent requested but libevent package not found]))
else
if test "${LIBEVENT_DIR}" = "yes"; then
LIBEVENT_DIR=/usr
fi
CFLAGS="-I${LIBEVENT_DIR}/include $CFLAGS"
LDFLAGS="-L${LIBEVENT_DIR}/lib $LDFLAGS"
MOZ_CHECK_HEADER(event.h,
@ -3876,16 +3877,16 @@ else
AC_MSG_ERROR([--with-system-libevent requested but event.h not found]))
AC_CHECK_LIB(event, event_init,
[MOZ_NATIVE_LIBEVENT=1
MOZ_LIBEVENT_INCLUDES="${LIBEVENT_DIR}/include"
MOZ_LIBEVENT_CFLAGS="-I${LIBEVENT_DIR}/include"
MOZ_LIBEVENT_LIBS="-L${LIBEVENT_DIR}/lib -levent"],
[MOZ_NATIVE_LIBEVENT= MOZ_LIBEVENT_INCLUDES= MOZ_LIBEVENT_LIBS=])
[MOZ_NATIVE_LIBEVENT= MOZ_LIBEVENT_CFLAGS= MOZ_LIBEVENT_LIBS=])
fi
CFLAGS=$_SAVE_CFLAGS
LDFLAGS=$_SAVE_LDFLAGS
LIBS=$_SAVE_LIBS
AC_SUBST(MOZ_NATIVE_LIBEVENT)
AC_SUBST(MOZ_LIBEVENT_INCLUDES)
AC_SUBST(MOZ_LIBEVENT_CFLAGS)
AC_SUBST(MOZ_LIBEVENT_LIBS)
dnl ========================================================

View File

@ -42,6 +42,7 @@ nsReferencedElement.h \
nsTreeSanitizer.h \
nsXMLNameSpaceMap.h \
nsIXFormsUtilityService.h \
nsBlobProtocolHandler.h \
$(NULL)
EXPORTS_NAMESPACES = mozilla/dom mozilla

View File

@ -0,0 +1,51 @@
/* 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/. */
#ifndef nsBlobProtocolHandler_h
#define nsBlobProtocolHandler_h
#include "nsIProtocolHandler.h"
#include "nsIURI.h"
#include "nsCOMPtr.h"
#define BLOBURI_SCHEME "blob"
class nsIDOMBlob;
class nsIPrincipal;
class nsIInputStream;
inline bool IsBlobURI(nsIURI* aUri)
{
bool isBlob;
return NS_SUCCEEDED(aUri->SchemeIs(BLOBURI_SCHEME, &isBlob)) && isBlob;
}
extern nsresult
NS_GetStreamForBlobURI(nsIURI* aURI, nsIInputStream** aStream);
class nsBlobProtocolHandler : public nsIProtocolHandler
{
public:
NS_DECL_ISUPPORTS
// nsIProtocolHandler methods:
NS_DECL_NSIPROTOCOLHANDLER
// nsBlobProtocolHandler methods:
nsBlobProtocolHandler() {}
virtual ~nsBlobProtocolHandler() {}
// Methods for managing uri->file mapping
static void AddFileDataEntry(nsACString& aUri,
nsIDOMBlob* aFile,
nsIPrincipal* aPrincipal);
static void RemoveFileDataEntry(nsACString& aUri);
static nsIPrincipal* GetFileDataEntryPrincipal(nsACString& aUri);
};
#define NS_BLOBPROTOCOLHANDLER_CID \
{ 0xb43964aa, 0xa078, 0x44b2, \
{ 0xb0, 0x6b, 0xfd, 0x4d, 0x1b, 0x17, 0x2e, 0x66 } }
#endif /* nsBlobProtocolHandler_h */

View File

@ -165,7 +165,7 @@ NS_IMETHODIMP
FileIOObject::OnDataAvailable(nsIRequest *aRequest,
nsISupports *aContext,
nsIInputStream *aInputStream,
uint32_t aOffset,
uint64_t aOffset,
uint32_t aCount)
{
nsresult rv;

View File

@ -68,7 +68,7 @@ protected:
nsAString& aTerminationEvent) = 0;
// and for onDataAvailable
NS_IMETHOD DoOnDataAvailable(nsIRequest *aRequest, nsISupports *aContext,
nsIInputStream *aInputStream, uint32_t aOffset,
nsIInputStream *aInputStream, uint64_t aOffset,
uint32_t aCount) = 0;
void StartProgressEventTimer();

View File

@ -564,8 +564,7 @@ nsAttrAndChildArray::SetAndTakeMappedAttr(nsIAtom* aLocalName,
nsRefPtr<nsMappedAttributes> mapped =
GetModifiableMapped(aContent, aSheet, willAdd);
nsresult rv = mapped->SetAndTakeAttr(aLocalName, aValue);
NS_ENSURE_SUCCESS(rv, rv);
mapped->SetAndTakeAttr(aLocalName, aValue);
return MakeMappedUnique(mapped);
}

View File

@ -163,8 +163,8 @@ nsBlobProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
nsCOMPtr<nsIChannel> channel;
rv = NS_NewInputStreamChannel(getter_AddRefs(channel),
uri,
stream);
uri,
stream);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsISupports> owner = do_QueryInterface(info->mPrincipal);
@ -195,3 +195,23 @@ nsBlobProtocolHandler::AllowPort(int32_t port, const char *scheme,
*_retval = false;
return NS_OK;
}
nsresult
NS_GetStreamForBlobURI(nsIURI* aURI, nsIInputStream** aStream)
{
NS_ASSERTION(IsBlobURI(aURI), "Only call this with blob URIs");
*aStream = nullptr;
nsCString spec;
aURI->GetSpec(spec);
FileDataInfo* info =
GetFileDataInfo(spec);
if (!info) {
return NS_ERROR_DOM_BAD_URI;
}
return info->mFile->GetInternalStream(aStream);
}

View File

@ -6,11 +6,23 @@
#define nsBlobProtocolHandler_h
#include "nsIProtocolHandler.h"
#include "nsIURI.h"
#include "nsCOMPtr.h"
#define BLOBURI_SCHEME "blob"
class nsIDOMBlob;
class nsIPrincipal;
class nsIInputStream;
inline bool IsBlobURI(nsIURI* aUri)
{
bool isBlob;
return NS_SUCCEEDED(aUri->SchemeIs(BLOBURI_SCHEME, &isBlob)) && isBlob;
}
extern nsresult
NS_GetStreamForBlobURI(nsIURI* aURI, nsIInputStream** aStream);
class nsBlobProtocolHandler : public nsIProtocolHandler
{
@ -26,11 +38,10 @@ public:
// Methods for managing uri->file mapping
static void AddFileDataEntry(nsACString& aUri,
nsIDOMBlob* aFile,
nsIDOMBlob* aFile,
nsIPrincipal* aPrincipal);
static void RemoveFileDataEntry(nsACString& aUri);
static nsIPrincipal* GetFileDataEntryPrincipal(nsACString& aUri);
};
#define NS_BLOBPROTOCOLHANDLER_CID \

View File

@ -3598,21 +3598,39 @@ nsContentUtils::ConvertStringFromCharset(const nsACString& aCharset,
return rv;
nsPromiseFlatCString flatInput(aInput);
int32_t srcLen = flatInput.Length();
int32_t dstLen;
rv = decoder->GetMaxLength(flatInput.get(), srcLen, &dstLen);
int32_t length = flatInput.Length();
int32_t outLen;
rv = decoder->GetMaxLength(flatInput.get(), length, &outLen);
if (NS_FAILED(rv))
return rv;
PRUnichar *ustr = (PRUnichar *)nsMemory::Alloc((dstLen + 1) *
PRUnichar *ustr = (PRUnichar *)nsMemory::Alloc((outLen + 1) *
sizeof(PRUnichar));
if (!ustr)
return NS_ERROR_OUT_OF_MEMORY;
rv = decoder->Convert(flatInput.get(), &srcLen, ustr, &dstLen);
if (NS_SUCCEEDED(rv)) {
const char* data = flatInput.get();
aOutput.Truncate();
for (;;) {
int32_t srcLen = length;
int32_t dstLen = outLen;
rv = decoder->Convert(data, &srcLen, ustr, &dstLen);
// Convert will convert the input partially even if the status
// indicates a failure.
ustr[dstLen] = 0;
aOutput.Assign(ustr, dstLen);
aOutput.Append(ustr, dstLen);
if (rv != NS_ERROR_ILLEGAL_INPUT) {
break;
}
// Emit a decode error manually because some decoders
// do not support kOnError_Recover (bug 638379)
if (srcLen == -1) {
decoder->Reset();
} else {
data += srcLen + 1;
length -= srcLen + 1;
aOutput.Append(static_cast<PRUnichar>(0xFFFD));
}
}
nsMemory::Free(ustr);

View File

@ -614,7 +614,7 @@ NS_IMETHODIMP
nsCORSListenerProxy::OnDataAvailable(nsIRequest* aRequest,
nsISupports* aContext,
nsIInputStream* aInputStream,
uint32_t aOffset,
uint64_t aOffset,
uint32_t aCount)
{
if (!mRequestApproved) {
@ -1006,7 +1006,7 @@ NS_IMETHODIMP
nsCORSPreflightListener::OnDataAvailable(nsIRequest *aRequest,
nsISupports *ctxt,
nsIInputStream *inStr,
uint32_t sourceOffset,
uint64_t sourceOffset,
uint32_t count)
{
uint32_t totalRead;

View File

@ -286,7 +286,7 @@ nsresult
nsDOMFileReader::DoOnDataAvailable(nsIRequest *aRequest,
nsISupports *aContext,
nsIInputStream *aInputStream,
uint32_t aOffset,
uint64_t aOffset,
uint32_t aCount)
{
if (mDataFormat == FILE_AS_BINARY) {
@ -294,6 +294,9 @@ nsDOMFileReader::DoOnDataAvailable(nsIRequest *aRequest,
NS_ASSERTION(mResult.Length() == aOffset,
"unexpected mResult length");
uint32_t oldLen = mResult.Length();
if (uint64_t(oldLen) + aCount > PR_UINT32_MAX)
return NS_ERROR_OUT_OF_MEMORY;
PRUnichar *buf = nullptr;
mResult.GetMutableData(&buf, oldLen + aCount, fallible_t());
NS_ENSURE_TRUE(buf, NS_ERROR_OUT_OF_MEMORY);
@ -311,6 +314,10 @@ nsDOMFileReader::DoOnDataAvailable(nsIRequest *aRequest,
}
else {
//Update memory buffer to reflect the contents of the file
if (aOffset + aCount > PR_UINT32_MAX) {
// PR_Realloc doesn't support over 4GB memory size even if 64-bit OS
return NS_ERROR_OUT_OF_MEMORY;
}
mFileData = (char *)PR_Realloc(mFileData, aOffset + aCount);
NS_ENSURE_TRUE(mFileData, NS_ERROR_OUT_OF_MEMORY);

View File

@ -57,7 +57,7 @@ public:
nsresult aStatus, nsAString& aSuccessEvent,
nsAString& aTerminationEvent);
NS_IMETHOD DoOnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
nsIInputStream* aInputStream, uint32_t aOffset,
nsIInputStream* aInputStream, uint64_t aOffset,
uint32_t aCount);
nsresult Init();

View File

@ -1023,7 +1023,7 @@ NS_IMETHODIMP
nsExternalResourceMap::PendingLoad::OnDataAvailable(nsIRequest* aRequest,
nsISupports* aContext,
nsIInputStream* aStream,
uint32_t aOffset,
uint64_t aOffset,
uint32_t aCount)
{
NS_PRECONDITION(mTargetListener, "Shouldn't be getting called!");

View File

@ -537,7 +537,7 @@ NS_IMETHODIMP
nsEventSource::OnDataAvailable(nsIRequest *aRequest,
nsISupports *aContext,
nsIInputStream *aInputStream,
uint32_t aOffset,
uint64_t aOffset,
uint32_t aCount)
{
NS_ENSURE_ARG_POINTER(aInputStream);

View File

@ -91,6 +91,10 @@
#include "mozilla/dom/StructuredCloneUtils.h"
#ifdef MOZ_XUL
#include "nsXULPopupManager.h"
#endif
using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::layers;
@ -306,6 +310,7 @@ nsFrameLoader::nsFrameLoader(Element* aOwner, bool aNetworkCreated)
, mClipSubdocument(true)
, mClampScrollPosition(true)
, mRemoteBrowserInitialized(false)
, mObservingOwnerContent(false)
, mCurrentRemoteFrame(nullptr)
, mRemoteBrowser(nullptr)
, mRenderMode(RENDER_MODE_DEFAULT)
@ -657,29 +662,24 @@ SetTreeOwnerAndChromeEventHandlerOnDocshellTree(nsIDocShellTreeItem* aItem,
/**
* Set the type of the treeitem and hook it up to the treeowner.
* @param aItem the treeitem we're working with
* @param aOwningContent the content node that owns aItem
* @param aTreeOwner the relevant treeowner; might be null
* @param aParentType the nsIDocShellTreeItem::GetType of our parent docshell
* @param aParentNode if non-null, the docshell we should be added as a child to
*
* @return whether aItem is top-level content
*/
static bool
AddTreeItemToTreeOwner(nsIDocShellTreeItem* aItem, nsIContent* aOwningContent,
nsIDocShellTreeOwner* aOwner, int32_t aParentType,
nsIDocShellTreeNode* aParentNode)
bool
nsFrameLoader::AddTreeItemToTreeOwner(nsIDocShellTreeItem* aItem,
nsIDocShellTreeOwner* aOwner,
int32_t aParentType,
nsIDocShellTreeNode* aParentNode)
{
NS_PRECONDITION(aItem, "Must have docshell treeitem");
NS_PRECONDITION(aOwningContent, "Must have owning content");
NS_PRECONDITION(mOwnerContent, "Must have owning content");
nsAutoString value;
bool isContent = false;
if (aOwningContent->IsXUL()) {
aOwningContent->GetAttr(kNameSpaceID_None, nsGkAtoms::type, value);
} else {
aOwningContent->GetAttr(kNameSpaceID_None, nsGkAtoms::mozframetype, value);
}
mOwnerContent->GetAttr(kNameSpaceID_None, TypeAttrName(), value);
// we accept "content" and "content-xxx" values.
// at time of writing, we expect "xxx" to be "primary" or "targetable", but
@ -692,7 +692,7 @@ AddTreeItemToTreeOwner(nsIDocShellTreeItem* aItem, nsIContent* aOwningContent,
// Force mozbrowser frames to always be typeContent, even if the
// mozbrowser interfaces are disabled.
nsCOMPtr<nsIDOMMozBrowserFrame> mozbrowser =
do_QueryInterface(aOwningContent);
do_QueryInterface(mOwnerContent);
if (mozbrowser) {
bool isMozbrowser = false;
mozbrowser->GetMozbrowser(&isMozbrowser);
@ -725,6 +725,8 @@ AddTreeItemToTreeOwner(nsIDocShellTreeItem* aItem, nsIContent* aOwningContent,
if (aOwner) {
bool is_targetable = is_primary ||
value.LowerCaseEqualsLiteral("content-targetable");
mOwnerContent->AddMutationObserver(this);
mObservingOwnerContent = true;
aOwner->ContentShellAdded(aItem, is_primary, is_targetable, value);
}
}
@ -1205,10 +1207,15 @@ nsFrameLoader::SwapWithOtherLoader(nsFrameLoader* aOther,
SetTreeOwnerAndChromeEventHandlerOnDocshellTree(otherTreeItem, ourOwner,
ourChromeEventHandler);
AddTreeItemToTreeOwner(ourTreeItem, otherContent, otherOwner,
otherParentType, nullptr);
AddTreeItemToTreeOwner(otherTreeItem, ourContent, ourOwner, ourParentType,
nullptr);
// Switch the owner content before we start calling AddTreeItemToTreeOwner.
// Note that we rely on this to deal with setting mObservingOwnerContent to
// false and calling RemoveMutationObserver as needed.
SetOwnerContent(otherContent);
aOther->SetOwnerContent(ourContent);
AddTreeItemToTreeOwner(ourTreeItem, otherOwner, otherParentType, nullptr);
aOther->AddTreeItemToTreeOwner(otherTreeItem, ourOwner, ourParentType,
nullptr);
// SetSubDocumentFor nulls out parent documents on the old child doc if a
// new non-null document is passed in, so just go ahead and remove both
@ -1222,9 +1229,6 @@ nsFrameLoader::SwapWithOtherLoader(nsFrameLoader* aOther,
ourWindow->SetFrameElementInternal(otherFrameElement);
otherWindow->SetFrameElementInternal(ourFrameElement);
SetOwnerContent(otherContent);
aOther->SetOwnerContent(ourContent);
nsRefPtr<nsFrameMessageManager> ourMessageManager = mMessageManager;
nsRefPtr<nsFrameMessageManager> otherMessageManager = aOther->mMessageManager;
// Swap pointers in child message managers.
@ -1383,6 +1387,10 @@ nsFrameLoader::GetDepthTooGreat(bool* aDepthTooGreat)
void
nsFrameLoader::SetOwnerContent(Element* aContent)
{
if (mObservingOwnerContent) {
mObservingOwnerContent = false;
mOwnerContent->RemoveMutationObserver(this);
}
mOwnerContent = aContent;
if (RenderFrameParent* rfp = GetCurrentRemoteFrame()) {
rfp->OwnerContentChanged(aContent);
@ -1559,8 +1567,8 @@ nsFrameLoader::MaybeCreateDocShell()
parentAsItem->GetTreeOwner(getter_AddRefs(parentTreeOwner));
NS_ENSURE_STATE(parentTreeOwner);
mIsTopLevelContent =
AddTreeItemToTreeOwner(docShellAsItem, mOwnerContent, parentTreeOwner,
parentType, parentAsNode);
AddTreeItemToTreeOwner(docShellAsItem, parentTreeOwner, parentType,
parentAsNode);
// Make sure all shells have links back to the content element
// in the nearest enclosing chrome shell.
@ -2404,3 +2412,78 @@ nsFrameLoader::GetDetachedSubdocView(nsIDocument** aContainerDoc) const
return mDetachedSubdocViews;
}
/* virtual */ void
nsFrameLoader::AttributeChanged(nsIDocument* aDocument,
mozilla::dom::Element* aElement,
int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType)
{
MOZ_ASSERT(mObservingOwnerContent);
// TODO: Implement ContentShellAdded for remote browsers (bug 658304)
MOZ_ASSERT(!mRemoteBrowser);
if (aNameSpaceID != kNameSpaceID_None || aAttribute != TypeAttrName()) {
return;
}
if (aElement != mOwnerContent) {
return;
}
// Note: This logic duplicates a lot of logic in
// MaybeCreateDocshell. We should fix that.
// Notify our enclosing chrome that our type has changed. We only do this
// if our parent is chrome, since in all other cases we're random content
// subframes and the treeowner shouldn't worry about us.
nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(do_QueryInterface(mDocShell));
if (!docShellAsItem) {
return;
}
nsCOMPtr<nsIDocShellTreeItem> parentItem;
docShellAsItem->GetParent(getter_AddRefs(parentItem));
if (!parentItem) {
return;
}
int32_t parentType;
parentItem->GetItemType(&parentType);
if (parentType != nsIDocShellTreeItem::typeChrome) {
return;
}
nsCOMPtr<nsIDocShellTreeOwner> parentTreeOwner;
parentItem->GetTreeOwner(getter_AddRefs(parentTreeOwner));
if (!parentTreeOwner) {
return;
}
nsAutoString value;
aElement->GetAttr(kNameSpaceID_None, TypeAttrName(), value);
bool is_primary = value.LowerCaseEqualsLiteral("content-primary");
#ifdef MOZ_XUL
// when a content panel is no longer primary, hide any open popups it may have
if (!is_primary) {
nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
if (pm)
pm->HidePopupsInDocShell(docShellAsItem);
}
#endif
parentTreeOwner->ContentShellRemoved(docShellAsItem);
if (value.LowerCaseEqualsLiteral("content") ||
StringBeginsWith(value, NS_LITERAL_STRING("content-"),
nsCaseInsensitiveStringComparator())) {
bool is_targetable = is_primary ||
value.LowerCaseEqualsLiteral("content-targetable");
parentTreeOwner->ContentShellAdded(docShellAsItem, is_primary,
is_targetable, value);
}
}

View File

@ -22,6 +22,7 @@
#include "mozilla/dom/Element.h"
#include "mozilla/Attributes.h"
#include "FrameMetrics.h"
#include "nsStubMutationObserver.h"
class nsIURI;
class nsSubDocumentFrame;
@ -29,6 +30,9 @@ class nsIView;
class nsIInProcessContentFrameMessageManager;
class AutoResetInShow;
class nsITabParent;
class nsIDocShellTreeItem;
class nsIDocShellTreeOwner;
class nsIDocShellTreeNode;
namespace mozilla {
namespace dom {
@ -135,7 +139,8 @@ private:
class nsFrameLoader MOZ_FINAL : public nsIFrameLoader,
public nsIContentViewManager
public nsIContentViewManager,
public nsStubMutationObserver
{
friend class AutoResetInShow;
typedef mozilla::dom::PBrowserParent PBrowserParent;
@ -166,6 +171,7 @@ public:
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsFrameLoader, nsIFrameLoader)
NS_DECL_NSIFRAMELOADER
NS_DECL_NSICONTENTVIEWMANAGER
NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
NS_HIDDEN_(nsresult) CheckForRecursiveLoad(nsIURI* aURI);
nsresult ReallyStartLoading();
void Finalize();
@ -337,9 +343,19 @@ private:
// Tell the remote browser that it's now "virtually visible"
bool ShowRemoteFrame(const nsIntSize& size);
bool AddTreeItemToTreeOwner(nsIDocShellTreeItem* aItem,
nsIDocShellTreeOwner* aOwner,
int32_t aParentType,
nsIDocShellTreeNode* aParentNode);
nsIAtom* TypeAttrName() const {
return mOwnerContent->IsXUL() ? nsGkAtoms::type : nsGkAtoms::mozframetype;
}
nsCOMPtr<nsIDocShell> mDocShell;
nsCOMPtr<nsIURI> mURIToLoad;
mozilla::dom::Element* mOwnerContent; // WEAK
public:
// public because a callback needs these.
nsRefPtr<nsFrameMessageManager> mMessageManager;
@ -373,6 +389,7 @@ private:
bool mClipSubdocument : 1;
bool mClampScrollPosition : 1;
bool mRemoteBrowserInitialized : 1;
bool mObservingOwnerContent : 1;
// XXX leaking
nsCOMPtr<nsIObserver> mChildHost;

View File

@ -958,8 +958,7 @@ nsFrameScriptExecutor::InitTabChildGlobalInternal(nsISupports* aScope)
JSAutoRequest ar(cx);
nsIXPConnect* xpc = nsContentUtils::XPConnect();
const uint32_t flags = nsIXPConnect::INIT_JS_STANDARD_CLASSES |
nsIXPConnect::FLAG_SYSTEM_GLOBAL_OBJECT;
const uint32_t flags = nsIXPConnect::INIT_JS_STANDARD_CLASSES;
JS_SetContextPrivate(cx, aScope);

View File

@ -77,7 +77,7 @@ void* nsMappedAttributes::operator new(size_t aSize, uint32_t aAttrCount) CPP_TH
NS_IMPL_ISUPPORTS1(nsMappedAttributes,
nsIStyleRule)
nsresult
void
nsMappedAttributes::SetAndTakeAttr(nsIAtom* aAttrName, nsAttrValue& aValue)
{
NS_PRECONDITION(aAttrName, "null name");
@ -87,8 +87,7 @@ nsMappedAttributes::SetAndTakeAttr(nsIAtom* aAttrName, nsAttrValue& aValue)
if (Attrs()[i].mName.Equals(aAttrName)) {
Attrs()[i].mValue.Reset();
Attrs()[i].mValue.SwapValueWith(aValue);
return NS_OK;
return;
}
}
@ -102,8 +101,6 @@ nsMappedAttributes::SetAndTakeAttr(nsIAtom* aAttrName, nsAttrValue& aValue)
new (&Attrs()[i].mValue) nsAttrValue();
Attrs()[i].mValue.SwapValueWith(aValue);
++mAttrCount;
return NS_OK;
}
const nsAttrValue*

View File

@ -32,7 +32,7 @@ public:
NS_DECL_ISUPPORTS
nsresult SetAndTakeAttr(nsIAtom* aAttrName, nsAttrValue& aValue);
void SetAndTakeAttr(nsIAtom* aAttrName, nsAttrValue& aValue);
const nsAttrValue* GetAttr(nsIAtom* aAttrName) const;
const nsAttrValue* GetAttr(const nsAString& aAttrName) const;

View File

@ -687,21 +687,29 @@ nsObjectLoadingContent::~nsObjectLoadingContent()
nsresult
nsObjectLoadingContent::InstantiatePluginInstance()
{
if (mType != eType_Plugin || mIsLoading) {
LOG(("OBJLC [%p]: Not instantiating loading or non-plugin object, type %u",
this, mType));
if (mInstanceOwner || mType != eType_Plugin || mIsLoading || mInstantiating) {
return NS_OK;
}
nsCOMPtr<nsIContent> thisContent =
do_QueryInterface(static_cast<nsIImageLoadingContent *>(this));
// Flush layout so that the frame is created if possible and the plugin is
// initialized with the latest information.
nsIDocument* doc = thisContent->GetCurrentDoc();
if (!doc || !InActiveDocument(thisContent)) {
NS_ERROR("Shouldn't be calling "
"InstantiatePluginInstance without an active document");
return NS_ERROR_FAILURE;
}
doc->FlushPendingNotifications(Flush_Layout);
if (!thisContent->GetPrimaryFrame()) {
LOG(("OBJLC [%p]: Not instantiating plugin with no frame", this));
return NS_OK;
}
// Don't do anything if we already have an active instance.
if (mInstanceOwner) {
return NS_OK;
}
// Don't allow re-entry into initialization code.
if (mInstantiating) {
return NS_OK;
}
mInstantiating = true;
AutoSetInstantiatingToFalse autoInstantiating(this);
@ -710,20 +718,6 @@ nsObjectLoadingContent::InstantiatePluginInstance()
// of this method.
nsCOMPtr<nsIObjectLoadingContent> kungFuDeathGrip = this;
nsCOMPtr<nsIContent> thisContent =
do_QueryInterface(static_cast<nsIImageLoadingContent *>(this));
// Flush layout so that the plugin is initialized with the latest information.
nsIDocument* doc = thisContent->GetCurrentDoc();
if (!doc) {
return NS_ERROR_FAILURE;
}
if (!InActiveDocument(thisContent)) {
NS_ERROR("Shouldn't be calling "
"InstantiatePluginInstance in an inactive document");
return NS_ERROR_FAILURE;
}
doc->FlushPendingNotifications(Flush_Layout);
nsresult rv = NS_ERROR_FAILURE;
nsRefPtr<nsPluginHost> pluginHost =
already_AddRefed<nsPluginHost>(nsPluginHost::GetInst());
@ -881,7 +875,7 @@ NS_IMETHODIMP
nsObjectLoadingContent::OnDataAvailable(nsIRequest *aRequest,
nsISupports *aContext,
nsIInputStream *aInputStream,
uint32_t aOffset, uint32_t aCount)
uint64_t aOffset, uint32_t aCount)
{
NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_NOT_AVAILABLE);
@ -1729,6 +1723,14 @@ nsObjectLoadingContent::LoadObject(bool aNotify,
oldType = mType;
oldState = ObjectState();
if (!thisContent->GetPrimaryFrame()) {
// We're un-rendered, and can't instantiate a plugin. HasNewFrame will
// re-start us when we can proceed.
LOG(("OBJLC [%p]: Aborting load - plugin-type, but no frame", this));
CloseChannel();
break;
}
rv = pluginHost->NewEmbeddedPluginStreamListener(mURI, this, nullptr,
getter_AddRefs(mFinalListener));
if (NS_SUCCEEDED(rv)) {

View File

@ -274,7 +274,7 @@ NS_IMETHODIMP
nsMultipartProxyListener::OnDataAvailable(nsIRequest *aRequest,
nsISupports *ctxt,
nsIInputStream *inStr,
uint32_t sourceOffset,
uint64_t sourceOffset,
uint32_t count)
{
return mDestListener->OnDataAvailable(aRequest, ctxt, inStr, sourceOffset,
@ -1925,7 +1925,7 @@ NS_IMETHODIMP
nsXMLHttpRequest::OnDataAvailable(nsIRequest *request,
nsISupports *ctxt,
nsIInputStream *inStr,
uint32_t sourceOffset,
uint64_t sourceOffset,
uint32_t count)
{
NS_ENSURE_ARG_POINTER(inStr);
@ -3888,7 +3888,7 @@ nsXMLHttpProgressEvent::nsXMLHttpProgressEvent(nsIDOMProgressEvent* aInner,
nsPIDOMWindow* aWindow)
: mWindow(aWindow)
{
mInner = static_cast<nsDOMProgressEvent*>(aInner);
mInner = aInner;
mCurProgress = aCurrentProgress;
mMaxProgress = aMaxProgress;
}
@ -3918,8 +3918,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsXMLHttpProgressEvent)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsXMLHttpProgressEvent)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mInner,
nsIDOMProgressEvent)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mInner)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mWindow);
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END

View File

@ -27,7 +27,7 @@
#include "nsIJSNativeInitializer.h"
#include "nsIDOMLSProgressEvent.h"
#include "nsITimer.h"
#include "nsDOMProgressEvent.h"
#include "nsIDOMProgressEvent.h"
#include "nsDOMEventTargetHelper.h"
#include "nsContentUtils.h"
#include "nsDOMFile.h"
@ -682,9 +682,7 @@ public:
protected:
void WarnAboutLSProgressEvent(nsIDocument::DeprecatedOperations);
// Use nsDOMProgressEvent so that we can forward
// most of the method calls easily.
nsRefPtr<nsDOMProgressEvent> mInner;
nsCOMPtr<nsIDOMProgressEvent> mInner;
nsCOMPtr<nsPIDOMWindow> mWindow;
uint64_t mCurProgress;
uint64_t mMaxProgress;

View File

@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<body>
<canvas id="canv" width="5" height="5"></canvas>
<script>
var canv = document.getElementById("canv");
var ctx = canv.getContext("2d");
ctx.fillStyle = "red";
// 0 size font shouldn't assert!
ctx.font = "0px Arial";
ctx.shadowColor = '#f00';
ctx.shadowBlur = 4;
ctx.fillText("A", 0, 0);
document.documentElement.className = "";
</script>
</body>
</html>

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