-
Notifications
You must be signed in to change notification settings - Fork 709
[resize-observer] Add offset position to rects #3550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@atotic and I discussed this, we also looked at real world usage and providing the offsets of an individual box relative to its closest other box does not provide enough information to be useful. Another good point which aligns with what @bfgeek brought up in the issue regarding which box info to return, we're currently only allowing observations on the inline or block dimensions, not their offsets. So if we report the offsets and they're used within but not observed the information will be out of sync. In addition to this, we didn't find any usecases for needing this information in relation to resizeObserver. @smfr since you raised this issue I'd like to hear your thoughts as we're currently leaning to not adding the offsets. |
The CSS Working Group just discussed
The full IRC log of that discussion<heycam> Topic: Add offset pos<gregwhitworth> Github: https://github.com//issues/3550 <heycam> gregwhitworth: Simon brought up that the position of the rects you're observing <heycam> ... say the author wants to observe the content rect, you want both the tlbr offsets relative to the box <heycam> ... Alex and I discussed this. Ian brought up a valid pint, we're not observing the offsets <heycam> .. beingable to use the offsets inside the observer may cause stale issues <heycam> ... only when dimensions change do you fire the observer <heycam> smfr: which box? <heycam> gregwhitworth: the one you're watching <heycam> ... say you're observing context box <heycam> ... you' dget the dimensions of that back <heycam> ... you asked about having the offsets in there sa well <heycam> ... use counters say that isn't common <heycam> ... Ian brought up looking at the offsets when not firing the observer <heycam> ... you'd want to add that you're also observing offsets <heycam> smfr: so author could change border and padding so the content box doesn't change <heycam> alex: you'd have to put two boxes together if you really wanted to know the offsets <heycam> smfr: I suggested it for completeness. if it adds complexity I don't feel strongly <heycam> iank_: if we need it eventually, it should be trivial to extend to support this <heycam> gregwhitworth: but also need to add observing offsets <heycam> iank_: but we haven't painted ourselves into a corner <heycam> stefan: the behavior is polyfillable if oyu have a 100% div inside <heycam> ... if the size changes, the offsets will have chnaged <heycam> dbaron: I like the idea that hte pieces of data you provide are the ones you're observing <heycam> ... don't like having data in there that you're using which you don't get notifications for <heycam> RESOLVED: Don't include offsets for the box being observed. |
To summarize the above, it was resolved to not include the offsets of the box that is being observed as the offsets are not actually be observed and thus can be stale. In addition, looking at utilization for this - the offsets are not normally utilized and in a situation where someone is wanting to do custom layout the Houdini Layout API is a better approach. |
The CSS Working Group just discussed
Which box information should we pass to the callback
.@smfr wanted to have the offsets included rather than just the dimensions so that if the authors want that data they're aren't potentially flushing the pipeline again to retrieve it. Opening this issue to track that since the other issue is specifically about whether to return all boxes or the ones that are specified.
The text was updated successfully, but these errors were encountered: