From 9d5a9428c6bd60a2750c2940cbdbfa2fab3b4b36 Mon Sep 17 00:00:00 2001 From: Tobias Schneider Date: Fri, 9 Dec 2016 12:12:46 -0800 Subject: [PATCH 1/6] Bug 1321865 - Enable IntersectionObserver. r=smaug --HG-- extra : source : 3ae78eda5a0c2f2b0f57650e9b62656e11818a3c --- modules/libpref/init/all.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 74d741ae8b07..91a365d6d3b9 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -5562,4 +5562,4 @@ pref("prompts.authentication_dialog_abuse_limit", 3); // To enable the DOM implementation, turn on "dom.storageManager.enabled" pref("browser.storageManager.enabled", false); -pref("dom.IntersectionObserver.enabled", false); +pref("dom.IntersectionObserver.enabled", true); From dfd9861f0768cfd5494e6695750365dcedab260a Mon Sep 17 00:00:00 2001 From: Tobias Schneider Date: Thu, 15 Dec 2016 16:03:05 -0800 Subject: [PATCH 2/6] Bug 1321865 - Enable IntersectionObserver tests. r=smaug --HG-- extra : source : 016b87fe9145354cbdcc1b2bfdeb2cc737962016 --- dom/base/test/mochitest.ini | 2 +- dom/tests/mochitest/general/test_interfaces.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dom/base/test/mochitest.ini b/dom/base/test/mochitest.ini index e40730ddf353..6590fa6c99e5 100644 --- a/dom/base/test/mochitest.ini +++ b/dom/base/test/mochitest.ini @@ -655,7 +655,7 @@ skip-if = (toolkit == 'android') # Android: Bug 775227 [test_innersize_scrollport.html] [test_integer_attr_with_leading_zero.html] [test_intersectionobservers.html] -skip-if = true # Track Bug 1320704 +skip-if = (os == "android") # Timing issues [test_link_prefetch.html] skip-if = !e10s # Track Bug 1281415 [test_link_stylesheet.html] diff --git a/dom/tests/mochitest/general/test_interfaces.html b/dom/tests/mochitest/general/test_interfaces.html index 0123040ac859..7a878968321b 100644 --- a/dom/tests/mochitest/general/test_interfaces.html +++ b/dom/tests/mochitest/general/test_interfaces.html @@ -619,9 +619,9 @@ var interfaceNamesInGlobalScope = // IMPORTANT: Do not change this list without review from a DOM peer! "InstallTrigger", // IMPORTANT: Do not change this list without review from a DOM peer! - {name: "IntersectionObserver", disabled: true}, + "IntersectionObserver", // IMPORTANT: Do not change this list without review from a DOM peer! - {name: "IntersectionObserverEntry", disabled: true}, + "IntersectionObserverEntry", // IMPORTANT: Do not change this list without review from a DOM peer! "KeyEvent", // IMPORTANT: Do not change this list without review from a DOM peer! From fb9632e1c72cb98529955b68b079aa29c9dc43b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Fri, 23 Dec 2016 05:13:41 -0800 Subject: [PATCH 3/6] Bug 1324020 - Remove unreachable code in EnumerableOwnProperties function. rs=Waldo --- js/src/builtin/Object.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/js/src/builtin/Object.cpp b/js/src/builtin/Object.cpp index 9d2f29939970..b63c37d4ad11 100644 --- a/js/src/builtin/Object.cpp +++ b/js/src/builtin/Object.cpp @@ -860,9 +860,7 @@ EnumerableOwnProperties(JSContext* cx, const JS::CallArgs& args, EnumerableOwnPr // (Omitted because Object.keys doesn't use this implementation.) // Step 4.a.ii.2.a. - if (obj->isNative() && desc.hasValue()) - value = desc.value(); - else if (!GetProperty(cx, obj, obj, id, &value)) + if (!GetProperty(cx, obj, obj, id, &value)) return false; } From 0b1384e9e57762dd24a3350b523bf7d04b20d1ca Mon Sep 17 00:00:00 2001 From: Ethan Lin Date: Tue, 27 Dec 2016 11:40:40 +0800 Subject: [PATCH 4/6] Bug 1322079 - Set CreateBorderLayer to pure virtual function and let nsDisplayBorder return LAYER_ACTIVE. r=mattwoodrow MozReview-Commit-ID: 6zGq7ymIkO0 --- gfx/layers/Layers.h | 2 +- gfx/tests/gtest/TestLayers.cpp | 4 ++++ layout/painting/nsDisplayList.cpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gfx/layers/Layers.h b/gfx/layers/Layers.h index 225a7cd81034..fee7d88619cf 100644 --- a/gfx/layers/Layers.h +++ b/gfx/layers/Layers.h @@ -414,7 +414,7 @@ public: * CONSTRUCTION PHASE ONLY * Create a BorderLayer for this manager's layer tree. */ - virtual already_AddRefed CreateBorderLayer() { return nullptr; } + virtual already_AddRefed CreateBorderLayer() = 0; /** * CONSTRUCTION PHASE ONLY * Create a CanvasLayer for this manager's layer tree. diff --git a/gfx/tests/gtest/TestLayers.cpp b/gfx/tests/gtest/TestLayers.cpp index 47cb72264b61..3bee497537dd 100644 --- a/gfx/tests/gtest/TestLayers.cpp +++ b/gfx/tests/gtest/TestLayers.cpp @@ -82,6 +82,10 @@ public: NS_RUNTIMEABORT("Not implemented."); return nullptr; } + virtual already_AddRefed CreateBorderLayer() { + NS_RUNTIMEABORT("Not implemented."); + return nullptr; + } virtual void SetRoot(Layer* aLayer) {} virtual bool BeginTransactionWithTarget(gfxContext* aTarget) { return true; } virtual already_AddRefed CreateCanvasLayer() { diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index fa2416e5354f..22c61acb6582 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -4179,7 +4179,7 @@ nsDisplayBorder::GetLayerState(nsDisplayListBuilder* aBuilder, } mRect = ViewAs(br->mOuterRect); - return LAYER_INACTIVE; + return LAYER_ACTIVE; } already_AddRefed From 95c7ee0695ed611c0d6c699e91e824d51edee8dc Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Mon, 26 Dec 2016 19:00:56 +0100 Subject: [PATCH 5/6] Bug 1322681 - JS shell: wait for async tasks in DrainJobQueue(); r=bbouvier Changes DrainJobQueue() to wait for async tasks launched by queued jobs, rather than ignoring them and potentially causing segfaults. MozReview-Commit-ID: 3fMoNHzdlUW --HG-- extra : rebase_source : 1dcd3fd927cf648d2b17b9c894f364324cb80122 --- js/src/shell/js.cpp | 98 +++++++++++++++++++++++++-------------------- 1 file changed, 55 insertions(+), 43 deletions(-) diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index ba0679b18780..48a9a5cedba8 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -778,52 +778,64 @@ DrainJobQueue(JSContext* cx) if (sc->quitting || sc->drainingJobQueue) return true; - // Wait for any outstanding async tasks to finish so that the - // finishedAsyncTasks list is fixed. while (true) { - AutoLockHelperThreadState lock; - if (!sc->asyncTasks.lock()->outstanding) - break; - HelperThreadState().wait(lock, GlobalHelperThreadState::CONSUMER); - } - - // Lock the whole time while copying back the asyncTasks finished queue so - // that any new tasks created during finish() cannot racily join the job - // queue. Call finish() only thereafter, to avoid a circular mutex - // dependency (see also bug 1297901). - Vector finished(cx); - { - ExclusiveData::Guard asyncTasks = sc->asyncTasks.lock(); - finished = Move(asyncTasks->finished); - asyncTasks->finished.clear(); - } - - for (JS::AsyncTask* task : finished) - task->finish(cx); - - // It doesn't make sense for job queue draining to be reentrant. At the - // same time we don't want to assert against it, because that'd make - // drainJobQueue unsafe for fuzzers. We do want fuzzers to test this, so - // we simply ignore nested calls of drainJobQueue. - sc->drainingJobQueue = true; - - RootedObject job(cx); - JS::HandleValueArray args(JS::HandleValueArray::empty()); - RootedValue rval(cx); - // Execute jobs in a loop until we've reached the end of the queue. - // Since executing a job can trigger enqueuing of additional jobs, - // it's crucial to re-check the queue length during each iteration. - for (size_t i = 0; i < sc->jobQueue.length(); i++) { - job = sc->jobQueue[i]; - AutoCompartment ac(cx, job); - { - AutoReportException are(cx); - JS::Call(cx, UndefinedHandleValue, job, args, &rval); + // Wait for any outstanding async tasks to finish so that the + // finishedAsyncTasks list is fixed. + while (true) { + AutoLockHelperThreadState lock; + if (!sc->asyncTasks.lock()->outstanding) + break; + HelperThreadState().wait(lock, GlobalHelperThreadState::CONSUMER); + } + + // Lock the whole time while copying back the asyncTasks finished queue + // so that any new tasks created during finish() cannot racily join the + // job queue. Call finish() only thereafter, to avoid a circular mutex + // dependency (see also bug 1297901). + Vector finished(cx); + { + ExclusiveData::Guard asyncTasks = sc->asyncTasks.lock(); + finished = Move(asyncTasks->finished); + asyncTasks->finished.clear(); + } + + for (JS::AsyncTask* task : finished) + task->finish(cx); + + // It doesn't make sense for job queue draining to be reentrant. At the + // same time we don't want to assert against it, because that'd make + // drainJobQueue unsafe for fuzzers. We do want fuzzers to test this, + // so we simply ignore nested calls of drainJobQueue. + sc->drainingJobQueue = true; + + RootedObject job(cx); + JS::HandleValueArray args(JS::HandleValueArray::empty()); + RootedValue rval(cx); + + // Execute jobs in a loop until we've reached the end of the queue. + // Since executing a job can trigger enqueuing of additional jobs, + // it's crucial to re-check the queue length during each iteration. + for (size_t i = 0; i < sc->jobQueue.length(); i++) { + job = sc->jobQueue[i]; + AutoCompartment ac(cx, job); + { + AutoReportException are(cx); + JS::Call(cx, UndefinedHandleValue, job, args, &rval); + } + sc->jobQueue[i].set(nullptr); + } + sc->jobQueue.clear(); + sc->drainingJobQueue = false; + + // It's possible a job added an async task, and it's also possible + // that task has already finished. + { + ExclusiveData::Guard asyncTasks = sc->asyncTasks.lock(); + if (asyncTasks->outstanding == 0 && asyncTasks->finished.length() == 0) + break; } - sc->jobQueue[i].set(nullptr); } - sc->jobQueue.clear(); - sc->drainingJobQueue = false; + return true; } From 3ed240d6b86fcffd42bb72c7727068755250c9ee Mon Sep 17 00:00:00 2001 From: Tom Schuster Date: Tue, 27 Dec 2016 13:31:07 +0100 Subject: [PATCH 6/6] Bug 1325927 - Reorder JSValueTag to match JSValueType. r=jandem --- js/public/Value.h | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/js/public/Value.h b/js/public/Value.h index 14a30e8bd916..e052a090ca5d 100644 --- a/js/public/Value.h +++ b/js/public/Value.h @@ -45,7 +45,6 @@ namespace JS { class Value; } # define JS_ENUM_FOOTER(id) __attribute__((packed)) #endif -/* Remember to propagate changes to the C defines below. */ JS_ENUM_HEADER(JSValueType, uint8_t) { JSVAL_TYPE_DOUBLE = 0x00, @@ -69,19 +68,18 @@ static_assert(sizeof(JSValueType) == 1, #if defined(JS_NUNBOX32) -/* Remember to propagate changes to the C defines below. */ JS_ENUM_HEADER(JSValueTag, uint32_t) { JSVAL_TAG_CLEAR = 0xFFFFFF80, JSVAL_TAG_INT32 = JSVAL_TAG_CLEAR | JSVAL_TYPE_INT32, JSVAL_TAG_UNDEFINED = JSVAL_TAG_CLEAR | JSVAL_TYPE_UNDEFINED, JSVAL_TAG_NULL = JSVAL_TAG_CLEAR | JSVAL_TYPE_NULL, - JSVAL_TAG_STRING = JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING, - JSVAL_TAG_SYMBOL = JSVAL_TAG_CLEAR | JSVAL_TYPE_SYMBOL, JSVAL_TAG_BOOLEAN = JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN, JSVAL_TAG_MAGIC = JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC, - JSVAL_TAG_OBJECT = JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT, - JSVAL_TAG_PRIVATE_GCTHING = JSVAL_TAG_CLEAR | JSVAL_TYPE_PRIVATE_GCTHING + JSVAL_TAG_STRING = JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING, + JSVAL_TAG_SYMBOL = JSVAL_TAG_CLEAR | JSVAL_TYPE_SYMBOL, + JSVAL_TAG_PRIVATE_GCTHING = JSVAL_TAG_CLEAR | JSVAL_TYPE_PRIVATE_GCTHING, + JSVAL_TAG_OBJECT = JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT } JS_ENUM_FOOTER(JSValueTag); static_assert(sizeof(JSValueTag) == sizeof(uint32_t), @@ -89,19 +87,18 @@ static_assert(sizeof(JSValueTag) == sizeof(uint32_t), #elif defined(JS_PUNBOX64) -/* Remember to propagate changes to the C defines below. */ JS_ENUM_HEADER(JSValueTag, uint32_t) { JSVAL_TAG_MAX_DOUBLE = 0x1FFF0, JSVAL_TAG_INT32 = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32, JSVAL_TAG_UNDEFINED = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED, JSVAL_TAG_NULL = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_NULL, - JSVAL_TAG_STRING = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING, - JSVAL_TAG_SYMBOL = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_SYMBOL, JSVAL_TAG_BOOLEAN = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_BOOLEAN, JSVAL_TAG_MAGIC = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_MAGIC, - JSVAL_TAG_OBJECT = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_OBJECT, - JSVAL_TAG_PRIVATE_GCTHING = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_PRIVATE_GCTHING + JSVAL_TAG_STRING = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING, + JSVAL_TAG_SYMBOL = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_SYMBOL, + JSVAL_TAG_PRIVATE_GCTHING = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_PRIVATE_GCTHING, + JSVAL_TAG_OBJECT = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_OBJECT } JS_ENUM_FOOTER(JSValueTag); static_assert(sizeof(JSValueTag) == sizeof(uint32_t), @@ -113,12 +110,12 @@ JS_ENUM_HEADER(JSValueShiftedTag, uint64_t) JSVAL_SHIFTED_TAG_INT32 = (((uint64_t)JSVAL_TAG_INT32) << JSVAL_TAG_SHIFT), JSVAL_SHIFTED_TAG_UNDEFINED = (((uint64_t)JSVAL_TAG_UNDEFINED) << JSVAL_TAG_SHIFT), JSVAL_SHIFTED_TAG_NULL = (((uint64_t)JSVAL_TAG_NULL) << JSVAL_TAG_SHIFT), - JSVAL_SHIFTED_TAG_STRING = (((uint64_t)JSVAL_TAG_STRING) << JSVAL_TAG_SHIFT), - JSVAL_SHIFTED_TAG_SYMBOL = (((uint64_t)JSVAL_TAG_SYMBOL) << JSVAL_TAG_SHIFT), JSVAL_SHIFTED_TAG_BOOLEAN = (((uint64_t)JSVAL_TAG_BOOLEAN) << JSVAL_TAG_SHIFT), JSVAL_SHIFTED_TAG_MAGIC = (((uint64_t)JSVAL_TAG_MAGIC) << JSVAL_TAG_SHIFT), - JSVAL_SHIFTED_TAG_OBJECT = (((uint64_t)JSVAL_TAG_OBJECT) << JSVAL_TAG_SHIFT), - JSVAL_SHIFTED_TAG_PRIVATE_GCTHING = (((uint64_t)JSVAL_TAG_PRIVATE_GCTHING) << JSVAL_TAG_SHIFT) + JSVAL_SHIFTED_TAG_STRING = (((uint64_t)JSVAL_TAG_STRING) << JSVAL_TAG_SHIFT), + JSVAL_SHIFTED_TAG_SYMBOL = (((uint64_t)JSVAL_TAG_SYMBOL) << JSVAL_TAG_SHIFT), + JSVAL_SHIFTED_TAG_PRIVATE_GCTHING = (((uint64_t)JSVAL_TAG_PRIVATE_GCTHING) << JSVAL_TAG_SHIFT), + JSVAL_SHIFTED_TAG_OBJECT = (((uint64_t)JSVAL_TAG_OBJECT) << JSVAL_TAG_SHIFT) } JS_ENUM_FOOTER(JSValueShiftedTag); static_assert(sizeof(JSValueShiftedTag) == sizeof(uint64_t),