@@ -1049,6 +1049,80 @@ dictionary LayoutConstraintsOptions {
1049
1049
};
1050
1050
</pre>
1051
1051
1052
+ Note: The [=translate a LayoutConstraintsOptions to internal constraints=] describes how to convert
1053
+ a {{LayoutConstraintsOptions}} object into a user agents internal representation.
1054
+
1055
+ <div algorithm="translate a LayoutConstraintsOptions to internal constraints">
1056
+ When the user agent wants to <dfn>translate a LayoutConstraintsOptions to internal constraints</dfn>
1057
+ given |options|, it <em> must</em> run the following steps:
1058
+
1059
+ 1. Let the [=available space=] in the inline direction (with respect to the [=current layout=] ,
1060
+ be the result of:
1061
+
1062
+ - If |options|' {{LayoutConstraintsOptions/availableInlineSize}} is not null, and
1063
+ {{LayoutConstraintsOptions/availableInlineSize}} is greater than zero, let the result be
1064
+ {{LayoutConstraintsOptions/availableInlineSize}} .
1065
+
1066
+ - Otherwhise, let the result be zero.
1067
+
1068
+ 2. Let the [=available space=] in the block direction (with respect to the [=current layout=] ),
1069
+ be the result of:
1070
+
1071
+ - If |options|' {{LayoutConstraintsOptions/availableBlockSize}} is not null, and
1072
+ {{LayoutConstraintsOptions/availableBlockSize}} is greater than zero, let the result be
1073
+ {{LayoutConstraintsOptions/availableBlockSize}} .
1074
+
1075
+ - Otherwhise, let the result be zero.
1076
+
1077
+ 3. Let the override size in the inline direction (with respect to the [=current layout=] , be the
1078
+ result of:
1079
+
1080
+ - Let the result be |options|' {{LayoutConstraintsOptions/fixedInlineSize}} .
1081
+
1082
+ Note: If the {{LayoutConstraintsOptions/fixedInlineSize}} is null, no override size is
1083
+ applied.
1084
+
1085
+ 4. Let the override size in the block direction (with respect to the [=current layout=] , be the
1086
+ result of:
1087
+
1088
+ - Let the result be |options|' {{LayoutConstraintsOptions/fixedBlockSize}} .
1089
+
1090
+ Note: If the {{LayoutConstraintsOptions/fixedBlockSize}} is null, no override size is
1091
+ applied.
1092
+
1093
+ 5. Let the percentage resultion size in the inline direction (with respect to the [=current
1094
+ layout=] , be the result of:
1095
+
1096
+ - If |options|' {{LayoutConstraintsOptions/percentageInlineSize}} is not null, and
1097
+ {{LayoutConstraintsOptions/percentageInlineSize}} is greater than zero, let the result
1098
+ be {{LayoutConstraintsOptions/percentageInlineSize}} .
1099
+
1100
+ - If |options|' {{LayoutConstraintsOptions/availableInlineSize}} is not null, and
1101
+ {{LayoutConstraintsOptions/availableInlineSize}} is greater than zero, let the result be
1102
+ {{LayoutConstraintsOptions/availableInlineSize}} .
1103
+
1104
+ - Otherwhise, let the result be zero.
1105
+
1106
+ 6. Let the percentage resultion size in the block direction (with respect to the [=current
1107
+ layout=] , be the result of:
1108
+
1109
+ - If |options|' {{LayoutConstraintsOptions/percentageBlockSize}} is not null, and
1110
+ {{LayoutConstraintsOptions/percentageBlockSize}} is greater than zero, let the result
1111
+ be {{LayoutConstraintsOptions/percentageBlockSize}} .
1112
+
1113
+ - If |options|' {{LayoutConstraintsOptions/availableBlockSize}} is not null, and
1114
+ {{LayoutConstraintsOptions/availableBlockSize}} is greater than zero, let the result be
1115
+ {{LayoutConstraintsOptions/availableBlockSize}} .
1116
+
1117
+ - Otherwhise, let the result be zero.
1118
+
1119
+ 7. If the [=child layout=] is a [=layout API container=] , then let the store the data (passed by
1120
+ {{LayoutConstraints/data}} ) be the result of:
1121
+
1122
+ - Invoking [=StructuredSerializeForStorage=] on |options|'
1123
+ {{LayoutConstraintsOptions/data}} .
1124
+ </div>
1125
+
1052
1126
<div class="example">
1053
1127
The example below shows the basic usage of the {{LayoutConstraintsOptions}} dictionary.
1054
1128
@@ -1077,8 +1151,6 @@ registerLayout('child-layout-constraints-example', class {
1077
1151
</pre>
1078
1152
</div>
1079
1153
1080
- Issue: Specify how to convert to internal representation of these values.
1081
-
1082
1154
Breaking and Fragmentation {#breaking-and-fragmentation}
1083
1155
--------------------------------------------------------
1084
1156
@@ -2034,7 +2106,7 @@ When the user agent wants to <dfn>run a work queue</dfn> given |promise|, and |w
2034
2106
2035
2107
2. Let |box| be |layoutChild|'s [=box=] in the {{LayoutChild/[[box]]}} internal slot.
2036
2108
2037
- 3. Let |childPromise| be |task|'s [=layout api work task/= promise].
2109
+ 3. Let |childPromise| be |task|'s [=layout api work task/promise= ] .
2038
2110
2039
2111
2. If |task|'s [=layout api work task/task type=] is <code> "layout"</code> ,
2040
2112
@@ -2049,6 +2121,11 @@ When the user agent wants to <dfn>run a work queue</dfn> given |promise|, and |w
2049
2121
4. Let |internalFragment| be the result of the user agent producing a
2050
2122
[=fragment=] based on |box|, |childConstraints|, and |childBreakToken|.
2051
2123
2124
+ Invoking [=translate a LayoutConstraintsOptions to internal constraints=]
2125
+ given |childConstraints|, must be run to translate the given
2126
+ {{LayoutConstraintsOptions}} into the internal constraints for the user
2127
+ agent's layout engine.
2128
+
2052
2129
5. Let |fragment| be a new {{LayoutFragment}} with:
2053
2130
2054
2131
- {{LayoutFragment/inlineSize}} being |internalFragment|'s [=inline size=]
0 commit comments