some mussing,
Why the exact size is needed? can't the formula be put inside a box big enough, so 90% of the time the browser don't have to re-layout all the page?. Its other re-layour happening here? maybe the MathJax build the formula incrementally and the browser try to render every iteration? If that where the case, then It would be solvable with visibility: none; <slow render magic happends here> visibility: normal; What DOM is required? all of it? .cloneNode is very fast at cloning DOM trees. Code can operate over a clone, then copy the result. If the code is not attached to the page, maybe nothing will be rendered until you .cloneNode back your new tree.
.cloneNode is faster than WeepingAngels :D
On 26 July 2013 04:04, Peter Krautzberger peter.krautzberger@mathjax.org wrote:
Ok this is getting off-topic -- sorry -- but glad you like it :) Unfortunately, webworker isn't an option, we need the DOM. Using the PNG for size is an nice idea, but only saves one measurement, all others occur within the equation. IIRC, the basic problem is that browser are not reliable enough when it comes to em to pixel conversion; the only way to get those correctly is to layout&measure -- recursively, of course, building the equation bottom up. But you should talk to our devs if you need more information on MathJax internals.
Peter.
On Thu, Jul 25, 2013 at 7:40 AM, <<"tei''>>> oscar.vives@gmail.com wrote:
On 24 July 2013 21:12, Peter Krautzberger peter.krautzberger@mathjax.org wrote: ..
@Oscar that's the idea of bug 48036https://bugzilla.wikimedia.org/show_bug.cgi?id=48036 To test the user experience try this bookmarklethttps://gist.github.com/pkra/5500316
:-O
This is pretty. And if it still affect the browser (small freezes wen the user is scrolling) maybe the javascript can be moved to a iframe or a "web worker", so it don't run on the main javascript thread. About re-layouts, can't smart use of "min-width min-height" avoid that? you already have the size of the png as reference.