diff options
Diffstat (limited to 'tests/wpt/web-platform-tests/css/css-layout-api/support')
5 files changed, 15 insertions, 17 deletions
diff --git a/tests/wpt/web-platform-tests/css/css-layout-api/support/constraints-fixed-block-size.js b/tests/wpt/web-platform-tests/css/css-layout-api/support/constraints-fixed-block-size.js index 50f802f47eb..25d73ef6156 100644 --- a/tests/wpt/web-platform-tests/css/css-layout-api/support/constraints-fixed-block-size.js +++ b/tests/wpt/web-platform-tests/css/css-layout-api/support/constraints-fixed-block-size.js @@ -3,8 +3,8 @@ registerLayout('test', class { return ['--expected-block-size']; } - *intrinsicSizes() {} - *layout([child], edges, constraints, styleMap) { + async intrinsicSizes() {} + async layout([child], edges, constraints, styleMap) { let childFixedInlineSize = 0; let childFixedBlockSize = 0; if (constraints.fixedBlockSize === JSON.parse(styleMap.get('--expected-block-size'))) { @@ -12,7 +12,7 @@ registerLayout('test', class { childFixedBlockSize = 100; } - const childFragments = [yield child.layoutNextFragment({ + const childFragments = [await child.layoutNextFragment({ fixedInlineSize: childFixedInlineSize, fixedBlockSize: childFixedBlockSize, })]; diff --git a/tests/wpt/web-platform-tests/css/css-layout-api/support/constraints-fixed-inline-size.js b/tests/wpt/web-platform-tests/css/css-layout-api/support/constraints-fixed-inline-size.js index 4e591f7a736..3636f366547 100644 --- a/tests/wpt/web-platform-tests/css/css-layout-api/support/constraints-fixed-inline-size.js +++ b/tests/wpt/web-platform-tests/css/css-layout-api/support/constraints-fixed-inline-size.js @@ -1,6 +1,6 @@ registerLayout('test', class { - *intrinsicSizes() {} - *layout(children, edges, constraints, styleMap) { + async intrinsicSizes() {} + async layout(children, edges, constraints, styleMap) { if (constraints.fixedInlineSize !== 100) return {autoBlockSize: 0}; diff --git a/tests/wpt/web-platform-tests/css/css-layout-api/support/layout-child-sizes-worklet.js b/tests/wpt/web-platform-tests/css/css-layout-api/support/layout-child-sizes-worklet.js index 28546d6e422..5956c9a70c2 100644 --- a/tests/wpt/web-platform-tests/css/css-layout-api/support/layout-child-sizes-worklet.js +++ b/tests/wpt/web-platform-tests/css/css-layout-api/support/layout-child-sizes-worklet.js @@ -20,9 +20,9 @@ registerLayout('test', class { ]; } - *intrinsicSizes() {} - *layout(children, edges, constraints, styleMap) { - const childFragments = yield children.map((child) => { + async intrinsicSizes() {} + async layout(children, edges, constraints, styleMap) { + const childFragments = await Promise.all(children.map((child) => { const childConstraints = {}; const availableInlineSize = parseNumber(child.styleMap.get('--available-inline-size')); const availableBlockSize = parseNumber(child.styleMap.get('--available-block-size')); @@ -38,7 +38,7 @@ registerLayout('test', class { percentageInlineSize, percentageBlockSize, }); - }); + })); const actual = childFragments.map((childFragment) => { return { diff --git a/tests/wpt/web-platform-tests/css/css-layout-api/support/layout-child-worklet.js b/tests/wpt/web-platform-tests/css/css-layout-api/support/layout-child-worklet.js index db20e2ec76b..70d1b7e4572 100644 --- a/tests/wpt/web-platform-tests/css/css-layout-api/support/layout-child-worklet.js +++ b/tests/wpt/web-platform-tests/css/css-layout-api/support/layout-child-worklet.js @@ -9,14 +9,14 @@ registerLayout('test', class { return [ '--child' ]; } - *intrinsicSizes() {} - *layout(children, edges, constraints, styleMap) { + async intrinsicSizes() {} + async layout(children, edges, constraints, styleMap) { const expected = JSON.parse(styleMap.get('--child-expected').toString()); const actual = children.map((child) => { return child.styleMap.get('--child').toString().trim(); }); - const childFragments = yield children.map((child) => { return child.layoutNextFragment({}); }); + const childFragments = await Promise.all(children.map(child => child.layoutNextFragment({}))); if (!areArraysEqual(expected, actual)) return {autoBlockSize: 0, childFragments}; diff --git a/tests/wpt/web-platform-tests/css/css-layout-api/support/layout-position-child-worklet.js b/tests/wpt/web-platform-tests/css/css-layout-api/support/layout-position-child-worklet.js index 1ccfeab5aeb..7d5c494952d 100644 --- a/tests/wpt/web-platform-tests/css/css-layout-api/support/layout-position-child-worklet.js +++ b/tests/wpt/web-platform-tests/css/css-layout-api/support/layout-position-child-worklet.js @@ -6,11 +6,9 @@ registerLayout('test', class { ]; } - *intrinsicSizes() {} - *layout(children, edges, constraints, styleMap) { - const childFragments = yield children.map((child) => { - return child.layoutNextFragment({}); - }); + async intrinsicSizes() {} + async layout(children, edges, constraints, styleMap) { + const childFragments = await Promise.all(children.map((child) => child.layoutNextFragment({}))); for (let i = 0; i < children.length; i++) { childFragments[i].inlineOffset = parseInt(children[i].styleMap.get('--inline-offset').toString()); |