On Mon, Mar 3, 2014 at 10:19 PM, Boris Zbarsky <[email protected]> wrote: > 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?
Seems more efficient to write the walk in C++, since the innerHTML getter already includes the walk in C++. How important is it to avoid C++? On Mon, Mar 3, 2014 at 10:45 PM, Ehsan Akhgari <[email protected]> wrote: > There's https://github.com/google/gumbo-parser which can be compiled to js. The parser we use in Gecko can be compiled to JS using GWT. However, the current glue code assumes the parser is running in the context of a browser window object and a browser DOM. Writing the glue code that assumes something else about the environment should be easy. Also, David Flanagan has implemented the HTML parsing algorithm (pre-<template>; not sure if updated since) directly in JS. On Tue, Mar 4, 2014 at 1:57 AM, Andrew Sutherland <[email protected]> wrote: > The Gaia e-mail app has a streaming HTML parser in its worker-friendly > sanitizer at > https://github.com/mozilla-b2g/bleach.js/blob/worker-thread-friendly/lib/bleach.js. On Tue, Mar 4, 2014 at 7:14 AM, Wesley Johnston <[email protected]> wrote: > Android also ships a parser that we wrote for Reader mode: > > http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/JSDOMParser.js It saddens me that we are using non-compliant ad hoc parsers when we already have two spec-compliant (at least at some point in time) ones. -- Henri Sivonen [email protected] https://hsivonen.fi/ _______________________________________________ dev-platform mailing list [email protected] https://lists.mozilla.org/listinfo/dev-platform

