Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: child of flex item with flex-grow not stretch #665

Merged
merged 2 commits into from
Sep 13, 2021
Merged

Conversation

temper357
Copy link
Contributor

Closes #646

修复主轴无 size 且有 flex-grow 的 flex item 底下的 child 主轴 size 无法撑开。

  • fix:Kraken 是通过 parent 的 style 计算出 RenderBoxModel 的 logical size 当作其最大 constraints 然后作 layout,当 parent style 中无 width 或者 height 时,此时根据 style 算出最大 constraints 应该是 0,issue 中 flex item 无 width 且有 flex-grow, 这种 case 应该将 flex-grow 计算过后的主轴 size 作为其最大 constraints,因此在计算 logical size 方法中需要加一个分支,当 width/height 不存在时,计算 parent 的 constraints 是否为 tight (flex-grow 算法会将计算完的 size 设在 constraints 中)并将其最大 constraints 作为 logical size。

@temper357 temper357 added this to In Progress in Browser Features via automation Sep 8, 2021
@temper357 temper357 added this to the 0.9 milestone Sep 8, 2021
@temper357 temper357 requested review from wssgcg1213, andycall, answershuto and yuanyan and removed request for wssgcg1213 September 8, 2021 09:51
@wssgcg1213 wssgcg1213 merged commit 701ab9f into main Sep 13, 2021
@wssgcg1213 wssgcg1213 deleted the fix/flex-grow branch September 13, 2021 12:56
Browser Features automation moved this from In Progress to Done Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

flex排版异常
3 participants