- Notifications
You must be signed in to change notification settings - Fork 3.3k
/
Copy pathfragment-data-function-failure.https.html
43 lines (38 loc) · 1.15 KB
/
fragment-data-function-failure.https.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<htmlclass=reftest-wait>
<linkrel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutfragment-data">
<linkrel="match" href="green-square-ref.html">
<metaname="assert" content="This test checks that passing something that can't be serialized to the parent triggers a fallback to block layout." />
<style>
.test {
background: red;
width:100px;
}
.child {
height:100px;
}
@supports (display:layout(fallback-fn)) {
.test {
display:layout(fallback-fn);
background: green;
}
}
</style>
<scriptsrc="/common/reftest-wait.js"></script>
<scriptsrc="/common/worklet-reftest.js"></script>
<divclass="test">
<divclass="child"></div>
</div>
<scriptid="code" type="text/worklet">
registerLayout('fallback-fn',class{
asyncintrinsicSizes(){}
asynclayout(children,edges,constraints,styleMap){
constchildFragments=awaitchildren.map(child=>child.layoutNextFragment());
return{autoBlockSize: 0, childFragments,data: {fn: function(){}}};
}
});
</script>
<script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet,document.getElementById('code').textContent);
</script>
</html>