kraken icon indicating copy to clipboard operation
kraken copied to clipboard

计算 flex-shrink 时 minimum content size 不应该考虑 child 的百分比 width/height

Open temper357 opened this issue 2 years ago • 0 comments

重现代码 | Code example:

  // @TODO: Percentage size of child should not be considered in auto min content width/height.
  xit("size 003", async () => {
    let flexbox_9;
    flexbox_9 = createElement(
      "div",
      {
        class: "flexbox column vertical",
        style: {
          display: "flex",
          "-webkit-flex-direction": "column",
          "flex-direction": "column",
          "background-color": "#aaa",
          position: "relative",
          height: "50px",
          "box-sizing": "border-box",
        },
      },
      [
        createElement("div", {
          "data-expected-width": "10",
          "data-offset-x": "20",
          style: {
            height: "100%",
            "background-color": "blue",
            "box-sizing": "border-box",
            flex: "1 0 10px",
          },
        }),
        createElement("div", {
          "data-expected-width": "10",
          "data-offset-x": "10",
          style: {
            height: "100%",
            "background-color": "green",
            "box-sizing": "border-box",
            width: "10px",
          },
        }),
        createElement(
          "div",
          {
            "data-expected-width": "10",
            "data-offset-x": "0",
            style: {
              height: "100%",
              "background-color": "red",
              "box-sizing": "border-box",
            },
          },
          [
            createElement("div", {
              "data-expected-width": "10",
              "data-offset-x": "0",
              style: {
                height: "100%",
                "box-sizing": "border-box",
                width: "10px",
              },
            }),
          ]
        ),
      ]
    );
    BODY.appendChild(flexbox_9);

    await snapshot();
  });

预期结果 | Expected results: image

实际结果 | Actual results: image

temper357 avatar May 13 '22 03:05 temper357