W3C home > Mailing lists > Public > public-css-archive@w3.org > July 2019

Re: [csswg-drafts] [cssom-view] {element, elements, nodes}FromPoint but without restricting to the viewport clip? (#4122)

From: Chris Harrelson via GitHub <sysbot+gh@w3.org>
Date: Tue, 30 Jul 2019 18:57:30 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-516549271-1564513049-sysbot+gh@w3.org>
> I wanted to respond here as one of the motivating use cases for Emilio bringing this issue up for discussion. I did [try using the Intersection Observer API](https://github.com/mozilla/price-tracker/issues/319#issuecomment-516497169) (I believe v2 based on your description). I saw about a 20% performance improvement compared to the 80% improvement using 
`elementsFromPoint` described in the same thread.

Interesting. Do you know what the difference is that led to the worse performance? (I'm not necessarily saying it must have been the same, just trying to understand your use-case better.)

> 1. We want to check visibility for every single element on the page, not just a handful of say, ads. My sample page had upwards of 6000 elements, which means 6000 observers.
> 2. We only want to check once, not monitor changes over time. It seems like overkill to walk the DOM and attach an observer to each element only to remove it after the first event.

Could you explain in more detail what you're doing with this information? Again, just trying to learn and understand the use-case.

GitHub Notification of comment by chrishtr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4122#issuecomment-516549271 using your GitHub account
Received on Tuesday, 30 July 2019 18:57:33 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:50 UTC