script: Inline some hot functions used in flow constructions.

9% improvement in style recalc on the rainbow page.
Added refs to Element's DOM spec

This is a sub-task for #1660.
Added refs to live HTMLCollections issue
Fixed FIXME message as pointed out by jdm
Rename starts_*_flow to is_*_flow
Move DOMString into servo_util.
Add str.rs.
auto merge of #1694 : Ms2ger/servo/move-DOMString, r=SimonSapin
style: Separate out style structs into inherited and initial structs.

This doesn't make much of a difference in performance, but will be
necessary for style struct sharing.
layout: Stop storing intermediate applicable declarations inside layout
data.

9% improvement in style recalc on the rainbow page.
layout: Implement basic style sharing.

No improvement on the rainbow page, but necessary for some other
optimizations we want to do.
layout: Cache applicable-declarations-to-computed-values mappings.

If the cache is hit, then we can only compute inherited properties. This
is a WebKit optimization.
style: Eliminate a temporary vector when performing selector matching.

26% improvement in style recalc on the rainbow page.
layout: Aggressively try to share styles with the last few nodes seen.

This roughly implements the same cache found in Blink. 50% improvement
on the rainbow page, but at the cost of reducing parallel gains down to
nothing. I added a new page, `perf-rainbow-hard.html`, which disables
the optimizations in both Blink and Servo.
auto merge of #1644 : pcwalton/servo/style-sharing, r=larsbergstrom

This series of patches implements style struct sharing as found in existing browser engines, as well as a bunch of related important optimizations. With them, we are faster than Blink, WebKit, and Gecko on the rainbow page for style recalc in sequential mode by at least 15%. Parallel gains are mixed—the rainbow page turns out to be a degenerate sequential case for the LRU cache used to track candidates for style sharing and so there is no improvement. For cases in which the cache is not hit, such as `perf-rainbow-hard.html`, we are around 25% slower than Blink sequentially, but have very large parallel wins so that we are around 2x faster at style recalc. (Note that parallel flow tree construction will improve this further.)

This patch series also fixes, as near as I can tell, some bugs related to ordering of properties that other properties depend on in selector matching.

r? @larsbergstrom
feedback? @SimonSapin (for selector matching changes)
feedback? @bzbarsky (for style sharing heuristics)
Change Text, Comment and ProcessingInstructions parent name from element to characterdata

All other node's parent type names reflect the actual type of the parent. This change extends that convention to the indicated nodes.

closes #1594
auto merge of #1702 : quandrum/servo/element_to_characterdata, r=jdm

... to characterdata

All other node's parent type names reflect the actual type of the parent. This change extends that convention to the indicated nodes.

closes #1594
Simplify string construction in InterfaceObjectToString.
Use DOMString in a few more places in utils.rs.
Use DOMString instead of ~str in a few places.