On 3/3/14 2:28 PM, Felipe G wrote:
A possible solution to that is to only pause the page that is being translated 
(with,
say, EnterModalState) until we can finish working on it, while letting
other pages and the UI work normally.

The other pages can still modify the DOM of the page in question, right? It'll just be a bit more rare...

Another option exists if it's possible to make a fast copy of the whole
DOM, and then work on this snapshot'ed copy which is not live.

How feasible is just doing .innerHTML to do that, then doing some sort of async parse (e.g. XHR or DOMParser) to get a DOM snapshot? That said, this would mean that you end up with a snapshot that's actual DOM stuff, on the main thread.

Better yet if we can send this copy with a non-copy move to a Worker thread.

You could send the string to a worker (if you do this in C++ you won't even need to copy it, afaict), but then on the worker you have to parse the HTML... That said, there might be JS implementations of an HTML5 parser out there. There's definitely some tradeoff here for the string and the parsed representation and all the parsing code, though. :(

-Boris

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to