These members provide core functionality. The members on these classes will provide most your direct interaction.
The main document interface, including a html or xml parser.
.
This represents almost everything in the DOM and offers a lot of inspection and manipulation functions. Element, or its subclasses, are what makes the dom tree.
Specializes Document for handling generic XML. (always uses strict mode, uses xml mime type and file header)
finds comments that match the given txt. Case insensitive, strips whitespace.
This takes a string of raw HTML and decodes the entities into a nice D utf-8 string. By default, it uses loose mode - it will try to return a useful string from garbage input too. Set the second parameter to true if you'd prefer it to strictly throw exceptions on garbage input.
Given text, encode all html entities on it - &, <, >, and ". This function also encodes all 8 bit characters as entities, thus ensuring the resultant text will work even if your charset isn't set right. You can suppress with by setting encodeNonAscii = false
This helper function is used for decoding html entities. It has a hard-coded list of entities and characters.
You can use this to do an easy null check or a dynamic cast+null check on any element.
An alias for htmlEntitiesEncode; it works for xml too
The html struct is used to differentiate between regular text nodes and html in certain functions
Represents a parsed CSS selector. You never have to use this directly, but you can if you know it is going to be reused a lot to avoid a bit of repeat parsing.
These provide additional functionality for special use cases.
.
This might belong in another module, but it represents a file with a mime type and some data. Document implements this interface with type = text/html (see Document.contentType for more info) and data = document.toString, so you can return Documents anywhere web.d expects FileResources.
These provide implementations of other functionality.
.
.
This is used when you are using one of the require variants of navigation, and no matching element can be found in the tree.
Represents a HTML form. This slightly specializes Element to add a few more convenience methods for adding and extracting form data.
.
Represents a HTML link. This provides some convenience methods for manipulating query strings, but otherwise is sthe same Element interface.
This is thrown on parse errors.
.
.
.
Represents a HTML table. Has some convenience methods for working with tabular data.
Represents anything that can be a table cell - <td> or <th> html.
Represents a table row element - a <tr>
.
this puts in operators and opDispatch to handle string indexes and properties, forwarding to get and set functions.
Proxy object for attributes which will replace the main opDispatch eventually
A proxy object to do the Element class' dataset property. See Element.dataset for more info.
A collection of elements which forwards methods to the children.
for style, i want to be able to set it with a string like a plain attribute, but also be able to do properties Javascript style.
An option type that propagates null. See: Element.optionSelector
used for DOM events
This is probably not useful to you unless you're writing a browser or something like that. It represents a *computed* style, like what the browser gives you after applying stylesheets, inline styles, and html attributes. From here, you can start to make a layout engine for the box model and have a css aware browser.
This is the lazy range that walks the tree for you. It tries to go in the lexical order of the source: node, then children from first to last, each recursively.
This is a DOM event, like in javascript. Note that this library never fires events - it is only here for you to use if you want it.
This is kinda private; just a little utility container for use by the ElementStream class.
This probably isn't useful, unless you're writing a browser or something like that. You might want to look at arsd.html for css macro, nesting, etc., or just use standard css as text.
Translates a css style property-name to a camel cased propertyName
This delegate is called if you call Element.computedStyle to attach an object to the element that holds stylesheet information. You can rebind it to something else to return a subclass if you want to hold more per-element extension data than the normal computed style object holds (e.g. layout info as well).
Parts of the CSS selector implementation
.
helper function for decoding html entities
Parts of the CSS selector implementation
Normalizes the whitespace in the given text according to HTML rules.
.
.
.
Converts a camel cased propertyName to a css style dashed property-name
.
.
Parts of the CSS selector implementation
This delegate is called if you call Element.computedStyle to attach an object to the element that holds stylesheet information. You can rebind it to something else to return a subclass if you want to hold more per-element extension data than the normal computed style object holds (e.g. layout info as well).
This is an html DOM implementation, started with cloning what the browser offers in Javascript, but going well beyond it in convenience.
If you can do it in Javascript, you can probably do it with this module, and much more.
BTW: this file optionally depends on arsd.characterencodings, to help it correctly read files from the internet. You should be able to get characterencodings.d from the same place you got this file.
If you want it to stand alone, just always use the Document.parseUtf8 function or the constructor that takes a string.