[resize-observer] What should the fragment-aware behavior be when there are no fragments?
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- css
- Domain
- web-dev
Research direction
Start with the linked CSSWG issue 3673 comment and the ResizeObserver fragment-size behavior described here. Compare the empty-array and zero-size alternatives, including the linked react-breakpoints usage, and document a resolved behavior for elements with no fragments.
Written by the indexing model from the issue text.
Description
See https://github.com/w3c/csswg-drafts/issues/3673#issuecomment-467221565
RES0LVED: Option 1; contentBox is an array of fragment sizes
So if a box has 1 fragment then the array has length 1, if it has 2 fragments it has length 2, and so on.
What if the element has no fragments like in display: none? Then getting an empty array would probably make the most sense.
Likewise for non-atomic inlines, which are considered to have a size of zero. Since this is not a real size it might make more sense to represent it as a lack of fragments.
I think it's also possible (e.g. with continue: discard) to have an element that generates a box, but no fragment is created.
The risk of an empty array is that right now with the non-fragment aware API we get an array of length 1 (a 0x0 size). I'm concerned that several web pages may be using contentBoxSize[0].inlineSize without checking contentBoxSize.length. See https://github.com/envato/react-breakpoints/blob/5b25ede569801efa0030e42e49b9fca08308dc47/src/useBreakpoints.ts#L99-L120 for an example.
That said, elements with a size of 0x0 (either real or due to no box or inline box) weren't initially getting their ResizeObserver callback invoked before #3664, so it may not be a big deal if the callback now throws in the non-real 0x0 case.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 24
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from w3c/csswg-drafts
-
Agenda+ css-sizing-4 css-values-5
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
w3c/csswg-drafts#14502 · 1 reaction ·
-
css-values-5 editorial Needs Edits
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
w3c/csswg-drafts#14498 · 2 comments ·
-
css-overflow-4 topic: line-clamp
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
w3c/csswg-drafts#14485 · 1 comment ·
-
Administrative Tracker css-values-4
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
w3c/csswg-drafts#14482 · 4 comments · 1 reaction ·
-
css-values-5 Needs Edits
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
w3c/csswg-drafts#14466 ·
All issues in w3c/csswg-drafts
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
tvOS
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bvaughn/react-resizable-panels#751 · 1 comment ·
-
www.wiwo.de OpenN: AdGuard Browser Extension P3: Medium T: Annoyance
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
AdguardTeam/AdguardFilters#242026 ·
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 92/100