Re: [csswg-drafts] [cssom-view] Proposal: add Element.isRendered() to detect if element is rendered. (#6850)

Re name: I agree `isVisible` is not a perfect name. `isVisibleToDocument` is descriptive of what it is, that sounds good to me.

Re sync style: this is definitely something to make sure we get right. The is-rendered and `visibility:visible` parts will require sync style recalc, but only if the element is not skipped (i.e not in a skipped `content-visibility` subtree). If the element is skipped, then we can detect that with a sync style update up to ancestors that skip their contents, and then observe that the element is in the subtree with a tree walk. (And if style were already up-to-date, then of course the above computations would potentially be free or mostly free.)

Worst-case performance summary:
* Forces style for non-skipped parts of the document
* Requires an ancestor tree walk for skipped elements up to a non-skipped ancestor

(p.s. I updated the third bullet point of my proposal a few comments back to be accurate about skipped elements)


-- 
GitHub Notification of comment by chrishtr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6850#issuecomment-991090682 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 10 December 2021 16:00:13 UTC