Bug 1456887 part 1. Remove the [ArrayClass] annotation from DOMRectList. r=qdot
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 26 Apr 2018 01:38:06 -0400
changeset 471817 388cb76398c036775e92f9809926db2dbf46e784
parent 471774 822e81707327954a2c4e7d8060c5d91ae528bbf3
child 471818 1692850c1b87be1829271a379a47ac9433777eaf
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot
bugs1456887
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1456887 part 1. Remove the [ArrayClass] annotation from DOMRectList. r=qdot The NoInterfaceObject bit is me cleaning up after spec editors who change the spec without updating the tests...
dom/tests/mochitest/general/test_clientRects.html
dom/webidl/DOMRectList.webidl
testing/web-platform/meta/css/geometry/DOMRectList.html.ini
testing/web-platform/tests/css/geometry/DOMRectList.html
--- a/dom/tests/mochitest/general/test_clientRects.html
+++ b/dom/tests/mochitest/general/test_clientRects.html
@@ -24,21 +24,18 @@ function checkRect(clientRect, r, eps, e
   isWithinEps(clientRect.height, r[3] - r[1], eps, exprMsg + ".height" + restMsg);
 }
 function doc(id) {
   return document.getElementById(id).contentDocument;
 }
 function checkElement(id, list, eps, doc) {
   var e = (doc || document).getElementById(id);
   var clientRects = e.getClientRects();
-  ok(clientRects instanceof e.ownerDocument.defaultView.Array,
-     "getClientRects retval should have Array.prototype on its proto chain");
-  clientRects.map(function(rect) {
-    ok(rect instanceof DOMRect, "Should have a DOMRect here");
-  });
+  ok(!(clientRects instanceof e.ownerDocument.defaultView.Array),
+     "getClientRects retval should not have Array.prototype on its proto chain");
   is(clientRects.length, list.length, "getClientRects().length for element '" + id + "'");
   var bounds = list.length > 0 ? list[0] : [0,0,0,0];
   for (var i = 0; i < clientRects.length && i < list.length; ++i) {
     var r = list[i];
     r[2] += r[0];
     r[3] += r[1];
     checkRect(clientRects[i], r, eps, "getClientRects()[" + i + "]", " for element '" + id + "'");
     if (r[2] != r[0] && r[3] != r[1]) {
--- a/dom/webidl/DOMRectList.webidl
+++ b/dom/webidl/DOMRectList.webidl
@@ -1,11 +1,10 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-[ArrayClass]
 interface DOMRectList {
   readonly attribute unsigned long length;
   getter DOMRect? item(unsigned long index);
 };
deleted file mode 100644
--- a/testing/web-platform/meta/css/geometry/DOMRectList.html.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[DOMRectList.html]
-  [DOMRectList [NoInterfaceObject\]]
-    expected: FAIL
-
--- a/testing/web-platform/tests/css/geometry/DOMRectList.html
+++ b/testing/web-platform/tests/css/geometry/DOMRectList.html
@@ -5,22 +5,22 @@
 <script src=/resources/testharnessreport.js></script>
 <div id=x>x</div>
 <script>
 setup(() => {
   window.domRectList = document.getElementById('x').getClientRects();
 });
 
 test(() => {
-  assert_false('DOMRectList' in window);
-}, 'DOMRectList [NoInterfaceObject]');
+  assert_true('DOMRectList' in window);
+}, 'DOMRectList is not [NoInterfaceObject]');
 
 test(() => {
-  assert_true(domRectList instanceof Array);
-}, 'DOMRectList [LegacyArrayClass]');
+  assert_false(domRectList instanceof Array);
+}, 'DOMRectList is not [LegacyArrayClass]');
 
 test(() => {
   assert_equals(domRectList.length, 1);
 }, 'DOMRectList length');
 
 test(() => {
   assert_equals(domRectList[-1], undefined, 'domRectList[-1]');
   assert_class_string(domRectList[0], 'DOMRect', 'domRectList[0]');