Merge m-i to m-c, a=merge
authorPhil Ringnalda <philringnalda@gmail.com>
Tue, 27 Dec 2016 20:33:25 -0800
changeset 454127 d7b6af32811bddcec10a47d24bd455a1ec1836fc
parent 454119 a0866731bbe884fffce6f007b851f7ac453013fa (current diff)
parent 454126 935e36fde31c6ecd8321beb29d896e42a70aecd0 (diff)
child 454128 cfe87780c02d1a0e302c4a9ce21416eac031c60a
child 454136 0249e09e7569578ea73097a51a34242b3dfb2709
child 454138 383768c608df77caf18f48ba97dfb8c0e6d1c26a
child 454147 197d0e1032b9e26e7530b650e96b7df418d8c212
child 454154 4552113e12c3c131d69ab71f3d57a26f9a560436
child 454165 3c74e4b8e8ddfb81f2059dd0dbfe3abdc386e87c
child 454167 5a603e1e749c615ef0812d76cb09bd46e25f013e
child 454171 8a5435c7c955cdf12d8e68c73481de98d2ec5bc4
child 454175 23f724ee87af5bd2a1e5b3a83602890d8a2a9db3
child 454178 aa2f392b5d173ef5ba81e166628deeed091ceb86
child 454179 d09fba7ab9dda769d6e78ac796fe49800e04f7f3
child 454180 085ec0fa7b6f395b81001c42ce243ff5e8a77459
child 454183 7e419a4b565046050dd96b35f9ac910fd1f6eef4
child 454198 6588fd305dd2c8b7a5ea187c6769dcf85b8af72f
child 454201 ffa2e4dd93e877a5cccb1dbedfae2b23c17f84bf
child 454209 433db65b4f4717cd77d73d8bacf565495e496746
child 454211 96685998896d989d6b966a9f9d370f60036352c5
child 454213 3b8dd7474fa1a6820551e608aac856a7d7214fe7
child 454215 da02a5288295aed3e68c68df954d5263c6cae794
child 454216 ff3d77e96732e415c5a6af942d0572de596a63bf
child 454221 a3af602577681e2b8169aa983f1adf752d0f4634
child 454240 1e3143a9bc7c29577b11ca8b72db10a4b210a3e0
child 454274 be9f044a65929db44576d93c94cd7615bffeca25
child 454315 d23e21a03ce2cb665afd5a63da6180dda0fd6a4b
child 454457 ca321a43f8d164b8b01d300fb0088549ca9db004
child 454490 5f27c66afb06c32cad49700df05d1b572cb03163
child 456234 522329bd6843b369521f6321eec41aa32cbe9e67
child 456235 d8742de073f5c3454179db4d0c5aacce0efb2ff5
child 456279 0d70823086782fecedc163fae72c0b12c93db04e
child 456313 fdb8f0e6b3730c5097153c2119ed94fda3cba68e
child 456348 4ef1f977c022e208217491a760655c492198ec62
child 456732 613777c1b625f4d281fb73cb703109acd7c01ed0
child 456750 7536afbc8d929e92975fbe1e3ccbbf3985cfcbe2
child 457537 bdcc1ffd9eaf4c641c6da7d7039994e1539fc61c
child 458209 b24a2921d61bfd24548ae3872f8a9bda70c576ac
child 462922 3c106aa4e82d7e03fb5e041af21652d6b52b533f
child 462927 22c0887b455b9864ef0b92c2064fecc40c21be6b
child 464842 bd71305f1e8efcfdfc324dacb016852243f5f730
child 465554 9aa32b3bc8ec7c29e4a61ca51e0fe6507371ca4d
child 465557 04dcedf8bf7498190a912dfb63d94aaef4159796
push id39837
push userbmo:fliu@mozilla.com
push dateWed, 28 Dec 2016 06:28:22 +0000
reviewersmerge
milestone53.0a1
Merge m-i to m-c, a=merge MozReview-Commit-ID: JGQ9qyi5pRc
modules/libpref/init/all.js
--- a/dom/base/test/mochitest.ini
+++ b/dom/base/test/mochitest.ini
@@ -650,17 +650,17 @@ skip-if = (toolkit == 'android') # Andro
 [test_iframe_referrer.html]
 [test_iframe_referrer_changing.html]
 [test_iframe_referrer_invalid.html]
 [test_Image_constructor.html]
 [test_img_referrer.html]
 [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]
 [test_messagemanager_targetchain.html]
 [test_meta_viewport0.html]
 skip-if = (os != 'android')    # meta-viewport tag support is mobile-only
 [test_meta_viewport1.html]
 skip-if = (os != 'android')    # meta-viewport tag support is mobile-only
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -614,19 +614,19 @@ var interfaceNamesInGlobalScope =
     {name: "ImageCaptureErrorEvent", disabled: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "ImageData",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "InputEvent",
 // 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!
     "KeyboardEvent",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "KeyframeEffectReadOnly", release: false},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "KeyframeEffect", release: false},
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -409,17 +409,17 @@ public:
    * CONSTRUCTION PHASE ONLY
    * Create a TextLayer for this manager's layer tree.
    */
   virtual already_AddRefed<TextLayer> CreateTextLayer() = 0;
   /**
    * CONSTRUCTION PHASE ONLY
    * Create a BorderLayer for this manager's layer tree.
    */
-  virtual already_AddRefed<BorderLayer> CreateBorderLayer() { return nullptr; }
+  virtual already_AddRefed<BorderLayer> CreateBorderLayer() = 0;
   /**
    * CONSTRUCTION PHASE ONLY
    * Create a CanvasLayer for this manager's layer tree.
    */
   virtual already_AddRefed<CanvasLayer> CreateCanvasLayer() = 0;
   /**
    * CONSTRUCTION PHASE ONLY
    * Create a ReadbackLayer for this manager's layer tree.
--- a/gfx/tests/gtest/TestLayers.cpp
+++ b/gfx/tests/gtest/TestLayers.cpp
@@ -77,16 +77,20 @@ public:
   virtual already_AddRefed<ColorLayer> CreateColorLayer() {
     NS_RUNTIMEABORT("Not implemented.");
     return nullptr;
   }
   virtual already_AddRefed<TextLayer> CreateTextLayer() {
     NS_RUNTIMEABORT("Not implemented.");
     return nullptr;
   }
+  virtual already_AddRefed<BorderLayer> CreateBorderLayer() {
+    NS_RUNTIMEABORT("Not implemented.");
+    return nullptr;
+  }
   virtual void SetRoot(Layer* aLayer) {}
   virtual bool BeginTransactionWithTarget(gfxContext* aTarget) { return true; }
   virtual already_AddRefed<CanvasLayer> CreateCanvasLayer() {
     NS_RUNTIMEABORT("Not implemented.");
     return nullptr;
   }
   virtual void EndTransaction(DrawPaintedLayerCallback aCallback,
                               void* aCallbackData,
--- a/js/public/Value.h
+++ b/js/public/Value.h
@@ -40,17 +40,16 @@ namespace JS { class Value; }
 #if defined(_MSC_VER)
 # define JS_ENUM_HEADER(id, type)              enum id : type
 # define JS_ENUM_FOOTER(id)
 #else
 # define JS_ENUM_HEADER(id, type)              enum id
 # 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,
     JSVAL_TYPE_INT32               = 0x01,
     JSVAL_TYPE_UNDEFINED           = 0x02,
     JSVAL_TYPE_NULL                = 0x03,
     JSVAL_TYPE_BOOLEAN             = 0x04,
     JSVAL_TYPE_MAGIC               = 0x05,
@@ -64,66 +63,64 @@ JS_ENUM_HEADER(JSValueType, uint8_t)
     JSVAL_TYPE_MISSING             = 0x21
 } JS_ENUM_FOOTER(JSValueType);
 
 static_assert(sizeof(JSValueType) == 1,
               "compiler typed enum support is apparently buggy");
 
 #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_BOOLEAN              = JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN,
+    JSVAL_TAG_MAGIC                = JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC,
     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_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),
               "compiler typed enum support is apparently buggy");
 
 #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_BOOLEAN              = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_BOOLEAN,
+    JSVAL_TAG_MAGIC                = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_MAGIC,
     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_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),
               "compiler typed enum support is apparently buggy");
 
 JS_ENUM_HEADER(JSValueShiftedTag, uint64_t)
 {
     JSVAL_SHIFTED_TAG_MAX_DOUBLE      = ((((uint64_t)JSVAL_TAG_MAX_DOUBLE)     << JSVAL_TAG_SHIFT) | 0xFFFFFFFF),
     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_BOOLEAN         = (((uint64_t)JSVAL_TAG_BOOLEAN)         << JSVAL_TAG_SHIFT),
+    JSVAL_SHIFTED_TAG_MAGIC           = (((uint64_t)JSVAL_TAG_MAGIC)           << 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_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),
               "compiler typed enum support is apparently buggy");
 
 #endif
 
 /*
--- a/js/src/builtin/Object.cpp
+++ b/js/src/builtin/Object.cpp
@@ -855,19 +855,17 @@ EnumerableOwnProperties(JSContext* cx, c
             // Step 4.a.ii. (inverted.)
             if (!desc.object() || !desc.enumerable())
                 continue;
 
             // Step 4.a.ii.1.
             // (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;
         }
 
         // Steps 4.a.ii.2.b-c.
         if (kind == Values)
             properties[out++].set(value);
         else if (!NewValuePair(cx, key, value, properties[out++]))
             return false;
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -773,62 +773,74 @@ ShellFinishAsyncTaskCallback(JS::AsyncTa
 
 static bool
 DrainJobQueue(JSContext* cx)
 {
     ShellContext* sc = GetShellContext(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<JS::AsyncTask*> finished(cx);
-    {
-        ExclusiveData<ShellAsyncTasks>::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);
+        // 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<JS::AsyncTask*> finished(cx);
         {
-            AutoReportException are(cx);
-            JS::Call(cx, UndefinedHandleValue, job, args, &rval);
+            ExclusiveData<ShellAsyncTasks>::Guard asyncTasks = sc->asyncTasks.lock();
+            finished = Move(asyncTasks->finished);
+            asyncTasks->finished.clear();
         }
-        sc->jobQueue[i].set(nullptr);
-    }
-    sc->jobQueue.clear();
-    sc->drainingJobQueue = false;
+
+        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<ShellAsyncTasks>::Guard asyncTasks = sc->asyncTasks.lock();
+            if (asyncTasks->outstanding == 0 && asyncTasks->finished.length() == 0)
+                break;
+        }
+    }
+
     return true;
 }
 
 static bool
 DrainJobQueue(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -4174,17 +4174,17 @@ nsDisplayBorder::GetLayerState(nsDisplay
       mColors[i] = ToDeviceColor(br->mBorderColors[i]);
       mWidths[i] = br->mBorderWidths[i];
     } else {
       mWidths[i] = 0;
     }
   }
 
   mRect = ViewAs<LayerPixel>(br->mOuterRect);
-  return LAYER_INACTIVE;
+  return LAYER_ACTIVE;
 }
 
 already_AddRefed<Layer>
 nsDisplayBorder::BuildLayer(nsDisplayListBuilder* aBuilder,
                             LayerManager* aManager,
                             const ContainerLayerParameters& aContainerParameters)
 {
   RefPtr<BorderLayer> layer = static_cast<BorderLayer*>
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -5561,9 +5561,9 @@ pref("dom.storageManager.enabled", false
 // be blocked (automatically canceled) for that page. The counter resets
 // when the page is reloaded. To turn this feature off, just set the limit to 0.
 pref("prompts.authentication_dialog_abuse_limit", 3);
 
 // Enable the Storage management in about:preferences and persistent-storage permission request
 // 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);