[webkit-changes] [WebKit/WebKit] fdbaf7: Refactor LengthMode handling in SVGLengthContext
Ahmad Saleem
noreply at github.com
Sat Sep 14 07:27:53 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: fdbaf754005cabddd3b928228f2bc6dfdbae88ab
https://github.com/WebKit/WebKit/commit/fdbaf754005cabddd3b928228f2bc6dfdbae88ab
Author: Ahmad Saleem <ahmad.saleem792+github at gmail.com>
Date: 2024-09-14 (Sat, 14 Sep 2024)
Changed paths:
M Source/WebCore/svg/SVGLengthContext.cpp
Log Message:
-----------
Refactor LengthMode handling in SVGLengthContext
https://bugs.webkit.org/show_bug.cgi?id=279707
rdar://135995385
Reviewed by Alan Baradlay.
Merge: https://chromium.googlesource.com/chromium/src.git/+/1368ac8914b34af0187b55e048477fd8abf191a2
This patch introduces new helper function `dimensionForLengthMode`, which
selects the correct "dimension" factor to scale and with this function,
we would be able to reduce three repeated `switch` cases.
* Source/WebCore/svg/SVGLengthContext.cpp:
(WebCore::dimensionForLengthMode):
(WebCore::SVGLengthContext::valueForLength):
(WebCore::SVGLengthContext::convertValueFromUserUnitsToPercentage const):
(WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits const):
Canonical link: https://commits.webkit.org/283671@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list