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

refactor: remove targetId and elementManager in RenderBoxModel #452

Merged
merged 23 commits into from
Jul 2, 2021

Conversation

temper357
Copy link
Contributor

@temper357 temper357 commented Jun 28, 2021

Closes #124

  • RenderBoxModel 上去除 targetId 与 elementManager 属性。

    • 使用 targetId 作唯一标识的 case 使用 renderBoxModel 的 hashCode 替代,devtools 也涉及此变更 https://github.com/openkraken/devtools/pull/11
    • 由于 renderBoxModel 不再需要关联 targetId,删除 overflow 样式变更创建 repaintBoundary renderBox 时的 scrollingElement hack。
  • RenderStyle 上增加 viewportSize 属性,以便 RenderBoxModel 中进行 length 计算时 viewportSize 从 renderStyle 中获取。

  • RenderBoxModel 中涉及到重新创建新的 renderBoxModel 时需要从对应的 element 上 detach 和 attach 强依赖 element,包含以下两块逻辑:

    • 改变 overflow 与 transform 样式时涉及到要对 renderBoxModel 转换成 repaintBoundary。
    • Sliver 对应的 RecycleLayout 中动态增删 renderBoxModel 。

    为防止直接在 RenderBoxModel 上传入 element,通过闭包的方式将与 element 的操作逻辑传入,考虑到扩展性,通过 delegate 编程模式创建一个新的 ElementDelegate 类,通过属性传入 RenderBoxModel,上面包含所有 renderBoxModel 上要用到的方法。

  • 由于 CI 测试经常报错,暂时 disable opacity 相关用例, opacity 样式的测试用例偶发报错 #459

@andycall andycall added this to In Progress in Architecture Design via automation Jul 1, 2021
@temper357 temper357 changed the title [WIP] refactor: remove targetId and elementManager in RenderBoxModel refactor: remove targetId and elementManager in RenderBoxModel Jul 1, 2021
kraken/lib/src/dom/element.dart Outdated Show resolved Hide resolved
wssgcg1213
wssgcg1213 previously approved these changes Jul 1, 2021
andycall
andycall previously approved these changes Jul 1, 2021
@andycall andycall merged commit c4ffd41 into main Jul 2, 2021
Architecture Design automation moved this from In Progress to Done Jul 2, 2021
@andycall andycall deleted the refactor/remove-targetid branch July 2, 2021 12:50
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.

RenderBoxModel 去除对于 elementManager 与 targetId 依赖
3 participants