commit 8a28ab14664107096b1a47f3d1e33f00822b8d75 parent f786affdc7afdd03c816b79d4abb30818959bf03 Author: serge-sans-paille <sguelton@mozilla.com> Date: Thu, 9 Oct 2025 11:34:01 +0000 Bug 1992012 - Cleanup FloatingPoint.h inclusion r=emilio,media-playback-reviewers,firefox-svg-reviewers,layout-reviewers,dholbert,alwu There was a lot of leftovers from previous code cleaning. Also turn detail::FloatingPointTrait into FloatingPointTrait because it's specialized in js/src/vm/Float16.h, which shows it's not an internal API. Differential Revision: https://phabricator.services.mozilla.com/D267467 Diffstat:
58 files changed, 6 insertions(+), 65 deletions(-)
diff --git a/accessible/atk/nsMaiInterfaceValue.cpp b/accessible/atk/nsMaiInterfaceValue.cpp @@ -9,7 +9,6 @@ #include "AccessibleWrap.h" #include "nsMai.h" #include "RemoteAccessible.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/Likely.h" using namespace mozilla; diff --git a/accessible/mac/mozActionElements.mm b/accessible/mac/mozActionElements.mm @@ -14,7 +14,6 @@ #include "HTMLFormControlAccessible.h" #include "nsCocoaUtils.h" -#include "mozilla/FloatingPoint.h" using namespace mozilla::a11y; diff --git a/accessible/windows/ia2/ia2AccessibleValue.cpp b/accessible/windows/ia2/ia2AccessibleValue.cpp @@ -14,8 +14,6 @@ #include "IUnknownImpl.h" #include "MsaaAccessible.h" -#include "mozilla/FloatingPoint.h" - using namespace mozilla::a11y; AccessibleWrap* ia2AccessibleValue::LocalAcc() { diff --git a/dom/animation/KeyframeEffect.cpp b/dom/animation/KeyframeEffect.cpp @@ -16,7 +16,6 @@ #include "mozilla/AutoRestore.h" #include "mozilla/ComputedStyleInlines.h" #include "mozilla/EffectSet.h" -#include "mozilla/FloatingPoint.h" // For IsFinite #include "mozilla/KeyframeUtils.h" #include "mozilla/LayerAnimationInfo.h" #include "mozilla/LookAndFeel.h" // For LookAndFeel::GetInt diff --git a/dom/base/DOMMatrix.cpp b/dom/base/DOMMatrix.cpp @@ -16,7 +16,6 @@ #include "js/StructuredClone.h" #include "js/Value.h" #include "mozilla/ErrorResult.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/RefPtr.h" #include "mozilla/ServoCSSParser.h" #include "mozilla/dom/BindingDeclarations.h" diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp @@ -33,7 +33,6 @@ #include "mozilla/Assertions.h" #include "mozilla/DebugOnly.h" #include "mozilla/Encoding.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/Preferences.h" #include "mozilla/ScopeExit.h" #include "mozilla/Sprintf.h" diff --git a/dom/bindings/PrimitiveConversions.h b/dom/bindings/PrimitiveConversions.h @@ -19,7 +19,6 @@ #include "js/Conversions.h" #include "js/RootingAPI.h" #include "mozilla/Assertions.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/dom/BindingCallContext.h" namespace mozilla::dom { diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp @@ -34,7 +34,6 @@ #include "mozilla/CycleCollectedJSRuntime.h" #include "mozilla/DebugOnly.h" #include "mozilla/FilterInstance.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/GeckoBindings.h" #include "mozilla/Logging.h" #include "mozilla/MathAlgorithms.h" diff --git a/dom/canvas/CanvasUtils.h b/dom/canvas/CanvasUtils.h @@ -11,7 +11,6 @@ #include "js/PropertyAndElement.h" // JS_GetElement #include "jsapi.h" #include "mozilla/CheckedInt.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/dom/ToJSValue.h" class nsIPrincipal; diff --git a/dom/geolocation/GeolocationCoordinates.cpp b/dom/geolocation/GeolocationCoordinates.cpp @@ -6,7 +6,6 @@ #include "mozilla/dom/GeolocationCoordinates.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/dom/GeolocationCoordinatesBinding.h" #include "mozilla/dom/GeolocationPosition.h" diff --git a/dom/media/MediaDecoder.cpp b/dom/media/MediaDecoder.cpp @@ -23,7 +23,6 @@ #include "VideoUtils.h" #include "WindowRenderer.h" #include "mozilla/AbstractThread.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/MathAlgorithms.h" #include "mozilla/Preferences.h" #include "mozilla/StaticPrefs_media.h" diff --git a/dom/media/mediaelement/HTMLMediaElement.cpp b/dom/media/mediaelement/HTMLMediaElement.cpp @@ -60,7 +60,6 @@ #include "mozilla/AsyncEventDispatcher.h" #include "mozilla/EMEUtils.h" #include "mozilla/EventDispatcher.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/MathAlgorithms.h" #include "mozilla/NotNull.h" #include "mozilla/Preferences.h" diff --git a/dom/media/webaudio/AudioBufferSourceNode.cpp b/dom/media/webaudio/AudioBufferSourceNode.cpp @@ -15,7 +15,6 @@ #include "AudioNodeTrack.h" #include "AudioParamTimeline.h" #include "Tracing.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/dom/AudioBufferSourceNodeBinding.h" #include "mozilla/dom/AudioParam.h" #include "nsContentUtils.h" diff --git a/dom/media/webaudio/AudioEventTimeline.h b/dom/media/webaudio/AudioEventTimeline.h @@ -15,7 +15,6 @@ #include "mozilla/Assertions.h" #include "mozilla/DefineEnum.h" #include "mozilla/ErrorResult.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/PodOperations.h" #include "nsTArray.h" diff --git a/dom/media/webaudio/blink/IIRFilter.cpp b/dom/media/webaudio/blink/IIRFilter.cpp @@ -10,7 +10,6 @@ #include "DenormalDisabler.h" #include "fdlibm.h" -#include "mozilla/FloatingPoint.h" namespace blink { diff --git a/dom/media/webaudio/blink/Reverb.cpp b/dom/media/webaudio/blink/Reverb.cpp @@ -32,7 +32,6 @@ #include "ReverbConvolver.h" #include "ReverbConvolverStage.h" -#include "mozilla/FloatingPoint.h" using namespace mozilla; diff --git a/dom/midi/MIDIMessageEvent.cpp b/dom/midi/MIDIMessageEvent.cpp @@ -9,7 +9,6 @@ #include "js/GCAPI.h" #include "js/Realm.h" #include "jsfriendapi.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/HoldDropJSObjects.h" #include "mozilla/dom/EventBinding.h" #include "mozilla/dom/MIDIMessageEventBinding.h" diff --git a/dom/svg/DOMSVGLength.cpp b/dom/svg/DOMSVGLength.cpp @@ -12,7 +12,6 @@ #include "SVGAnimatedLengthList.h" #include "SVGAttrTearoffTable.h" #include "SVGLength.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/dom/SVGElement.h" #include "mozilla/dom/SVGLengthBinding.h" #include "nsError.h" diff --git a/dom/svg/DOMSVGPoint.h b/dom/svg/DOMSVGPoint.h @@ -10,7 +10,6 @@ #include "DOMSVGPointList.h" #include "SVGPoint.h" #include "mozilla/Attributes.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/dom/SVGSVGElement.h" #include "mozilla/gfx/2D.h" #include "nsCycleCollectionParticipant.h" diff --git a/dom/svg/DOMSVGTransform.cpp b/dom/svg/DOMSVGTransform.cpp @@ -10,7 +10,6 @@ #include "SVGAttrTearoffTable.h" #include "mozAutoDocUpdate.h" #include "mozilla/DebugOnly.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/Maybe.h" #include "mozilla/dom/DOMMatrix.h" #include "mozilla/dom/DOMMatrixBinding.h" diff --git a/dom/svg/SVGAnimatedNumber.h b/dom/svg/SVGAnimatedNumber.h @@ -8,7 +8,6 @@ #define DOM_SVG_SVGANIMATEDNUMBER_H_ #include "mozilla/Attributes.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/SMILAttr.h" #include "mozilla/UniquePtr.h" #include "mozilla/dom/DOMSVGAnimatedNumber.h" diff --git a/dom/svg/SVGAnimatedNumberPair.h b/dom/svg/SVGAnimatedNumberPair.h @@ -9,7 +9,6 @@ #include "DOMSVGAnimatedNumber.h" #include "mozilla/Attributes.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/SMILAttr.h" #include "mozilla/UniquePtr.h" #include "nsCycleCollectionParticipant.h" diff --git a/dom/svg/SVGContentUtils.cpp b/dom/svg/SVGContentUtils.cpp @@ -18,7 +18,6 @@ #include "gfxMatrix.h" #include "gfxPlatform.h" #include "mozilla/ComputedStyle.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/PresShell.h" #include "mozilla/RefPtr.h" #include "mozilla/SVGContextPaint.h" diff --git a/dom/svg/SVGLengthListSMILType.cpp b/dom/svg/SVGLengthListSMILType.cpp @@ -11,7 +11,6 @@ #include <algorithm> #include "SVGLengthList.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/SMILValue.h" #include "nsMathUtils.h" diff --git a/dom/svg/SVGMarkerElement.cpp b/dom/svg/SVGMarkerElement.cpp @@ -10,7 +10,6 @@ #include "SVGAnimatedPreserveAspectRatio.h" #include "SVGContentUtils.h" #include "mozilla/ArrayUtils.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/RefPtr.h" #include "mozilla/dom/SVGGeometryElement.h" #include "mozilla/dom/SVGLengthBinding.h" diff --git a/dom/svg/SVGMatrix.cpp b/dom/svg/SVGMatrix.cpp @@ -8,7 +8,6 @@ #include <math.h> -#include "mozilla/FloatingPoint.h" #include "mozilla/dom/DOMMatrix.h" #include "mozilla/dom/SVGMatrixBinding.h" #include "nsError.h" diff --git a/dom/svg/SVGNumberListSMILType.cpp b/dom/svg/SVGNumberListSMILType.cpp @@ -9,7 +9,6 @@ #include <math.h> #include "SVGNumberList.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/SMILValue.h" #include "nsMathUtils.h" diff --git a/dom/svg/SVGPoint.h b/dom/svg/SVGPoint.h @@ -8,7 +8,6 @@ #define DOM_SVG_SVGPOINT_H_ #include "gfxPoint.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/gfx/Point.h" #include "nsDebug.h" diff --git a/dom/svg/SVGPointListSMILType.cpp b/dom/svg/SVGPointListSMILType.cpp @@ -9,7 +9,6 @@ #include <math.h> #include "SVGPointList.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/SMILValue.h" #include "nsMathUtils.h" diff --git a/dom/svg/SVGViewportElement.cpp b/dom/svg/SVGViewportElement.cpp @@ -16,7 +16,6 @@ #include "mozilla/ArrayUtils.h" #include "mozilla/ContentEvents.h" #include "mozilla/EventDispatcher.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/Likely.h" #include "mozilla/SMILTypes.h" #include "mozilla/SVGContentUtils.h" diff --git a/dom/system/windows/location/WindowsLocationProvider.cpp b/dom/system/windows/location/WindowsLocationProvider.cpp @@ -10,7 +10,6 @@ #include "MLSFallback.h" #include "WindowsLocationParent.h" #include "mozilla/Attributes.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/Logging.h" #include "mozilla/dom/GeolocationPositionErrorBinding.h" #include "mozilla/dom/WindowsUtilsParent.h" diff --git a/dom/xslt/xpath/txNumberResult.cpp b/dom/xslt/xpath/txNumberResult.cpp @@ -8,7 +8,6 @@ * Represents the a number as the result of evaluating an Expr **/ -#include "mozilla/FloatingPoint.h" #include "txExprResult.h" /** diff --git a/dom/xslt/xslt/txStylesheet.cpp b/dom/xslt/xslt/txStylesheet.cpp @@ -7,7 +7,6 @@ #include <utility> -#include "mozilla/FloatingPoint.h" #include "txExpr.h" #include "txInstructions.h" #include "txKey.h" diff --git a/dom/xslt/xslt/txXPathResultComparator.cpp b/dom/xslt/xslt/txXPathResultComparator.cpp @@ -5,7 +5,6 @@ #include "txXPathResultComparator.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/intl/Collator.h" #include "mozilla/intl/LocaleService.h" #include "nsComponentManagerUtils.h" diff --git a/dom/xslt/xslt/txXSLTNumber.cpp b/dom/xslt/xslt/txXSLTNumber.cpp @@ -10,7 +10,6 @@ #include <algorithm> #include "mozilla/ArrayUtils.h" -#include "mozilla/FloatingPoint.h" #include "nsGkAtoms.h" #include "txCore.h" #include "txExpr.h" diff --git a/gfx/2d/BasePoint.h b/gfx/2d/BasePoint.h @@ -11,7 +11,6 @@ #include <ostream> #include <type_traits> #include "mozilla/Attributes.h" -#include "mozilla/FloatingPoint.h" #include "Coord.h" namespace mozilla { diff --git a/gfx/2d/BaseRect.h b/gfx/2d/BaseRect.h @@ -13,7 +13,6 @@ #include <type_traits> #include "mozilla/Assertions.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/gfx/ScaleFactors2D.h" #include "Types.h" diff --git a/gfx/layers/apz/src/OverscrollHandoffState.cpp b/gfx/layers/apz/src/OverscrollHandoffState.cpp @@ -8,7 +8,6 @@ #include <algorithm> // for std::stable_sort #include "mozilla/Assertions.h" -#include "mozilla/FloatingPoint.h" #include "AsyncPanZoomController.h" namespace mozilla { diff --git a/gfx/thebes/gfxFontEntry.cpp b/gfx/thebes/gfxFontEntry.cpp @@ -27,7 +27,6 @@ #include "nsBidiUtils.h" #include "nsStyleConsts.h" #include "mozilla/AppUnits.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/Likely.h" #include "mozilla/MemoryReporting.h" #include "mozilla/Preferences.h" diff --git a/intl/components/src/NumberFormat.h b/intl/components/src/NumberFormat.h @@ -7,7 +7,6 @@ #include <utility> #include <vector> -#include "mozilla/FloatingPoint.h" #include "mozilla/intl/ICU4CGlue.h" #include "mozilla/Maybe.h" #include "mozilla/PodOperations.h" diff --git a/intl/components/src/NumberFormatFields.cpp b/intl/components/src/NumberFormatFields.cpp @@ -5,7 +5,6 @@ #include "NumberFormatFields.h" #include "ScopedICUObject.h" -#include "mozilla/FloatingPoint.h" #include "unicode/uformattedvalue.h" #include "unicode/unum.h" #include "unicode/unumberformatter.h" diff --git a/js/src/builtin/JSON.cpp b/js/src/builtin/JSON.cpp @@ -7,7 +7,6 @@ #include "builtin/JSON.h" #include "mozilla/CheckedInt.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/Range.h" #include "mozilla/ScopeExit.h" #include "mozilla/Variant.h" diff --git a/js/src/builtin/String.cpp b/js/src/builtin/String.cpp @@ -9,7 +9,6 @@ #include "mozilla/Attributes.h" #include "mozilla/CheckedInt.h" #include "mozilla/Compiler.h" -#include "mozilla/FloatingPoint.h" #if JS_HAS_INTL_API # include "mozilla/intl/String.h" #endif diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp @@ -8,7 +8,6 @@ #include "mozilla/Atomics.h" #include "mozilla/Casting.h" -#include "mozilla/FloatingPoint.h" #ifdef JS_HAS_INTL_API # include "mozilla/intl/ICU4CLibrary.h" # include "mozilla/intl/Locale.h" diff --git a/js/src/builtin/intl/RelativeTimeFormat.cpp b/js/src/builtin/intl/RelativeTimeFormat.cpp @@ -9,7 +9,6 @@ #include "builtin/intl/RelativeTimeFormat.h" #include "mozilla/Assertions.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/intl/RelativeTimeFormat.h" #include "builtin/intl/CommonFunctions.h" diff --git a/js/src/frontend/ParseNode.cpp b/js/src/frontend/ParseNode.cpp @@ -6,7 +6,6 @@ #include "frontend/ParseNode.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/Try.h" // MOZ_TRY* #include "jsnum.h" diff --git a/js/src/jit/arm/Simulator-arm.cpp b/js/src/jit/arm/Simulator-arm.cpp @@ -31,7 +31,6 @@ #include "mozilla/Casting.h" #include "mozilla/DebugOnly.h" #include "mozilla/EndianUtils.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/Likely.h" #include "mozilla/MathAlgorithms.h" diff --git a/js/src/jit/mips64/Simulator-mips64.cpp b/js/src/jit/mips64/Simulator-mips64.cpp @@ -30,7 +30,6 @@ #include "jit/mips64/Simulator-mips64.h" #include "mozilla/Casting.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/IntegerPrintfMacros.h" #include "mozilla/Likely.h" #include "mozilla/MathAlgorithms.h" diff --git a/js/src/vm/Float16.h b/js/src/vm/Float16.h @@ -340,7 +340,7 @@ class std::numeric_limits<js::float16> { }; template <> -struct mozilla::detail::FloatingPointTrait<js::float16> { +struct mozilla::FloatingPointTrait<js::float16> { protected: using Bits = uint16_t; diff --git a/js/src/vm/JSONPrinter.cpp b/js/src/vm/JSONPrinter.cpp @@ -7,7 +7,6 @@ #include "vm/JSONPrinter.h" #include "mozilla/Assertions.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/IntegerPrintfMacros.h" #include <stdarg.h> diff --git a/js/src/vm/TypedArrayObject-inl.h b/js/src/vm/TypedArrayObject-inl.h @@ -13,7 +13,6 @@ #include "mozilla/Assertions.h" #include "mozilla/Compiler.h" -#include "mozilla/FloatingPoint.h" #include <algorithm> #include <type_traits> diff --git a/layout/forms/nsNumberControlFrame.cpp b/layout/forms/nsNumberControlFrame.cpp @@ -8,7 +8,6 @@ #include "HTMLInputElement.h" #include "mozilla/BasicEvents.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/PresShell.h" #include "nsCSSPseudoElements.h" #include "nsContentCreatorFunctions.h" diff --git a/layout/style/StyleAnimationValue.cpp b/layout/style/StyleAnimationValue.cpp @@ -14,7 +14,6 @@ #include "mozilla/ArrayUtils.h" #include "mozilla/ComputedStyle.h" #include "mozilla/ComputedStyleInlines.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/Likely.h" #include "mozilla/MathAlgorithms.h" #include "mozilla/PresShell.h" diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp @@ -15,7 +15,6 @@ #include "mozilla/ComputedStyle.h" #include "mozilla/ComputedStyleInlines.h" #include "mozilla/EffectSet.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/FontPropertyTypes.h" #include "mozilla/IntegerRange.h" #include "mozilla/Preferences.h" diff --git a/mfbt/FloatingPoint.cpp b/mfbt/FloatingPoint.cpp @@ -9,6 +9,7 @@ #include "mozilla/FloatingPoint.h" #include <cfloat> // for FLT_MAX +#include <cmath> namespace mozilla { diff --git a/mfbt/FloatingPoint.h b/mfbt/FloatingPoint.h @@ -17,9 +17,9 @@ #include "mozilla/Types.h" #include <algorithm> -#include <climits> +#include <cstdint> #include <limits> -#include <stdint.h> +#include <type_traits> namespace mozilla { @@ -38,8 +38,6 @@ namespace mozilla { * compiler bustage, particularly PGO-specific bustage. */ -namespace detail { - /* * These implementations assume float/double are 32/64-bit single/double * format number types compatible with the IEEE-754 standard. C++ doesn't @@ -67,8 +65,6 @@ struct FloatingPointTrait<double> { static constexpr unsigned kSignificandWidth = 52; }; -} // namespace detail - /* * This struct contains details regarding the encoding of floating-point * numbers that can be useful for direct bit manipulation. As of now, the @@ -96,9 +92,9 @@ struct FloatingPointTrait<double> { * http://en.wikipedia.org/wiki/Floating_point#IEEE_754:_floating_point_in_modern_computers */ template <typename T> -struct FloatingPoint final : private detail::FloatingPointTrait<T> { +struct FloatingPoint final : private FloatingPointTrait<T> { private: - using Base = detail::FloatingPointTrait<T>; + using Base = FloatingPointTrait<T>; public: /** diff --git a/mozglue/tests/TestBaseProfiler.cpp b/mozglue/tests/TestBaseProfiler.cpp @@ -11,7 +11,6 @@ #include "mozilla/BaseProfileJSONWriter.h" #include "mozilla/BaseProfilerDetail.h" #include "mozilla/FailureLatch.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/NotNull.h" #include "mozilla/ProgressLogger.h" #include "mozilla/ProportionValue.h" diff --git a/xpcom/ds/nsVariant.cpp b/xpcom/ds/nsVariant.cpp @@ -13,7 +13,6 @@ #include "nsReadableUtils.h" #include "nsString.h" #include "nsCRTGlue.h" -#include "mozilla/FloatingPoint.h" #include "mozilla/IntegerPrintfMacros.h" #include "mozilla/Printf.h"