Skip to content

Commit

Permalink
merge mozilla-inbound to mozilla-central a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Nov 6, 2014
2 parents 165bb95 + c39cc68 commit 1357b3a
Show file tree
Hide file tree
Showing 162 changed files with 2,567 additions and 937 deletions.
6 changes: 3 additions & 3 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ endif
ifndef MOZ_PROFILE_USE
# We need to explicitly put backend.RecursiveMakeBackend here
# otherwise the rule in rules.mk doesn't run early enough.
libs binaries export tools:: CLOBBER $(configure_dir)/configure config.status backend.RecursiveMakeBackend
$(TIERS) binaries:: CLOBBER $(configure_dir)/configure config.status backend.RecursiveMakeBackend
ifndef JS_STANDALONE
ifndef LIBXUL_SDK
libs binaries export tools:: $(topsrcdir)/js/src/configure js/src/config.status
$(TIERS) binaries:: $(topsrcdir)/js/src/configure js/src/config.status
endif
endif
endif
Expand Down Expand Up @@ -174,7 +174,7 @@ endif
endif

default all::
$(call BUILDSTATUS,TIERS export $(if $(COMPILE_ENVIRONMENT),compile )libs tools $(if $(MOZ_AUTOMATION),$(MOZ_AUTOMATION_TIERS)))
$(call BUILDSTATUS,TIERS $(TIERS) $(if $(MOZ_AUTOMATION),$(MOZ_AUTOMATION_TIERS)))

include $(topsrcdir)/config/rules.mk

Expand Down
17 changes: 11 additions & 6 deletions accessible/generic/ImageAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,18 @@ already_AddRefed<nsIURI>
ImageAccessible::GetLongDescURI() const
{
if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::longdesc)) {
nsGenericHTMLElement* element =
nsGenericHTMLElement::FromContent(mContent);
if (element) {
nsCOMPtr<nsIURI> uri;
element->GetURIAttr(nsGkAtoms::longdesc, nullptr, getter_AddRefs(uri));
return uri.forget();
// To check if longdesc contains an invalid url.
nsAutoString longdesc;
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::longdesc, longdesc);
if (longdesc.FindChar(' ') != -1 || longdesc.FindChar('\t') != -1 ||
longdesc.FindChar('\r') != -1 || longdesc.FindChar('\n') != -1) {
return nullptr;
}
nsCOMPtr<nsIURI> baseURI = mContent->GetBaseURI();
nsCOMPtr<nsIURI> uri;
nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(uri), longdesc,
mContent->OwnerDoc(), baseURI);
return uri.forget();
}

DocAccessible* document = Document();
Expand Down
32 changes: 26 additions & 6 deletions accessible/tests/mochitest/test_nsIAccessibleImage.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,14 @@
var attributes = {"src": aSRC};
testAttrs(acc, attributes, true);

if (aActionCount) {
is(acc.actionCount, aActionCount,
"Wrong number of actions for " + aID + "!");

for (index = 0; index < aActionNames.length; index++)
var actionCount = aActionCount || 0;
is(acc.actionCount, actionCount,
"Wrong number of actions for " + aID + "!");
if (actionCount) {
for (index = 0; index < aActionNames.length; index++) {
is(acc.getActionName(index), aActionNames[index],
"Wrong action name for " + aID + ", index " + index +"!");
}
}
}

Expand All @@ -109,13 +110,18 @@
testThis("nonLinkedImage", "moz.png", 89, 38);

// Test linked image
testThis("linkedImage", "moz.png", 89, 38);
var actionNamesArray = new Array("jump");
testThis("linkedImage", "moz.png", 89, 38, 1,
actionNamesArray);

// Image with long desc
var actionNamesArray = new Array("showlongdesc");
testThis("longdesc", "moz.png", 89, 38, 1,
actionNamesArray);

// Image with invalid url in long desc
testThis("invalidLongdesc", "moz.png", 89, 38, 0);

// Image with click and long desc
actionNamesArray = null;
actionNamesArray = new Array("click", "showlongdesc");
Expand All @@ -134,6 +140,12 @@
testThis("longdesc2", "moz.png",
89, 38, 1, actionNamesArray);

// Image described by HTML:a@href with whitespaces
actionNamesArray = null;
actionNamesArray = new Array("showlongdesc");
testThis("longdesc3", "moz.png",
89, 38, 1, actionNamesArray);

SimpleTest.finish();
}

Expand Down Expand Up @@ -162,6 +174,9 @@
<br>Image with longdesc:<br>
<img id="longdesc" src="moz.png" longdesc="longdesc_src.html"
alt="Image of Mozilla logo"/>
<br>Image with invalid url in longdesc:<br>
<img id="invalidLongdesc" src="moz.png" longdesc="longdesc src.html"
alt="Image of Mozilla logo"/>
<br>Image with click and longdesc:<br>
<img id="clickAndLongdesc" src="moz.png" longdesc="longdesc_src.html"
alt="Another image of Mozilla logo" onclick="alert('Clicked!');"/>
Expand All @@ -171,6 +186,11 @@
alt="Second Image of Mozilla logo"/>
<a id="describing_link" href="longdesc_src.html">link to description of image</a>

<br>Image described by a link to be treated as longdesc with whitespaces<br>
<img id="longdesc3" src="moz.png" aria-describedby="describing_link2"
alt="Second Image of Mozilla logo"/>
<a id="describing_link2" href="longdesc src.html">link to description of image</a>

<br>Image with click:<br>
<img id="click" src="moz.png"
alt="A third image of Mozilla logo" onclick="alert('Clicked, too!');"/>
Expand Down
5 changes: 5 additions & 0 deletions b2g/app/b2g.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@ pref("dom.indexedDB.warningQuota", 5);
pref("media.preload.default", 1); // default to preload none
pref("media.preload.auto", 2); // preload metadata if preload=auto
pref("media.cache_size", 4096); // 4MB media cache
// Try to save battery by not resuming reading from a connection until we fall
// below 10s of buffered data.
pref("media.cache_resume_threshold", 10);
pref("media.cache_readahead_limit", 30);

#ifdef MOZ_FMP4
// Enable/Disable Gonk Decoder Module
pref("media.fragmented-mp4.gonk.enabled", false);
Expand Down
1 change: 1 addition & 0 deletions browser/installer/package-manifest.in
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@
@BINPATH@/components/nsUpdateTimerManager.js
@BINPATH@/components/addoncompat.manifest
@BINPATH@/components/multiprocessShims.js
@BINPATH@/components/remoteTagService.js
@BINPATH@/components/pluginGlue.manifest
@BINPATH@/components/ProcessSingleton.manifest
@BINPATH@/components/MainProcessSingleton.js
Expand Down
4 changes: 2 additions & 2 deletions build/autoconf/hooks.m4
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ if test "$no_recursion" != yes; then
fi
])

define([MOZ_RUN_ALL_SUBCONFIGURES],
define([MOZ_RUN_ALL_SUBCONFIGURES],[
MOZ_RUN_SUBCONFIGURES([--list subconfigures --skip skip_subconfigures])
)
])

dnl Print error messages in config.log as well as stderr
define([AC_MSG_ERROR],
Expand Down
2 changes: 1 addition & 1 deletion config/baseconfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ _DEPRECATED_VARIABLES := \
SHORT_LIBNAME \
TESTING_JS_MODULES \
TESTING_JS_MODULE_DIR \
TIERS \
$(NULL)

# Freeze the values specified by moz.build to catch them if they fail.

$(foreach var,$(_MOZBUILD_EXTERNAL_VARIABLES) $(_DEPRECATED_VARIABLES),$(eval $(var)_FROZEN := '$($(var))'))

TIERS := export $(if $(COMPILE_ENVIRONMENT),compile )misc libs tools
endif
8 changes: 4 additions & 4 deletions config/recurse.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ include root.mk

# Main rules (export, compile, libs and tools) call recurse_* rules.
# This wrapping is only really useful for build status.
compile libs export tools::
$(TIERS)::
$(call BUILDSTATUS,TIER_START $@)
+$(MAKE) recurse_$@
$(call BUILDSTATUS,TIER_FINISH $@)
Expand All @@ -44,7 +44,7 @@ binaries::
# Carefully avoid $(eval) type of rule generation, which makes pymake slower
# than necessary.
# Get current tier and corresponding subtiers from the data in root.mk.
CURRENT_TIER := $(filter $(foreach tier,compile libs export tools,recurse_$(tier) $(tier)-deps),$(MAKECMDGOALS))
CURRENT_TIER := $(filter $(foreach tier,$(TIERS),recurse_$(tier) $(tier)-deps),$(MAKECMDGOALS))
ifneq (,$(filter-out 0 1,$(words $(CURRENT_TIER))))
$(error $(CURRENT_TIER) not supported on the same make command line)
endif
Expand Down Expand Up @@ -108,7 +108,7 @@ else
# Don't recurse if MAKELEVEL is NO_RECURSE_MAKELEVEL as defined above
ifeq ($(NO_RECURSE_MAKELEVEL),$(MAKELEVEL))

compile libs export tools::
$(TIERS)::

else
#########################
Expand All @@ -123,7 +123,7 @@ $(1):: $$(SUBMAKEFILES)

endef

$(foreach subtier,export libs tools,$(eval $(call CREATE_SUBTIER_TRAVERSAL_RULE,$(subtier))))
$(foreach subtier,$(filter-out compile,$(TIERS)),$(eval $(call CREATE_SUBTIER_TRAVERSAL_RULE,$(subtier))))

ifndef TOPLEVEL_BUILD
libs:: target host
Expand Down
13 changes: 5 additions & 8 deletions config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -542,12 +542,7 @@ endif
# of something else. Makefiles which use this var *must* provide a sensible
# default rule before including rules.mk
default all::
$(MAKE) export
ifdef COMPILE_ENVIRONMENT
$(MAKE) compile
endif
$(MAKE) libs
$(MAKE) tools
$(foreach tier,$(TIERS),$(call SUBMAKE,$(tier)))

ifeq ($(findstring s,$(filter-out --%, $(MAKEFLAGS))),)
ECHO := echo
Expand Down Expand Up @@ -1189,10 +1184,11 @@ endif
endif

ifdef EXTRA_COMPONENTS
libs:: $(EXTRA_COMPONENTS)
misc:: $(EXTRA_COMPONENTS)
ifndef NO_DIST_INSTALL
EXTRA_COMPONENTS_FILES := $(EXTRA_COMPONENTS)
EXTRA_COMPONENTS_DEST := $(FINAL_TARGET)/components
EXTRA_COMPONENTS_TARGET := misc
INSTALL_TARGETS += EXTRA_COMPONENTS
endif

Expand All @@ -1201,13 +1197,14 @@ endif
ifdef EXTRA_PP_COMPONENTS
ifndef NO_DIST_INSTALL
EXTRA_PP_COMPONENTS_PATH := $(FINAL_TARGET)/components
EXTRA_PP_COMPONENTS_TARGET := misc
PP_TARGETS += EXTRA_PP_COMPONENTS
endif
endif

EXTRA_MANIFESTS = $(filter %.manifest,$(EXTRA_COMPONENTS) $(EXTRA_PP_COMPONENTS))
ifneq (,$(EXTRA_MANIFESTS))
libs:: $(call mkdir_deps,$(FINAL_TARGET))
misc:: $(call mkdir_deps,$(FINAL_TARGET))
$(call py_action,buildlist,$(FINAL_TARGET)/chrome.manifest $(patsubst %,'manifest components/%',$(notdir $(EXTRA_MANIFESTS))))
endif

Expand Down
7 changes: 7 additions & 0 deletions dom/base/nsGlobalWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@

#include "mozilla/dom/SelectionChangeEvent.h"

#include "mozilla/AddonPathService.h"
#include "mozilla/Services.h"
#include "mozilla/Telemetry.h"
#include "nsLocation.h"
Expand Down Expand Up @@ -2265,6 +2266,12 @@ CreateNativeGlobalForInner(JSContext* aCx,
top = aNewInner->GetTop();
}
JS::CompartmentOptions options;

// Sometimes add-ons load their own XUL windows, either as separate top-level
// windows or inside a browser element. In such cases we want to tag the
// window's compartment with the add-on ID. See bug 1092156.
options.setAddonId(MapURIToAddonID(aURI));

if (top) {
if (top->GetGlobalJSObject()) {
options.setSameZoneAs(top->GetGlobalJSObject());
Expand Down
4 changes: 2 additions & 2 deletions dom/base/nsObjectLoadingContent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3602,9 +3602,9 @@ nsObjectLoadingContent::TeardownProtoChain()
if (!proto) {
break;
}
// Unwrap while checking the jsclass - if the prototype is a wrapper for
// Unwrap while checking the class - if the prototype is a wrapper for
// an NP object, that counts too.
if (JS_GetClass(js::UncheckedUnwrap(proto)) == &sNPObjectJSWrapperClass) {
if (nsNPObjWrapper::IsWrapper(js::UncheckedUnwrap(proto))) {
// We found an NPObject on the proto chain, get its prototype...
if (!::JS_GetPrototype(cx, proto, &proto)) {
return;
Expand Down
9 changes: 9 additions & 0 deletions dom/base/test/chrome/cpows_child.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ function parent_test()
addMessageListener("cpows:from_parent", (msg) => {
let obj = msg.objects.obj;
ok(obj.a == 1, "correct value from parent");

// Test that a CPOW reference to a function in the chrome process
// is callable from unprivileged content. Greasemonkey uses this
// functionality.
let func = msg.objects.func;
let sb = Cu.Sandbox('http://www.example.com', {});
sb.func = func;
ok(sb.eval('func()') == 101, "can call parent's function in child");

done_count++;
if (done_count == 2)
sendSyncMessage("cpows:done", {});
Expand Down
5 changes: 4 additions & 1 deletion dom/base/test/chrome/cpows_parent.xul
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,11 @@
let func = message.objects.func;
let result = func(n => 2*n);
ok(result == 20, "result == 20");
function f() {
return 101;
}
let obj = {a:1, __exposedProps__: {"a": "r"}};
savedMM.sendAsyncMessage("cpows:from_parent", {}, {obj: obj});
savedMM.sendAsyncMessage("cpows:from_parent", {}, {obj: obj, func: f});
}
// Make sure errors in this file actually hit window.onerror.
Expand Down
13 changes: 8 additions & 5 deletions dom/media/MediaCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ static const uint32_t REPLAY_PENALTY_FACTOR = 3;
// can.
static const uint32_t FREE_BLOCK_SCAN_LIMIT = 16;

// Try to save power by not resuming paused reads if the stream won't need new
// data within this time interval in the future
static const uint32_t CACHE_POWERSAVE_WAKEUP_LOW_THRESHOLD_MS = 10000;

#ifdef DEBUG
// Turn this on to do very expensive cache state validation
// #define DEBUG_VERIFY_CACHE
Expand Down Expand Up @@ -1164,6 +1160,9 @@ MediaCache::Update()
}
}

int32_t resumeThreshold = Preferences::GetInt("media.cache_resume_threshold", 10);
int32_t readaheadLimit = Preferences::GetInt("media.cache_readahead_limit", 30);

for (uint32_t i = 0; i < mStreams.Length(); ++i) {
actions.AppendElement(NONE);

Expand Down Expand Up @@ -1245,10 +1244,14 @@ MediaCache::Update()
TimeDuration predictedNewDataUse = PredictNextUseForIncomingData(stream);

if (stream->mCacheSuspended &&
predictedNewDataUse.ToMilliseconds() > CACHE_POWERSAVE_WAKEUP_LOW_THRESHOLD_MS) {
predictedNewDataUse.ToSeconds() > resumeThreshold) {
// Don't need data for a while, so don't bother waking up the stream
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p avoiding wakeup since more data is not needed", stream));
enableReading = false;
} else if (predictedNewDataUse.ToSeconds() > readaheadLimit) {
// Don't read ahead more than this much
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p throttling to avoid reading ahead too far", stream));
enableReading = false;
} else if (freeBlockCount > 0) {
// Free blocks in the cache, so keep reading
CACHE_LOG(PR_LOG_DEBUG, ("Stream %p reading since there are free blocks", stream));
Expand Down
14 changes: 14 additions & 0 deletions dom/media/MediaDataDecodedListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,20 @@ class MediaDataDecodedListener : public RequestSampleCallback {
mTaskQueue = nullptr;
}

virtual void OnSeekCompleted(nsresult aResult) MOZ_OVERRIDE {
MonitorAutoLock lock(mMonitor);
if (!mTarget || !mTaskQueue) {
// We've been shutdown, abort.
return;
}
RefPtr<nsIRunnable> task(NS_NewRunnableMethodWithArg<nsresult>(mTarget,
&Target::OnSeekCompleted,
aResult));
if (NS_FAILED(mTaskQueue->Dispatch(task))) {
NS_WARNING("Failed to dispatch OnSeekCompleted task");
}
}

private:

class DeliverAudioTask : public nsRunnable {
Expand Down
Loading

0 comments on commit 1357b3a

Please sign in to comment.