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

Convert TrailingZerosTruncatingPolicy into an enum class #17186

Conversation

annevk
Copy link
Contributor

@annevk annevk commented Aug 29, 2023

137065a

Convert TrailingZerosTruncatingPolicy into an enum class
https://bugs.webkit.org/show_bug.cgi?id=260863
rdar://114628958

Reviewed by Tim Nguyen.

* Source/JavaScriptCore/runtime/NumberPrototype.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/WTF/wtf/text/StringConcatenateNumbers.h:
(WTF::FormattedNumber::fixedPrecision):
* Source/WTF/wtf/text/WTFString.cpp:
(WTF::String::numberToStringFixedPrecision):
* Source/WTF/wtf/text/WTFString.h:
* Source/WebCore/accessibility/AccessibilityObjectInterface.h:
(WebCore::AXCoreObject::value):
* Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::ResourceUsageOverlay::platformDraw):
* Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp:
(TestWebKitAPI::TEST):
* Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp:
(WTR::attributesOfElement):

Canonical link: https://commits.webkit.org/267447@main

c563ce3

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ›  πŸ§ͺ jsc βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  πŸ§ͺ jsc-arm64 βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2 βœ… πŸ›  jsc-armv7
βœ… πŸ›  tv-sim   πŸ§ͺ jsc-armv7-tests
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch βœ… πŸ›  jsc-mips
βœ… πŸ›  watch-sim βœ… πŸ§ͺ jsc-mips-tests

@annevk annevk requested review from cdumez and a team as code owners August 29, 2023 15:26
@annevk annevk self-assigned this Aug 29, 2023
@webkit-early-warning-system

This comment was marked as outdated.

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 29, 2023
@annevk annevk added skip-ews Applied to prevent a change from being run on EWS and removed merging-blocked Applied to prevent a change from being merged skip-ews Applied to prevent a change from being run on EWS labels Aug 29, 2023
@annevk annevk force-pushed the eng/Convert-TrailingZerosTruncatingPolicy-into-an-enum-class branch from 2828448 to c563ce3 Compare August 29, 2023 17:40
@annevk annevk requested a review from a team as a code owner August 29, 2023 17:40
@annevk annevk added the merge-queue Applied to send a pull request to merge-queue label Aug 30, 2023
https://bugs.webkit.org/show_bug.cgi?id=260863
rdar://114628958

Reviewed by Tim Nguyen.

* Source/JavaScriptCore/runtime/NumberPrototype.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/WTF/wtf/text/StringConcatenateNumbers.h:
(WTF::FormattedNumber::fixedPrecision):
* Source/WTF/wtf/text/WTFString.cpp:
(WTF::String::numberToStringFixedPrecision):
* Source/WTF/wtf/text/WTFString.h:
* Source/WebCore/accessibility/AccessibilityObjectInterface.h:
(WebCore::AXCoreObject::value):
* Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::ResourceUsageOverlay::platformDraw):
* Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp:
(TestWebKitAPI::TEST):
* Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp:
(WTR::attributesOfElement):

Canonical link: https://commits.webkit.org/267447@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Convert-TrailingZerosTruncatingPolicy-into-an-enum-class branch from c563ce3 to 137065a Compare August 30, 2023 08:06
@webkit-commit-queue
Copy link
Collaborator

Committed 267447@main (137065a): https://commits.webkit.org/267447@main

Reviewed commits have been landed. Closing PR #17186 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 137065a into WebKit:main Aug 30, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Aug 30, 2023
@annevk annevk deleted the eng/Convert-TrailingZerosTruncatingPolicy-into-an-enum-class branch August 30, 2023 13:21
@@ -573,7 +573,6 @@ inline String operator"" _str(const UChar* characters, size_t length)

} // namespace WTF

using WTF::KeepTrailingZeros;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WTF design has been to use these using statements rather than WTF:: prefixes at site of use. I know this is unconventional, but it’s the pattern we use in most cases across the library. To do that we would have using WTF::TrailingZerosPolicy here and fewer (maybe no) WTF:: prefixes elsewhere.

I’d be open to changing the WTF approach, and if we’d agreed that we’d not do it for anything new that would be OK with me.

But if I was making this change I would have stayed consistent with the approach and done the above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair! Created #17375.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants