4 ms·
> but whether an element is in view depends on the results of layout, which depends on the user's installed fonts… It'd be kind of interesting if you could onl
by derefr 10y ago
> but whether an element is in view depends on the results of layout, which depends on the user's installed fonts…
It'd be kind of interesting if you could only ask about the CSSOM in terms of what the page would look like if rendered with a known set of {fonts, visited links, whatever else is a security leak} rather than asking what it does actually look like—with the browser keeping two render-trees in memory for metrics (the real one, and your hypothetical one) but only actually rendering the real one.
Then, you could synchronize page-manipulation events between the two render-trees, by trying to re-synthesize things like viewport/scroll-offsets and mouse positions, such that everything "will have been" in the right position in one model to end up clicking on whatever element ended up being clicked on in the other model.
Very inefficient, but kind of interesting.
- gsnedders 10y agoIf you have multiple columns of text, which column are you matching the scroll position up to? I'm pretty sure even something that inefficient isn't going to work. :)