[webkit-changes] [WebKit/WebKit] c5050d: Fix warnings found by compiling with -Wdeprecated-...
Commit Queue
noreply at github.com
Tue Jan 9 07:56:57 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c5050dfe582460a512d647870889778fcdb4604d
https://github.com/WebKit/WebKit/commit/c5050dfe582460a512d647870889778fcdb4604d
Author: David Kilzer <ddkilzer at apple.com>
Date: 2024-01-09 (Tue, 09 Jan 2024)
Changed paths:
M Source/WebCore/rendering/style/TextSizeAdjustment.h
M Source/WebCore/style/StyleBuilderCustom.h
M Source/WebCore/style/StyleResolveForDocument.cpp
Log Message:
-----------
Fix warnings found by compiling with -Wdeprecated-enum-float-conversion
https://bugs.webkit.org/show_bug.cgi?id=267206
<rdar://120610023>
Reviewed by Tim Nguyen and Darin Adler.
The fix for the warning is to replace the TextSizeAdjustmentType enum
with helper methods that use internal float constants within the class.
The remaining changes are to add some debug assertions and to update the
code to use the new helper methods.
* Source/WebCore/rendering/style/TextSizeAdjustment.h:
(WebCore::TextSizeAdjustmentType): Remove.
(WebCore::TextSizeAdjustment::autoAdjust): Add.
(WebCore::TextSizeAdjustment::none): Add.
- Add static helper methods to replace enum values.
(WebCore::TextSizeAdjustment::TextSizeAdjustment):
- Add debug assertion when setting a float value to make sure it is not
negative.
- Add private, overloaded constructor that takes a bool parameter to
implement autoAdjust() and none().
(WebCore::TextSizeAdjustment::percentage const):
(WebCore::TextSizeAdjustment::multiplier const):
- Add debug assertions that m_value is not negative when calling
percentage() and multiplier().
(WebCore::TextSizeAdjustment::isAuto const):
(WebCore::TextSizeAdjustment::isNone const):
(WebCore::TextSizeAdjustment::Auto): Add.
(WebCore::TextSizeAdjustment::None): Add.
- Private constant float values to implement autoAdjust() and none().
* Source/WebCore/style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueWebkitTextSizeAdjust):
* Source/WebCore/style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
Canonical link: https://commits.webkit.org/272819@main
More information about the webkit-changes
mailing list