Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A slow JS-based HTML parser with good error feedback and debugging metadata.
JavaScript
branch: gh-pages

This branch is 236 commits ahead, 60 commits behind mozilla:gh-pages

Added documentation via Brocco, replaced toolness refs w/ mozilla.

Information about Brocco: http://toolness.github.com/brocco/

Also got rid of demo/editor/index.html, since it was a stub and I doubt
anything references it anymore.
latest commit 61b4092669
@toolness authored
Failed to load latest commit information.
LICENSE_files forgotten CSS files for MPL
demo
spec Added documentation via Brocco, replaced toolness refs w/ mozilla.
test Added documentation via Brocco, replaced toolness refs w/ mozilla.
vendor
.gitignore
LICENSE.html
README.md
index.html Added documentation via Brocco, replaced toolness refs w/ mozilla.
slowparse.js Added documentation via Brocco, replaced toolness refs w/ mozilla.
tree-inspectors.js

README.md

Slowparse is an experimental JavaScript-based HTML parser for Mozilla Webmaking initiatives.

Until now, most of Mozilla's Webmaking experiments that involve writing HTML (lovebomb.me, Storything, X-Ray Goggles, etc) have used .innerHTML to parse HTML into a DOM. However, this has a number of disadvantages:

  • It's difficult to map an element in the generated DOM back to its location in the original HTML source code. This is useful in a variety of scenarios such as Jessica Klein's lovebomb mockups and webmaker tutorials.

  • It's completely insecure. For our webmaker initiatives that really need to scale, we'd like to have more fine-grained control over what kinds of elements and attributes are allowed in code.

  • It can be difficult to help the user pinpoint errors in their code, e.g. mismatching tags.

Slowparse is intended to solve all of these problems. It parses HTML and uses a host DOM implementation to create the DOM representation of the page. Each generated DOM node has an expando property called parseInfo which provides metadata mapping the location of the node in the original source code. It also provides detailed error feedback so that users can easily pinpoint why their code isn't working the way they intend.

For more information, see:

Something went wrong with that request. Please try again.