Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

New observation target proposal #6

Closed
atotic opened this issue May 25, 2016 · 1 comment
Closed

New observation target proposal #6

atotic opened this issue May 25, 2016 · 1 comment

Comments

@atotic
Copy link
Collaborator

atotic commented May 25, 2016

Original proposal was to observe target's clientHeight. This was inadequate, as explained in #4.
Here is the new proposal:

  1. Observe the target's content size
    • Because authors manipulate DOM with respect to content size. Content size is well-specified in CSS. "content size like" properties have various quirks, lets use content size directly.
  2. Report observations with content rectangle, whose:
    • size is content size,
    • position top is padding-top, left is padding-left

Having content rect position be padding-top/left is useful for absolute positioning of target's children. Absolute position coordinate space origin is topleft of the padding rect.

The new ResizeObserverEntry IDL would be:

interface ResizeObserverEntry {
    readonly attribute Element target;
    readonly attribute DOMRectReadOnly contentRect;
};

What makes me happy about content rect entry is that all the information needed to position/show/hide children is right there.

atotic pushed a commit that referenced this issue Jun 9, 2016
@atotic
Copy link
Collaborator Author

atotic commented Jun 9, 2016

Spec has been updated with observing content size. goodbye clientWidth....

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants