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)