Fix path animations with Safari zoom#3484
Conversation
Safari incorrectly scales stroke-dasharray and stroke-dashoffset values when using px units during page zoom. This causes SVG path animations using pathLength to shrink progressively as the zoom level decreases. The fix removes the px unit conversion and uses unitless numeric values instead, which Safari does not scale during zoom operations. Fixes #3301
Code Review SummaryThis PR fixes a Safari-specific bug where SVG path animations shrink when zooming the page. The fix is clean, well-tested, and addresses the root cause correctly. ✅ Code Quality & Best PracticesExcellent:
Consistency:
✅ Bug Fix QualityRoot Cause Analysis: Correctness:
✅ Test CoverageComprehensive:
Suggestion: Consider adding a Safari-specific regression test that verifies the zoom behavior doesn't break in the future (though this may require browser automation with zoom controls, which could be complex). ✅ Performance ConsiderationsImproved:
No Regressions:
✅ SecurityNo Concerns:
📝 Minor Observations
🎯 Verdict✅ Approve - This is a high-quality fix that:
The fix is minimal, targeted, and well-reasoned. Ready to merge. Related Issue: Fixes #3301 |
Pull Request Review: Fix path animations with Safari zoomSummary: This PR fixes a Safari-specific bug where SVG path animations using pathLength would progressively shrink when the browser zoom level changed. The fix removes px unit conversion and uses unitless numeric values for stroke-dasharray and stroke-dashoffset. Code Quality - EXCELLENT
Potential Issues - MINOR
Performance - POSITIVE
Security - CLEANNo issues identified. Values are safely converted and DOM APIs handle escaping properly. Test Coverage - EXCELLENT
Browser Compatibility - SAFE
Architecture - SOUND
Final Verdict: APPROVE ✅Strengths:
Minor suggestions (non-blocking):
This PR is ready to merge. Elegant fix for a longstanding Safari compatibility issue. Great work! |
Code Review: Fix path animations with Safari zoomSummaryThis PR fixes a Safari-specific bug where SVG path animations using ✅ Strengths1. Excellent Root Cause Analysis
2. Comprehensive Test Coverage
3. Clean Implementation
4. Well-Documented
🔍 Observations1. Type Safety 2. SVG Spec Compliance 3. String Coercion of Numbers 4. Potential Edge Case: Non-numeric Values
|
Safari incorrectly scales stroke-dasharray and stroke-dashoffset values when using px units during page zoom. This causes SVG path animations using pathLength to shrink progressively as the zoom level decreases.
The fix removes the px unit conversion and uses unitless numeric values instead, which Safari does not scale during zoom operations.
Fixes #3301
Fixes #2544