Implement Encoding API

Initial implementation, behind the experimental features flag.

Tests are derived from my JS impl: code.google.com/p/stringencoding/

Many of the tests have FAIL results, due to a mix of:
* Mismatch between canonical encoding names
* Unsupported encodings from the spec
* Extra encodings (e.g "us-ascii") that are mapped differently in the spec
* Issues with streaming encode/decode (e.g. split UTF-16 code units)
* Possible encoder differences

In other words, there's still a lot of work to do.

BUG=243354
R=dglazkov@chromium.org

Review URL: https://chromiumcodereview.appspot.com/15901002

git-svn-id: svn://svn.chromium.org/blink/trunk@155379 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Reimplement Shadow DOM distribution as a tree walk

This reimplements Shadow DOM distribution as a top down tree walk where at recalcStyle
time we distribute the whole tree. We now track which ElementShadows need redistribution
with a flag and then track on the host and all its ancestors that children need to go through
Node::recalcDistribution() just like recalcStyle.

This patch makes ShadowDOM/LargeDistributionWithLayout:Runs perf test an astounding
25-30% faster! The rest of the perf tests seem about the same, maybe 1-2% faster.

To make this work I also had to make Node::lazyAttach traverse through ShadowRoots just like
in the original patch http://src.chromium.org/viewvc/blink?view=revision&revision=154720 but
now distribution is not in the middle of recalcStyle so we won't hit assertions there.

I also had to teach InsertionPoint how to lazyAttach its distribution. This turns out to be
the source of the original bugs related to distribution. If you called lazyReattach() on an
InsertionPoint it would do ::detach() which detaches the distributed nodes since
InsertionPoint::detach walks over m_distribution, but then it only does setAttached() and
setNeedsStyleRecalc() inside lazyAttach on the InsertionPoint leaving all the distributed
nodes in the tree detached which is bad and confuses the style recalc and distribution code
later.

BUG=264064

Review URL: https://chromiumcodereview.appspot.com/20213002

git-svn-id: svn://svn.chromium.org/blink/trunk@155380 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add a release assert when painting text without a layout.

This patch adds a release assert when painting text without a layout.
Until the larger issue in crbug.com/264211 is finished this will
prevent bad things from happening with a partially laid out tree.

BUG=264211

Review URL: https://chromiumcodereview.appspot.com/20664003

git-svn-id: svn://svn.chromium.org/blink/trunk@155381 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Avoid reaching for StyleResolver::m_features from StyleBuilder.

In order to inform style invalidation machinery, we have to keep track
of all styles that depend on DOM state. This bookkeeping is provided
by RuleFeatureSet, which is unfortunately hosted on StyleResolver.

This means that whenever we apply a "content: attr(foo)" property,
we must reach for m_features and add stuff to it.

This change avoids direct reaching by accumulating values on StyleResolverState.

No change in behavior, so no tests.

BUG=259085
R=eae, eseidel, esprehn

Review URL: https://chromiumcodereview.appspot.com/20672003

git-svn-id: svn://svn.chromium.org/blink/trunk@155382 bbb929c8-8fbe-4397-9dbb-9b2b20218538