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: style fail after resize #916
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
temper357
changed the title
[WIP] fix: style fail after resize
fix: style fail after resize
Nov 29, 2021
After merged this PR, it works. |
yuanyan
reviewed
Nov 30, 2021
temper357
changed the title
fix: style fail after resize
[WIP] fix: style fail after resize
Dec 2, 2021
…raken into fix/resize-style-fail # Conflicts: # kraken/lib/src/rendering/intrinsic.dart
…start should not stretch
temper357
changed the title
[WIP] fix: style fail after resize
fix: style fail after resize
Dec 6, 2021
yuanyan
reviewed
Dec 6, 2021
…tyle-fail # Conflicts: # kraken/lib/src/dom/elements/img.dart
…into fix/resize-style-fail # Conflicts: # integration_tests/specs/dom/elements/img.ts # kraken/lib/src/dom/elements/img.dart
…tyle-fail # Conflicts: # integration_tests/specs/dom/elements/img.ts # kraken/lib/src/dom/elements/img.dart
yuanyan
approved these changes
Dec 8, 2021
answershuto
approved these changes
Dec 9, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #944
Closes #945
修复容器 resize 后 style 未对应进行 resize。
在 renderStyle 重构后每次重新 layout 都会调用 width/height 的 computedValue getter,在 getter 中会对 vw, rem 这种相对单位进行重新计算,而 window resize 已经对 html 重新设置了 viewportSize 会触发 html 重新 layout,layout 会从上向下递归,所以理论上原来递归 element 重新 markNeedsLayout 的逻辑是多余的。但是原代码有两处实现导致 viewportSize 无法顺利向下传递:
删除 RenderIntrinsic 中计算 size 多余逻辑。
修复 flex-item 纵轴 stretch 判断条件不完全。 flex 布局下 align-self 为非 stretch 的 flex item 不应该拉伸 #944
修复 image 的 property 与 style 上的 width/height 优先级判断逻辑出错导致已有 width property 的情况下改变 width property 不生效。 image 在已有width property 的情况下改变 width property 不生效 #945