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: scrollable size should include padding #1135

Merged
merged 5 commits into from
Feb 7, 2022

Conversation

temper357
Copy link
Contributor

@temper357 temper357 commented Jan 24, 2022

Closes #1134

  • 修复 scrollable size 未包含滚动容器自身的 paddingRight/paddingLeft 与 child 的 marginRight/marginBottom。注意标准中并没有对 scrollable size 在不同 case 下是否要包含 padding,margin 作详细规范,导致不同的浏览器对于 scrollable size 的实现也不一致,经实侧 firefox 与 safari 的 scrollable size 并不包含 padding-right,而且二者在不同 case 下表现又不一致,而 chrome 是包含的,Kraken 选择与 chrome 相同的实现。
  • 修复当 overflowX: hidden, overflowY: scroll 组合情况下,并未创建内层的 scrollingContentBox 导致滚动时可能会出现性能问题。原因是之前创建 scrollingContentBox 分别放在 overflowX 与 overflowY 的 setter 中做,后设置 overflowX: hidden 时会将 overflowY 创建的 scrollingContentBox 给删除掉,由于 overflowX 与 overflowY 二者的值相互关联,因此在 scrollingContentBox 的更新逻辑中需要同时判断 effectiveOverflowX 与 effectiveOverflowY。

@temper357 temper357 changed the title [WIP] fix: scrollable size should include padding fix: scrollable size should include padding Jan 25, 2022
@wssgcg1213 wssgcg1213 merged commit c617f70 into main Feb 7, 2022
@wssgcg1213 wssgcg1213 deleted the fix/scrollable-size-padding branch February 7, 2022 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

滚动容器的滚动 Size 未包含滚动容器的 padding
3 participants