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: positioned element size wrong when no width/height is set #671

Merged
merged 3 commits into from
Sep 13, 2021

Conversation

temper357
Copy link
Contributor

Closes #670

修复当有定位(absolute/fixed)的元素未设置 width 或 height 且有设置 left,right 或 top,bottom 时,宽高以容器 size 撑开时因 padding, border, margin 未考虑导致宽高计算不正确,包含以下两个问题:

  1. 宽高撑开时以容器的 padding-box 作为边界,即容器的 border 应在容器 size 减去,容器 padding 不应该减去。
  2. 定位元素自身的 margin 也应该从 size 中减去。

@temper357 temper357 added this to the 0.9 milestone Sep 10, 2021
@temper357 temper357 added this to In Progress in Browser Features via automation Sep 10, 2021
@temper357 temper357 changed the title fix: positioned element size stretch when no width/height is set fix: positioned element size wrong when no width/height is set Sep 10, 2021
@wssgcg1213 wssgcg1213 merged commit 2fc11c5 into main Sep 13, 2021
@wssgcg1213 wssgcg1213 deleted the fix/positioned-element-size branch September 13, 2021 06:14
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.

无 height 有 top 的绝对定位 element 高度计算不正确
3 participants