- From: Ian Kilpatrick via GitHub <sysbot+gh@w3.org>
- Date: Tue, 10 Jan 2017 22:12:07 +0000
- To: public-houdini-archive@w3.org
bfgeek has just created a new issue for
https://github.com/w3c/css-houdini-drafts:
== [css-layout-api] Decide on how to do min/max Content Sizes. ==
There are two possible ways that we can do min/max content
contributions.
1) Use the existing layout functions. E.g.
```js
class {
*layout(constraintSpace, children, styleMap, opt_breakToken) {
const minSize = (yield* this.layout(new ConstraintSpace({
inlineSize: 0,
blockSize: 0,
percentageInlineSize: 0,
percentageBlockSize: 0,
}), children, styleMap)).inlineSize;
const maxSize = (yield* this.layout(new ConstraintSpace({
inlineSize: Infinity,
blockSize: Infinity,
percentageInlineSize: 0,
percentageBlockSize: 0,
}), children, styleMap)).inlineSize;
const inlineSize = resolveInlineSize(space, styleMap, {minSize:
minSize, maxSize: maxSize});
}
```
2) Introduce a new function. E.g.
```js
class {
*minMaxSizes(constraintSpace, children, styleMap) {
}
needsMinMaxSizes(styleMap) {
return super();
}
*layout(constraintSpace, children, styleMap, opt_breakToken,
opt_minMaxSizes) {
// If needsMinMaxSizes returns true, opt_minMaxSizes will be
provided.
}
}
```
The engine may call minMaxSizes separately from layout, if a parents
needs to know this.
Please view or discuss this issue at
https://github.com/w3c/css-houdini-drafts/issues/343 using your GitHub
account
Received on Tuesday, 10 January 2017 22:12:13 UTC