Merge m-c to birch.

This commit is contained in:
Ryan VanderMeulen 2013-05-14 08:38:59 -04:00
commit 453e5797ca
216 changed files with 1254 additions and 858 deletions

View File

@ -630,6 +630,9 @@ Accessible::VisibilityState()
if (view && view->GetVisibility() == nsViewVisibility_kHide)
return states::INVISIBLE;
if (nsLayoutUtils::IsPopup(curFrame))
return 0;
// Offscreen state for background tab content and invisible for not selected
// deck panel.
nsIFrame* parentFrame = curFrame->GetParent();

View File

@ -15,16 +15,76 @@
src="../role.js" />
<script type="application/javascript"
src="../states.js" />
<script type="application/javascript"
src="../events.js" />
<script type="application/javascript">
<![CDATA[
function openMenu(aID, aSubID, aOffscreenSubID)
{
this.menuNode = getNode(aID);
this.eventSeq = [
new invokerChecker(EVENT_FOCUS, this.menuNode)
];
this.invoke = function openMenu_invoke()
{
this.menuNode.open = true;
}
this.finalCheck = function openMenu_finalCheck()
{
testStates(aID, 0, 0, STATE_INVISIBLE | STATE_OFFSCREEN);
testStates(aSubID, 0, 0, STATE_INVISIBLE | STATE_OFFSCREEN);
if (aOffscreenSubID)
testStates(aOffscreenSubID, STATE_OFFSCREEN, 0, STATE_INVISIBLE);
}
this.getID = function openMenu_invoke()
{
return "open menu '" + aID + "' and test states";
}
}
function closeMenu(aID, aSubID, aSub2ID)
{
this.menuNode = getNode(aID);
this.eventSeq = [
new invokerChecker(EVENT_FOCUS, document)
];
this.invoke = function openMenu_invoke()
{
this.menuNode.open = false;
}
this.finalCheck = function openMenu_finalCheck()
{
testStates(aID, 0, 0, STATE_INVISIBLE | STATE_OFFSCREEN);
testStates(aSubID, STATE_INVISIBLE, 0, STATE_OFFSCREEN);
testStates(aSub2ID, STATE_INVISIBLE, 0, STATE_OFFSCREEN);
}
this.getID = function openMenu_invoke()
{
return "open menu and test states";
}
}
var gQueue = null;
function doTest()
{
testStates("deck_pane2", 0, 0, STATE_INVISIBLE | STATE_OFFSCREEN);
testStates("tabs_pane1", 0, 0, STATE_INVISIBLE | STATE_OFFSCREEN);
testStates("tabs_pane2", STATE_OFFSCREEN, 0, STATE_INVISIBLE);
SimpleTest.finish();
gQueue = new eventQueue();
gQueue.push(new openMenu("mi_file1", "mi_file1.1"));
gQueue.push(new openMenu("mi_file1.2", "mi_file1.2.1", "mi_file1.2.4"));
gQueue.push(new closeMenu("mi_file1", "mi_file1.1", "mi_file1.2.1"));
gQueue.invoke(); // Will call SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
@ -39,6 +99,11 @@
title="xul:deck hidden pages shouldn't be offscreen">
Mozilla Bug 810260
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=865591"
title="Visible menu item have offscreen state">
Mozilla Bug 865591
</a>
<p id="display"></p>
<div id="content" style="display: none">
@ -65,6 +130,21 @@
</tabpanels>
</tabbox>
<menubar>
<menu label="File" id="mi_file1">
<menupopup>
<menuitem label="SubFile" id="mi_file1.1"/>
<menu label="SubFile2" id="mi_file1.2">
<menupopup style="max-height: 5em;">
<menuitem label="SubSubFile" id="mi_file1.2.1"/>
<menuitem label="SubSubFile2" id="mi_file1.2.2"/>
<menuitem label="SubSubFile3" id="mi_file1.2.3"/>
<menuitem label="SubSubFile4" id="mi_file1.2.4"/>
</menupopup>
</menu>
</menupopup>
</menu>
</menubar>
</vbox>
</hbox>

View File

@ -8,7 +8,5 @@ srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = @relativesrcdir@
DISABLED_XPCSHELL_TESTS = unit
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk

View File

@ -13,6 +13,4 @@ FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
include $(topsrcdir)/config/rules.mk

View File

@ -579,11 +579,18 @@ pref("network.protocol-handler.external.mailto", true); // for mail
pref("network.protocol-handler.external.news", true); // for news
pref("network.protocol-handler.external.snews", true); // for secure news
pref("network.protocol-handler.external.nntp", true); // also news
#ifdef XP_WIN
pref("network.protocol-handler.external.ms-windows-store", true);
#endif
// ...without warning dialogs
pref("network.protocol-handler.warn-external.mailto", false);
pref("network.protocol-handler.warn-external.news", false);
pref("network.protocol-handler.warn-external.snews", false);
pref("network.protocol-handler.warn-external.nntp", false);
#ifdef XP_WIN
pref("network.protocol-handler.warn-external.ms-windows-store", false);
#endif
// By default, all protocol handlers are exposed. This means that
// the browser will respond to openURL commands for all URL types.

View File

@ -10,6 +10,4 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
include $(topsrcdir)/config/rules.mk

View File

@ -10,6 +10,4 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
include $(topsrcdir)/config/rules.mk

View File

@ -10,9 +10,8 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
MOCHITEST_FILES = bug408328-data.xml \
MOCHITEST_FILES = \
bug408328-data.xml \
bug368464-data.xml \
test_bug494328.html \
bug494328-data.xml \

View File

@ -10,6 +10,4 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
include $(topsrcdir)/config/rules.mk

View File

@ -168,7 +168,7 @@ BrowserGlue.prototype = {
this._onAppDefaults();
break;
case "final-ui-startup":
this._onProfileStartup();
this._finalUIStartup();
break;
case "browser-delayed-startup-finished":
this._onFirstWindowLoaded();
@ -388,12 +388,13 @@ BrowserGlue.prototype = {
_onAppDefaults: function BG__onAppDefaults() {
// apply distribution customizations (prefs)
// other customizations are applied in _onProfileStartup()
// other customizations are applied in _finalUIStartup()
this._distributionCustomizer.applyPrefDefaults();
},
// profile startup handler (contains profile initialization routines)
_onProfileStartup: function BG__onProfileStartup() {
// runs on startup, before the first command line handler is invoked
// (i.e. before the first window is opened)
_finalUIStartup: function BG__finalUIStartup() {
this._sanitizer.onStartup();
// check if we're in safe mode
if (Services.appinfo.inSafeMode) {

View File

@ -11,6 +11,4 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
include $(topsrcdir)/config/rules.mk

View File

@ -15,10 +15,6 @@ include $(DEPTH)/config/autoconf.mk
# browser_589246.js is disabled for leaking browser windows (bug 752467)
# browser_580512.js is disabled for leaking browser windows (bug 752467)
DISABLED_XPCSHELL_TESTS = \
unit \
$(NULL)
MOCHITEST_BROWSER_FILES = \
head.js \
browser_capabilities.js \

View File

@ -10,10 +10,8 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
MOCHITEST_BROWSER_FILES = browser_420786.js \
MOCHITEST_BROWSER_FILES = \
browser_420786.js \
browser_633221.js \
$(NULL)

View File

@ -1928,7 +1928,7 @@ const { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server
gcli.addCommand({
name: "listen",
description: gcli.lookup("listenDesc"),
manual: gcli.lookup("listenManual"),
manual: gcli.lookupFormat("listenManual2", [BRAND_SHORT_NAME]),
params: [
{
name: "port",

View File

@ -11,8 +11,6 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
MOCHITEST_BROWSER_FILES = \
browser_require_basic.js \
browser_templater_basic.js \

View File

@ -1263,9 +1263,9 @@ profilerNotReady=For this command to work you need to open the profiler first
# function of the 'listen' command.
listenDesc=Open a remote debug port
# LOCALIZATION NOTE (listenManual) A longer description of the 'listen'
# LOCALIZATION NOTE (listenManual2) A longer description of the 'listen'
# command.
listenManual=Firefox can allow remote debugging over a TCP/IP connection. For security reasons this is turned off by default, but can be enabled using this command.
listenManual2=%1$S can allow remote debugging over a TCP/IP connection. For security reasons this is turned off by default, but can be enabled using this command.
# LOCALIZATION NOTE (listenPortDesc) A very short string used to describe the
# function of 'port' parameter to the 'listen' command.

View File

@ -309,7 +309,7 @@
</vbox>
<!-- popup for content navigator helper -->
<vbox id="content-navigator" top="0">
<vbox id="content-navigator">
<textbox id="find-helper-textbox" class="search-bar content-navigator-item" oncommand="FindHelperUI.search(this.value)" oninput="FindHelperUI.updateCommands(this.value);" type="search"/>
</vbox>

View File

@ -10,8 +10,6 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
# For now we're copying the actual Util code.
# We should make this into a jsm module. See bug 848137
XPCSHELL_RESOURCES = \

View File

@ -83,6 +83,8 @@ pref("browser.offline-apps.notify", true);
pref("network.protocol-handler.warn-external.tel", false);
pref("network.protocol-handler.warn-external.mailto", false);
pref("network.protocol-handler.warn-external.vnd.youtube", false);
pref("network.protocol-handler.warn-external.ms-windows-store", false);
pref("network.protocol-handler.external.ms-windows-store", true);
/* history max results display */
pref("browser.display.history.maxresults", 100);

View File

@ -52,7 +52,8 @@
}
#tray[startpage],
#tray[visible]:not([expanded]) {
#tray[visible]:not([expanded]),
#tray[visible][expanded][viewstate="snapped"] {
transform: translateY(-@tabs_height@);
}
@ -518,11 +519,6 @@ documenttab[selected] .documenttab-selection {
visibility: collapse;
}
/* If we're in the small snap view, compress and simplify the UI. */
#tray[visible][expanded][viewstate="snapped"] {
margin-top: -@tabs_height@ !important;
}
#toolbar[viewstate="snapped"] {
-moz-padding-end: 0;
}

View File

@ -11,6 +11,8 @@
pointer-events: none;
padding: 0;
background-color: @appbar_color@;
bottom: 0;
position: fixed;
}
#content-navigator[type="find"],

View File

@ -10,11 +10,4 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit \
$(NULL)
# FIXME/bug 575918: out-of-process xpcshell is broken on OS X
ifneq ($(OS_ARCH),Darwin)
DISABLED_XPCSHELL_TESTS += unit_ipc
endif
include $(topsrcdir)/config/rules.mk

View File

@ -7977,6 +7977,17 @@ NotifyPageHide(nsIDocument* aDocument, void* aData)
return true;
}
static void
DispatchFullScreenChange(nsIDocument* aTarget)
{
nsRefPtr<nsAsyncDOMEvent> e =
new nsAsyncDOMEvent(aTarget,
NS_LITERAL_STRING("mozfullscreenchange"),
true,
false);
e->PostDOMEvent();
}
void
nsDocument::OnPageHide(bool aPersisted,
EventTarget* aDispatchStartTarget)
@ -8050,6 +8061,10 @@ nsDocument::OnPageHide(bool aPersisted,
// so calling CleanupFullscreenState() here will ensure all hidden
// documents have their fullscreen state reset.
CleanupFullscreenState();
// If anyone was listening to this document's state, advertizing the state
// change would be the least of the politeness.
DispatchFullScreenChange(this);
}
}
@ -9483,17 +9498,6 @@ nsDocument::SetFullscreenRoot(nsIDocument* aRoot)
mFullscreenRoot = do_GetWeakReference(aRoot);
}
static void
DispatchFullScreenChange(nsIDocument* aTarget)
{
nsRefPtr<nsAsyncDOMEvent> e =
new nsAsyncDOMEvent(aTarget,
NS_LITERAL_STRING("mozfullscreenchange"),
true,
false);
e->PostDOMEvent();
}
NS_IMETHODIMP
nsDocument::MozCancelFullScreen()
{

View File

@ -2094,7 +2094,7 @@ nsINode::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
} \
NS_IMETHODIMP nsINode::GetOn##name_(JSContext *cx, JS::Value *vp) { \
EventHandlerNonNull* h = GetOn##name_(); \
vp->setObjectOrNull(h ? h->Callable() : nullptr); \
vp->setObjectOrNull(h ? h->Callable().get() : nullptr); \
return NS_OK; \
} \
NS_IMETHODIMP nsINode::SetOn##name_(JSContext *cx, const JS::Value &v) { \

View File

@ -17,16 +17,6 @@ CPP_UNIT_TESTS = \
TestPlainTextSerializer.cpp \
$(NULL)
DISABLED_XPCSHELL_TESTS = \
unit \
$(NULL)
# FIXME/bug 575918: out-of-process xpcshell is broken on OS X
ifneq ($(OS_ARCH),Darwin)
DISABLED_XPCSHELL_TESTS += unit_ipc
endif
# Split files arbitrarily in three groups to not run into too-long command lines
# which break on Windows (see bug 563151 and bug 831989)
MOCHITEST_FILES_A = \

View File

@ -858,11 +858,10 @@ nsEventListenerManager::CompileEventHandlerInternal(nsListenerStruct *aListenerS
options.setFileAndLine(url.get(), lineNo)
.setVersion(SCRIPTVERSION_DEFAULT);
JS::RootedObject rootedNull(cx, nullptr); // See bug 781070.
JSObject *handlerFun = nullptr;
result = nsJSUtils::CompileFunction(cx, rootedNull, options,
JS::Rooted<JSObject*> handlerFun(cx);
result = nsJSUtils::CompileFunction(cx, JS::NullPtr(), options,
nsAtomCString(aListenerStruct->mTypeAtom),
argCount, argNames, *body, &handlerFun);
argCount, argNames, *body, handlerFun.address());
NS_ENSURE_SUCCESS(result, result);
handler = handlerFun;
NS_ENSURE_TRUE(handler, NS_ERROR_FAILURE);

View File

@ -95,7 +95,7 @@ nsEventListenerInfo::GetJSVal(JSContext* aCx,
nsCOMPtr<nsIJSEventListener> jsl = do_QueryInterface(mListener);
if (jsl) {
JSObject *handler = jsl->GetHandler().Ptr()->Callable();
JS::Handle<JSObject*> handler(jsl->GetHandler().Ptr()->Callable());
if (handler) {
aAc.construct(aCx, handler);
*aJSVal = OBJECT_TO_JSVAL(handler);

View File

@ -500,7 +500,7 @@ HTMLBodyElement::IsEventAttributeName(nsIAtom *aName)
HTMLBodyElement::GetOn##name_(JSContext *cx, JS::Value *vp) \
{ \
getter_type_ h = forwardto_::GetOn##name_(); \
vp->setObjectOrNull(h ? h->Callable() : nullptr); \
vp->setObjectOrNull(h ? h->Callable().get() : nullptr); \
return NS_OK; \
} \
NS_IMETHODIMP \

View File

@ -365,7 +365,7 @@ HTMLFrameSetElement::IsEventAttributeName(nsIAtom *aName)
HTMLFrameSetElement::GetOn##name_(JSContext *cx, JS::Value *vp) \
{ \
getter_type_ h = forwardto_::GetOn##name_(); \
vp->setObjectOrNull(h ? h->Callable() : nullptr); \
vp->setObjectOrNull(h ? h->Callable().get() : nullptr); \
return NS_OK; \
} \
NS_IMETHODIMP \

View File

@ -1566,9 +1566,9 @@ HTMLMediaElement::GetMozSampleRate(uint32_t* aMozSampleRate)
}
// Helper struct with arguments for our hash iterator.
typedef struct {
typedef struct MOZ_STACK_CLASS {
JSContext* cx;
JSObject* tags;
JS::HandleObject tags;
bool error;
} MetadataIterCx;

View File

@ -1163,8 +1163,8 @@ UndoManager::DispatchTransactionEvent(JSContext* aCx, const nsAString& aType,
nsCOMArray<nsIVariant> keepAlive;
nsTArray<nsIVariant*> transactionItems;
for (uint32_t i = 0; i < items.Length(); i++) {
JS::Value txVal = JS::ObjectValue(*items[i]->Callback());
if (!JS_WrapValue(aCx, &txVal)) {
JS::Rooted<JS::Value> txVal(aCx, JS::ObjectValue(*items[i]->Callback()));
if (!JS_WrapValue(aCx, txVal.address())) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
}

View File

@ -3122,8 +3122,8 @@ nsGenericHTMLElement::GetItemValue(JSContext* aCx, JSObject* aScope,
}
if (ItemScope()) {
JS::Value v;
if (!mozilla::dom::WrapObject(aCx, scope, this, &v)) {
JS::Rooted<JS::Value> v(aCx);
if (!mozilla::dom::WrapObject(aCx, scope, this, v.address())) {
aError.Throw(NS_ERROR_FAILURE);
return JS::UndefinedValue();
}

View File

@ -135,6 +135,7 @@ function checkGarbageValues()
var caught = false;
element.valueAsDate = value;
} catch(e) {
is(e.name, "TypeError", "Exception should be 'TypeError'.");
caught = true;
}
ok(caught, "Assigning " + value + " to .valueAsDate should throw");
@ -333,8 +334,6 @@ function checkWithBustedPrototype()
var element = document.createElement('input');
element.type = type;
var witnessDate = new Date();
var backupPrototype = {};
backupPrototype.getUTCFullYear = Date.prototype.getUTCFullYear;
backupPrototype.getUTCMonth = Date.prototype.getUTCMonth;
@ -351,8 +350,22 @@ function checkWithBustedPrototype()
element.valueAsDate = new Date();
isnot(element.valueAsDate, null, ".valueAsDate should not return null");
// TODO: check the Date object value (UTCFullYear, UTCMonth and UTCDate)
// when .valueAsDate will stop returning null.
// The object returned by element.valueAsDate should return a Date object
// with the same prototype:
is(element.valueAsDate.getUTCFullYear, Date.prototype.getUTCFullYear,
"prototype is the same");
is(element.valueAsDate.getUTCMonth, Date.prototype.getUTCMonth,
"prototype is the same");
is(element.valueAsDate.getUTCDate, Date.prototype.getUTCDate,
"prototype is the same");
is(element.valueAsDate.getTime, Date.prototype.getTime,
"prototype is the same");
is(element.valueAsDate.setUTCFullYear, Date.prototype.setUTCFullYear,
"prototype is the same");
// However the Date should have the correct information.
var witnessDate = new Date(element.valueAsNumber);
is(element.valueAsDate.valueOf(), witnessDate.valueOf(), "correct Date");
// Same test as above but using NaN instead of {}.
@ -365,8 +378,22 @@ function checkWithBustedPrototype()
element.valueAsDate = new Date();
isnot(element.valueAsDate, null, ".valueAsDate should not return null");
// TODO: check the Date object value (UTCFullYear, UTCMonth and UTCDate)
// when .valueAsDate will stop returning null.
// The object returned by element.valueAsDate should return a Date object
// with the same prototype:
is(element.valueAsDate.getUTCFullYear, Date.prototype.getUTCFullYear,
"prototype is the same");
is(element.valueAsDate.getUTCMonth, Date.prototype.getUTCMonth,
"prototype is the same");
is(element.valueAsDate.getUTCDate, Date.prototype.getUTCDate,
"prototype is the same");
is(element.valueAsDate.getTime, Date.prototype.getTime,
"prototype is the same");
is(element.valueAsDate.setUTCFullYear, Date.prototype.setUTCFullYear,
"prototype is the same");
// However the Date should have the correct information.
var witnessDate = new Date(element.valueAsNumber);
is(element.valueAsDate.valueOf(), witnessDate.valueOf(), "correct Date");
Date.prototype.getUTCFullYear = backupPrototype.getUTCFullYear;
Date.prototype.getUTCMonth = backupPrototype.getUTCMonth;

View File

@ -188,6 +188,11 @@ public:
{
NS_ERROR("SetBuffer called on engine that doesn't support it");
}
// This consumes the contents of aData. aData will be emptied after this returns.
virtual void SetRawArrayData(nsTArray<float>& aData)
{
NS_ERROR("SetRawArrayData called on an engine that doesn't support it");
}
/**
* Produce the next block of audio samples, given input samples aInput

View File

@ -159,6 +159,28 @@ AudioNodeStream::SetBuffer(already_AddRefed<ThreadSharedFloatArrayBufferList> aB
GraphImpl()->AppendMessage(new Message(this, aBuffer));
}
void
AudioNodeStream::SetRawArrayData(nsTArray<float>& aData)
{
class Message : public ControlMessage {
public:
Message(AudioNodeStream* aStream,
nsTArray<float>& aData)
: ControlMessage(aStream)
{
mData.SwapElements(aData);
}
virtual void Run()
{
static_cast<AudioNodeStream*>(mStream)->Engine()->SetRawArrayData(mData);
}
nsTArray<float> mData;
};
MOZ_ASSERT(this);
GraphImpl()->AppendMessage(new Message(this, aData));
}
void
AudioNodeStream::SetChannelMixingParameters(uint32_t aNumberOfChannels,
ChannelCountMode aChannelCountMode,

View File

@ -75,6 +75,8 @@ public:
void SetTimelineParameter(uint32_t aIndex, const dom::AudioParamTimeline& aValue);
void SetThreeDPointParameter(uint32_t aIndex, const dom::ThreeDPoint& aValue);
void SetBuffer(already_AddRefed<ThreadSharedFloatArrayBufferList> aBuffer);
// This consumes the contents of aData. aData will be emptied after this returns.
void SetRawArrayData(nsTArray<float>& aData);
void SetChannelMixingParameters(uint32_t aNumberOfChannels,
dom::ChannelCountMode aChannelCountMoe,
dom::ChannelInterpretation aChannelInterpretation);

View File

@ -22,6 +22,7 @@
#include "ScriptProcessorNode.h"
#include "ChannelMergerNode.h"
#include "ChannelSplitterNode.h"
#include "WaveShaperNode.h"
#include "nsNetUtil.h"
// Note that this number is an arbitrary large value to protect against OOM
@ -195,6 +196,13 @@ AudioContext::CreateGain()
return gainNode.forget();
}
already_AddRefed<WaveShaperNode>
AudioContext::CreateWaveShaper()
{
nsRefPtr<WaveShaperNode> waveShaperNode = new WaveShaperNode(this);
return waveShaperNode.forget();
}
already_AddRefed<DelayNode>
AudioContext::CreateDelay(double aMaxDelayTime, ErrorResult& aRv)
{

View File

@ -52,6 +52,7 @@ class GainNode;
class GlobalObject;
class PannerNode;
class ScriptProcessorNode;
class WaveShaperNode;
class AudioContext MOZ_FINAL : public nsDOMEventTargetHelper,
public EnableWebAudioCheck
@ -126,6 +127,9 @@ public:
already_AddRefed<GainNode>
CreateGain();
already_AddRefed<WaveShaperNode>
CreateWaveShaper();
already_AddRefed<GainNode>
CreateGainNode()
{

View File

@ -36,6 +36,7 @@ CPPSRCS := \
PannerNode.cpp \
ScriptProcessorNode.cpp \
ThreeDPoint.cpp \
WaveShaperNode.cpp \
WebAudioUtils.cpp \
$(NULL)

View File

@ -0,0 +1,140 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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/. */
#include "WaveShaperNode.h"
#include "mozilla/dom/WaveShaperNodeBinding.h"
#include "AudioNode.h"
#include "AudioNodeEngine.h"
#include "AudioNodeStream.h"
#include "mozilla/PodOperations.h"
namespace mozilla {
namespace dom {
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(WaveShaperNode, AudioNode)
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
tmp->ClearCurve();
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(WaveShaperNode, AudioNode)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(WaveShaperNode)
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mCurve)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(WaveShaperNode)
NS_INTERFACE_MAP_END_INHERITING(AudioNode)
NS_IMPL_ADDREF_INHERITED(WaveShaperNode, AudioNode)
NS_IMPL_RELEASE_INHERITED(WaveShaperNode, AudioNode)
class WaveShaperNodeEngine : public AudioNodeEngine
{
public:
explicit WaveShaperNodeEngine(AudioNode* aNode)
: AudioNodeEngine(aNode)
{
}
virtual void SetRawArrayData(nsTArray<float>& aCurve) MOZ_OVERRIDE
{
mCurve.SwapElements(aCurve);
}
virtual void ProduceAudioBlock(AudioNodeStream* aStream,
const AudioChunk& aInput,
AudioChunk* aOutput,
bool* aFinished)
{
uint32_t channelCount = aInput.mChannelData.Length();
if (!mCurve.Length() || !channelCount) {
// Optimize the case where we don't have a curve buffer,
// or the input is null.
*aOutput = aInput;
return;
}
AllocateAudioBlock(channelCount, aOutput);
for (uint32_t i = 0; i < channelCount; ++i) {
const float* inputBuffer = static_cast<const float*>(aInput.mChannelData[i]);
float* outputBuffer = const_cast<float*> (static_cast<const float*>(aOutput->mChannelData[i]));
for (uint32_t j = 0; j < WEBAUDIO_BLOCK_SIZE; ++j) {
// Index into the curve array based on the amplitude of the
// incoming signal by clamping the amplitude to [-1, 1] and
// performing a linear interpolation of the neighbor values.
float index = std::max(0.0f, std::min(float(mCurve.Length() - 1),
mCurve.Length() * (inputBuffer[j] + 1) / 2));
uint32_t indexLower = uint32_t(index);
uint32_t indexHigher = uint32_t(index + 1.0f);
if (indexHigher == mCurve.Length()) {
outputBuffer[j] = mCurve[indexLower];
} else {
float interpolationFactor = index - indexLower;
outputBuffer[j] = (1.0f - interpolationFactor) * mCurve[indexLower] +
interpolationFactor * mCurve[indexHigher];
}
}
}
}
private:
nsTArray<float> mCurve;
};
WaveShaperNode::WaveShaperNode(AudioContext* aContext)
: AudioNode(aContext,
2,
ChannelCountMode::Max,
ChannelInterpretation::Speakers)
, mCurve(nullptr)
{
NS_HOLD_JS_OBJECTS(this, WaveShaperNode);
WaveShaperNodeEngine* engine = new WaveShaperNodeEngine(this);
mStream = aContext->Graph()->CreateAudioNodeStream(engine, MediaStreamGraph::INTERNAL_STREAM);
}
WaveShaperNode::~WaveShaperNode()
{
ClearCurve();
}
void
WaveShaperNode::ClearCurve()
{
mCurve = nullptr;
NS_DROP_JS_OBJECTS(this, WaveShaperNode);
}
JSObject*
WaveShaperNode::WrapObject(JSContext *aCx, JS::Handle<JSObject*> aScope)
{
return WaveShaperNodeBinding::Wrap(aCx, aScope, this);
}
void
WaveShaperNode::SetCurve(const Float32Array* aCurve)
{
nsTArray<float> curve;
if (aCurve) {
mCurve = aCurve->Obj();
curve.SetLength(aCurve->Length());
PodCopy(curve.Elements(), aCurve->Data(), aCurve->Length());
} else {
mCurve = nullptr;
}
AudioNodeStream* ns = static_cast<AudioNodeStream*>(mStream.get());
MOZ_ASSERT(ns, "Why don't we have a stream here?");
ns->SetRawArrayData(curve);
}
}
}

View File

@ -0,0 +1,46 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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 WaveShaperNode_h_
#define WaveShaperNode_h_
#include "AudioNode.h"
#include "AudioParam.h"
namespace mozilla {
namespace dom {
class AudioContext;
class WaveShaperNode : public AudioNode
{
public:
explicit WaveShaperNode(AudioContext *aContext);
virtual ~WaveShaperNode();
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(WaveShaperNode, AudioNode)
virtual JSObject* WrapObject(JSContext *aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
JSObject* GetCurve(JSContext* aCx) const
{
return mCurve;
}
void SetCurve(const Float32Array* aData);
private:
void ClearCurve();
private:
JSObject* mCurve;
};
}
}
#endif

View File

@ -36,5 +36,6 @@ EXPORTS.mozilla.dom += [
'GainNode.h',
'PannerNode.h',
'ScriptProcessorNode.h',
'WaveShaperNode.h',
]

View File

@ -61,6 +61,9 @@ MOCHITEST_FILES := \
test_scriptProcessorNode.html \
test_scriptProcessorNodeChannelCount.html \
test_singleSourceDest.html \
test_waveShaper.html \
test_waveShaperNoCurve.html \
test_waveShaperZeroLengthCurve.html \
ting.ogg \
ting-expected.wav \
ting-dualchannel44.1.ogg \

View File

@ -0,0 +1,60 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test WaveShaperNode with no curve</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="webaudio.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
var gTest = {
length: 4096,
numberOfChannels: 1,
createGraph: function(context) {
var source = context.createBufferSource();
source.buffer = this.buffer;
var shaper = context.createWaveShaper();
shaper.curve = this.curve;
source.connect(shaper);
source.start(0);
return shaper;
},
createExpectedBuffers: function(context) {
this.buffer = context.createBuffer(1, 4096, context.sampleRate);
for (var i = 1; i < 4095; ++i) {
this.buffer.getChannelData(0)[i] = 2 * (i / 4096) - 1;
}
// Two out of range values
this.buffer.getChannelData(0)[0] = -2;
this.buffer.getChannelData(0)[4095] = 2;
this.curve = new Float32Array(2048);
for (var i = 0; i < 2048; ++i) {
this.curve[i] = Math.sin(100 * Math.PI * (i + 1) / context.sampleRate);
}
var expectedBuffer = context.createBuffer(1, 4096, context.sampleRate);
for (var i = 1; i < 4095; ++i) {
var input = this.buffer.getChannelData(0)[i];
var index = Math.floor(this.curve.length * (input + 1) / 2);
index = Math.max(0, Math.min(this.curve.length - 1, index));
expectedBuffer.getChannelData(0)[i] = this.curve[index];
}
expectedBuffer.getChannelData(0)[0] = this.curve[0];
expectedBuffer.getChannelData(0)[4095] = this.curve[2047];
return expectedBuffer;
},
};
runTest();
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,43 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test WaveShaperNode with no curve</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="webaudio.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
var gTest = {
length: 2048,
numberOfChannels: 1,
createGraph: function(context) {
var source = context.createBufferSource();
source.buffer = this.buffer;
var shaper = context.createWaveShaper();
is(shaper.curve, null, "The shaper curve must be null by default");
source.connect(shaper);
source.start(0);
return shaper;
},
createExpectedBuffers: function(context) {
var expectedBuffer = context.createBuffer(1, 2048, context.sampleRate);
for (var i = 0; i < 2048; ++i) {
expectedBuffer.getChannelData(0)[i] = Math.sin(440 * 2 * Math.PI * i / context.sampleRate);
}
this.buffer = expectedBuffer;
return expectedBuffer;
},
};
runTest();
</script>
</pre>
</body>
</html>

View File

@ -0,0 +1,43 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test WaveShaperNode with no curve</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="webaudio.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
var gTest = {
length: 2048,
numberOfChannels: 1,
createGraph: function(context) {
var source = context.createBufferSource();
source.buffer = this.buffer;
var shaper = context.createWaveShaper();
shaper.curve = new Float32Array(0);
source.connect(shaper);
source.start(0);
return shaper;
},
createExpectedBuffers: function(context) {
var expectedBuffer = context.createBuffer(1, 2048, context.sampleRate);
for (var i = 0; i < 2048; ++i) {
expectedBuffer.getChannelData(0)[i] = Math.sin(440 * 2 * Math.PI * i / context.sampleRate);
}
this.buffer = expectedBuffer;
return expectedBuffer;
},
};
runTest();
</script>
</pre>
</body>
</html>

View File

@ -11,6 +11,4 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
include $(topsrcdir)/config/rules.mk

View File

@ -177,8 +177,8 @@ nsXBLProtoImpl::InitTargetObjects(nsXBLPrototypeBinding* aBinding,
AutoPushJSContext cx(aContext->GetNativeContext());
JS::Rooted<JSObject*> global(cx, sgo->GetGlobalJSObject());
nsCOMPtr<nsIXPConnectJSObjectHolder> wrapper;
JS::Value v;
rv = nsContentUtils::WrapNative(cx, global, aBoundElement, &v,
JS::Rooted<JS::Value> v(cx);
rv = nsContentUtils::WrapNative(cx, global, aBoundElement, v.address(),
getter_AddRefs(wrapper));
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -3653,8 +3653,9 @@ XULDocument::ExecuteScript(nsIScriptContext * aContext, JSScript* aScriptObject)
NS_ENSURE_TRUE(mScriptGlobalObject, NS_ERROR_NOT_INITIALIZED);
// Execute the precompiled script with the given version
JS::Rooted<JSScript*> script(aContext->GetNativeContext(), aScriptObject);
JSObject* global = mScriptGlobalObject->GetGlobalJSObject();
return aContext->ExecuteScript(aScriptObject, global);
return aContext->ExecuteScript(script, global);
}
nsresult

View File

@ -1397,14 +1397,14 @@ nsXULTemplateBuilder::InitHTMLTemplateRoot()
if (mDB) {
// database
JS::Value jsdatabase;
JS::Rooted<JS::Value> jsdatabase(jscontext);
rv = nsContentUtils::WrapNative(jscontext, scope, mDB,
&NS_GET_IID(nsIRDFCompositeDataSource),
&jsdatabase, getter_AddRefs(wrapper));
jsdatabase.address(), getter_AddRefs(wrapper));
NS_ENSURE_SUCCESS(rv, rv);
bool ok;
ok = JS_SetProperty(jscontext, jselement, "database", &jsdatabase);
ok = JS_SetProperty(jscontext, jselement, "database", jsdatabase.address());
NS_ASSERTION(ok, "unable to set database property");
if (! ok)
return NS_ERROR_FAILURE;
@ -1412,16 +1412,16 @@ nsXULTemplateBuilder::InitHTMLTemplateRoot()
{
// builder
JS::Value jsbuilder;
JS::Rooted<JS::Value> jsbuilder(jscontext);
nsCOMPtr<nsIXPConnectJSObjectHolder> wrapper;
rv = nsContentUtils::WrapNative(jscontext, jselement,
static_cast<nsIXULTemplateBuilder*>(this),
&NS_GET_IID(nsIXULTemplateBuilder),
&jsbuilder, getter_AddRefs(wrapper));
jsbuilder.address(), getter_AddRefs(wrapper));
NS_ENSURE_SUCCESS(rv, rv);
bool ok;
ok = JS_SetProperty(jscontext, jselement, "builder", &jsbuilder);
ok = JS_SetProperty(jscontext, jselement, "builder", jsbuilder.address());
if (! ok)
return NS_ERROR_FAILURE;
}

View File

@ -11,12 +11,6 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
# FIXME/bug 575918: out-of-process xpcshell is broken on OS X
ifneq ($(OS_ARCH),Darwin)
DISABLED_XPCSHELL_TESTS += unit_ipc
endif
MOCHITEST_FILES = \
test_bug123696.html \
bug123696-subframe.html \

View File

@ -54,6 +54,7 @@ MOCHITEST_FILES += \
endif
MOCHITEST_BROWSER_FILES = \
browser_bug343515.js \
bug343515_pg1.html \
bug343515_pg2.html \
bug343515_pg3.html \
@ -62,12 +63,4 @@ MOCHITEST_BROWSER_FILES = \
bug343515_pg3_1_1.html \
$(NULL)
# browser_bug343515.js disabled on Windows & OS X for intermittent failures
# (see bug 765192 and bug 813242)
ifneq (,$(filter-out WINNT Darwin,$(OS_ARCH)))
MOCHITEST_BROWSER_FILES += \
browser_bug343515.js \
$(NULL)
endif
include $(topsrcdir)/config/rules.mk

View File

@ -12,51 +12,26 @@ function isActive(aWindow) {
return docshell.isActive;
}
function oneShotListener(aElem, aType, aCallback) {
aElem.addEventListener(aType, function () {
aElem.removeEventListener(aType, arguments.callee, true);
// We need to wait until the page from each testcase is fully loaded,
// including all of its descendant iframes. To do that we manually count
// how many load events should happen on that page (one for the toplevel doc
// and one for each subframe) and wait until we receive the expected number
// of events.
function nShotsListener(aElem, aType, aCallback, aCount) {
let count = aCount;
aElem.addEventListener(aType, function listenerCallback() {
if (--count == 0) {
aElem.removeEventListener(aType, listenerCallback, true);
// aCallback is executed asynchronously, which is handy because load
// events fire before mIsDocumentLoaded is actually set to true. :(
executeSoon(aCallback);
}
}, true);
}
// Returns a closure that iteratively (BFS) waits for all
// of the descendant frames of aInitialWindow to finish loading,
// then calls aFinalCallback.
function frameLoadWaiter(aInitialWindow, aFinalCallback) {
// The window we're currently waiting on
var curr = aInitialWindow;
// The windows we need to wait for
var waitQueue = [];
// The callback to call when we're all done
var finalCallback = aFinalCallback;
function frameLoadCallback() {
// Push any subframes of what we just got
for (var i = 0; i < curr.frames.length; ++i)
waitQueue.push(curr.frames[i]);
// Handle the next window in the queue
if (waitQueue.length >= 1) {
curr = waitQueue.shift();
if (curr.document.readyState == "complete")
frameLoadCallback();
else
oneShotListener(curr, "load", frameLoadCallback);
return;
}
// Otherwise, we're all done. Call the final callback
finalCallback();
}
return frameLoadCallback;
function oneShotListener(aElem, aType, aCallback) {
nShotsListener(aElem, aType, aCallback, 1);
}
// Entry point from Mochikit
@ -105,7 +80,10 @@ function step2() {
ctx.tab2 = gBrowser.addTab(testPath + "bug343515_pg2.html");
ctx.tab2Browser = gBrowser.getBrowserForTab(ctx.tab2);
ctx.tab2Window = ctx.tab2Browser.contentWindow;
oneShotListener(ctx.tab2Browser, "load", frameLoadWaiter(ctx.tab2Window, step3));
// bug343515_pg2.html consists of a page with two iframes,
// which will therefore generate 3 load events.
nShotsListener(ctx.tab2Browser, "load", step3, 3);
}
function step3() {
@ -126,7 +104,10 @@ function step3() {
// Navigate tab 2 to a different page
ctx.tab2Window.location = testPath + "bug343515_pg3.html";
oneShotListener(ctx.tab2Browser, "load", frameLoadWaiter(ctx.tab2Window, step4));
// bug343515_pg3.html consists of a page with two iframes, one of which
// contains another iframe, so there'll be a total of 4 load events
nShotsListener(ctx.tab2Browser, "load", step4, 4);
}
function step4() {
@ -159,13 +140,12 @@ function step4() {
ok(isActive(ctx.tab2Window.frames[1]), "Tab2 iframe 1 should be active");
// Go back
oneShotListener(ctx.tab2Browser, "pageshow", frameLoadWaiter(ctx.tab2Window, step5));
oneShotListener(ctx.tab2Browser, "pageshow", step5);
ctx.tab2Browser.goBack();
}
function step5() {
// Check everything
ok(!isActive(ctx.tab0Window), "Tab 0 should be inactive");
ok(!isActive(ctx.tab1Window), "Tab 1 should be inactive");
@ -178,7 +158,10 @@ function step5() {
// Navigate to page 3
ctx.tab1Window.location = testPath + "bug343515_pg3.html";
oneShotListener(ctx.tab1Browser, "load", frameLoadWaiter(ctx.tab1Window, step6));
// bug343515_pg3.html consists of a page with two iframes, one of which
// contains another iframe, so there'll be a total of 4 load events
nShotsListener(ctx.tab1Browser, "load", step6, 4);
}
function step6() {
@ -194,7 +177,7 @@ function step6() {
ok(!isActive(ctx.tab2Window.frames[1]), "Tab2 iframe 1 should be inactive");
// Go forward on tab 2
oneShotListener(ctx.tab2Browser, "pageshow", frameLoadWaiter(ctx.tab2Window, step7));
oneShotListener(ctx.tab2Browser, "pageshow", step7);
var tab2docshell = ctx.tab2Window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation);
tab2docshell.goForward();

View File

@ -1,5 +1,5 @@
<html>
<head></head>
<head><meta charset="UTF-8"/></head>
<body>Page 1
</body>
</html>

View File

@ -1,7 +1,7 @@
<html>
<head></head>
<head><meta charset="UTF-8"/></head>
<body>Page 2
<iframe src="data:text/html,<html><head></head><body>pg2 iframe 0</body></html>"></iframe>
<iframe src="data:text/html,<html><head></head><body>pg2 iframe 1</body></html>"></iframe>
<iframe src="data:text/html;charset=UTF8,<html><head></head><body>pg2 iframe 0</body></html>"></iframe>
<iframe src="data:text/html;charset=UTF8,<html><head></head><body>pg2 iframe 1</body></html>"></iframe>
</body>
</html>

View File

@ -1,5 +1,5 @@
<html>
<head></head>
<head><meta charset="UTF-8"/></head>
<body>Page 3
<iframe src="bug343515_pg3_1.html"></iframe>
<iframe src="bug343515_pg3_2.html"></iframe>

View File

@ -1,5 +1,5 @@
<html>
<head></head>
<head><meta charset="UTF-8"/></head>
<body>pg3 - iframe 0
<iframe src="bug343515_pg3_1_1.html"></iframe>
</body>

View File

@ -1 +1 @@
<html><head></head><body>How far does the rabbit hole go?</body></html>
<html><head><meta charset="UTF-8"/></head><body>How far does the rabbit hole go?</body></html>

View File

@ -1 +1 @@
<html><head></head><body>pg3 iframe 1</body></html>
<html><head><meta charset="UTF-8"/></head><body>pg3 iframe 1</body></html>

View File

@ -12,6 +12,4 @@ FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
include $(topsrcdir)/config/rules.mk

View File

@ -24,6 +24,4 @@ MOCHITEST_CHROME_FILES = \
test_apps_service.xul \
$(NULL)
DISABLED_XPCSHELL_TESTS = unit
include $(topsrcdir)/config/rules.mk

View File

@ -1477,7 +1477,6 @@ nsGlobalWindow::FreeInnerObjects()
}
if (mScreen) {
mScreen->Reset();
mScreen = nullptr;
}
@ -1754,8 +1753,8 @@ nsGlobalWindow::UnmarkGrayTimers()
Function* f = timeout->mScriptHandler->GetCallback();
if (f) {
// Callable() already does xpc_UnmarkGrayObject.
DebugOnly<JSObject*> o = f->Callable();
MOZ_ASSERT(!xpc_IsGrayGCThing(o), "Should have been unmarked");
DebugOnly<JS::Handle<JSObject*> > o = f->Callable();
MOZ_ASSERT(!xpc_IsGrayGCThing(o.value), "Should have been unmarked");
}
}
}
@ -11783,7 +11782,7 @@ nsGlobalWindow::DisableNetworkEvent(uint32_t aType)
NS_IMETHODIMP nsGlobalWindow::GetOn##name_(JSContext *cx, \
JS::Value *vp) { \
EventHandlerNonNull* h = GetOn##name_(); \
vp->setObjectOrNull(h ? h->Callable() : nullptr); \
vp->setObjectOrNull(h ? h->Callable().get() : nullptr); \
return NS_OK; \
} \
NS_IMETHODIMP nsGlobalWindow::SetOn##name_(JSContext *cx, \

View File

@ -65,25 +65,9 @@ nsScreen::nsScreen()
SetIsDOMBinding();
}
void
nsScreen::Reset()
{
hal::UnlockScreenOrientation();
if (mEventListener) {
nsCOMPtr<EventTarget> target = do_QueryInterface(GetOwner());
if (target) {
target->RemoveSystemEventListener(NS_LITERAL_STRING("mozfullscreenchange"),
mEventListener, /* usecapture */ true);
}
mEventListener = nullptr;
}
}
nsScreen::~nsScreen()
{
Reset();
MOZ_ASSERT(!mEventListener);
hal::UnregisterScreenConfigurationObserver(this);
}
@ -368,7 +352,7 @@ nsScreen::MozLockOrientation(const Sequence<nsString>& aOrientations,
// and when we will have to unlock the screen.
// This needs to be done before LockScreenOrientation call to make sure
// the locking can be unlocked.
nsCOMPtr<EventTarget> target = do_QueryInterface(GetOwner());
nsCOMPtr<EventTarget> target = do_QueryInterface(GetOwner()->GetDoc());
if (!target) {
return false;
}
@ -427,24 +411,17 @@ nsScreen::FullScreenEventListener::HandleEvent(nsIDOMEvent* aEvent)
#endif
nsCOMPtr<EventTarget> target = aEvent->InternalDOMEvent()->GetCurrentTarget();
nsCOMPtr<nsIDOMDocument> doc = do_QueryInterface(target);
MOZ_ASSERT(target && doc);
// We have to make sure that the event we got is the event sent when
// fullscreen is disabled because we could get one when fullscreen
// got enabled if the lock call is done at the same moment.
nsCOMPtr<nsIDOMWindow> window = do_QueryInterface(target);
MOZ_ASSERT(window);
nsCOMPtr<nsIDOMDocument> doc;
window->GetDocument(getter_AddRefs(doc));
// If we have no doc, we will just continue, remove the event and unlock.
// This is an edge case were orientation lock and fullscreen is meaningless.
if (doc) {
bool fullscreen;
doc->GetMozFullScreen(&fullscreen);
if (fullscreen) {
return NS_OK;
}
}
target->RemoveSystemEventListener(NS_LITERAL_STRING("mozfullscreenchange"),
this, true);

View File

@ -30,8 +30,6 @@ class nsScreen : public nsDOMEventTargetHelper
public:
static already_AddRefed<nsScreen> Create(nsPIDOMWindow* aWindow);
void Reset();
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMSCREEN
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper)

View File

@ -31,7 +31,7 @@ public:
MOZ_ASSERT(JS_ObjectIsCallable(nullptr, aCallable));
}
JSObject* Callable() const
JS::Handle<JSObject*> Callable() const
{
return Callback();
}

View File

@ -10,8 +10,6 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
MOCHITEST_FILES = \
file_utf16_be_bom.css \
file_utf16_be_bom.js \

View File

@ -29,6 +29,8 @@ DEFINES += -D_IMPL_NS_LAYOUT
MOCHITEST_FILES = test_ipc.html
# bug: 866734 - move XPCSHEL_TESTS to moz.build
# Need to enable these tests sometime soon.
#DISABLED_XPCSHELL_TESTS = unit

View File

@ -10,8 +10,6 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
MOCHITEST_FILES = \
bfcache_iframe1.html \
bfcache_iframe2.html \

View File

@ -127,6 +127,44 @@ function runTest(aCallback) {
});
}
/**
* Checks that the media stream tracks have the expected amount of tracks
* with the correct kind and id based on the type and constraints given.
*
* @param {Object} constraints specifies whether the stream should have
* audio, video, or both
* @param {String} type the type of media stream tracks being checked
* @param {sequence<MediaStreamTrack>} mediaStreamTracks the media stream
* tracks being checked
*/
function checkMediaStreamTracksByType(constraints, type, mediaStreamTracks) {
if(constraints[type]) {
is(mediaStreamTracks.length, 1, 'One ' + type + ' track shall be present');
if(mediaStreamTracks.length) {
is(mediaStreamTracks[0].kind, type, 'Track kind should be ' + type);
ok(mediaStreamTracks[0].id, 'Track id should be defined');
}
} else {
is(mediaStreamTracks.length, 0, 'No ' + type + ' tracks shall be present');
}
}
/**
* Check that the given media stream contains the expected media stream
* tracks given the associated audio & video constraints provided.
*
* @param {Object} constraints specifies whether the stream should have
* audio, video, or both
* @param {MediaStream} mediaStream the media stream being checked
*/
function checkMediaStreamTracks(constraints, mediaStream) {
checkMediaStreamTracksByType(constraints, 'audio',
mediaStream.getAudioTracks());
checkMediaStreamTracksByType(constraints, 'video',
mediaStream.getVideoTracks());
}
/**
* Generates a callback function fired only under unexpected circumstances
* while running the tests. The generated function kills off the test as well

View File

@ -25,10 +25,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=781534
*/
runTest(function () {
var testAudio = document.getElementById('testAudio');
var constraints = {audio: true};
getUserMedia(constraints, function (aStream) {
checkMediaStreamTracks(constraints, aStream);
getUserMedia({audio: true}, function (aStream) {
var playback = new LocalMediaStreamPlayback(testAudio, aStream);
playback.playMedia(false, function () {
aStream.stop();
SimpleTest.finish();

View File

@ -25,10 +25,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=781534
*/
runTest(function () {
var testVideo = document.getElementById('testVideo');
var constraints = {video: true};
getUserMedia(constraints, function (aStream) {
checkMediaStreamTracks(constraints, aStream);
getUserMedia({video: true}, function (aStream) {
var playback = new LocalMediaStreamPlayback(testVideo, aStream);
playback.playMedia(false, function () {
aStream.stop();
SimpleTest.finish();

View File

@ -25,10 +25,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=781534
*/
runTest(function () {
var testVideoAudio = document.getElementById('testVideoAudio');
var constraints = {video: true, audio: true};
getUserMedia(constraints, function (aStream) {
checkMediaStreamTracks(constraints, aStream);
getUserMedia({video: true, audio: true}, function (aStream) {
var playback = new LocalMediaStreamPlayback(testVideoAudio, aStream);
playback.playMedia(false, function () {
aStream.stop();
SimpleTest.finish();

View File

@ -11,10 +11,4 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
ifdef MOZ_B2G_RIL
ifdef ENABLE_TESTS
DISABLED_XPCSHELL_TESTS = tests
endif
endif
include $(topsrcdir)/config/rules.mk

View File

@ -11,8 +11,4 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
ifdef ENABLE_TESTS
DISABLED_XPCSHELL_TESTS = tests
endif
include $(topsrcdir)/config/rules.mk

View File

@ -27,10 +27,4 @@ MOCHITEST_FILES = \
$(NULL)
endif
DISABLED_XPCSHELL_TESTS = unit unit_ipc
ifdef MOZ_B2G_RIL
DISABLED_XPCSHELL_TESTS += unit_stats
endif
include $(topsrcdir)/config/rules.mk

View File

@ -11,6 +11,4 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
include $(topsrcdir)/config/rules.mk

View File

@ -11,8 +11,6 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
include $(topsrcdir)/config/rules.mk
_TEST_FILES = \

View File

@ -11,8 +11,4 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = \
unit \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -11,9 +11,8 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
MOCHITEST_FILES = test_json.html \
MOCHITEST_FILES = \
test_json.html \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -76,10 +76,6 @@ EXTRA_JS_MODULES = \
systemlibs.js \
$(NULL)
ifdef ENABLE_TESTS
DISABLED_XPCSHELL_TESTS = tests
endif
include $(topsrcdir)/config/rules.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk

View File

@ -10,6 +10,4 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
include $(topsrcdir)/config/rules.mk

View File

@ -49,6 +49,8 @@ interface AudioContext : EventTarget {
[Creator]
BiquadFilterNode createBiquadFilter();
[Creator]
WaveShaperNode createWaveShaper();
[Creator]
PannerNode createPanner();
[Creator, Throws]

View File

@ -0,0 +1,19 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/.
*
* The origin of this IDL file is
* https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html
*
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
[PrefControlled]
interface WaveShaperNode : AudioNode {
attribute Float32Array? curve;
};

View File

@ -315,6 +315,7 @@ webidl_files = \
URLUtils.webidl \
USSDReceivedEvent.webidl \
VideoStreamTrack.webidl \
WaveShaperNode.webidl \
Window.webidl \
XMLDocument.webidl \
XMLHttpRequest.webidl \

View File

@ -11,8 +11,4 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
ifdef ENABLE_TESTS
DISABLED_XPCSHELL_TESTS = tests/unit
endif
include $(topsrcdir)/config/rules.mk

View File

@ -61,12 +61,5 @@ MOCHITEST_BROWSER_FILES = \
browser_test_favicon.js \
$(NULL)
DISABLED_XPCSHELL_TESTS = unit
# FIXME/bug 575918: out-of-process xpcshell is broken on OS X
ifneq ($(OS_ARCH),Darwin)
DISABLED_XPCSHELL_TESTS += unit_ipc
endif
include $(topsrcdir)/config/rules.mk

View File

@ -10,9 +10,5 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
ifdef ENABLE_TESTS
DISABLED_XPCSHELL_TESTS = tests/unit
endif
include $(topsrcdir)/config/rules.mk

View File

@ -13,8 +13,6 @@ include $(DEPTH)/config/autoconf.mk
MOZILLA_INTERNAL_API = 1
DISABLED_XPCSHELL_TESTS = unit
MOCHITEST_FILES = $(addprefix mochitest/, \
test_bug509244.html \
test_bug513439.html \

View File

@ -91,5 +91,5 @@ load 686190-1.html
load 693143-1.html
load 768079-1.html
asserts-if(gtk2Widget,1) load 798853.html # bug 868792
asserts-if(winWidget,0-1) load 815489.html
asserts-if(winWidget,0-1) skip-if(B2G) load 815489.html
load 856784-1.html

View File

@ -476,57 +476,6 @@ void imgFrame::Draw(gfxContext *aContext, gfxPattern::GraphicsFilter aFilter,
}
}
nsresult imgFrame::Extract(const nsIntRect& aRegion, imgFrame** aResult)
{
nsAutoPtr<imgFrame> subImage(new imgFrame());
// The scaling problems described in bug 468496 are especially
// likely to be visible for the sub-image, as at present the only
// user is the border-image code and border-images tend to get
// stretched a lot. At the same time, the performance concerns
// that prevent us from just using Cairo's fallback scaler when
// accelerated graphics won't cut it are less relevant to such
// images, since they also tend to be small. Thus, we forcibly
// disable the use of anything other than a client-side image
// surface for the sub-image; this ensures that the correct
// (albeit slower) Cairo fallback scaler will be used.
subImage->mNeverUseDeviceSurface = true;
nsresult rv = subImage->Init(0, 0, aRegion.width, aRegion.height,
mFormat, mPaletteDepth);
NS_ENSURE_SUCCESS(rv, rv);
subImage->SetAsNonPremult(mNonPremult);
// scope to destroy ctx
{
gfxContext ctx(subImage->ThebesSurface());
ctx.SetOperator(gfxContext::OPERATOR_SOURCE);
if (mSinglePixel) {
ctx.SetDeviceColor(mSinglePixelColor);
} else {
// SetSource() places point (0,0) of its first argument at
// the coordinages given by its second argument. We want
// (x,y) of the image to be (0,0) of source space, so we
// put (0,0) of the image at (-x,-y).
ctx.SetSource(this->ThebesSurface(), gfxPoint(-aRegion.x, -aRegion.y));
}
ctx.Rectangle(gfxRect(0, 0, aRegion.width, aRegion.height));
ctx.Fill();
}
nsIntRect filled(0, 0, aRegion.width, aRegion.height);
rv = subImage->ImageUpdated(filled);
NS_ENSURE_SUCCESS(rv, rv);
subImage->Optimize();
*aResult = subImage.forget();
return NS_OK;
}
nsresult imgFrame::ImageUpdated(const nsIntRect &aUpdateRect)
{
mDecoded.UnionRect(mDecoded, aUpdateRect);

View File

@ -38,8 +38,6 @@ public:
const nsIntMargin &aPadding, const nsIntRect &aSubimage,
uint32_t aImageFlags = imgIContainer::FLAG_NONE);
nsresult Extract(const nsIntRect& aRegion, imgFrame** aResult);
nsresult ImageUpdated(const nsIntRect &aUpdateRect);
nsIntRect GetRect() const;

View File

@ -10,7 +10,4 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
# Module name for xpcshell tests.
DISABLED_XPCSHELL_TESTS = unit
include $(topsrcdir)/config/rules.mk

View File

@ -11,6 +11,4 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
include $(topsrcdir)/config/rules.mk

View File

@ -11,6 +11,4 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
include $(topsrcdir)/config/rules.mk

View File

@ -11,8 +11,6 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
# Tests disabled because they dont work in libxul builds.
#MOZILLA_INTERNAL_API = 1
#

View File

@ -11,8 +11,6 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DISABLED_XPCSHELL_TESTS = unit
USE_STATIC_LIBS = 1
CPPSRCS = UnicharSelfTest.cpp \

View File

@ -28,11 +28,6 @@ LOCAL_INCLUDES += \
-I$(topsrcdir)/dom/base \
$(NULL)
# FIXME/bug 575918: out-of-process xpcshell is broken on OS X
ifneq ($(OS_ARCH),Darwin)
DISABLED_XPCSHELL_TESTS = tests
endif
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
include $(topsrcdir)/config/rules.mk

View File

@ -30,6 +30,4 @@ EXTRA_JS_MODULES = \
jsdebugger.jsm \
$(NULL)
DISABLED_XPCSHELL_TESTS = tests
include $(topsrcdir)/config/rules.mk

View File

@ -9,10 +9,5 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
# FIXME/bug 575918: out-of-process xpcshell is broken on OS X
ifneq ($(OS_ARCH),Darwin)
DISABLED_XPCSHELL_TESTS = unit
endif
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk

View File

@ -24,8 +24,6 @@ LIBXUL_LIBRARY = 1
MODULE_NAME = JavaScript_Debugger
EXPORT_LIBRARY = 1
DISABLED_XPCSHELL_TESTS = test
# REQUIRES = java js
ifdef JS_THREADSAFE

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