Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ability to change the origin style (parent of <html>)
I want to invisibly set the zoom to the devicePixelRatio in the demo site, but still allow people to see the effect of zoom on <html> as they would in a normal browser. I don't think this will be useful for other purposes, and it effectively clears the style cache, so not documenting it. --- I've been thinking about how to optimize the use of the zoom property for devicePixelRatio for more than a month now. The way the API is now, you have to regenerate both a DOM and a layout tree if you want to change it. This could be bad for CellEngine since it can retain tens of thousands of layouts. I seriously considered having an element's style list be mutable. I mostly figured out how Firefox tracks style damage, restyle roots, lazy frame construction, etc. Avoiding recreating the DOM and box tree when you want to change styles would lower GC pressure and reduce CPU time. However, the CPU doesn't get off that easily since layout is far more expensive than DOM and box generation combined. It would also be a big API change because I would have to move generate and style calc into layout. Ultimatley I decided this isn't a problem to fix here because: 1. Server-side doesn't benefit from mutable DOM, and that's the primary focus for dropflow 2. CellEngine could use zoom: 1 for measurement and, when DPR changes, only regenerate in-viewport layouts (mark the rest dirty). Also worth noting is that CellEngine doesn't even need zoom since it only renders text. Who knows if it ever will. 3. CellEngine should probably not be retaining that many layouts. It would be better to page them in and out, only creating all of them when needed (measuring).
- Loading branch information