<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>299972</bug_id>
          
          <creation_ts>2025-10-01 11:38:57 -0700</creation_ts>
          <short_desc>[Style] Replace isZero/isNegative/isPositive functions inherited from WebCore::Length</short_desc>
          <delta_ts>2025-11-03 11:19:00 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>Safari 18</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=301873</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sam Weinig">sam</reporter>
          <assigned_to name="Diego Pino">dpino</assigned_to>
          <cc>dpino</cc>
    
    <cc>koivisto</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2147605</commentid>
    <comment_count>0</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2025-10-01 11:38:57 -0700</bug_when>
    <thetext>StyleLengthPercentage&lt;&gt; and Style::LengthWrapperBase&lt;&gt; 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2147606</commentid>
    <comment_count>1</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2025-10-01 11:50:15 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/51635</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2147999</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-10-02 18:01:06 -0700</bug_when>
    <thetext>Committed 300911@main (33b130ec17ce): &lt;https://commits.webkit.org/300911@main&gt;

Reviewed commits have been landed. Closing PR #51635 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2148000</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-10-02 18:02:18 -0700</bug_when>
    <thetext>&lt;rdar://problem/161861437&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2149044</commentid>
    <comment_count>4</comment_count>
    <who name="Diego Pino">dpino</who>
    <bug_when>2025-10-07 03:31:43 -0700</bug_when>
    <thetext>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&lt;WebCore::CSS::Percentage&lt;WebCore::CSS::Range{0.0, +Inf, WebCore::CSS::RangeClampOptions::Default, WebCore::CSS::RangeZoomOptions::Default}, float&gt; &gt;::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 };
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2149050</commentid>
    <comment_count>5</comment_count>
    <who name="Diego Pino">dpino</who>
    <bug_when>2025-10-07 04:17:31 -0700</bug_when>
    <thetext>Re-opening for pull request https://github.com/WebKit/WebKit/pull/51934</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2149732</commentid>
    <comment_count>6</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-10-09 10:21:31 -0700</bug_when>
    <thetext>Committed 301265@main (0e023c832420): &lt;https://commits.webkit.org/301265@main&gt;

Reviewed commits have been landed. Closing PR #51934 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2156028</commentid>
    <comment_count>7</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2025-11-03 11:19:00 -0800</bug_when>
    <thetext>This caused bug 301873.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>