- From: Ian Kilpatrick via GitHub <sysbot+gh@w3.org>
- Date: Sat, 07 Apr 2018 18:13:24 +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] Review the LayoutOptions.sizing parameter ==
I've introduced a new option for the layout, which should help out a little for servo, and easier for implementations to implement initially.
```js
registerLayout('foo', class {
static layoutOptions = {sizing: 'block-like'}; // or {sizing: 'manual'}
*layout(children, edges, constraints, styleMap, breakToken) {
constraints.fixedInlineSize; // For 'block-like' sizing this *always* fixed, its never null.
return {autoBlockSize: 100}; // Now autoBlockSize is the size if 'block-size' was 'auto'.
// The actual block-size might get affected by max-height, height, etc..
}
});
```
For the `'manual'` sizing mode:
```js
registerLayout('foo', class {
static layoutOptions = {sizing: 'manual'};
*layout(children, edges, constraints, styleMap, breakToken) {
constraints.fixedInlineSize; // This may exist, e.g. abs-pos'd, layout, auto within block container (see sizing interactions).
return {inlineSize: 100, blockSize: 100}; // These do something in this mode
// they get ignored if constraints.fixedInlineSize, fixedBlockSize exist still,
// but otherwise they are the size of the fragment.
}
});
```
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/747 using your GitHub account
Received on Saturday, 7 April 2018 18:13:29 UTC