Repository navigation
修复原生缩放下预览尺寸与滚动条反复振荡 - #52
Merged
Merged
Conversation
This file contains hidden or 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
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.
问题与修复
Edge 110% 缩放后整幅预览持续抖动:整数 clientWidth/clientHeight 回写为固定像素尺寸,与实际小数容器产生溢出;经典滚动条出现和消失又触发 ResizeObserver,形成循环。旧版在 110% 下 90 帧触发 90 次 iframe resize。
自动画布和 iframe 改为百分比匹配真实容器;设备模拟使用 CSS min() 限制宽度并按实际计算宽度缩放。保留原尺寸滚动、动画、设备切换、详情和全屏行为。修复后相同条件 90 帧内 resize 为 0,预览位置与尺寸稳定。
验证
npm run check通过,包含严格类型检查与 12 项单元测试。npm test先构建,再通过全部 156 项测试:Chromium 140、Firefox 8、WebKit 8;无跳过或 flaky。npm run test:dev通过;31 项定向回归通过。docs/ui/native-zoom/。不修改依赖、归档演示代码或个人文件。CI 成功后按已授权流程 Merge 合并,由既有 Pages 工作流发布,再检查线上 110% 原生缩放。
Closes #51