diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js
index 13d99dfbbc02..951bf358d0a1 100644
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -319,7 +319,7 @@ pref("media.fragmented-mp4.gonk.enabled", true);
pref("media.video-queue.default-size", 3);
// optimize images' memory usage
-pref("image.mem.decodeondraw", true);
+pref("image.mem.decodeondraw", false);
pref("image.mem.allow_locking_in_content_processes", false); /* don't allow image locking */
// Limit the surface cache to 1/8 of main memory or 128MB, whichever is smaller.
// Almost everything that was factored into 'max_decoded_image_kb' is now stored
diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml
index 0931cffbf8b1..9006d3bcd51c 100644
--- a/b2g/config/dolphin/sources.xml
+++ b/b2g/config/dolphin/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index 8df3d0248551..08f9699d0554 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index 27c9f7610966..1b0893f608f4 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index 0194695809fc..b2e9feaff5ca 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index 8df3d0248551..08f9699d0554 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml
index 4ca1b3822b17..6f748f41b8de 100644
--- a/b2g/config/flame-kk/sources.xml
+++ b/b2g/config/flame-kk/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml
index 5344147e21d0..cb27a1a0b6dc 100644
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index e40258533106..c85110c777b8 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,9 +1,9 @@
{
"git": {
- "git_revision": "0244121522343877d65a69377226a836688e3004",
+ "git_revision": "a0e71e61922bde009a3b6714cbe965021d3279f1",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
- "revision": "33d9ca589ca27af7f98b29b97a232ca599f111fe",
+ "revision": "0829f98e30c6f7795f66052d32e25456eb54bda5",
"repo_path": "integration/gaia-central"
}
diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml
index 163972b68a6c..6efea03d0359 100644
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/nexus-5-l/sources.xml b/b2g/config/nexus-5-l/sources.xml
index dff4eb545101..75f5f8292c90 100644
--- a/b2g/config/nexus-5-l/sources.xml
+++ b/b2g/config/nexus-5-l/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/browser/modules/ProcessHangMonitor.jsm b/browser/modules/ProcessHangMonitor.jsm
index a175e1d1f6b8..c12964aaa8a9 100644
--- a/browser/modules/ProcessHangMonitor.jsm
+++ b/browser/modules/ProcessHangMonitor.jsm
@@ -278,6 +278,17 @@ let ProcessHangMonitor = {
return;
}
+ // On e10s this counts slow-script/hanged-plugin notice only once.
+ // This code is not reached on non-e10s.
+ if (report.hangType == report.SLOW_SCRIPT) {
+ // On non-e10s, SLOW_SCRIPT_NOTICE_COUNT is probed at nsGlobalWindow.cpp
+ Services.telemetry.getHistogramById("SLOW_SCRIPT_NOTICE_COUNT").add();
+ } else if (report.hangType == report.PLUGIN_HANG) {
+ // On non-e10s we have sufficient plugin telemetry probes,
+ // so PLUGIN_HANG_NOTICE_COUNT is only probed on e10s.
+ Services.telemetry.getHistogramById("PLUGIN_HANG_NOTICE_COUNT").add();
+ }
+
// Otherwise create a new timer and display the report.
let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
timer.initWithCallback(this, HANG_EXPIRATION_TIME, timer.TYPE_ONE_SHOT);
diff --git a/build/sanitizers/lsan_suppressions.txt b/build/sanitizers/lsan_suppressions.txt
index 9b7d6029e2cb..78865b3049a1 100644
--- a/build/sanitizers/lsan_suppressions.txt
+++ b/build/sanitizers/lsan_suppressions.txt
@@ -46,7 +46,7 @@ leak:mozilla::TransportLayerDtls::Setup
###
# Bug 981195 - Small leak in the parser. m4
-leak:TypeCompartment::fixObjectGroup
+leak:ObjectGroup::fixPlainObjectGroup
# Bug 982111 - WebM is leaking. m1
leak:nestegg_read_packet
diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp
index 671609e4ef8e..3a621a03996d 100644
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -3078,8 +3078,14 @@ nsGlobalWindow::PreHandleEvent(EventChainPreVisitor& aVisitor)
gEntropyCollector->RandomUpdate((void*)&(aVisitor.mEvent->time),
sizeof(uint32_t));
}
- } else if (msg == NS_RESIZE_EVENT) {
- mIsHandlingResizeEvent = true;
+ } else if (msg == NS_RESIZE_EVENT && aVisitor.mEvent->mFlags.mIsTrusted) {
+ // QIing to window so that we can keep the old behavior also in case
+ // a child window is handling resize.
+ nsCOMPtr window =
+ do_QueryInterface(aVisitor.mEvent->originalTarget);
+ if (window) {
+ mIsHandlingResizeEvent = true;
+ }
} else if (msg == NS_MOUSE_BUTTON_DOWN &&
aVisitor.mEvent->mFlags.mIsTrusted) {
gMouseDown = true;
@@ -7259,7 +7265,7 @@ nsGlobalWindow::ScrollTo(const CSSIntPoint& aScroll,
NS_IMETHODIMP
nsGlobalWindow::ScrollBy(int32_t aXScrollDif, int32_t aYScrollDif)
{
- ScrollBy(aXScrollDif, aYScrollDif);
+ ScrollBy(double(aXScrollDif), double(aYScrollDif));
return NS_OK;
}
@@ -11018,6 +11024,10 @@ nsGlobalWindow::ShowSlowScriptDialog()
return ContinueSlowScriptAndKeepNotifying;
}
+ // Reached only on non-e10s - once per slow script dialog.
+ // On e10s - we probe once at ProcessHangsMonitor.jsm
+ Telemetry::Accumulate(Telemetry::SLOW_SCRIPT_NOTICE_COUNT, 1);
+
// Get the nsIPrompt interface from the docshell
nsCOMPtr ds = GetDocShell();
NS_ENSURE_TRUE(ds, KillSlowScript);
diff --git a/dom/base/nsIImageLoadingContent.idl b/dom/base/nsIImageLoadingContent.idl
index 3c3594054e16..f477b67ebf31 100644
--- a/dom/base/nsIImageLoadingContent.idl
+++ b/dom/base/nsIImageLoadingContent.idl
@@ -37,7 +37,7 @@ interface nsIFrame;
* interface to mirror this interface when changing it.
*/
-[scriptable, builtinclass, uuid(ce098f6c-baca-4178-a9aa-266e8bfe509b)]
+[scriptable, builtinclass, uuid(5794d12b-3195-4526-a814-a2181f6c71fe)]
interface nsIImageLoadingContent : imgINotificationObserver
{
/**
@@ -170,9 +170,17 @@ interface nsIImageLoadingContent : imgINotificationObserver
/**
* A visible count is stored, if it is non-zero then this image is considered
- * visible. These methods increment, decrement, or return the visible coount.
+ * visible. These methods increment, decrement, or return the visible count.
+ *
+ * @param aNonvisibleAction What to do if the image's visibility count is now
+ * zero. If ON_NONVISIBLE_NO_ACTION, nothing will be
+ * done. If ON_NONVISIBLE_REQUEST_DISCARD, the image
+ * will be asked to discard its surfaces if possible.
*/
[noscript, notxpcom] void IncrementVisibleCount();
- [noscript, notxpcom] void DecrementVisibleCount();
+ [noscript, notxpcom] void DecrementVisibleCount(in uint32_t aNonvisibleAction);
[noscript, notxpcom] uint32_t GetVisibleCount();
+
+ const long ON_NONVISIBLE_NO_ACTION = 0;
+ const long ON_NONVISIBLE_REQUEST_DISCARD = 1;
};
diff --git a/dom/base/nsImageLoadingContent.cpp b/dom/base/nsImageLoadingContent.cpp
index 3cb7700b3124..c1157d3d4d48 100644
--- a/dom/base/nsImageLoadingContent.cpp
+++ b/dom/base/nsImageLoadingContent.cpp
@@ -105,8 +105,8 @@ nsImageLoadingContent::DestroyImageLoadingContent()
{
// Cancel our requests so they won't hold stale refs to us
// NB: Don't ask to discard the images here.
- ClearCurrentRequest(NS_BINDING_ABORTED, 0);
- ClearPendingRequest(NS_BINDING_ABORTED, 0);
+ ClearCurrentRequest(NS_BINDING_ABORTED, ON_NONVISIBLE_NO_ACTION);
+ ClearPendingRequest(NS_BINDING_ABORTED, ON_NONVISIBLE_NO_ACTION);
}
nsImageLoadingContent::~nsImageLoadingContent()
@@ -554,7 +554,7 @@ nsImageLoadingContent::FrameDestroyed(nsIFrame* aFrame)
if (aFrame->HasAnyStateBits(NS_FRAME_IN_POPUP)) {
// We assume all images in popups are visible, so this decrement balances
// out the increment in FrameCreated above.
- DecrementVisibleCount();
+ DecrementVisibleCount(ON_NONVISIBLE_NO_ACTION);
}
}
@@ -777,14 +777,14 @@ nsImageLoadingContent::IncrementVisibleCount()
}
void
-nsImageLoadingContent::DecrementVisibleCount()
+nsImageLoadingContent::DecrementVisibleCount(uint32_t aNonvisibleAction)
{
NS_ASSERTION(mVisibleCount > 0, "visible count should be positive here");
mVisibleCount--;
if (mVisibleCount == 0) {
- UntrackImage(mCurrentRequest);
- UntrackImage(mPendingRequest);
+ UntrackImage(mCurrentRequest, aNonvisibleAction);
+ UntrackImage(mPendingRequest, aNonvisibleAction);
}
}
@@ -1096,8 +1096,8 @@ void
nsImageLoadingContent::CancelImageRequests(bool aNotify)
{
AutoStateChanger changer(this, aNotify);
- ClearPendingRequest(NS_BINDING_ABORTED, REQUEST_DISCARD);
- ClearCurrentRequest(NS_BINDING_ABORTED, REQUEST_DISCARD);
+ ClearPendingRequest(NS_BINDING_ABORTED, ON_NONVISIBLE_REQUEST_DISCARD);
+ ClearCurrentRequest(NS_BINDING_ABORTED, ON_NONVISIBLE_REQUEST_DISCARD);
}
nsresult
@@ -1109,8 +1109,8 @@ nsImageLoadingContent::UseAsPrimaryRequest(imgRequestProxy* aRequest,
AutoStateChanger changer(this, aNotify);
// Get rid if our existing images
- ClearPendingRequest(NS_BINDING_ABORTED, REQUEST_DISCARD);
- ClearCurrentRequest(NS_BINDING_ABORTED, REQUEST_DISCARD);
+ ClearPendingRequest(NS_BINDING_ABORTED, ON_NONVISIBLE_REQUEST_DISCARD);
+ ClearCurrentRequest(NS_BINDING_ABORTED, ON_NONVISIBLE_REQUEST_DISCARD);
// Clone the request we were given.
nsRefPtr& req = PrepareNextRequest(aImageLoadType);
@@ -1227,7 +1227,7 @@ nsImageLoadingContent::SetBlockedRequest(nsIURI* aURI, int16_t aContentDecision)
// reason "image source changed". However, apparently there's some abuse
// over in nsImageFrame where the displaying of the "broken" icon for the
// next image depends on the cancel reason of the previous image. ugh.
- ClearPendingRequest(NS_ERROR_IMAGE_BLOCKED, REQUEST_DISCARD);
+ ClearPendingRequest(NS_ERROR_IMAGE_BLOCKED, ON_NONVISIBLE_REQUEST_DISCARD);
// For the blocked case, we only want to cancel the existing current request
// if size is not available. bz says the web depends on this behavior.
@@ -1235,7 +1235,7 @@ nsImageLoadingContent::SetBlockedRequest(nsIURI* aURI, int16_t aContentDecision)
mImageBlockingStatus = aContentDecision;
uint32_t keepFlags = mCurrentRequestFlags & REQUEST_IS_IMAGESET;
- ClearCurrentRequest(NS_ERROR_IMAGE_BLOCKED, REQUEST_DISCARD);
+ ClearCurrentRequest(NS_ERROR_IMAGE_BLOCKED, ON_NONVISIBLE_REQUEST_DISCARD);
// We still want to remember what URI we were and if it was an imageset,
// despite not having an actual request. These are both cleared as part of
@@ -1253,7 +1253,8 @@ nsImageLoadingContent::PrepareCurrentRequest(ImageLoadType aImageLoadType)
mImageBlockingStatus = nsIContentPolicy::ACCEPT;
// Get rid of anything that was there previously.
- ClearCurrentRequest(NS_ERROR_IMAGE_SRC_CHANGED, REQUEST_DISCARD);
+ ClearCurrentRequest(NS_ERROR_IMAGE_SRC_CHANGED,
+ ON_NONVISIBLE_REQUEST_DISCARD);
if (mNewRequestsWillNeedAnimationReset) {
mCurrentRequestFlags |= REQUEST_NEEDS_ANIMATION_RESET;
@@ -1271,7 +1272,8 @@ nsRefPtr&
nsImageLoadingContent::PreparePendingRequest(ImageLoadType aImageLoadType)
{
// Get rid of anything that was there previously.
- ClearPendingRequest(NS_ERROR_IMAGE_SRC_CHANGED, REQUEST_DISCARD);
+ ClearPendingRequest(NS_ERROR_IMAGE_SRC_CHANGED,
+ ON_NONVISIBLE_REQUEST_DISCARD);
if (mNewRequestsWillNeedAnimationReset) {
mPendingRequestFlags |= REQUEST_NEEDS_ANIMATION_RESET;
@@ -1336,7 +1338,7 @@ nsImageLoadingContent::MakePendingRequestCurrent()
void
nsImageLoadingContent::ClearCurrentRequest(nsresult aReason,
- uint32_t aFlags)
+ uint32_t aNonvisibleAction)
{
if (!mCurrentRequest) {
// Even if we didn't have a current request, we might have been keeping
@@ -1354,7 +1356,7 @@ nsImageLoadingContent::ClearCurrentRequest(nsresult aReason,
&mCurrentRequestRegistered);
// Clean up the request.
- UntrackImage(mCurrentRequest, aFlags);
+ UntrackImage(mCurrentRequest, aNonvisibleAction);
mCurrentRequest->CancelAndForgetObserver(aReason);
mCurrentRequest = nullptr;
mCurrentRequestFlags = 0;
@@ -1362,7 +1364,7 @@ nsImageLoadingContent::ClearCurrentRequest(nsresult aReason,
void
nsImageLoadingContent::ClearPendingRequest(nsresult aReason,
- uint32_t aFlags)
+ uint32_t aNonvisibleAction)
{
if (!mPendingRequest)
return;
@@ -1372,7 +1374,7 @@ nsImageLoadingContent::ClearPendingRequest(nsresult aReason,
nsLayoutUtils::DeregisterImageRequest(GetFramePresContext(), mPendingRequest,
&mPendingRequestRegistered);
- UntrackImage(mPendingRequest, aFlags);
+ UntrackImage(mPendingRequest, aNonvisibleAction);
mPendingRequest->CancelAndForgetObserver(aReason);
mPendingRequest = nullptr;
mPendingRequestFlags = 0;
@@ -1472,7 +1474,9 @@ nsImageLoadingContent::TrackImage(imgIRequest* aImage)
}
void
-nsImageLoadingContent::UntrackImage(imgIRequest* aImage, uint32_t aFlags /* = 0 */)
+nsImageLoadingContent::UntrackImage(imgIRequest* aImage,
+ uint32_t aNonvisibleAction
+ /* = ON_NONVISIBLE_NO_ACTION */)
{
if (!aImage)
return;
@@ -1489,9 +1493,10 @@ nsImageLoadingContent::UntrackImage(imgIRequest* aImage, uint32_t aFlags /* = 0
if (doc && (mCurrentRequestFlags & REQUEST_IS_TRACKED)) {
mCurrentRequestFlags &= ~REQUEST_IS_TRACKED;
doc->RemoveImage(mCurrentRequest,
- (aFlags & REQUEST_DISCARD) ? nsIDocument::REQUEST_DISCARD : 0);
- }
- else if (aFlags & REQUEST_DISCARD) {
+ (aNonvisibleAction == ON_NONVISIBLE_REQUEST_DISCARD)
+ ? nsIDocument::REQUEST_DISCARD
+ : 0);
+ } else if (aNonvisibleAction == ON_NONVISIBLE_REQUEST_DISCARD) {
// If we're not in the document we may still need to be discarded.
aImage->RequestDiscard();
}
@@ -1500,9 +1505,10 @@ nsImageLoadingContent::UntrackImage(imgIRequest* aImage, uint32_t aFlags /* = 0
if (doc && (mPendingRequestFlags & REQUEST_IS_TRACKED)) {
mPendingRequestFlags &= ~REQUEST_IS_TRACKED;
doc->RemoveImage(mPendingRequest,
- (aFlags & REQUEST_DISCARD) ? nsIDocument::REQUEST_DISCARD : 0);
- }
- else if (aFlags & REQUEST_DISCARD) {
+ (aNonvisibleAction == ON_NONVISIBLE_REQUEST_DISCARD)
+ ? nsIDocument::REQUEST_DISCARD
+ : 0);
+ } else if (aNonvisibleAction == ON_NONVISIBLE_REQUEST_DISCARD) {
// If we're not in the document we may still need to be discarded.
aImage->RequestDiscard();
}
diff --git a/dom/base/nsImageLoadingContent.h b/dom/base/nsImageLoadingContent.h
index 97b8c54dfd67..6719ffed6f64 100644
--- a/dom/base/nsImageLoadingContent.h
+++ b/dom/base/nsImageLoadingContent.h
@@ -316,9 +316,12 @@ protected:
/**
* Cancels and nulls-out the "current" and "pending" requests if they exist.
+ *
+ * @param aNonvisibleAction An action to take if the image is no longer
+ * visible as a result; see |UntrackImage|.
*/
- void ClearCurrentRequest(nsresult aReason, uint32_t aFlags);
- void ClearPendingRequest(nsresult aReason, uint32_t aFlags);
+ void ClearCurrentRequest(nsresult aReason, uint32_t aNonvisibleAction);
+ void ClearPendingRequest(nsresult aReason, uint32_t aNonvisibleAction);
/**
* Retrieve a pointer to the 'registered with the refresh driver' flag for
@@ -347,14 +350,14 @@ protected:
*
* No-op if aImage is null.
*
- * REQUEST_DISCARD passed to UntrackImage means we request the discard of the
- * decoded data of the image.
+ * @param aNonvisibleAction What to do if the image's visibility count is now
+ * zero. If ON_NONVISIBLE_NO_ACTION, nothing will be
+ * done. If ON_NONVISIBLE_REQUEST_DISCARD, the image
+ * will be asked to discard its surfaces if possible.
*/
void TrackImage(imgIRequest* aImage);
- enum {
- REQUEST_DISCARD = 0x1
- };
- void UntrackImage(imgIRequest* aImage, uint32_t aFlags = 0);
+ void UntrackImage(imgIRequest* aImage,
+ uint32_t aNonvisibleAction = ON_NONVISIBLE_NO_ACTION);
/* MEMBERS */
nsRefPtr mCurrentRequest;
diff --git a/dom/base/test/mochitest.ini b/dom/base/test/mochitest.ini
index 4895b6c5ea1e..d84fc5cf1212 100644
--- a/dom/base/test/mochitest.ini
+++ b/dom/base/test/mochitest.ini
@@ -772,4 +772,6 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s
[test_window_define_nonconfigurable.html]
skip-if = true # bug 1107443 - code for newly-added test was disabled
[test_root_iframe.html]
-[test_performance_user_timing.html]
\ No newline at end of file
+[test_performance_user_timing.html]
+[test_bug1126851.html]
+skip-if = buildapp == 'mulet' || buildapp == 'b2g'
\ No newline at end of file
diff --git a/dom/base/test/test_bug1126851.html b/dom/base/test/test_bug1126851.html
new file mode 100644
index 000000000000..d6d7bf4a2206
--- /dev/null
+++ b/dom/base/test/test_bug1126851.html
@@ -0,0 +1,44 @@
+
+
+
+
+
+ Test for Bug 1126851
+
+
+
+
+
+Mozilla Bug 1126851
+
+
+
+
+
+
+
+
diff --git a/dom/broadcastchannel/BroadcastChannel.cpp b/dom/broadcastchannel/BroadcastChannel.cpp
index fbd103267b95..96b7c35123d8 100644
--- a/dom/broadcastchannel/BroadcastChannel.cpp
+++ b/dom/broadcastchannel/BroadcastChannel.cpp
@@ -195,13 +195,13 @@ private:
ErrorResult& mRv;
};
-class PostMessageRunnable MOZ_FINAL : public nsICancelableRunnable
+class BCPostMessageRunnable MOZ_FINAL : public nsICancelableRunnable
{
public:
NS_DECL_ISUPPORTS
- PostMessageRunnable(BroadcastChannelChild* aActor,
- BroadcastChannelMessage* aData)
+ BCPostMessageRunnable(BroadcastChannelChild* aActor,
+ BroadcastChannelMessage* aData)
: mActor(aActor)
, mData(aData)
{
@@ -249,13 +249,13 @@ public:
}
private:
- ~PostMessageRunnable() {}
+ ~BCPostMessageRunnable() {}
nsRefPtr mActor;
nsRefPtr mData;
};
-NS_IMPL_ISUPPORTS(PostMessageRunnable, nsICancelableRunnable, nsIRunnable)
+NS_IMPL_ISUPPORTS(BCPostMessageRunnable, nsICancelableRunnable, nsIRunnable)
class CloseRunnable MOZ_FINAL : public nsICancelableRunnable
{
@@ -559,8 +559,8 @@ void
BroadcastChannel::PostMessageData(BroadcastChannelMessage* aData)
{
if (mActor) {
- nsRefPtr runnable =
- new PostMessageRunnable(mActor, aData);
+ nsRefPtr runnable =
+ new BCPostMessageRunnable(mActor, aData);
if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
NS_WARNING("Failed to dispatch to the current thread!");
diff --git a/dom/broadcastchannel/moz.build b/dom/broadcastchannel/moz.build
index 01c795f8743e..6ff7e04872cf 100644
--- a/dom/broadcastchannel/moz.build
+++ b/dom/broadcastchannel/moz.build
@@ -8,7 +8,7 @@ EXPORTS.mozilla.dom += [
'BroadcastChannel.h',
]
-SOURCES += [
+UNIFIED_SOURCES += [
'BroadcastChannel.cpp',
'BroadcastChannelChild.cpp',
'BroadcastChannelParent.cpp',
diff --git a/dom/browser-element/mochitest/browserElement_Alert.js b/dom/browser-element/mochitest/browserElement_Alert.js
index 269996bb5174..3c7c507205e8 100644
--- a/dom/browser-element/mochitest/browserElement_Alert.js
+++ b/dom/browser-element/mochitest/browserElement_Alert.js
@@ -109,7 +109,10 @@ function test3(e) {
numPendingChildTests++;
onTryAgain();
- waitForPendingTests(function() { test4(); });
+ waitForPendingTests(function() {
+ mm.removeMessageListener('test-try-again', onTryAgain);
+ test4();
+ });
}
function test4() {
@@ -240,7 +243,10 @@ function test6f() {
numPendingChildTests++;
onTryAgain();
- waitForPendingTests(test6g);
+ waitForPendingTests(function() {
+ mm.removeMessageListener('test-try-again', onTryAgain);
+ test6g();
+ });
}
function test6g() {
@@ -269,7 +275,10 @@ function test6g() {
numPendingChildTests++;
onTryAgain();
- waitForPendingTests(test6h);
+ waitForPendingTests(function() {
+ mm.removeMessageListener('test-try-again', onTryAgain);
+ test6h();
+ });
}
function test6h() {
diff --git a/dom/canvas/WebGLContext.cpp b/dom/canvas/WebGLContext.cpp
index 38420ff232e2..749621074af9 100644
--- a/dom/canvas/WebGLContext.cpp
+++ b/dom/canvas/WebGLContext.cpp
@@ -505,7 +505,7 @@ IsFeatureInBlacklist(const nsCOMPtr& gfxInfo, int32_t feature)
static already_AddRefed
CreateHeadlessNativeGL(bool forceEnabled, const nsCOMPtr& gfxInfo,
- bool requireCompatProfile, WebGLContext* webgl)
+ WebGLContext* webgl)
{
if (!forceEnabled &&
IsFeatureInBlacklist(gfxInfo, nsIGfxInfo::FEATURE_WEBGL_OPENGL))
@@ -515,7 +515,7 @@ CreateHeadlessNativeGL(bool forceEnabled, const nsCOMPtr& gfxInfo,
return nullptr;
}
- nsRefPtr gl = gl::GLContextProvider::CreateHeadless(requireCompatProfile);
+ nsRefPtr gl = gl::GLContextProvider::CreateHeadless();
if (!gl) {
webgl->GenerateWarning("Error during native OpenGL init.");
return nullptr;
@@ -530,7 +530,7 @@ CreateHeadlessNativeGL(bool forceEnabled, const nsCOMPtr& gfxInfo,
// Eventually, we want to be able to pick ANGLE-EGL or native EGL.
static already_AddRefed
CreateHeadlessANGLE(bool forceEnabled, const nsCOMPtr& gfxInfo,
- bool requireCompatProfile, WebGLContext* webgl)
+ WebGLContext* webgl)
{
nsRefPtr gl;
@@ -543,7 +543,7 @@ CreateHeadlessANGLE(bool forceEnabled, const nsCOMPtr& gfxInfo,
return nullptr;
}
- gl = gl::GLContextProviderEGL::CreateHeadless(requireCompatProfile);
+ gl = gl::GLContextProviderEGL::CreateHeadless();
if (!gl) {
webgl->GenerateWarning("Error during ANGLE OpenGL init.");
return nullptr;
@@ -555,13 +555,13 @@ CreateHeadlessANGLE(bool forceEnabled, const nsCOMPtr& gfxInfo,
}
static already_AddRefed
-CreateHeadlessEGL(bool forceEnabled, bool requireCompatProfile,
+CreateHeadlessEGL(bool forceEnabled, const nsCOMPtr& gfxInfo,
WebGLContext* webgl)
{
nsRefPtr gl;
#ifdef ANDROID
- gl = gl::GLContextProviderEGL::CreateHeadless(requireCompatProfile);
+ gl = gl::GLContextProviderEGL::CreateHeadless();
if (!gl) {
webgl->GenerateWarning("Error during EGL OpenGL init.");
return nullptr;
@@ -583,22 +583,16 @@ CreateHeadlessGL(bool forceEnabled, const nsCOMPtr& gfxInfo,
if (PR_GetEnv("MOZ_WEBGL_FORCE_OPENGL"))
disableANGLE = true;
- bool requireCompatProfile = webgl->IsWebGL2() ? false : true;
-
nsRefPtr gl;
if (preferEGL)
- gl = CreateHeadlessEGL(forceEnabled, requireCompatProfile, webgl);
+ gl = CreateHeadlessEGL(forceEnabled, gfxInfo, webgl);
- if (!gl && !disableANGLE) {
- gl = CreateHeadlessANGLE(forceEnabled, gfxInfo, requireCompatProfile,
- webgl);
- }
+ if (!gl && !disableANGLE)
+ gl = CreateHeadlessANGLE(forceEnabled, gfxInfo, webgl);
- if (!gl) {
- gl = CreateHeadlessNativeGL(forceEnabled, gfxInfo,
- requireCompatProfile, webgl);
- }
+ if (!gl)
+ gl = CreateHeadlessNativeGL(forceEnabled, gfxInfo, webgl);
return gl.forget();
}
diff --git a/dom/canvas/WebGLContext.h b/dom/canvas/WebGLContext.h
index fdaada5f80b0..dabdd737782f 100644
--- a/dom/canvas/WebGLContext.h
+++ b/dom/canvas/WebGLContext.h
@@ -1209,10 +1209,9 @@ protected:
// -------------------------------------------------------------------------
// WebGL 2 specifics (implemented in WebGL2Context.cpp)
-public:
+
virtual bool IsWebGL2() const = 0;
-protected:
bool InitWebGL2();
// -------------------------------------------------------------------------
diff --git a/dom/canvas/WebGLContextGL.cpp b/dom/canvas/WebGLContextGL.cpp
index 1e4d4c1b370a..999b71b67e42 100644
--- a/dom/canvas/WebGLContextGL.cpp
+++ b/dom/canvas/WebGLContextGL.cpp
@@ -2106,6 +2106,7 @@ WebGLContext::ReadPixels(GLint x, GLint y, GLsizei width,
// if we're reading alpha, we may need to do fixup. Note that we don't allow
// GL_ALPHA to readpixels currently, but we had the code written for it already.
+
const bool formatHasAlpha = format == LOCAL_GL_ALPHA ||
format == LOCAL_GL_RGBA;
if (!formatHasAlpha)
diff --git a/dom/canvas/WebGLContextUtils.cpp b/dom/canvas/WebGLContextUtils.cpp
index caba53cac181..b0e02a185770 100644
--- a/dom/canvas/WebGLContextUtils.cpp
+++ b/dom/canvas/WebGLContextUtils.cpp
@@ -1117,12 +1117,11 @@ WebGLContext::AssertCachedState()
AssertUintParamCorrect(gl, LOCAL_GL_STENCIL_CLEAR_VALUE, mStencilClearValue);
GLint stencilBits = 0;
- if (GetStencilBits(&stencilBits)) {
- const GLuint stencilRefMask = (1 << stencilBits) - 1;
+ gl->fGetIntegerv(LOCAL_GL_STENCIL_BITS, &stencilBits);
+ const GLuint stencilRefMask = (1 << stencilBits) - 1;
- AssertMaskedUintParamCorrect(gl, LOCAL_GL_STENCIL_REF, stencilRefMask, mStencilRefFront);
- AssertMaskedUintParamCorrect(gl, LOCAL_GL_STENCIL_BACK_REF, stencilRefMask, mStencilRefBack);
- }
+ AssertMaskedUintParamCorrect(gl, LOCAL_GL_STENCIL_REF, stencilRefMask, mStencilRefFront);
+ AssertMaskedUintParamCorrect(gl, LOCAL_GL_STENCIL_BACK_REF, stencilRefMask, mStencilRefBack);
// GLES 3.0.4, $4.1.4, p177:
// [...] the front and back stencil mask are both set to the value `2^s - 1`, where
diff --git a/dom/canvas/WebGLContextValidate.cpp b/dom/canvas/WebGLContextValidate.cpp
index e942610793b9..1dbc000a1416 100644
--- a/dom/canvas/WebGLContextValidate.cpp
+++ b/dom/canvas/WebGLContextValidate.cpp
@@ -1779,8 +1779,8 @@ WebGLContext::InitAndValidateGL()
MakeContextCurrent();
- // For OpenGL compat. profiles, we always keep vertex attrib 0 array enabled.
- if (gl->IsCompatibilityProfile())
+ // on desktop OpenGL, we always keep vertex attrib 0 array enabled
+ if (!gl->IsGLES())
gl->fEnableVertexAttribArray(0);
if (MinCapabilityMode())
@@ -1889,7 +1889,7 @@ WebGLContext::InitAndValidateGL()
// Always 1 for GLES2
mMaxFramebufferColorAttachments = 1;
- if (gl->IsCompatibilityProfile()) {
+ if (!gl->IsGLES()) {
// gl_PointSize is always available in ES2 GLSL, but has to be
// specifically enabled on desktop GLSL.
gl->fEnable(LOCAL_GL_VERTEX_PROGRAM_POINT_SIZE);
diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp
index 90935dcbc96e..0d4e91df2a1c 100644
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -481,32 +481,9 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
mCurrentTarget = aTargetFrame;
mCurrentTargetContent = nullptr;
- // Focus events don't necessarily need a frame.
- if (NS_EVENT_NEEDS_FRAME(aEvent)) {
- NS_ASSERTION(mCurrentTarget, "mCurrentTarget is null. this should not happen. see bug #13007");
- if (!mCurrentTarget) return NS_ERROR_NULL_POINTER;
- }
-#ifdef DEBUG
- if (aEvent->HasDragEventMessage() && sIsPointerLocked) {
- NS_ASSERTION(sIsPointerLocked,
- "sIsPointerLocked is true. Drag events should be suppressed when the pointer is locked.");
- }
-#endif
- // Store last known screenPoint and clientPoint so pointer lock
- // can use these values as constants.
- WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
- if (aEvent->mFlags.mIsTrusted &&
- ((mouseEvent && mouseEvent->IsReal()) ||
- aEvent->mClass == eWheelEventClass) &&
- !sIsPointerLocked) {
- sLastScreenPoint =
- UIEvent::CalculateScreenPoint(aPresContext, aEvent);
- sLastClientPoint =
- UIEvent::CalculateClientPoint(aPresContext, aEvent, nullptr);
- }
-
// Do not take account NS_MOUSE_ENTER/EXIT so that loading a page
// when user is not active doesn't change the state to active.
+ WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
if (aEvent->mFlags.mIsTrusted &&
((mouseEvent && mouseEvent->IsReal() &&
mouseEvent->message != NS_MOUSE_ENTER &&
@@ -524,10 +501,35 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
++gMouseOrKeyboardEventCounter;
}
- *aStatus = nsEventStatus_eIgnore;
-
WheelTransaction::OnEvent(aEvent);
+ // Focus events don't necessarily need a frame.
+ if (NS_EVENT_NEEDS_FRAME(aEvent)) {
+ if (!mCurrentTarget) {
+ return NS_ERROR_NULL_POINTER;
+ }
+ }
+#ifdef DEBUG
+ if (aEvent->HasDragEventMessage() && sIsPointerLocked) {
+ NS_ASSERTION(sIsPointerLocked,
+ "sIsPointerLocked is true. Drag events should be suppressed when "
+ "the pointer is locked.");
+ }
+#endif
+ // Store last known screenPoint and clientPoint so pointer lock
+ // can use these values as constants.
+ if (aEvent->mFlags.mIsTrusted &&
+ ((mouseEvent && mouseEvent->IsReal()) ||
+ aEvent->mClass == eWheelEventClass) &&
+ !sIsPointerLocked) {
+ sLastScreenPoint =
+ UIEvent::CalculateScreenPoint(aPresContext, aEvent);
+ sLastClientPoint =
+ UIEvent::CalculateClientPoint(aPresContext, aEvent, nullptr);
+ }
+
+ *aStatus = nsEventStatus_eIgnore;
+
switch (aEvent->message) {
case NS_CONTEXTMENU:
if (sIsPointerLocked) {
diff --git a/dom/events/MessageEvent.cpp b/dom/events/MessageEvent.cpp
index b76093ddc16d..876e99b201e2 100644
--- a/dom/events/MessageEvent.cpp
+++ b/dom/events/MessageEvent.cpp
@@ -200,6 +200,12 @@ MessageEvent::SetPorts(MessagePortList* aPorts)
mPorts = aPorts;
}
+void
+MessageEvent::SetSource(mozilla::dom::MessagePort* aPort)
+{
+ mPortSource = aPort;
+}
+
} // namespace dom
} // namespace mozilla
diff --git a/dom/events/MessageEvent.h b/dom/events/MessageEvent.h
index 44262455c20f..2dc8e35a5c04 100644
--- a/dom/events/MessageEvent.h
+++ b/dom/events/MessageEvent.h
@@ -58,10 +58,7 @@ public:
void SetPorts(MessagePortList* aPorts);
// Non WebIDL methods
- void SetSource(mozilla::dom::MessagePort* aPort)
- {
- mPortSource = aPort;
- }
+ void SetSource(mozilla::dom::MessagePort* aPort);
void SetSource(nsPIDOMWindow* aWindow)
{
diff --git a/dom/html/test/test_bug1081037.html b/dom/html/test/test_bug1081037.html
index 783e8557c561..9d878258023d 100644
--- a/dom/html/test/test_bug1081037.html
+++ b/dom/html/test/test_bug1081037.html
@@ -96,7 +96,6 @@ shouldThrow(function() {
var getOwn = 0;
var defineProp = 0;
-var _has = 0;
var handler2 = {
getOwnPropertyDescriptor: function(target, name) {
if (name == "constructor") {
@@ -109,12 +108,6 @@ var handler2 = {
defineProp++;
}
return Object.defineProperty(target, name, propertyDescriptor);
- },
- has: function(target, name) {
- if (name == "constructor") {
- _has++;
- }
- return name in target;
}
};
var proxy2 = new Proxy({}, handler2);
@@ -125,8 +118,6 @@ document.registerElement('x-proxymagic2', {
is(getOwn, 1, "number of getOwnPropertyDescriptor calls from registerElement: " + getOwn);
is(defineProp, 1, "number of defineProperty calls from registerElement: " + defineProp);
-is(_has, 1, "number of 'has' calls from registerElement: " + _has);
-
@@ -139,4 +130,4 @@ is(_has, 1, "number of 'has' calls from registerElement: " + _has);