Closed Bug 1477856 Opened 2 years ago Closed 2 years ago

[css-flexbox] Return a more meaningful value for "max-width: none" via internal flexbox inspector APIs

Categories

(Core :: Layout, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(1 file)

Apparently our flexbox devtools API (from bug 1409083) returns a large float (17895697.05) for the mainMaxSize, if max-width is at its default value of "none".

This is NS_UNCONSTRAINEDSIZE (i.e. nscoord_MAX) naively converted to pixels as  (2^30 - 1) / 60.

We shouldn't do this -- we should detect NS_UNCONSTRAINEDSIZE in this max-size field and report it to the devtools API via some more declarative way.

I think dom/flex/FlexItem.cpp is where the nscoord to pixel conversion happens, so that's probably where we should add this special case.

(Thanks to Patrick for the report here.)
As the originator of the API, I'm happy to take this if that's helpful.
I'll tag you to review, if that's all right.

I'm tentatively planning on just making the FlexItem::MainMaxSize() API return the double representation of +infinity when we have mMainMaxSize == NS_UNCONSTRAINEDSIZE.
Priority: -- → P3
Attachment #8995283 - Attachment description: Bug 1477856: In flexbox devtools API, report max-width:none as +infinity. r?bradwerth (Previously we were just directly converting this nscoord sentinel-value representation (NS_UNCONSTRAINEDSIZE) into CSS pixels and producing a particular bogus... → Bug 1477856: In flexbox devtools API, report max-width:none as +infinity. r?bradwerth
commit message was initially a bit borked, but I think I fixed it up.

I verified that the tests pass with the code-changes, and fail without the code-changes. The failure message without the code-change looks like:
>  FAIL Item index 5 has expected (default) mainMaxSize. - got 17895697.05, expected Infinity
Comment on attachment 8995283 [details]
Bug 1477856: In flexbox devtools API, report max-width:none as +infinity. r?bradwerth

Brad Werth [:bradwerth] has approved the revision.

https://phabricator.services.mozilla.com/D2432
Attachment #8995283 - Flags: review+
Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/33ff92501b9b
In flexbox devtools API, report max-width:none as +infinity. r=bradwerth
https://hg.mozilla.org/mozilla-central/rev/33ff92501b9b
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.