w3c / w3c/csswg-drafts

[resize-observer] Populating a ResizeObserverEntry needs to use FrozenArray

Open
#7,618 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

resize-observer-1
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

https://drafts.csswg.org/resize-observer-1/#create-and-populate-a-resizeobserverentry

  1. Set this.borderBoxSize slot to result of computing size given target and observedBox of "border-box".
  2. Set this.contentBoxSize slot to result of computing size given target and observedBox of "content-box".
  3. Set this.devicePixelContentBoxSize slot to result of computing size given target and observedBox of "device-pixel-content-box".

"calculate box size" seems to return a ResizeObserverSize (#7615), but ResizeObserverEntry's borderBoxSize, contentBoxSize and devicePixelContentBoxSize aren't ResizeObserverSizes, they are FrozenArray<ResizeObserverSize>.

I guess the algorithm should use https://webidl.spec.whatwg.org/#dfn-create-frozen-array

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the linked Resize Observer specification section and compare the ResizeObserverEntry slots with the WebIDL FrozenArray definition and its create-frozen-array algorithm. Update the population steps so borderBoxSize, contentBoxSize, and devicePixelContentBoxSize match their declared FrozenArray types.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.