mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-12 06:08:24 +02:00
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
16 lines
405 B
JavaScript
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;
|
|
}
|