blob: 2b772d5b84a4f23991704d1115edffea93646037 [file] [log] [blame]
Victor Porof6e096922022-06-10 13:01:051// GENERATED CONTENT - DO NOT EDIT
2// Content was automatically extracted by Reffy into webref
3// (https://github.com/w3c/webref)
4// Source: CSS Layout API Level 1 (https://drafts.css-houdini.org/css-layout-api-1/)
5
6partial namespace CSS {
7 [SameObject] readonly attribute Worklet layoutWorklet;
8};
9
10[Global=(Worklet,LayoutWorklet),Exposed=LayoutWorklet]
11interface LayoutWorkletGlobalScope : WorkletGlobalScope {
12 undefined registerLayout(DOMString name, VoidFunction layoutCtor);
13};
14
15dictionary LayoutOptions {
16 ChildDisplayType childDisplay = "block";
17 LayoutSizingMode sizing = "block-like";
18};
19
20enum ChildDisplayType {
21 "block", // default - "blockifies" the child boxes.
22 "normal",
23};
24
25enum LayoutSizingMode {
26 "block-like", // default - Sizing behaves like block containers.
27 "manual", // Sizing is specified by the web developer.
28};
29
30[Exposed=LayoutWorklet]
31interface LayoutChild {
32 readonly attribute StylePropertyMapReadOnly styleMap;
33
34 Promise<IntrinsicSizes> intrinsicSizes();
35 Promise<LayoutFragment> layoutNextFragment(LayoutConstraintsOptions constraints, ChildBreakToken breakToken);
36};
37
38[Exposed=LayoutWorklet]
39interface LayoutFragment {
40 readonly attribute double inlineSize;
41 readonly attribute double blockSize;
42
43 attribute double inlineOffset;
44 attribute double blockOffset;
45
46 readonly attribute any data;
47
48 readonly attribute ChildBreakToken? breakToken;
49};
50
51[Exposed=LayoutWorklet]
52interface IntrinsicSizes {
53 readonly attribute double minContentSize;
54 readonly attribute double maxContentSize;
55};
56
57[Exposed=LayoutWorklet]
58interface LayoutConstraints {
59 readonly attribute double availableInlineSize;
60 readonly attribute double availableBlockSize;
61
62 readonly attribute double? fixedInlineSize;
63 readonly attribute double? fixedBlockSize;
64
65 readonly attribute double percentageInlineSize;
66 readonly attribute double percentageBlockSize;
67
68 readonly attribute double? blockFragmentationOffset;
69 readonly attribute BlockFragmentationType blockFragmentationType;
70
71 readonly attribute any data;
72};
73
74enum BlockFragmentationType { "none", "page", "column", "region" };
75
76dictionary LayoutConstraintsOptions {
77 double availableInlineSize;
78 double availableBlockSize;
79
80 double fixedInlineSize;
81 double fixedBlockSize;
82
83 double percentageInlineSize;
84 double percentageBlockSize;
85
86 double blockFragmentationOffset;
87 BlockFragmentationType blockFragmentationType = "none";
88
89 any data;
90};
91
92[Exposed=LayoutWorklet]
93interface ChildBreakToken {
94 readonly attribute BreakType breakType;
95 readonly attribute LayoutChild child;
96};
97
98[Exposed=LayoutWorklet]
99interface BreakToken {
100 readonly attribute FrozenArray<ChildBreakToken> childBreakTokens;
101 readonly attribute any data;
102};
103
104dictionary BreakTokenOptions {
105 sequence<ChildBreakToken> childBreakTokens;
106 any data = null;
107};
108
109enum BreakType { "none", "line", "column", "page", "region" };
110
111[Exposed=LayoutWorklet]
112interface LayoutEdges {
113 readonly attribute double inlineStart;
114 readonly attribute double inlineEnd;
115
116 readonly attribute double blockStart;
117 readonly attribute double blockEnd;
118
119 // Convenience attributes for the sum in one direction.
120 readonly attribute double inline;
121 readonly attribute double block;
122};
123
124// This is the final return value from the author defined layout() method.
125dictionary FragmentResultOptions {
126 double inlineSize = 0;
127 double blockSize = 0;
128 double autoBlockSize = 0;
129 sequence<LayoutFragment> childFragments = [];
130 any data = null;
131 BreakTokenOptions breakToken = null;
132};
133
134[Exposed=LayoutWorklet]
135interface FragmentResult {
136 constructor(optional FragmentResultOptions options = {});
137 readonly attribute double inlineSize;
138 readonly attribute double blockSize;
139};
140
141dictionary IntrinsicSizesResultOptions {
142 double maxContentSize;
143 double minContentSize;
144};