This commit is contained in:
Matthew Noorenberghe 2013-09-02 16:49:09 -07:00
Родитель c6fd93987e 12c7f19bac
Коммит 8852a78ede
281 изменённых файлов: 2849 добавлений и 2357 удалений

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

@ -415,6 +415,10 @@ SettingsListener.observe('privacy.donottrackheader.enabled', false, function(val
Services.prefs.setBoolPref('privacy.donottrackheader.enabled', value);
});
SettingsListener.observe('privacy.donottrackheader.value', 1, function(value) {
Services.prefs.setIntPref('privacy.donottrackheader.value', value);
});
// =================== Crash Reporting ====================
SettingsListener.observe('app.reportCrashes', 'ask', function(value) {
if (value == 'always') {

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

@ -1,4 +1,4 @@
{
"revision": "2ffeaf7249731583606df7c14d6802d17f7bfa17",
"revision": "46a5f0d899394798b848e204a5a17e661e19aba6",
"repo_path": "/integration/gaia-central"
}

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

@ -1,5 +1,5 @@
<?xml version="1.0"?>
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1376427851000">
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1377553788000">
<emItems>
<emItem blockID="i350" id="sqlmoz@facebook.com">
<versionRange minVersion="0" maxVersion="*" severity="3">
@ -480,6 +480,10 @@
<versionRange minVersion="0.1" maxVersion="5.2.0.7164" severity="1">
</versionRange>
</emItem>
<emItem blockID="i444" id="fplayer@adobe.flash">
<versionRange minVersion="0" maxVersion="*" severity="3">
</versionRange>
</emItem>
<emItem blockID="i334" id="{0F827075-B026-42F3-885D-98981EE7B1AE}">
<versionRange minVersion="0" maxVersion="*" severity="3">
</versionRange>

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

@ -16,18 +16,6 @@ XPCOMUtils.defineLazyModuleGetter(this,
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");
// Bug 671101 - directly using webNavigation in this context
// causes docshells to leak
this.__defineGetter__("webNavigation", function () {
return docShell.QueryInterface(Ci.nsIWebNavigation);
});
addMessageListener("WebNavigation:LoadURI", function (message) {
let flags = message.json.flags || webNavigation.LOAD_FLAGS_NONE;
webNavigation.loadURI(message.json.uri, flags, null, null, null);
});
addMessageListener("Browser:HideSessionRestoreButton", function (message) {
// Hide session restore button on about:home
let doc = content.document;

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

@ -11,6 +11,7 @@
.text-link {
color: #fff !important;
text-decoration: underline;
}
.text-link:-moz-focusring {

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

@ -11,6 +11,7 @@
.text-link {
color: #fff !important;
text-decoration: underline;
}
.text-link:-moz-focusring {

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

@ -11,6 +11,7 @@
.text-link {
color: #fff !important;
text-decoration: underline;
}
#rightBox {

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

@ -44,6 +44,11 @@ function test() {
let tab;
Task.spawn(function() {
try {
let SESSION_STORAGE_KEY = "SESSION_STORAGE_KEY " + Math.random();
let SESSION_STORAGE_VALUE = "SESSION_STORAGE_VALUE " + Math.random();
let LOCAL_STORAGE_KEY = "LOCAL_STORAGE_KEY " + Math.random();
let LOCAL_STORAGE_VALUE = "LOCAL_STORAGE_VALUE " + Math.random();
tab = gBrowser.addTab("http://example.com");
// about:home supports sessionStorage and localStorage
@ -57,25 +62,27 @@ function test() {
ss.getBrowserState();
info("Change sessionStorage, ensure that state is saved");
win.sessionStorage["SESSION_STORAGE_KEY"] = "SESSION_STORAGE_VALUE";
let storageChanged = yield waitForStorageChange(tab);
let storageChangedPromise = waitForStorageChange(tab);
win.sessionStorage[SESSION_STORAGE_KEY] = SESSION_STORAGE_VALUE;
let storageChanged = yield storageChangedPromise;
ok(storageChanged, "Changing sessionStorage triggered the right message");
yield forceWriteState();
let state = ss.getBrowserState();
ok(state.indexOf("SESSION_STORAGE_KEY") != -1, "Key appears in state");
ok(state.indexOf("SESSION_STORAGE_VALUE") != -1, "Value appears in state");
ok(state.indexOf(SESSION_STORAGE_KEY) != -1, "Key appears in state");
ok(state.indexOf(SESSION_STORAGE_VALUE) != -1, "Value appears in state");
info("Change localStorage, ensure that state is not saved");
win.localStorage["LOCAL_STORAGE_KEY"] = "LOCAL_STORAGE_VALUE";
storageChanged = yield waitForStorageChange(tab);
storageChangedPromise = waitForStorageChange(tab);
win.localStorage[LOCAL_STORAGE_KEY] = LOCAL_STORAGE_VALUE;
storageChanged = yield storageChangedPromise;
ok(!storageChanged, "Changing localStorage did not trigger a message");
yield forceWriteState();
state = ss.getBrowserState();
ok(state.indexOf("LOCAL_STORAGE_KEY") == -1, "Key does not appear in state");
ok(state.indexOf("LOCAL_STORAGE_VALUE") == -1, "Value does not appear in state");
ok(state.indexOf(LOCAL_STORAGE_KEY) == -1, "Key does not appear in state");
ok(state.indexOf(LOCAL_STORAGE_VALUE) == -1, "Value does not appear in state");
} catch (ex) {
ok(false, ex);
info(ex.stack);

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

@ -27,6 +27,16 @@ def main(file):
appdata = dict(("%s:%s" % (s, o), config.get(s, o)) for s in config.sections() for o in config.options(s))
appdata['flags'] = ' | '.join(flags) if flags else '0'
appdata['App:profile'] = '"%s"' % appdata['App:profile'] if 'App:profile' in appdata else 'NULL'
expected = ('App:vendor', 'App:name', 'App:version', 'App:buildid',
'App:id', 'Gecko:minversion', 'Gecko:maxversion')
missing = [var for var in expected if var not in appdata]
if missing:
print >>sys.stderr, \
"Missing values in %s: %s" % (file, ', '.join(missing))
sys.exit(1)
if not 'Crash Reporter:serverurl' in appdata:
appdata['Crash Reporter:serverurl'] = ''
print '''#include "nsXREAppData.h"
static const nsXREAppData sAppData = {

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

@ -538,7 +538,10 @@ class Automation(object):
return env
def killPid(self, pid):
os.kill(pid, getattr(signal, "SIGKILL", signal.SIGTERM))
try:
os.kill(pid, getattr(signal, "SIGKILL", signal.SIGTERM))
except WindowsError:
self.log.info("Failed to kill process %d." % pid)
if IS_WIN32:
PeekNamedPipe = ctypes.windll.kernel32.PeekNamedPipe

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

@ -8,7 +8,6 @@
#include "nsISerializable.idl"
%{C++
struct JSContext;
struct JSPrincipals;
#include "nsCOMPtr.h"
#include "nsTArray.h"

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

@ -18,13 +18,10 @@
#include "pldhash.h"
#include "plstr.h"
#include "nsIScriptExternalNameSet.h"
#include "js/TypeDecls.h"
#include <stdint.h>
namespace JS {
template <typename T> class Handle;
template <typename T> class MutableHandle;
}
class nsIDocShell;
class nsString;
class nsIClassInfo;

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

@ -104,18 +104,9 @@ endif
# Load mozconfig Options
# See build pages, http://www.mozilla.org/build/ for how to set up mozconfig.
MOZCONFIG_LOADER := build/autoconf/mozconfig2client-mk
define CR
endef
# As $(shell) doesn't preserve newlines, use sed to replace them with an
# unlikely sequence (||), which is then replaced back to newlines by make
# before evaluation.
$(eval $(subst ||,$(CR),$(shell _PYMAKE=$(.PYMAKE) $(TOPSRCDIR)/$(MOZCONFIG_LOADER) $(TOPSRCDIR) 2> $(TOPSRCDIR)/.mozconfig.out | sed 's/$$/||/')))
# mozconfig.mk needs to be loaded multiple times by configure, so we don't check
# for INCLUDED_MOZCONFIG_MK
include $(TOPSRCDIR)/config/makefiles/mozconfig.mk
ifdef AUTOCLOBBER
export AUTOCLOBBER=1

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

@ -0,0 +1,33 @@
# -*- 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/.
#
INCLUDED_MOZCONFIG_MK = 1
# We are pulling in the mozconfig exports, so we only need to run once for the
# whole make process tree (not for each sub-make). Export this so the sub-makes
# don't read mozconfig multiple times.
export INCLUDED_MOZCONFIG_MK
MOZCONFIG_LOADER := build/autoconf/mozconfig2client-mk
define CR
endef
# topsrcdir is used by rules.mk (set from the generated Makefile), while
# TOPSRCDIR is used by client.mk
ifneq (,$(topsrcdir))
top := $(topsrcdir)
else
top := $(TOPSRCDIR)
endif
# As $(shell) doesn't preserve newlines, use sed to replace them with an
# unlikely sequence (||), which is then replaced back to newlines by make
# before evaluation.
$(eval $(subst ||,$(CR),$(shell _PYMAKE=$(.PYMAKE) $(top)/$(MOZCONFIG_LOADER) $(top) 2> $(top)/.mozconfig.out | sed 's/$$/||/')))

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

@ -10,6 +10,10 @@ ifndef topsrcdir
$(error topsrcdir was not set))
endif
ifndef INCLUDED_MOZCONFIG_MK
include $(topsrcdir)/config/makefiles/mozconfig.mk
endif
# Integrate with mozbuild-generated make files. We first verify that no
# variables provided by the automatically generated .mk files are
# present. If they are, this is a violation of the separation of

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

@ -18,6 +18,7 @@
#include <ieeefp.h>
#endif
#include "js/TypeDecls.h"
#include "js/RootingAPI.h"
#include "mozilla/Assertions.h"
#include "mozilla/GuardObjects.h"
@ -92,7 +93,6 @@ class nsTextFragment;
class nsViewportInfo;
class nsWrapperCache;
struct JSContext;
struct JSPropertyDescriptor;
struct JSRuntime;
struct nsIntMargin;
@ -103,10 +103,6 @@ template<class K, class V> class nsDataHashtable;
template<class K, class V> class nsRefPtrHashtable;
template<class T> class nsReadingIterator;
namespace JS {
class Value;
} // namespace JS
namespace mozilla {
class ErrorResult;
class Selection;

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

@ -19,6 +19,7 @@
#include "mozilla/ErrorResult.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/dom/EventTarget.h" // for base class
#include "js/TypeDecls.h" // for Handle, Value, JSObject, JSContext
// Including 'windows.h' will #define GetClassInfo to something else.
#ifdef XP_WIN
@ -67,11 +68,6 @@ template<typename T> class Optional;
} // namespace dom
} // namespace mozilla
namespace JS {
class Value;
template<typename T> class Handle;
}
#define NODE_FLAG_BIT(n_) (1U << (WRAPPER_CACHE_FLAGS_BITS_USED + (n_)))
enum {

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

@ -108,8 +108,6 @@ StructuredCloneData UnpackClonedMessageDataForChild(const ClonedMessageData& aDa
} // namespace mozilla
class nsAXPCNativeCallContext;
struct JSContext;
class JSObject;
struct nsMessageListenerInfo
{

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

@ -8,10 +8,9 @@
#include "nsIContent.h" // for use in inline function (ParentChainChanged)
#include "nsIMutationObserver.h" // for use in inline function (ParentChainChanged)
#include "js/TypeDecls.h"
struct CharacterDataChangeInfo;
struct JSContext;
class JSObject;
class nsIVariant;
class nsIDOMNode;
class nsIDOMUserDataHandler;

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

@ -552,6 +552,9 @@ MOCHITEST_FILES_C= \
test_bug708620.html \
file_bug708620.html \
file_bug708620-2.html \
test_XHR_timeout.html \
test_XHR_timeout.js \
file_XHR_timeout.sjs \
test_bug717511.html \
file_bug717511.html \
file_bug717511.html^headers^ \
@ -701,11 +704,6 @@ MOCHITEST_FILES_PARTS = $(foreach s,A B C,MOCHITEST_FILES_$(s))
# test_bug503473.html \
# file_bug503473-frame.sjs \
# Disabled for frequent failures (bug 841505, bug 842344, etc)
# test_XHR_timeout.html \
# test_XHR_timeout.js \
# file_XHR_timeout.sjs \
MOCHITEST_BROWSER_FILES = \
browser_bug593387.js \
browser_bug902350.js \

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

@ -9,12 +9,7 @@
#include "WebGLTypes.h"
#include "nsISupports.h"
#include "nsString.h"
struct JSContext;
class JSObject;
namespace JS {
template <typename T> class Handle;
}
#include "js/TypeDecls.h"
namespace mozilla {

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

@ -18,12 +18,11 @@
#include "mozilla/dom/EventBinding.h"
#include "nsIScriptGlobalObject.h"
#include "Units.h"
#include "js/TypeDecls.h"
class nsIContent;
class nsIDOMEventTarget;
class nsPresContext;
struct JSContext;
class JSObject;
namespace mozilla {
namespace dom {

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

@ -348,7 +348,7 @@ nsDOMUIEvent::IsChar() const
case NS_KEY_EVENT:
return static_cast<nsKeyEvent*>(mEvent)->isChar;
case NS_TEXT_EVENT:
return static_cast<nsKeyEvent*>(mEvent)->isChar;
return static_cast<nsTextEvent*>(mEvent)->isChar;
default:
return false;
}

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

@ -8,9 +8,8 @@
#include "nsIDOMHTMLCollection.h"
#include "nsWrapperCache.h"
#include "js/TypeDecls.h"
struct JSContext;
class JSObject;
class nsINode;
class nsString;
template<class> class nsTArray;

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

@ -5,7 +5,7 @@
#include "mozilla/dom/HTMLCanvasElement.h"
#include "BasicLayers.h"
#include "Layers.h"
#include "imgIEncoder.h"
#include "jsapi.h"
#include "jsfriendapi.h"

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

@ -54,7 +54,7 @@
#include "nsICachingChannel.h"
#include "nsLayoutUtils.h"
#include "nsVideoFrame.h"
#include "BasicLayers.h"
#include "Layers.h"
#include <limits>
#include "nsIAsyncVerifyRedirectCallback.h"
#include "nsIAppShell.h"

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

@ -9,9 +9,7 @@
#include "nsIDOMValidityState.h"
#include "nsIConstraintValidation.h"
#include "nsWrapperCache.h"
class JSObject;
struct JSContext;
#include "js/TypeDecls.h"
namespace mozilla {
namespace dom {

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

@ -174,77 +174,53 @@ AudioBlockPanStereoToStereo_NEON(const float aInputL[WEBAUDIO_BLOCK_SIZE],
ASSERT_ALIGNED(aOutputL);
ASSERT_ALIGNED(aOutputR);
float32x4_t vinL0, vinL1, vinL2, vinL3;
float32x4_t vinR0, vinR1, vinR2, vinR3;
float32x4_t voutL0, voutL1, voutL2, voutL3;
float32x4_t voutR0, voutR1, voutR2, voutR3;
float32x4_t vinL0, vinL1;
float32x4_t vinR0, vinR1;
float32x4_t voutL0, voutL1;
float32x4_t voutR0, voutR1;
float32x4_t vscaleL = vmovq_n_f32(aGainL);
float32x4_t vscaleR = vmovq_n_f32(aGainR);
if (aIsOnTheLeft) {
for (uint32_t i = 0; i < WEBAUDIO_BLOCK_SIZE; i+=16) {
for (uint32_t i = 0; i < WEBAUDIO_BLOCK_SIZE; i+=8) {
vinL0 = vld1q_f32(ADDRESS_OF(aInputL, i));
vinL1 = vld1q_f32(ADDRESS_OF(aInputL, i+4));
vinL2 = vld1q_f32(ADDRESS_OF(aInputL, i+8));
vinL3 = vld1q_f32(ADDRESS_OF(aInputL, i+12));
vinR0 = vld1q_f32(ADDRESS_OF(aInputR, i));
vinR1 = vld1q_f32(ADDRESS_OF(aInputR, i+4));
vinR2 = vld1q_f32(ADDRESS_OF(aInputR, i+8));
vinR3 = vld1q_f32(ADDRESS_OF(aInputR, i+12));
voutL0 = vmlaq_f32(vinL0, vinR0, vscaleL);
voutL1 = vmlaq_f32(vinL1, vinR1, vscaleL);
voutL2 = vmlaq_f32(vinL2, vinR2, vscaleL);
voutL3 = vmlaq_f32(vinL3, vinR3, vscaleL);
vst1q_f32(ADDRESS_OF(aOutputL, i), voutL0);
vst1q_f32(ADDRESS_OF(aOutputL, i+4), voutL1);
vst1q_f32(ADDRESS_OF(aOutputL, i+8), voutL2);
vst1q_f32(ADDRESS_OF(aOutputL, i+12), voutL3);
voutR0 = vmulq_f32(vinR0, vscaleR);
voutR1 = vmulq_f32(vinR1, vscaleR);
voutR2 = vmulq_f32(vinR2, vscaleR);
voutR3 = vmulq_f32(vinR3, vscaleR);
vst1q_f32(ADDRESS_OF(aOutputR, i), voutR0);
vst1q_f32(ADDRESS_OF(aOutputR, i+4), voutR1);
vst1q_f32(ADDRESS_OF(aOutputR, i+8), voutR2);
vst1q_f32(ADDRESS_OF(aOutputR, i+12), voutR3);
}
} else {
for (uint32_t i = 0; i < WEBAUDIO_BLOCK_SIZE; i+=16) {
for (uint32_t i = 0; i < WEBAUDIO_BLOCK_SIZE; i+=8) {
vinL0 = vld1q_f32(ADDRESS_OF(aInputL, i));
vinL1 = vld1q_f32(ADDRESS_OF(aInputL, i+4));
vinL2 = vld1q_f32(ADDRESS_OF(aInputL, i+8));
vinL3 = vld1q_f32(ADDRESS_OF(aInputL, i+12));
vinR0 = vld1q_f32(ADDRESS_OF(aInputR, i));
vinR1 = vld1q_f32(ADDRESS_OF(aInputR, i+4));
vinR2 = vld1q_f32(ADDRESS_OF(aInputR, i+8));
vinR3 = vld1q_f32(ADDRESS_OF(aInputR, i+12));
voutL0 = vmulq_f32(vinL0, vscaleL);
voutL1 = vmulq_f32(vinL1, vscaleL);
voutL2 = vmulq_f32(vinL2, vscaleL);
voutL3 = vmulq_f32(vinL3, vscaleL);
vst1q_f32(ADDRESS_OF(aOutputL, i), voutL0);
vst1q_f32(ADDRESS_OF(aOutputL, i+4), voutL1);
vst1q_f32(ADDRESS_OF(aOutputL, i+8), voutL2);
vst1q_f32(ADDRESS_OF(aOutputL, i+12), voutL3);
voutR0 = vmlaq_f32(vinR0, vinL0, vscaleR);
voutR1 = vmlaq_f32(vinR1, vinL1, vscaleR);
voutR2 = vmlaq_f32(vinR2, vinL2, vscaleR);
voutR3 = vmlaq_f32(vinR3, vinL3, vscaleR);
vst1q_f32(ADDRESS_OF(aOutputR, i), voutR0);
vst1q_f32(ADDRESS_OF(aOutputR, i+4), voutR1);
vst1q_f32(ADDRESS_OF(aOutputR, i+8), voutR2);
vst1q_f32(ADDRESS_OF(aOutputR, i+12), voutR3);
}
}
}
}
}

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

@ -14,9 +14,7 @@
#include "nsAutoPtr.h"
#include "nsTArray.h"
#include "AudioContext.h"
struct JSContext;
class JSObject;
#include "js/TypeDecls.h"
namespace mozilla {

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

@ -17,6 +17,7 @@
#include "nsDOMEventTargetHelper.h"
#include "nsHashKeys.h"
#include "nsTHashtable.h"
#include "js/TypeDecls.h"
// X11 has a #define for CurrentTime. Unbelievable :-(.
// See content/media/DOMMediaStream.h for more fun!
@ -24,8 +25,6 @@
#undef CurrentTime
#endif
struct JSContext;
class JSObject;
class nsPIDOMWindow;
namespace mozilla {

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

@ -16,8 +16,7 @@
#include "AudioContext.h"
#include "PannerNode.h"
#include "WebAudioUtils.h"
struct JSContext;
#include "js/TypeDecls.h"
namespace mozilla {

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

@ -15,8 +15,7 @@
#include "AudioNode.h"
#include "mozilla/dom/TypedArray.h"
#include "WebAudioUtils.h"
struct JSContext;
#include "js/TypeDecls.h"
namespace mozilla {

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

@ -38,9 +38,7 @@ DelayProcessor::Process(const double *aPerFrameDelays,
0.0, static_cast<double>(mMaxDelayFrames));
// Write the input sample to the correct location in our buffer
if (input) {
buffer[writeIndex] = input[i];
}
buffer[writeIndex] = input ? input[i] : 0.0f;
// Now, determine the correct read position. We adjust the read position to be
// from currentDelayFrames frames in the past. We also interpolate the two input
@ -109,7 +107,10 @@ DelayProcessor::EnsureBuffer(uint32_t aNumberOfChannels)
if (!mBuffer.SetLength(aNumberOfChannels)) {
return false;
}
const int numFrames = mMaxDelayFrames;
// The length of the buffer is one greater than the maximum delay so that
// writing an input frame does not overwrite the frame that would
// subsequently be read at maximum delay.
const int numFrames = mMaxDelayFrames + 1;
for (uint32_t channel = 0; channel < aNumberOfChannels; ++channel) {
if (!mBuffer[channel].SetLength(numFrames)) {
return false;

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

@ -57,9 +57,11 @@ MOCHITEST_FILES := \
test_channelSplitterNode.html \
test_channelSplitterNodeWithVolume.html \
test_convolverNode.html \
test_convolverNodeWithGain.html \
test_convolverNode_mono_mono.html \
test_currentTime.html \
test_delayNode.html \
test_delayNodeAtMax.html \
test_delayNodeSmallMaxDelay.html \
test_delayNodeWithGain.html \
test_dynamicsCompressorNode.html \

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

@ -0,0 +1,62 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test ConvolverNode after a GainNode - Bug 891254 </title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<pre id="test">
<script src="webaudio.js" type="text/javascript"></script>
<script class="testbody" type="text/javascript">
const signalLength = 2048;
const responseLength = 100;
const outputLength = 4096; // > signalLength + responseLength
var gTest = {
length: outputLength,
numberOfChannels: 1,
createGraph: function(context) {
var buffer = context.createBuffer(1, signalLength, context.sampleRate);
for (var i = 0; i < signalLength; ++i) {
buffer.getChannelData(0)[i] = Math.sin(2 * Math.PI * i / signalLength);
}
var source = context.createBufferSource();
source.buffer = buffer;
source.start(0);
var response = context.createBuffer(1, responseLength, context.sampleRate);
for (var i = 0; i < responseLength; ++i) {
response.getChannelData(0)[i] = i / responseLength;
}
var gain = context.createGain();
gain.gain.value = -1;
source.connect(gain);
var convolver1 = context.createConvolver();
convolver1.buffer = response;
gain.connect(convolver1);
var convolver2 = context.createConvolver();
convolver2.buffer = response;
source.connect(convolver2);
// The output of convolver1 should be the inverse of convolver2, so blend
// them together and expect silence.
var blend = context.createGain();
convolver1.connect(blend);
convolver2.connect(blend);
return blend;
},
};
runTest();
</script>
</pre>
</body>
</html>

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

@ -0,0 +1,53 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test DelayNode with maxDelayTime delay - bug 890528</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<pre id="test">
<script src="webaudio.js" type="text/javascript"></script>
<script class="testbody" type="text/javascript">
const signalLength = 2048;
const delayLength = 1000; // Not on a block boundary
const outputLength = 4096 // > signalLength + 2 * delayLength;
function applySignal(buffer, offset) {
for (var i = 0; i < signalLength; ++i) {
buffer.getChannelData(0)[offset + i] = Math.cos(Math.PI * i / signalLength);
}
}
var gTest = {
numberOfChannels: 1,
createGraph: function(context) {
var buffer = context.createBuffer(1, signalLength, context.sampleRate);
applySignal(buffer, 0);
var source = context.createBufferSource();
source.buffer = buffer;
const delayTime = delayLength / context.sampleRate;
var delay = context.createDelay(delayTime);
delay.delayTime.value = delayTime;
source.connect(delay);
source.start(0);
return delay;
},
createExpectedBuffers: function(context) {
var expectedBuffer = context.createBuffer(1, outputLength, context.sampleRate);
applySignal(expectedBuffer, delayLength);
return expectedBuffer;
},
};
runTest();
</script>
</pre>
</body>
</html>

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

@ -68,8 +68,6 @@ function getEmptyBuffer(context, length) {
* This function assumes that the test file defines a single gTest variable with
* the following properties and methods:
*
* + length: mandatory property equal to the total number of frames which we
* are waiting to see in the output.
* + numberOfChannels: optional property which specifies the number of channels
* in the output. The default value is 2.
* + createGraph: mandatory method which takes a context object and does
@ -84,9 +82,17 @@ function getEmptyBuffer(context, length) {
* returns either one expected buffer or an array of
* them, designating what is expected to be observed
* in the output. If omitted, the output is expected
* to be silence. The sum of the length of the expected
* buffers should be equal to gTest.length. This
* function is guaranteed to be called before createGraph.
* to be silence. All buffers must have the same
* length, which must be a bufferSize supported by
* ScriptProcessorNode. This function is guaranteed
* to be called before createGraph.
* + length: property equal to the total number of frames which we are waiting
* to see in the output, mandatory if createExpectedBuffers is not
* provided, in which case it must be a bufferSize supported by
* ScriptProcessorNode (256, 512, 1024, 2048, 4096, 8192, or 16384).
* If createExpectedBuffers is provided then this must be equal to
* the number of expected buffers * the expected buffer length.
*
* + skipOfflineContextTests: optional. when true, skips running tests on an offline
* context by circumventing testOnOfflineContext.
*/
@ -120,7 +126,9 @@ function runTest()
"Correct number of channels for expected buffer " + i);
expectedFrames += expectedBuffers[i].length;
}
is(expectedFrames, gTest.length, "Correct number of expected frames");
if (gTest.length && gTest.createExpectedBuffers) {
is(expectedFrames, gTest.length, "Correct number of expected frames");
}
if (gTest.createGraphAsync) {
gTest.createGraphAsync(context, function(nodeToInspect) {

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

@ -10,14 +10,13 @@
#include "nsCycleCollectionParticipant.h"
#include "nsString.h"
#include "nsWrapperCache.h"
#include "js/TypeDecls.h"
#include "mozilla/Attributes.h"
#include "mozilla/ErrorResult.h"
#include "EnableWebSpeechRecognitionCheck.h"
struct JSContext;
namespace mozilla {
namespace dom {

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

@ -9,6 +9,7 @@
#include "nsCOMPtr.h"
#include "nsCycleCollectionParticipant.h"
#include "nsWrapperCache.h"
#include "js/TypeDecls.h"
#include "mozilla/Attributes.h"
#include "mozilla/dom/BindingUtils.h"
@ -16,8 +17,6 @@
#include "EnableWebSpeechRecognitionCheck.h"
#include "SpeechGrammar.h"
struct JSContext;
namespace mozilla {
namespace dom {

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

@ -12,6 +12,7 @@
#include "nsString.h"
#include "nsWrapperCache.h"
#include "nsTArray.h"
#include "js/TypeDecls.h"
#include "nsIDOMNavigatorUserMedia.h"
#include "nsITimer.h"
@ -30,7 +31,6 @@
#include "mozilla/dom/SpeechRecognitionError.h"
struct JSContext;
class nsIDOMWindow;
namespace mozilla {

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

@ -10,13 +10,12 @@
#include "nsString.h"
#include "nsWrapperCache.h"
#include "nsAutoPtr.h"
#include "js/TypeDecls.h"
#include "mozilla/Attributes.h"
#include "EnableWebSpeechRecognitionCheck.h"
struct JSContext;
namespace mozilla {
namespace dom {

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

@ -11,14 +11,13 @@
#include "nsWrapperCache.h"
#include "nsAutoPtr.h"
#include "nsTArray.h"
#include "js/TypeDecls.h"
#include "mozilla/Attributes.h"
#include "EnableWebSpeechRecognitionCheck.h"
#include "SpeechRecognitionAlternative.h"
struct JSContext;
namespace mozilla {
namespace dom {

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

@ -10,14 +10,13 @@
#include "nsWrapperCache.h"
#include "nsAutoPtr.h"
#include "nsTArray.h"
#include "js/TypeDecls.h"
#include "mozilla/Attributes.h"
#include "EnableWebSpeechRecognitionCheck.h"
#include "SpeechRecognitionResult.h"
struct JSContext;
namespace mozilla {
namespace dom {

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

@ -10,12 +10,12 @@
#include "nsString.h"
#include "nsWrapperCache.h"
#include "nsRefPtrHashtable.h"
#include "js/TypeDecls.h"
#include "EnableSpeechSynthesisCheck.h"
#include "SpeechSynthesisUtterance.h"
#include "SpeechSynthesisVoice.h"
struct JSContext;
class nsIDOMWindow;
namespace mozilla {

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

@ -9,12 +9,11 @@
#include "nsCOMPtr.h"
#include "nsDOMEventTargetHelper.h"
#include "nsString.h"
#include "js/TypeDecls.h"
#include "EnableSpeechSynthesisCheck.h"
#include "nsSpeechTask.h"
struct JSContext;
namespace mozilla {
namespace dom {

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

@ -9,12 +9,11 @@
#include "nsCOMPtr.h"
#include "nsString.h"
#include "nsWrapperCache.h"
#include "js/TypeDecls.h"
#include "EnableSpeechSynthesisCheck.h"
#include "nsISpeechService.h"
struct JSContext;
namespace mozilla {
namespace dom {

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

@ -15,6 +15,7 @@
#include "nsTArray.h"
#include "nsCycleCollectionParticipant.h"
#include "nsISupportsImpl.h"
#include "js/TypeDecls.h"
class nsXBLPrototypeBinding;
class nsIContent;
@ -31,8 +32,6 @@ class XBLChildrenElement;
}
class nsAnonymousContentList;
struct JSContext;
class JSObject;
// *********************************************************************/
// The XBLBinding class

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

@ -15,8 +15,8 @@
#include "nsIWeakReference.h"
#include "nsIScriptGlobalObject.h"
#include "nsCycleCollectionParticipant.h"
#include "js/TypeDecls.h"
class JSObject;
class nsIDOMEvent;
class nsIContent;
class nsIDOMUIEvent;
@ -26,10 +26,6 @@ class nsIObjectInputStream;
class nsIObjectOutputStream;
class nsXBLPrototypeBinding;
namespace JS {
template <typename T> class MutableHandle;
}
namespace mozilla {
namespace dom {
class EventTarget;

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

@ -9,11 +9,7 @@
#include "nsIObjectInputStream.h"
#include "nsIObjectOutputStream.h"
#include "nsINameSpaceManager.h"
namespace JS {
template <typename T> class Handle;
template <typename T> class MutableHandle;
}
#include "js/TypeDecls.h"
typedef uint8_t XBLBindingSerializeDetails;

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

@ -25,6 +25,8 @@
#include "mozilla/Attributes.h"
#include "js/TypeDecls.h"
class nsIRDFResource;
class nsIRDFService;
class nsPIWindowRoot;
@ -40,7 +42,6 @@ class nsIXULPrototypeScript;
#include "nsURIHashKey.h"
#include "nsInterfaceHashtable.h"
class JSObject;
struct JSTracer;
struct PRLogModuleInfo;

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

@ -9,9 +9,9 @@
#include "nsIAtom.idl"
%{ C++
#include "js/TypeDecls.h"
class nsPresContext;
class nsIPresShell;
struct JSContext;
%}
/**

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

@ -8,8 +8,7 @@
#include "nsISupports.h"
#include "nsIScriptObjectPrincipal.h"
class JSObject;
#include "js/TypeDecls.h"
#define NS_IGLOBALOBJECT_IID \
{ 0x8503e9a9, 0x530, 0x4b26, \

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

@ -10,11 +10,11 @@
#include "nsISupports.h"
#include "nsEvent.h"
#include "nsIGlobalObject.h"
#include "js/TypeDecls.h"
class nsIScriptContext;
class nsScriptErrorEvent;
class nsIScriptGlobalObject;
class JSObject;
// A helper function for nsIScriptGlobalObject implementations to use
// when handling a script error. Generally called by the global when a context

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

@ -7,10 +7,8 @@
#define nsIScriptTimeoutHandler_h___
#include "nsTArray.h"
#include "js/TypeDecls.h"
namespace JS {
class Value;
} // namespace JS
namespace mozilla {
namespace dom {
class Function;

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

@ -12,10 +12,10 @@
#include "nsIWeakReferenceUtils.h"
#include "nsWrapperCache.h"
#include "nsCycleCollectionParticipant.h"
#include "js/TypeDecls.h"
class nsIURI;
class nsIDocShell;
struct JSContext;
class nsIDocShellLoadInfo;
//*****************************************************************************

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

@ -14,12 +14,12 @@
#include "nsAutoPtr.h"
#include "nsTArray.h"
#include "mozilla/dom/EventTarget.h"
#include "js/TypeDecls.h"
#define DOM_WINDOW_DESTROYED_TOPIC "dom-window-destroyed"
#define DOM_WINDOW_FROZEN_TOPIC "dom-window-frozen"
#define DOM_WINDOW_THAWED_TOPIC "dom-window-thawed"
class JSObject;
class nsIArray;
class nsIContent;
class nsIDocShell;
@ -33,10 +33,6 @@ class nsPIWindowRoot;
class nsXBLPrototypeHandler;
struct nsTimeout;
namespace JS {
template<typename> class Handle;
}
namespace mozilla {
namespace dom {
class AudioContext;

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

@ -13,7 +13,6 @@
class nsPIDOMWindow;
class nsIControllers;
class nsIController;
struct JSContext;
#define NS_IWINDOWROOT_IID \
{ 0x3f71f50c, 0xa7e0, 0x43bc, \

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

@ -12,11 +12,10 @@
#include "nsDOMNavigationTiming.h"
#include "nsContentUtils.h"
#include "nsIDOMWindow.h"
#include "js/TypeDecls.h"
class nsITimedChannel;
class nsPerformance;
class JSObject;
struct JSContext;
// Script "performance.timing" object
class nsPerformanceTiming MOZ_FINAL : public nsWrapperCache

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

@ -13,8 +13,6 @@
#include "js/RootingAPI.h"
struct JSTracer;
class JSObject;
struct JSContext;
class XPCWrappedNativeScope;
namespace mozilla {

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

@ -23,8 +23,6 @@
#include "nsTArray.h"
#include "nsAutoPtr.h" // for nsRefPtr member variables
struct JSContext;
class JSObject;
class nsWrapperCache;
// nsGlobalWindow implements nsWrapperCache, but doesn't always use it. Don't

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

@ -7376,12 +7376,9 @@ class CGDOMJSProxyHandler_defineProperty(ClassMethod):
" return true;\n" +
"}\n") % (self.descriptor.nativeType)
elif self.descriptor.supportsIndexedProperties():
# XXXbz Once this is fixed to only throw in strict mode, update the
# code that decides whether to do a
# CGDOMJSProxyHandler_defineProperty at all.
set += ("if (IsArrayIndex(GetArrayIndexFromId(cx, id))) {\n" +
" return ThrowErrorMessage(cx, MSG_NO_PROPERTY_SETTER, \"%s\");\n" +
"}\n") % self.descriptor.name
set += ("if (IsArrayIndex(GetArrayIndexFromId(cx, id))) {\n"
" return js::IsInNonStrictPropertySet(cx) || ThrowErrorMessage(cx, MSG_NO_INDEXED_SETTER, \"%s\");\n"
"}\n" % self.descriptor.name)
if UseHolderForUnforgeable(self.descriptor):
defineOnUnforgeable = ("bool hasUnforgeable;\n"
@ -7408,15 +7405,10 @@ class CGDOMJSProxyHandler_defineProperty(ClassMethod):
"return true;\n")
else:
if self.descriptor.supportsNamedProperties():
# XXXbz Once this is fixed to only throw in strict mode, update
# the code that decides whether to do a
# CGDOMJSProxyHandler_defineProperty at all. If we support
# indexed properties, we won't get down here for indices, so we
# can just do our setter unconditionally here.
set += (CGProxyNamedPresenceChecker(self.descriptor).define() + "\n" +
"if (found) {\n"
" return ThrowErrorMessage(cx, MSG_NO_PROPERTY_SETTER, \"%s\");\n"
"}" % self.descriptor.name)
" return js::IsInNonStrictPropertySet(cx) || ThrowErrorMessage(cx, MSG_NO_NAMED_SETTER, \"%s\");\n"
"}\n" % self.descriptor.name)
set += ("return mozilla::dom::DOMProxyHandler::defineProperty(%s);" %
", ".join(a.name for a in self.args))
return set
@ -7799,26 +7791,22 @@ return &instance;"""
class CGDOMJSProxyHandler(CGClass):
def __init__(self, descriptor):
assert (descriptor.supportsIndexedProperties() or
descriptor.supportsNamedProperties())
constructors = [CGDOMJSProxyHandler_CGDOMJSProxyHandler()]
methods = [CGDOMJSProxyHandler_getOwnPropertyDescriptor(descriptor)]
# XXXbz This should really just test supportsIndexedProperties() and
# supportsNamedProperties(), but that would make us throw in all cases
# because we don't know whether we're in strict mode.
if (descriptor.operations['IndexedSetter'] or
descriptor.operations['NamedSetter'] or
UseHolderForUnforgeable(descriptor)):
methods.extend([CGDOMJSProxyHandler_defineProperty(descriptor),
ClassUsingDeclaration("mozilla::dom::DOMProxyHandler",
"defineProperty")])
methods.extend([CGDOMJSProxyHandler_getOwnPropertyNames(descriptor),
CGDOMJSProxyHandler_hasOwn(descriptor),
CGDOMJSProxyHandler_get(descriptor),
CGDOMJSProxyHandler_className(descriptor),
CGDOMJSProxyHandler_finalizeInBackground(descriptor),
CGDOMJSProxyHandler_finalize(descriptor),
CGDOMJSProxyHandler_getElementIfPresent(descriptor),
CGDOMJSProxyHandler_getInstance(),
CGDOMJSProxyHandler_delete(descriptor)])
methods = [CGDOMJSProxyHandler_getOwnPropertyDescriptor(descriptor),
CGDOMJSProxyHandler_defineProperty(descriptor),
ClassUsingDeclaration("mozilla::dom::DOMProxyHandler",
"defineProperty"),
CGDOMJSProxyHandler_getOwnPropertyNames(descriptor),
CGDOMJSProxyHandler_hasOwn(descriptor),
CGDOMJSProxyHandler_get(descriptor),
CGDOMJSProxyHandler_className(descriptor),
CGDOMJSProxyHandler_finalizeInBackground(descriptor),
CGDOMJSProxyHandler_finalize(descriptor),
CGDOMJSProxyHandler_getElementIfPresent(descriptor),
CGDOMJSProxyHandler_getInstance(),
CGDOMJSProxyHandler_delete(descriptor)]
CGClass.__init__(self, 'DOMProxyHandler',
bases=[ClassBase('mozilla::dom::DOMProxyHandler')],
constructors=constructors,

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

@ -9,13 +9,7 @@
#ifndef mozilla_dom_Date_h
#define mozilla_dom_Date_h
class JSObject;
struct JSContext;
namespace JS {
class Value;
template<typename> class MutableHandle;
} // namespace JS
#include "js/TypeDecls.h"
namespace mozilla {
namespace dom {

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

@ -18,8 +18,6 @@
#include "nsStringGlue.h"
#include "mozilla/Assertions.h"
struct JSContext;
namespace mozilla {
namespace dom {

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

@ -30,7 +30,8 @@ MSG_DEF(MSG_SETTER_THIS_DOES_NOT_IMPLEMENT_INTERFACE, 2, "'{0}' setter called on
MSG_DEF(MSG_THIS_DOES_NOT_IMPLEMENT_INTERFACE, 1, "\"this\" object does not implement interface {0}.")
MSG_DEF(MSG_NOT_IN_UNION, 2, "{0} could not be converted to any of: {1}.")
MSG_DEF(MSG_ILLEGAL_CONSTRUCTOR, 0, "Illegal constructor.")
MSG_DEF(MSG_NO_PROPERTY_SETTER, 1, "{0} doesn't have an indexed property setter.")
MSG_DEF(MSG_NO_INDEXED_SETTER, 1, "{0} doesn't have an indexed property setter.")
MSG_DEF(MSG_NO_NAMED_SETTER, 1, "{0} doesn't have a named property setter.")
MSG_DEF(MSG_ENFORCE_RANGE_NON_FINITE, 1, "Non-finite value is out of range for {0}.")
MSG_DEF(MSG_ENFORCE_RANGE_OUT_OF_RANGE, 1, "Value is out of range for {0}.")
MSG_DEF(MSG_NOT_SEQUENCE, 1, "{0} can't be converted to a sequence.")

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

@ -76,6 +76,7 @@ MOCHITEST_FILES := \
test_exception_messages.html \
test_bug707564.html \
test_bug907548.html \
test_defineProperty.html \
$(NULL)
MOCHITEST_CHROME_FILES = \

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

@ -0,0 +1,157 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=910220
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 910220</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=910220">Mozilla Bug 910220</a>
<p id="display"></p>
<div id="content" style="display: none">
<form name="x"></form>
</div>
<pre id="test">
</pre>
<script type="application/javascript">
/** Test for Bug 910220 **/
function getX() {
return "x";
}
function namedSetStrict(obj) {
"use strict";
var threw;
try {
obj.x = 5;
threw = false;
} catch (e) {
threw = true;
}
ok(threw,
"Should throw in strict mode when setting named property on " + obj);
try {
obj[getX()] = 5;
threw = false;
} catch (e) {
threw = true;
}
ok(threw,
"Should throw in strict mode when setting named property via SETELEM on " + obj);
try {
Object.defineProperty(obj, "x", { value: 17 });
threw = false;
} catch (e) {
threw = true;
}
ok(threw,
"Should throw in strict mode when defining named property on " + obj);
}
function namedSetNonStrict(obj) {
var threw;
try {
obj.x = 5;
threw = false;
} catch (e) {
threw = true;
}
ok(!threw,
"Should not throw in non-strict mode when setting named property on " + obj);
try {
obj[getX()] = 5;
threw = false;
} catch (e) {
threw = true;
}
ok(!threw,
"Should not throw in non-strict mode when setting named property via SETELEM on" + obj);
try {
Object.defineProperty(obj, "x", { value: 17 });
threw = false;
} catch (e) {
threw = true;
}
ok(threw,
"Should throw in non-strict mode when defining named property on " + obj);
}
for (var obj of [ document, document.forms ]) {
namedSetStrict(obj);
namedSetNonStrict(obj);
}
function indexedSetStrict(obj) {
"use strict";
var threw;
try {
obj[0] = 5;
threw = false;
} catch (e) {
threw = true;
}
ok(threw,
"Should throw in strict mode when setting indexed property on " + obj);
try {
obj[1000] = 5;
threw = false;
} catch (e) {
threw = true;
}
ok(threw,
"Should throw in strict mode when setting out of bounds indexed property on " + obj);
try {
Object.defineProperty(obj, "0", { value: 17 });
threw = false;
} catch (e) {
threw = true;
}
ok(threw,
"Should throw in strict mode when defining indexed property on " + obj);
}
function indexedSetNonStrict(obj) {
var threw;
try {
obj[0] = 5;
threw = false;
} catch (e) {
threw = true;
}
ok(!threw,
"Should not throw in non-strict mode when setting indexed property on " + obj);
try {
obj[1000] = 5;
threw = false;
} catch (e) {
threw = true;
}
ok(!threw,
"Should not throw in non-strict mode when setting out of bounds indexed property on " + obj);
try {
Object.defineProperty(obj, "0", { value: 17 });
threw = false;
} catch (e) {
threw = true;
}
ok(threw,
"Should throw in non-strict mode when defining indexed property on " + obj);
}
for (var obj of [ document.forms, document.childNodes ]) {
indexedSetStrict(obj);
indexedSetNonStrict(obj);
}
</script>
</body>
</html>

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

@ -8,9 +8,7 @@
#define mozilla_dom_bluetooth_bluetoothutils_h__
#include "BluetoothCommon.h"
struct JSContext;
class JSObject;
#include "js/TypeDecls.h"
BEGIN_BLUETOOTH_NAMESPACE

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

@ -10,9 +10,7 @@
#include "mozilla/ErrorResult.h"
#include "nsDOMEventTargetHelper.h"
#include "nsICellBroadcastProvider.h"
class JSObject;
struct JSContext;
#include "js/TypeDecls.h"
class nsPIDOMWindow;

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

@ -1,5 +1,4 @@
{
"Shouldn't be able to set unsigned properties on a HTMLCollection (strict mode)": true,
"Document.getElementsByTagName 1": true,
"Document.getElementsByTagName 2": true
}

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

@ -5,10 +5,6 @@
#include "domstubs.idl"
%{ C++
struct JSContext;
%}
[scriptable, uuid(55226663-fe68-48ba-addf-08e32eaab569)]
interface nsIDOMHistory : nsISupports
{

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

@ -11,7 +11,7 @@ interface nsIVariant;
interface nsIDocument;
%{C++
struct JSContext;
#include "js/TypeDecls.h"
%}
/**

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

@ -8,6 +8,7 @@
%{C++
#include "nsEvent.h"
#include "mozilla/dom/Nullable.h"
#include "js/TypeDecls.h"
using mozilla::dom::Nullable;
@ -20,7 +21,6 @@ class EventTarget;
class nsPresContext;
class nsEventChainPreVisitor;
class nsEventChainPostVisitor;
struct JSContext;
class nsEventListenerManager;
%}

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

@ -13,7 +13,7 @@ interface nsIScriptGlobalObject;
[ptr] native JSContext(JSContext);
%{C++
namespace JS { class Value; }
#include "js/TypeDecls.h"
%}
/**

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

@ -8,7 +8,7 @@
#include "TabChild.h"
#include "BasicLayers.h"
#include "Layers.h"
#include "Blob.h"
#include "ContentChild.h"
#include "IndexedDBChild.h"

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

@ -22,10 +22,9 @@
#include "nsITabParent.h"
#include "nsWeakReference.h"
#include "Units.h"
#include "js/TypeDecls.h"
struct gfxMatrix;
struct JSContext;
class JSObject;
class mozIApplication;
class nsFrameLoader;
class nsIURI;

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

@ -32,7 +32,7 @@ interface nsISocketTransport;
// Bug 797561 - Expose a server tcp socket API to web applications
[scriptable, uuid(b7803a0b-4492-45ec-ac7a-3e29f6445fa4)]
[scriptable, uuid(65f6d2c8-4be6-4695-958d-0735e8935289)]
interface nsIDOMTCPSocket : nsISupports
{
/**
@ -44,7 +44,7 @@ interface nsIDOMTCPSocket : nsISupports
* @param options An object specifying one or more parameters which
* determine the details of the socket.
*
* useSSL: true to create an SSL socket. Defaults to false.
* useSecureTransport: true to create an SSL socket. Defaults to false.
*
* binaryType: "arraybuffer" to use ArrayBuffer
* instances in the ondata callback and as the argument
@ -74,6 +74,11 @@ interface nsIDOMTCPSocket : nsISupports
nsIDOMTCPServerSocket listen(in unsigned short localPort, [optional] in jsval options,
[optional] in unsigned short backlog);
/**
* Enable secure on channel.
*/
void upgradeToSecure();
/**
* The host of this socket object.
*/

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

@ -8,7 +8,7 @@ interface nsITCPSocketInternal;
interface nsIDOMWindow;
// Interface to allow the content process socket to reach the IPC bridge.
[scriptable, uuid(edf07a93-36a6-4574-8e23-40f64ab5f596)]
[scriptable, uuid(ada5342d-6d45-4ff1-a7d3-6a4b150d0385)]
interface nsITCPSocketChild : nsISupports
{
// Tell the chrome process to open a corresponding connection with the given parameters
@ -23,6 +23,7 @@ interface nsITCPSocketChild : nsISupports
void resume();
void suspend();
void close();
void startTLS();
/**
* Initialize the TCP socket on the child side for IPC. It is called from the child side,

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

@ -37,6 +37,7 @@ protocol PTCPSocket
parent:
Open(nsString host, uint16_t port, bool useSSL, nsString binaryType);
Data(SendableData data);
StartTLS();
Suspend();
Resume();
Close();

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

@ -11,8 +11,6 @@
{ 0x41a77ec8, 0xfd86, 0x409e, { 0xae, 0xa9, 0xaf, 0x2c, 0xa4, 0x07, 0xef, 0x8e } }
class nsITCPServerSocketInternal;
struct JSContext;
struct JSObject;
namespace mozilla {
namespace dom {

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

@ -10,9 +10,6 @@
#include "nsCOMPtr.h"
#include "nsIDOMTCPSocket.h"
struct JSContext;
struct JSObject;
namespace mozilla {
namespace dom {

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

@ -157,6 +157,10 @@ TCPSocket.prototype = {
// IPC socket actor
_socketBridge: null,
// StartTLS
_waitingForStartTLS: false,
_pendingDataAfterStartTLS: [],
// Public accessors.
get readyState() {
return this._readyState;
@ -210,19 +214,23 @@ TCPSocket.prototype = {
this._onclose = f;
},
_activateTLS: function() {
let securityInfo = this._transport.securityInfo
.QueryInterface(Ci.nsISSLSocketControl);
securityInfo.StartTLS();
},
// Helper methods.
_createTransport: function ts_createTransport(host, port, sslMode) {
let options, optlen;
if (sslMode) {
options = [sslMode];
optlen = 1;
let options;
if (sslMode === 'ssl') {
options = ['ssl'];
} else {
options = null;
optlen = 0;
options = ['starttls'];
}
return Cc["@mozilla.org/network/socket-transport-service;1"]
.getService(Ci.nsISocketTransportService)
.createTransport(options, optlen, host, port, null);
.createTransport(options, 1, host, port, null);
},
_ensureCopying: function ts_ensureCopying() {
@ -248,6 +256,21 @@ TCPSocket.prototype = {
if (self._multiplexStream.count) {
self._ensureCopying();
} else {
// If we are waiting for initiating starttls, we can begin to
// activate tls now.
if (self._waitingForStartTLS && self._readyState == kOPEN) {
self._activateTLS();
self._waitingForStartTLS = false;
// If we have pending data, we should send them, or fire
// a drain event if we are waiting for it.
if (self._pendingDataAfterStartTLS.length > 0) {
while (self._pendingDataAfterStartTLS.length)
self._multiplexStream.appendStream(self._pendingDataAfterStartTLS.shift());
self._ensureCopying();
return;
}
}
if (self._waitingForDrain) {
self._waitingForDrain = false;
self.callListener("drain");
@ -435,7 +458,7 @@ TCPSocket.prototype = {
that._host = host;
that._port = port;
if (options !== undefined) {
if (options.useSSL) {
if (options.useSecureTransport) {
that._ssl = 'ssl';
} else {
that._ssl = false;
@ -458,7 +481,30 @@ TCPSocket.prototype = {
that._initStream(that._binaryType);
return that;
},
upgradeToSecure: function ts_upgradeToSecure() {
if (this._readyState !== kOPEN) {
throw new Error("Socket not open.");
}
if (this._ssl == 'ssl') {
// Already SSL
return;
}
this._ssl = 'ssl';
if (this._inChild) {
this._socketBridge.startTLS();
return;
}
if (this._multiplexStream.count == 0) {
this._activateTLS();
} else {
this._waitingForStartTLS = true;
}
},
listen: function ts_listen(localPort, options, backlog) {
if (!this.initWindowless())
return null;
@ -524,7 +570,14 @@ TCPSocket.prototype = {
new_stream = new StringInputStream();
new_stream.setData(data, length);
}
this._multiplexStream.appendStream(new_stream);
if (this._waitingForStartTLS) {
// When we are waiting for starttls, new_stream is added to pendingData
// and will be appended to multiplexStream after tls had been set up.
this._pendingDataAfterStartTLS.push(new_stream);
} else {
this._multiplexStream.appendStream(new_stream);
}
if (newBufferedAmount >= BUFFER_SIZE) {
// If we buffered more than some arbitrary amount of data,

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

@ -158,6 +158,13 @@ TCPSocketChild::RecvCallback(const nsString& aType,
return true;
}
NS_IMETHODIMP
TCPSocketChild::StartTLS()
{
SendStartTLS();
return NS_OK;
}
NS_IMETHODIMP
TCPSocketChild::Suspend()
{

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

@ -6,13 +6,12 @@
#include "nsITCPSocketChild.h"
#include "nsCycleCollectionParticipant.h"
#include "nsCOMPtr.h"
#include "js/TypeDecls.h"
#define TCPSOCKETCHILD_CID \
{ 0xa589d96f, 0x7e09, 0x4edf, { 0xa0, 0x1a, 0xeb, 0x49, 0x51, 0xf4, 0x2f, 0x37 } }
class nsITCPSocketInternal;
struct JSContext;
class JSObject;
namespace mozilla {
namespace dom {

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

@ -115,6 +115,15 @@ TCPSocketParent::InitJS(const JS::Value& aIntermediary, JSContext* aCx)
return NS_OK;
}
bool
TCPSocketParent::RecvStartTLS()
{
NS_ENSURE_TRUE(mSocket, true);
nsresult rv = mSocket->UpgradeToSecure();
NS_ENSURE_SUCCESS(rv, true);
return true;
}
bool
TCPSocketParent::RecvSuspend()
{

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

@ -7,9 +7,7 @@
#include "nsCycleCollectionParticipant.h"
#include "nsCOMPtr.h"
#include "nsIDOMTCPSocket.h"
struct JSContext;
class JSObject;
#include "js/TypeDecls.h"
#define TCPSOCKETPARENT_CID \
{ 0x4e7246c6, 0xa8b3, 0x426d, { 0x9c, 0x17, 0x76, 0xda, 0xb1, 0xe1, 0xe1, 0x4a } }
@ -49,6 +47,7 @@ public:
virtual bool RecvOpen(const nsString& aHost, const uint16_t& aPort,
const bool& useSSL, const nsString& aBinaryType);
virtual bool RecvStartTLS() MOZ_OVERRIDE;
virtual bool RecvSuspend() MOZ_OVERRIDE;
virtual bool RecvResume() MOZ_OVERRIDE;
virtual bool RecvClose() MOZ_OVERRIDE;

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

@ -16,6 +16,7 @@
#include "nsInterfaceHashtable.h"
#include "nsHashKeys.h"
#include <prinrval.h>
#include "js/TypeDecls.h"
#ifdef MOZ_WIDGET_ANDROID
#include "nsAutoPtr.h"
#include "nsIRunnable.h"
@ -30,8 +31,6 @@ class SharedPluginTexture;
#include "mozilla/TimeStamp.h"
#include "mozilla/PluginLibrary.h"
class JSObject;
class nsPluginStreamListenerPeer; // browser-initiated stream class
class nsNPAPIPluginStreamListener; // plugin-initiated stream class
class nsIPluginInstanceOwner;

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

@ -15,8 +15,7 @@
#include "nsWrapperCache.h"
#include "nsAutoPtr.h"
#include "nsPIDOMWindow.h"
struct JSContext;
#include "js/TypeDecls.h"
namespace mozilla {
namespace dom {

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

@ -12,8 +12,7 @@
#include "mozilla/dom/BindingDeclarations.h"
#include "nsCycleCollectionParticipant.h"
#include "nsWrapperCache.h"
struct JSContext;
#include "js/TypeDecls.h"
namespace mozilla {
namespace dom {

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

@ -14,8 +14,7 @@
#include "nsCycleCollectionParticipant.h"
#include "nsWrapperCache.h"
#include "mozilla/dom/Nullable.h"
struct JSContext;
#include "js/TypeDecls.h"
////////////////////////////////////////////////////
// nsGeoPositionCoords

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

@ -3129,11 +3129,11 @@ RadioInterface.prototype = {
.setMessageDeliveryByMessageId(context.sms.id,
null,
context.sms.delivery,
message.deliveryStatus,
response.deliveryStatus,
null,
function notifyResult(rv, domMessage) {
// TODO bug 832140 handle !Components.isSuccessCode(rv)
let topic = (message.deliveryStatus == RIL.GECKO_SMS_DELIVERY_STATUS_SUCCESS)
let topic = (response.deliveryStatus == RIL.GECKO_SMS_DELIVERY_STATUS_SUCCESS)
? kSmsDeliverySuccessObserverTopic
: kSmsDeliveryErrorObserverTopic;
Services.obs.notifyObservers(domMessage, topic, null);

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

@ -80,6 +80,7 @@ var interfaceNamesInGlobalScope =
"Attr",
"Audio",
"AudioBuffer",
{name: "AudioChannelManager", b2g: true},
"AudioContext",
"AudioBufferSourceNode",
"AudioDestinationNode",
@ -94,8 +95,14 @@ var interfaceNamesInGlobalScope =
"BiquadFilterNode",
"Blob",
"BlobEvent",
{name: "BluetoothAdapter", b2g: true},
{name: "BluetoothDevice", b2g: true},
{name: "BluetoothDeviceEvent", b2g: true},
{name: "BluetoothManager", b2g: true},
{name: "BluetoothStatusChangedEvent", b2g: true},
{name: "BoxObject", xbl: true},
{name: "BrowserFeedWriter", android: false},
{name: "BrowserFeedWriter", desktop: true},
{name: "CallEvent", b2g: true},
"CameraCapabilities",
"CameraControl",
"CameraManager",
@ -104,6 +111,7 @@ var interfaceNamesInGlobalScope =
"CanvasRenderingContext2D",
"CaretPosition",
"CDATASection",
{name: "CFStateChangeEvent", b2g: true},
"ChannelMergerNode",
"ChannelSplitterNode",
"CharacterData",
@ -117,7 +125,7 @@ var interfaceNamesInGlobalScope =
"CompositionEvent",
"Controllers",
"ConvolverNode",
{name: "CRMFObject", android: false},
{name: "CRMFObject", desktop: true},
"Crypto",
"CSS",
"CSS2Properties",
@ -144,6 +152,7 @@ var interfaceNamesInGlobalScope =
"CustomEvent",
"DataChannel",
"DataContainerEvent",
{name: "DataErrorEvent", b2g: true},
"DataTransfer",
"DelayNode",
"DesktopNotification",
@ -185,13 +194,14 @@ var interfaceNamesInGlobalScope =
"FileList",
"FileReader",
"FileRequest",
{name: "FMRadio", b2g: true},
"FocusEvent",
"FormData",
"GainNode",
{name: "Gamepad", android: false},
{name: "GamepadAxisMoveEvent", android: false},
{name: "GamepadButtonEvent", android: false},
{name: "GamepadEvent", android: false},
{name: "Gamepad", desktop: true},
{name: "GamepadAxisMoveEvent", desktop: true},
{name: "GamepadButtonEvent", desktop: true},
{name: "GamepadEvent", desktop: true},
"HashChangeEvent",
"History",
"HTMLAnchorElement",
@ -265,6 +275,7 @@ var interfaceNamesInGlobalScope =
"HTMLUListElement",
"HTMLUnknownElement",
"HTMLVideoElement",
{name: "IccCardLockErrorEvent", b2g: true},
"IDBCursor",
"IDBCursorWithValue",
"IDBDatabase",
@ -279,7 +290,7 @@ var interfaceNamesInGlobalScope =
"IDBVersionChangeEvent",
"Image",
"ImageData",
{name: "InstallTrigger", xbl: false},
{name: "InstallTrigger", b2g: false, xbl: false},
"KeyEvent",
"KeyboardEvent",
"LoadStatus",
@ -302,18 +313,28 @@ var interfaceNamesInGlobalScope =
"ModalContentWindow",
"MouseEvent",
"MouseScrollEvent",
{name: "MozActivity", b2g: true},
"MozApplicationEvent",
"MozCanvasPrintState",
{name: "MozCellBroadcast", b2g: true},
{name: "MozCellBroadcastEvent", b2g: true},
"MozConnection",
"mozContact",
"MozContactChangeEvent",
"MozCSSKeyframeRule",
"MozCSSKeyframesRule",
{name: "MozEmergencyCbModeEvent", b2g: true},
{name: "MozIccManager", b2g: true},
{name: "MozInputContext", b2g: true},
{name: "MozInputMethod", b2g: true},
{name: "MozInputMethodManager", b2g: true},
"MozMmsEvent",
"MozMmsMessage",
{name: "MozMobileConnection", b2g: true},
"MozMobileMessageManager",
"MozMobileMessageThread",
"MozNamedAttrMap",
{name: "MozOtaStatusEvent", b2g: true},
"MozPowerManager",
"mozRTCIceCandidate",
"mozRTCPeerConnection",
@ -323,7 +344,13 @@ var interfaceNamesInGlobalScope =
"MozSmsFilter",
"MozSmsMessage",
"MozSmsSegmentInfo",
{name: "MozStkCommandEvent", b2g: true},
{name: "MozTimeManager", b2g: true},
{name: "MozVoicemail", b2g: true},
{name: "MozVoicemailEvent", b2g: true},
"MozWakeLock",
{name: "MozWifiConnectionInfoEvent", b2g: true},
{name: "MozWifiStatusChangeEvent", b2g: true},
"MutationEvent",
"MutationObserver",
"MutationRecord",
@ -355,8 +382,8 @@ var interfaceNamesInGlobalScope =
"PopupBlockedEvent",
"ProcessingInstruction",
"ProgressEvent",
{name: "Promise", release: false},
{name: "PromiseResolver", release: false},
{name: "Promise", b2g: false, release: false},
{name: "PromiseResolver", b2g: false, release: false},
"PropertyNodeList",
"Range",
"RecordErrorEvent",
@ -504,6 +531,9 @@ var interfaceNamesInGlobalScope =
"SVGViewElement",
"SVGZoomAndPan",
"SVGZoomEvent",
{name: "Telephony", b2g: true},
{name: "TelephonyCall", b2g: true},
{name: "TelephonyCallGroup", b2g: true},
"Text",
"TextDecoder",
"TextEncoder",
@ -524,6 +554,7 @@ var interfaceNamesInGlobalScope =
"URL",
{name: "UserDataHandler", xbl: true},
"UserProximityEvent",
{name: "USSDReceivedEvent", b2g: true},
"ValidityState",
"VideoStreamTrack",
"WaveShaperNode",
@ -572,7 +603,8 @@ function createInterfaceMap(isXBLScope) {
var version = SpecialPowers.Cc["@mozilla.org/xre/app-info;1"].getService(SpecialPowers.Ci.nsIXULAppInfo).version;
var isNightly = version.endsWith("a1");
var isRelease = !version.contains("a");
var isAndroid = navigator.userAgent.indexOf("Android") >= 0;
var isDesktop = !/Mobile|Tablet/.test(navigator.userAgent);
var isB2G = !isDesktop && !navigator.userAgent.contains("Android");
var interfaceMap = {};
for (var entry of ecmaGlobals) {
if (typeof(entry) === "string") {
@ -587,12 +619,13 @@ function createInterfaceMap(isXBLScope) {
for (var entry of interfaceNamesInGlobalScope) {
if (typeof(entry) === "string") {
interfaceMap[entry] = true;
} else if (entry.xbl === isXBLScope ||
entry.android === isAndroid ||
entry.release === isRelease) {
interfaceMap[entry.name] = true;
} else {
} else if (entry.xbl === !isXBLScope ||
entry.desktop === !isDesktop ||
entry.b2g === !isB2G ||
entry.release === !isRelease) {
interfaceMap[entry.name] = false;
} else {
interfaceMap[entry.name] = true;
}
}
return interfaceMap;

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

@ -44,7 +44,7 @@ interface TreeColumns {
/**
* Parametric column getters.
*/
getter MozTreeColumn? getNamedColumn(DOMString id);
getter MozTreeColumn? getNamedColumn(DOMString name);
getter MozTreeColumn? getColumnAt(unsigned long index);
/**

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

@ -108,8 +108,12 @@ MOCHITEST_FILES = \
url_worker.js \
$(NULL)
# Disabled for frequent failures (bug 841505, bug 842344, etc)
# test_xhr_timeout.html \
# Bug 842386 - Disabled on OSX due to intermittent failures.
ifneq ($(OS_ARCH), Darwin)
MOCHITEST_FILES += \
test_xhr_timeout.html \
$(NULL)
endif
MOCHITEST_CHROME_FILES = \
test_chromeWorker.xul \

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

@ -17,6 +17,7 @@
#include "nsIPromptFactory.h"
#include "nsPIWindowWatcher.h"
#include "nsTArray.h"
#include "js/TypeDecls.h"
class nsIURI;
class nsIDocShellTreeItem;
@ -26,8 +27,6 @@ class nsString;
class nsWatcherWindowEnumerator;
class nsIScriptContext;
class nsPromptService;
struct JSContext;
class JSObject;
struct nsWatcherWindowEntry;
struct SizeSpec;

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

@ -712,6 +712,121 @@ ContainerLayer::ContainerLayer(LayerManager* aManager, void* aImplData)
ContainerLayer::~ContainerLayer() {}
void
ContainerLayer::InsertAfter(Layer* aChild, Layer* aAfter)
{
NS_ASSERTION(aChild->Manager() == Manager(),
"Child has wrong manager");
NS_ASSERTION(!aChild->GetParent(),
"aChild already in the tree");
NS_ASSERTION(!aChild->GetNextSibling() && !aChild->GetPrevSibling(),
"aChild already has siblings?");
NS_ASSERTION(!aAfter ||
(aAfter->Manager() == Manager() &&
aAfter->GetParent() == this),
"aAfter is not our child");
aChild->SetParent(this);
if (aAfter == mLastChild) {
mLastChild = aChild;
}
if (!aAfter) {
aChild->SetNextSibling(mFirstChild);
if (mFirstChild) {
mFirstChild->SetPrevSibling(aChild);
}
mFirstChild = aChild;
NS_ADDREF(aChild);
DidInsertChild(aChild);
return;
}
Layer* next = aAfter->GetNextSibling();
aChild->SetNextSibling(next);
aChild->SetPrevSibling(aAfter);
if (next) {
next->SetPrevSibling(aChild);
}
aAfter->SetNextSibling(aChild);
NS_ADDREF(aChild);
DidInsertChild(aChild);
}
void
ContainerLayer::RemoveChild(Layer *aChild)
{
NS_ASSERTION(aChild->Manager() == Manager(),
"Child has wrong manager");
NS_ASSERTION(aChild->GetParent() == this,
"aChild not our child");
Layer* prev = aChild->GetPrevSibling();
Layer* next = aChild->GetNextSibling();
if (prev) {
prev->SetNextSibling(next);
} else {
this->mFirstChild = next;
}
if (next) {
next->SetPrevSibling(prev);
} else {
this->mLastChild = prev;
}
aChild->SetNextSibling(nullptr);
aChild->SetPrevSibling(nullptr);
aChild->SetParent(nullptr);
this->DidRemoveChild(aChild);
NS_RELEASE(aChild);
}
void
ContainerLayer::RepositionChild(Layer* aChild, Layer* aAfter)
{
NS_ASSERTION(aChild->Manager() == Manager(),
"Child has wrong manager");
NS_ASSERTION(aChild->GetParent() == this,
"aChild not our child");
NS_ASSERTION(!aAfter ||
(aAfter->Manager() == Manager() &&
aAfter->GetParent() == this),
"aAfter is not our child");
Layer* prev = aChild->GetPrevSibling();
Layer* next = aChild->GetNextSibling();
if (prev == aAfter) {
// aChild is already in the correct position, nothing to do.
return;
}
if (prev) {
prev->SetNextSibling(next);
}
if (next) {
next->SetPrevSibling(prev);
}
if (!aAfter) {
aChild->SetPrevSibling(nullptr);
aChild->SetNextSibling(mFirstChild);
if (mFirstChild) {
mFirstChild->SetPrevSibling(aChild);
}
mFirstChild = aChild;
return;
}
Layer* afterNext = aAfter->GetNextSibling();
if (afterNext) {
afterNext->SetPrevSibling(aChild);
} else {
mLastChild = aChild;
}
aAfter->SetNextSibling(aChild);
aChild->SetPrevSibling(aAfter);
aChild->SetNextSibling(afterNext);
}
void
ContainerLayer::FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
{
@ -827,6 +942,16 @@ ContainerLayer::ComputeEffectiveTransformsForChildren(const gfx3DMatrix& aTransf
}
}
/* static */ bool
ContainerLayer::HasOpaqueAncestorLayer(Layer* aLayer)
{
for (Layer* l = aLayer->GetParent(); l; l = l->GetParent()) {
if (l->GetContentFlags() & Layer::CONTENT_OPAQUE)
return true;
}
return false;
}
void
ContainerLayer::DidRemoveChild(Layer* aLayer)
{

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

@ -1411,13 +1411,13 @@ public:
* If aAfter is non-null, it must be a child of this container and
* we insert after that layer. If it's null we insert at the start.
*/
virtual void InsertAfter(Layer* aChild, Layer* aAfter) = 0;
virtual void InsertAfter(Layer* aChild, Layer* aAfter);
/**
* CONSTRUCTION PHASE ONLY
* Remove aChild from the child list of this container. aChild must
* be a child of this container.
*/
virtual void RemoveChild(Layer* aChild) = 0;
virtual void RemoveChild(Layer* aChild);
/**
* CONSTRUCTION PHASE ONLY
* Reposition aChild from the child list of this container. aChild must
@ -1425,7 +1425,7 @@ public:
* If aAfter is non-null, it must be a child of this container and we
* reposition after that layer. If it's null, we reposition at the start.
*/
virtual void RepositionChild(Layer* aChild, Layer* aAfter) = 0;
virtual void RepositionChild(Layer* aChild, Layer* aAfter);
/**
* CONSTRUCTION PHASE ONLY
@ -1530,6 +1530,8 @@ public:
protected:
friend class ReadbackProcessor;
static bool HasOpaqueAncestorLayer(Layer* aLayer);
void DidInsertChild(Layer* aLayer);
void DidRemoveChild(Layer* aLayer);

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

@ -15,6 +15,9 @@
#include "nsISupportsImpl.h" // for Layer::AddRef, etc
#include "nsPoint.h" // for nsIntPoint
#include "nsRect.h" // for nsIntRect
#include "gfx3DMatrix.h" // for gfx3DMatrix
#include "gfxMatrix.h" // for gfxMatrix
#include "nsRegion.h" // for nsIntRegion
using namespace mozilla::gfx;
@ -24,12 +27,48 @@ namespace layers {
BasicContainerLayer::~BasicContainerLayer()
{
while (mFirstChild) {
ContainerRemoveChild(mFirstChild, this);
ContainerLayer::RemoveChild(mFirstChild);
}
MOZ_COUNT_DTOR(BasicContainerLayer);
}
void
BasicContainerLayer::ComputeEffectiveTransforms(const gfx3DMatrix& aTransformToSurface)
{
// We push groups for container layers if we need to, which always
// are aligned in device space, so it doesn't really matter how we snap
// containers.
gfxMatrix residual;
gfx3DMatrix idealTransform = GetLocalTransform()*aTransformToSurface;
idealTransform.ProjectTo2D();
if (!idealTransform.CanDraw2D()) {
mEffectiveTransform = idealTransform;
ComputeEffectiveTransformsForChildren(gfx3DMatrix());
ComputeEffectiveTransformForMaskLayer(gfx3DMatrix());
mUseIntermediateSurface = true;
return;
}
mEffectiveTransform = SnapTransformTranslation(idealTransform, &residual);
// We always pass the ideal matrix down to our children, so there is no
// need to apply any compensation using the residual from SnapTransformTranslation.
ComputeEffectiveTransformsForChildren(idealTransform);
ComputeEffectiveTransformForMaskLayer(aTransformToSurface);
/* If we have a single child, it can just inherit our opacity,
* otherwise we need a PushGroup and we need to mark ourselves as using
* an intermediate surface so our children don't inherit our opacity
* via GetEffectiveOpacity.
* Having a mask layer always forces our own push group
*/
mUseIntermediateSurface =
GetMaskLayer() || (GetEffectiveOpacity() != 1.0 &&
HasMultipleChildren());
}
bool
BasicContainerLayer::ChildrenPartitionVisibleRegion(const nsIntRect& aInRect)
{

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

@ -9,181 +9,15 @@
#include "BasicImplData.h" // for BasicImplData
#include "BasicLayers.h" // for BasicLayerManager
#include "Layers.h" // for Layer, ContainerLayer
#include "gfx3DMatrix.h" // for gfx3DMatrix
#include "gfxMatrix.h" // for gfxMatrix
#include "nsDebug.h" // for NS_ASSERTION
#include "nsISupportsUtils.h" // for NS_ADDREF, NS_RELEASE
#include "nsRegion.h" // for nsIntRegion
#include "nsTraceRefcnt.h" // for MOZ_COUNT_CTOR
struct nsIntRect;
namespace mozilla {
namespace layers {
template<class Container> void
ContainerInsertAfter(Layer* aChild, Layer* aAfter, Container* aContainer)
{
NS_ASSERTION(aChild->Manager() == aContainer->Manager(),
"Child has wrong manager");
NS_ASSERTION(!aChild->GetParent(),
"aChild already in the tree");
NS_ASSERTION(!aChild->GetNextSibling() && !aChild->GetPrevSibling(),
"aChild already has siblings?");
NS_ASSERTION(!aAfter ||
(aAfter->Manager() == aContainer->Manager() &&
aAfter->GetParent() == aContainer),
"aAfter is not our child");
aChild->SetParent(aContainer);
if (aAfter == aContainer->mLastChild) {
aContainer->mLastChild = aChild;
}
if (!aAfter) {
aChild->SetNextSibling(aContainer->mFirstChild);
if (aContainer->mFirstChild) {
aContainer->mFirstChild->SetPrevSibling(aChild);
}
aContainer->mFirstChild = aChild;
NS_ADDREF(aChild);
aContainer->DidInsertChild(aChild);
return;
}
Layer* next = aAfter->GetNextSibling();
aChild->SetNextSibling(next);
aChild->SetPrevSibling(aAfter);
if (next) {
next->SetPrevSibling(aChild);
}
aAfter->SetNextSibling(aChild);
NS_ADDREF(aChild);
aContainer->DidInsertChild(aChild);
}
template<class Container> void
ContainerRemoveChild(Layer* aChild, Container* aContainer)
{
NS_ASSERTION(aChild->Manager() == aContainer->Manager(),
"Child has wrong manager");
NS_ASSERTION(aChild->GetParent() == aContainer,
"aChild not our child");
Layer* prev = aChild->GetPrevSibling();
Layer* next = aChild->GetNextSibling();
if (prev) {
prev->SetNextSibling(next);
} else {
aContainer->mFirstChild = next;
}
if (next) {
next->SetPrevSibling(prev);
} else {
aContainer->mLastChild = prev;
}
aChild->SetNextSibling(nullptr);
aChild->SetPrevSibling(nullptr);
aChild->SetParent(nullptr);
aContainer->DidRemoveChild(aChild);
NS_RELEASE(aChild);
}
template<class Container> void
ContainerRepositionChild(Layer* aChild, Layer* aAfter, Container* aContainer)
{
NS_ASSERTION(aChild->Manager() == aContainer->Manager(),
"Child has wrong manager");
NS_ASSERTION(aChild->GetParent() == aContainer,
"aChild not our child");
NS_ASSERTION(!aAfter ||
(aAfter->Manager() == aContainer->Manager() &&
aAfter->GetParent() == aContainer),
"aAfter is not our child");
Layer* prev = aChild->GetPrevSibling();
Layer* next = aChild->GetNextSibling();
if (prev == aAfter) {
// aChild is already in the correct position, nothing to do.
return;
}
if (prev) {
prev->SetNextSibling(next);
}
if (next) {
next->SetPrevSibling(prev);
}
if (!aAfter) {
aChild->SetPrevSibling(nullptr);
aChild->SetNextSibling(aContainer->mFirstChild);
if (aContainer->mFirstChild) {
aContainer->mFirstChild->SetPrevSibling(aChild);
}
aContainer->mFirstChild = aChild;
return;
}
Layer* afterNext = aAfter->GetNextSibling();
if (afterNext) {
afterNext->SetPrevSibling(aChild);
} else {
aContainer->mLastChild = aChild;
}
aAfter->SetNextSibling(aChild);
aChild->SetPrevSibling(aAfter);
aChild->SetNextSibling(afterNext);
}
template<class Container>
static void
ContainerComputeEffectiveTransforms(const gfx3DMatrix& aTransformToSurface,
Container* aContainer)
{
// We push groups for container layers if we need to, which always
// are aligned in device space, so it doesn't really matter how we snap
// containers.
gfxMatrix residual;
gfx3DMatrix idealTransform = aContainer->GetLocalTransform()*aTransformToSurface;
idealTransform.ProjectTo2D();
if (!idealTransform.CanDraw2D()) {
aContainer->mEffectiveTransform = idealTransform;
aContainer->ComputeEffectiveTransformsForChildren(gfx3DMatrix());
aContainer->ComputeEffectiveTransformForMaskLayer(gfx3DMatrix());
aContainer->mUseIntermediateSurface = true;
return;
}
aContainer->mEffectiveTransform =
aContainer->SnapTransformTranslation(idealTransform, &residual);
// We always pass the ideal matrix down to our children, so there is no
// need to apply any compensation using the residual from SnapTransformTranslation.
aContainer->ComputeEffectiveTransformsForChildren(idealTransform);
aContainer->ComputeEffectiveTransformForMaskLayer(aTransformToSurface);
/* If we have a single child, it can just inherit our opacity,
* otherwise we need a PushGroup and we need to mark ourselves as using
* an intermediate surface so our children don't inherit our opacity
* via GetEffectiveOpacity.
* Having a mask layer always forces our own push group
*/
aContainer->mUseIntermediateSurface =
aContainer->GetMaskLayer() || (aContainer->GetEffectiveOpacity() != 1.0 &&
aContainer->HasMultipleChildren());
}
class BasicContainerLayer : public ContainerLayer, public BasicImplData {
template<class Container>
friend void ContainerInsertAfter(Layer* aChild, Layer* aAfter, Container* aContainer);
template<class Container>
friend void ContainerRemoveChild(Layer* aChild, Container* aContainer);
template<class Container>
friend void ContainerRepositionChild(Layer* aChild, Layer* aAfter, Container* aContainer);
template<class Container>
friend void ContainerComputeEffectiveTransforms(const gfx3DMatrix& aTransformToSurface,
Container* aContainer);
public:
BasicContainerLayer(BasicLayerManager* aManager) :
ContainerLayer(aManager,
@ -204,27 +38,24 @@ public:
{
NS_ASSERTION(BasicManager()->InConstruction(),
"Can only set properties in construction phase");
ContainerInsertAfter(aChild, aAfter, this);
ContainerLayer::InsertAfter(aChild, aAfter);
}
virtual void RemoveChild(Layer* aChild)
{
NS_ASSERTION(BasicManager()->InConstruction(),
"Can only set properties in construction phase");
ContainerRemoveChild(aChild, this);
ContainerLayer::RemoveChild(aChild);
}
virtual void RepositionChild(Layer* aChild, Layer* aAfter)
{
NS_ASSERTION(BasicManager()->InConstruction(),
"Can only set properties in construction phase");
ContainerRepositionChild(aChild, aAfter, this);
ContainerLayer::RepositionChild(aChild, aAfter);
}
virtual void ComputeEffectiveTransforms(const gfx3DMatrix& aTransformToSurface)
{
ContainerComputeEffectiveTransforms(aTransformToSurface, this);
}
virtual void ComputeEffectiveTransforms(const gfx3DMatrix& aTransformToSurface);
/**
* Returns true when:

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

@ -23,140 +23,9 @@ namespace layers {
class ShadowableLayer;
template<class Container> void
ContainerInsertAfter(Layer* aChild, Layer* aAfter, Container* aContainer)
{
NS_ASSERTION(aChild->Manager() == aContainer->Manager(),
"Child has wrong manager");
NS_ASSERTION(!aChild->GetParent(),
"aChild already in the tree");
NS_ASSERTION(!aChild->GetNextSibling() && !aChild->GetPrevSibling(),
"aChild already has siblings?");
NS_ASSERTION(!aAfter ||
(aAfter->Manager() == aContainer->Manager() &&
aAfter->GetParent() == aContainer),
"aAfter is not our child");
aChild->SetParent(aContainer);
if (aAfter == aContainer->mLastChild) {
aContainer->mLastChild = aChild;
}
if (!aAfter) {
aChild->SetNextSibling(aContainer->mFirstChild);
if (aContainer->mFirstChild) {
aContainer->mFirstChild->SetPrevSibling(aChild);
}
aContainer->mFirstChild = aChild;
NS_ADDREF(aChild);
aContainer->DidInsertChild(aChild);
return;
}
Layer* next = aAfter->GetNextSibling();
aChild->SetNextSibling(next);
aChild->SetPrevSibling(aAfter);
if (next) {
next->SetPrevSibling(aChild);
}
aAfter->SetNextSibling(aChild);
NS_ADDREF(aChild);
aContainer->DidInsertChild(aChild);
}
template<class Container> void
ContainerRemoveChild(Layer* aChild, Container* aContainer)
{
NS_ASSERTION(aChild->Manager() == aContainer->Manager(),
"Child has wrong manager");
NS_ASSERTION(aChild->GetParent() == aContainer,
"aChild not our child");
Layer* prev = aChild->GetPrevSibling();
Layer* next = aChild->GetNextSibling();
if (prev) {
prev->SetNextSibling(next);
} else {
aContainer->mFirstChild = next;
}
if (next) {
next->SetPrevSibling(prev);
} else {
aContainer->mLastChild = prev;
}
aChild->SetNextSibling(nullptr);
aChild->SetPrevSibling(nullptr);
aChild->SetParent(nullptr);
aContainer->DidRemoveChild(aChild);
NS_RELEASE(aChild);
}
template<class Container> void
ContainerRepositionChild(Layer* aChild, Layer* aAfter, Container* aContainer)
{
NS_ASSERTION(aChild->Manager() == aContainer->Manager(),
"Child has wrong manager");
NS_ASSERTION(aChild->GetParent() == aContainer,
"aChild not our child");
NS_ASSERTION(!aAfter ||
(aAfter->Manager() == aContainer->Manager() &&
aAfter->GetParent() == aContainer),
"aAfter is not our child");
Layer* prev = aChild->GetPrevSibling();
Layer* next = aChild->GetNextSibling();
if (prev == aAfter) {
// aChild is already in the correct position, nothing to do.
return;
}
if (prev) {
prev->SetNextSibling(next);
}
if (next) {
next->SetPrevSibling(prev);
}
if (!aAfter) {
aChild->SetPrevSibling(nullptr);
aChild->SetNextSibling(aContainer->mFirstChild);
if (aContainer->mFirstChild) {
aContainer->mFirstChild->SetPrevSibling(aChild);
}
aContainer->mFirstChild = aChild;
return;
}
Layer* afterNext = aAfter->GetNextSibling();
if (afterNext) {
afterNext->SetPrevSibling(aChild);
} else {
aContainer->mLastChild = aChild;
}
aAfter->SetNextSibling(aChild);
aChild->SetPrevSibling(aAfter);
aChild->SetNextSibling(afterNext);
}
static bool
HasOpaqueAncestorLayer(Layer* aLayer)
{
for (Layer* l = aLayer->GetParent(); l; l = l->GetParent()) {
if (l->GetContentFlags() & Layer::CONTENT_OPAQUE)
return true;
}
return false;
}
class ClientContainerLayer : public ContainerLayer,
public ClientLayer
{
template<class Container>
friend void ContainerInsertAfter(Layer* aChild, Layer* aAfter, Container* aContainer);
template<class Container>
friend void ContainerRemoveChild(Layer* aChild, Container* aContainer);
template<class Container>
friend void ContainerRepositionChild(Layer* aChild, Layer* aAfter, Container* aContainer);
public:
ClientContainerLayer(ClientLayerManager* aManager) :
ContainerLayer(aManager,
@ -168,7 +37,7 @@ public:
virtual ~ClientContainerLayer()
{
while (mFirstChild) {
ContainerRemoveChild(mFirstChild, this);
ContainerLayer::RemoveChild(mFirstChild);
}
MOZ_COUNT_DTOR(ClientContainerLayer);
@ -219,33 +88,33 @@ public:
"Can only set properties in construction phase");
ContainerLayer::SetVisibleRegion(aRegion);
}
virtual void InsertAfter(Layer* aChild, Layer* aAfter)
virtual void InsertAfter(Layer* aChild, Layer* aAfter) MOZ_OVERRIDE
{
NS_ASSERTION(ClientManager()->InConstruction(),
"Can only set properties in construction phase");
ClientManager()->InsertAfter(ClientManager()->Hold(this),
ClientManager()->Hold(aChild),
aAfter ? ClientManager()->Hold(aAfter) : nullptr);
ContainerInsertAfter(aChild, aAfter, this);
ContainerLayer::InsertAfter(aChild, aAfter);
}
virtual void RemoveChild(Layer* aChild)
virtual void RemoveChild(Layer* aChild) MOZ_OVERRIDE
{
NS_ASSERTION(ClientManager()->InConstruction(),
"Can only set properties in construction phase");
ClientManager()->RemoveChild(ClientManager()->Hold(this),
ClientManager()->Hold(aChild));
ContainerRemoveChild(aChild, this);
ContainerLayer::RemoveChild(aChild);
}
virtual void RepositionChild(Layer* aChild, Layer* aAfter)
virtual void RepositionChild(Layer* aChild, Layer* aAfter) MOZ_OVERRIDE
{
NS_ASSERTION(ClientManager()->InConstruction(),
"Can only set properties in construction phase");
ClientManager()->RepositionChild(ClientManager()->Hold(this),
ClientManager()->Hold(aChild),
aAfter ? ClientManager()->Hold(aAfter) : nullptr);
ContainerRepositionChild(aChild, aAfter, this);
ContainerLayer::RepositionChild(aChild, aAfter);
}
virtual Layer* AsLayer() { return this; }

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

@ -116,6 +116,11 @@ ContainerRender(ContainerT* aContainer,
} else {
surface = compositor->CreateRenderTarget(surfaceRect, mode);
}
if (!surface) {
return;
}
compositor->SetRenderTarget(surface);
childOffset.x = visibleRect.x;
childOffset.y = visibleRect.y;
@ -216,75 +221,6 @@ ContainerLayerComposite::~ContainerLayerComposite()
}
}
void
ContainerLayerComposite::InsertAfter(Layer* aChild, Layer* aAfter)
{
NS_ASSERTION(aChild->Manager() == Manager(),
"Child has wrong manager");
NS_ASSERTION(!aChild->GetParent(),
"aChild already in the tree");
NS_ASSERTION(!aChild->GetNextSibling() && !aChild->GetPrevSibling(),
"aChild already has siblings?");
NS_ASSERTION(!aAfter ||
(aAfter->Manager() == Manager() &&
aAfter->GetParent() == this),
"aAfter is not our child");
aChild->SetParent(this);
if (aAfter == mLastChild) {
mLastChild = aChild;
}
if (!aAfter) {
aChild->SetNextSibling(mFirstChild);
if (mFirstChild) {
mFirstChild->SetPrevSibling(aChild);
}
mFirstChild = aChild;
NS_ADDREF(aChild);
DidInsertChild(aChild);
return;
}
Layer* next = aAfter->GetNextSibling();
aChild->SetNextSibling(next);
aChild->SetPrevSibling(aAfter);
if (next) {
next->SetPrevSibling(aChild);
}
aAfter->SetNextSibling(aChild);
NS_ADDREF(aChild);
DidInsertChild(aChild);
}
void
ContainerLayerComposite::RemoveChild(Layer *aChild)
{
NS_ASSERTION(aChild->Manager() == Manager(),
"Child has wrong manager");
NS_ASSERTION(aChild->GetParent() == this,
"aChild not our child");
Layer* prev = aChild->GetPrevSibling();
Layer* next = aChild->GetNextSibling();
if (prev) {
prev->SetNextSibling(next);
} else {
this->mFirstChild = next;
}
if (next) {
next->SetPrevSibling(prev);
} else {
this->mLastChild = prev;
}
aChild->SetNextSibling(nullptr);
aChild->SetPrevSibling(nullptr);
aChild->SetParent(nullptr);
this->DidRemoveChild(aChild);
NS_RELEASE(aChild);
}
void
ContainerLayerComposite::Destroy()
{
@ -306,51 +242,6 @@ ContainerLayerComposite::GetFirstChildComposite()
return static_cast<LayerComposite*>(mFirstChild->ImplData());
}
void
ContainerLayerComposite::RepositionChild(Layer* aChild, Layer* aAfter)
{
NS_ASSERTION(aChild->Manager() == Manager(),
"Child has wrong manager");
NS_ASSERTION(aChild->GetParent() == this,
"aChild not our child");
NS_ASSERTION(!aAfter ||
(aAfter->Manager() == Manager() &&
aAfter->GetParent() == this),
"aAfter is not our child");
Layer* prev = aChild->GetPrevSibling();
Layer* next = aChild->GetNextSibling();
if (prev == aAfter) {
// aChild is already in the correct position, nothing to do.
return;
}
if (prev) {
prev->SetNextSibling(next);
}
if (next) {
next->SetPrevSibling(prev);
}
if (!aAfter) {
aChild->SetPrevSibling(nullptr);
aChild->SetNextSibling(mFirstChild);
if (mFirstChild) {
mFirstChild->SetPrevSibling(aChild);
}
mFirstChild = aChild;
return;
}
Layer* afterNext = aAfter->GetNextSibling();
if (afterNext) {
afterNext->SetPrevSibling(aChild);
} else {
mLastChild = aChild;
}
aAfter->SetNextSibling(aChild);
aChild->SetPrevSibling(aAfter);
aChild->SetNextSibling(afterNext);
}
void
ContainerLayerComposite::RenderLayer(const nsIntPoint& aOffset,
const nsIntRect& aClipRect)

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