Bug 214347 - [css-grid] Rename SmallestTrackStart to ExplicitGridStart
Summary: [css-grid] Rename SmallestTrackStart to ExplicitGridStart
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Oriol Brufau
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-07-15 05:08 PDT by Oriol Brufau
Modified: 2020-07-15 10:27 PDT (History)
10 users (show)

See Also:


Attachments
Patch (10.86 KB, patch)
2020-07-15 05:17 PDT, Oriol Brufau
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oriol Brufau 2020-07-15 05:08:39 PDT
The SmallestTrackStart method returns a signed int which is never positive, representing the smallest untranslated start among all grid items, clamped by 0 as a maximum.

In practice, though, what we usually want is the index of the first explicit track/line among all tracks/lines, or equivalently, the number of leading implicit tracks/lines.

That number is precisely minus the return value of SmallestTrackStart.
Thus, in grid layout there were various std::abs() to invert the value.

But it's a bit confusing to have an API which returns a non-positive integer, which then needs to be made non-negative.
Therefore, we should rename SmallestTrackStart to ExplicitGridStart, and make it return an unsigned int.

Chromium did this in https://crrev.com/777768
Comment 1 Oriol Brufau 2020-07-15 05:17:02 PDT
Created attachment 404333 [details]
Patch
Comment 2 Manuel Rego Casasnovas 2020-07-15 05:54:37 PDT
Comment on attachment 404333 [details]
Patch

r=me, wait for green EWSs before landing.
Comment 3 EWS 2020-07-15 10:26:45 PDT
Committed r264403: <https://trac.webkit.org/changeset/264403>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 404333 [details].
Comment 4 Radar WebKit Bug Importer 2020-07-15 10:27:15 PDT
<rdar://problem/65613208>