WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
299972
[Style] Replace isZero/isNegative/isPositive functions inherited from WebCore::Length
https://bugs.webkit.org/show_bug.cgi?id=299972
Summary
[Style] Replace isZero/isNegative/isPositive functions inherited from WebCore...
Sam Weinig
Reported
2025-10-01 11:38:57 PDT
StyleLengthPercentage<> and Style::LengthWrapperBase<> inherited (to help things continue to work without too much churn) the isZero/isNegative/isPositive functions and along with them their quirky behavior with calc and keywords. For a type that includes a Length, Percentage, Calc, and Keywords, the functions have the following behavior: isZero: - Length (compare value, makes sense) - Percentage (compare value, makes sense) - Calc (always FALSE) - Keyword (always TRUE, due to keywords having a value of 0). isPositive: - Length (compare value, makes sense) - Percentage (compare value, makes sense) - Calc (always TRUE) - Keyword (always FALSE, due to keywords having a value of 0). isNegative: - Length (compare value, makes sense) - Percentage (compare value, makes sense) - Calc (always FALSE) - Keyword (always FALSE, due to keywords having a value of 0). We should remove them, and, if necessary, replace them with more accurately named functions.
Attachments
Add attachment
proposed patch, testcase, etc.
Sam Weinig
Comment 1
2025-10-01 11:50:15 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/51635
EWS
Comment 2
2025-10-02 18:01:06 PDT
Committed
300911@main
(33b130ec17ce): <
https://commits.webkit.org/300911@main
> Reviewed commits have been landed. Closing PR #51635 and removing active labels.
Radar WebKit Bug Importer
Comment 3
2025-10-02 18:02:18 PDT
<
rdar://problem/161861437
>
Diego Pino
Comment 4
2025-10-07 03:31:43 PDT
This change broke WPEWebKit/WebKitGTK builds with GCC12. The build error is:
https://build.webkit.org/#/builders/46/builds/55581
``` /home/buildbot/worker/GTK-Linux-64-bit-Release-Debian-12-Build/build/WebKitBuild/GTK/Release/WebCore/PrivateHeaders/WebCore/StyleLengthWrapper.h:146:67: error: invalid use of non-static data member ‘WebCore::Style::PrimitiveNumeric<WebCore::CSS::Percentage<WebCore::CSS::Range{0.0, +Inf, WebCore::CSS::RangeClampOptions::Default, WebCore::CSS::RangeZoomOptions::Default}, float> >::value’ 146 | else if (opaqueType == indexForPercentage) return visitor(Percentage { m_value.value() }); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /home/buildbot/worker/GTK-Linux-64-bit-Release-Debian-12-Build/build/WebKitBuild/GTK/Release/WebCore/PrivateHeaders/WebCore/StylePrimitiveNumericTypes.h:28, from /home/buildbot/worker/GTK-Linux-64-bit-Release-Debian-12-Build/build/WebKitBuild/GTK/Release/WebCore/PrivateHeaders/WebCore/CSSColorDescriptors.h:35, from /home/buildbot/worker/GTK-Linux-64-bit-Release-Debian-12-Build/build/WebKitBuild/GTK/Release/WebCore/PrivateHeaders/WebCore/CSSColor.h:29, from /home/buildbot/worker/GTK-Linux-64-bit-Release-Debian-12-Build/build/WebKitBuild/GTK/Release/WebCore/PrivateHeaders/WebCore/CSSGradient.h:29, from /home/buildbot/worker/GTK-Linux-64-bit-Release-Debian-12-Build/build/WebKitBuild/GTK/Release/WebCore/PrivateHeaders/WebCore/CSSCircleFunction.h:27, from /home/buildbot/worker/GTK-Linux-64-bit-Release-Debian-12-Build/build/WebKitBuild/GTK/Release/WebCore/PrivateHeaders/WebCore/CSSBasicShape.h:27, from /home/buildbot/worker/GTK-Linux-64-bit-Release-Debian-12-Build/build/WebKitBuild/GTK/Release/WebCore/PrivateHeaders/WebCore/StyleBasicShape.h:27: /home/buildbot/worker/GTK-Linux-64-bit-Release-Debian-12-Build/build/WebKitBuild/GTK/Release/WebCore/PrivateHeaders/WebCore/StylePrimitiveNumeric.h:60:23: note: declared here 60 | ResolvedValueType value { 0 }; ```
Diego Pino
Comment 5
2025-10-07 04:17:31 PDT
Re-opening for pull request
https://github.com/WebKit/WebKit/pull/51934
EWS
Comment 6
2025-10-09 10:21:31 PDT
Committed
301265@main
(0e023c832420): <
https://commits.webkit.org/301265@main
> Reviewed commits have been landed. Closing PR #51934 and removing active labels.
Simon Fraser (smfr)
Comment 7
2025-11-03 11:19:00 PST
This caused
bug 301873
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug