gecko-dev/testing/web-platform/tests/common/arrays.js
Ian Kilpatrick 430380d6b1 Bug 1441412 [wpt PR 9680] - [css-layout-api] Populate children, and pass into layout() function, a=testonly
Automatic update from web-platform-tests[css-layout-api] Populate children, and pass into layout() function

This introduces the LayoutChild API surface, (which only has a styleMap
accessor currently).

Each LayoutBox which is a child of a LayoutCustom will hold onto a
LayoutChild object, acting as the script interface for the web
developer.

Bug: 726125
Change-Id: Iecdb01a38c0712dcda063b485c4207bde59f3995
Reviewed-on: https://chromium-review.googlesource.com/933092
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539928}

wpt-commits: 41ab079dfcde76aebbde5660fe3e417447e61f80
wpt-pr: 9680
wpt-commits: 41ab079dfcde76aebbde5660fe3e417447e61f80
wpt-pr: 9680
2018-03-31 22:29:14 +01:00

16 lines
405 B
JavaScript

// Returns true if the given arrays are equal. Optionally can pass an equality function.
export function areArraysEqual(a, b, equalityFunction = (c, d) => { return c === d; }) {
try {
if (a.length !== b.length)
return false;
for (let i = 0; i < a.length; i++) {
if (!equalityFunction(a[i], b[i]))
return false;
}
} catch (ex) {
return false;
}
return true;
}