Skip to content

[css-layout-api] LayoutConstraints object - Are we ok with exposing information we don't have compat on? #749

@bfgeek

Description

@bfgeek

This primarily comes up with orthog. writing modes, e.g.

https://www.software.hixie.ch/utilities/js/live-dom-viewer/?saved=5867

<style>
#container { width: 200px; height: 100px; background: orange;}
#cross { display: flex; writing-mode: vertical-rl; padding-left: 10%; background: red; }
</style>
<div id=container>
  <div id=inner>
    <div id=cross>TEST</div>
  </div>
</div>

If #cross was controlled by the layout API (display: layout(foo)) it would get:

In chrome/webkit:

constraints.percentageInlineSize === 200;

In edge:

constraints.percentageInlineSize === 100;

In FF

constraints.percentageInlineSize == Infinity; // ?

As a basic example.

**** STOP! DON'T ARGUE ABOUT WHO IS CORRECT HERE AT THE MOMENT ****

Are we fine with giving the layout API different answers for different engines, and working towards compat in parallel?

Do we initially write tests for the LayoutConstraints object we know we have compat on?

Do we scope down the layout API initially in V1 and only accept LayoutOptions.sizing='block-like and only expose:

interface LayoutConstraints {
  readonly attribute double fixedInlineSize;
  readonly attribute double? fixedBlockSize;
}

As we strictly don't require knowing the percentage/available sizes when our inline/block size are determined by the engine.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions