Separate compositedLayerMapping allocation from computing compositing requirements.

For layer squashing, we need to have a separate phase of compositing
update that walks the tree and assigns how each layer will be handled
(i.e. have a separate backing, no backing, or squashed into a grouped
backing). This patch creates that new function, assignLayersToBackings.

BUG=261605

Review URL: https://codereview.chromium.org/75653004

git-svn-id: svn://svn.chromium.org/blink/trunk@162390 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Reland: Initiate webfont download right after style recalc

This patch relands https://codereview.chromium.org/63713002/
which caused timeouts on layout tests.
The problem that caused the timeouts has been fixed in
https://codereview.chromium.org/75983002/.

BUG=246492
TEST=Covered by existing tests

Review URL: https://codereview.chromium.org/77223004

git-svn-id: svn://svn.chromium.org/blink/trunk@162391 bbb929c8-8fbe-4397-9dbb-9b2b20218538
We had previously flagged some RenderLayers as being composited, but
paint into their ancestors. Really, they weren't composited, but we
wanted to create the associated backing and its GraphicsLayers in order
to accomplish the following:
 - Clipping (e.g., overflow: hidden).
 - Setting preserves-3d.
 - Applying a perspective transform.

The clipping can be conveniently taken care of via the child layers'
ancestor clipping layers, and the other two tasks can be handled rather
simply with a new graphics layer in the mapping: an ancestor transform
layer. This layer is the owner of the perspective transform.

I'd thought there was one gotcha with using an ancestor transform
layer. We may have nested perspective transforms, and the bounds of the
layer plays a role in its application (it factors into the positioning
of the perspective origin), but we can only have one set of bounds for
the ancestor transform layer. The solution I came up with was to have
zero bounds for this layer, and to express the various perspective
origins with respect to the origin of the compositing ancestor in which
the layers paint.

..but as it turned out, this was not an issue at all: we only respect
the inner-most perspective transform. I've added a layout test to cover
this case and checked that the behavior is the same with this patch.

BUG=None

Review URL: https://codereview.chromium.org/74793012

git-svn-id: svn://svn.chromium.org/blink/trunk@162392 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fixed StyleSheetCollection::compareStyleSheets to not return Additive.

In the new test case, we are not adding a new stylesheet, but this code
would return Additive anyways. It has an off-by-one, where it needs
to check newIndex == newStyleSheetCount at the end of the for-loop.

I couldn't come up with a testcase where this shows a bug because
we always would end up coming through again an returning Reconstruct, but
the test included with this patch hits the buggy codepath. This
becomes a problem for RuleSets living of StyleSheetContents because
we won't process them correctly in the Additive case.

Also, fixed naming to consistently capitalize the S in Sheet.

The style-scoped test result is now wrong, but it's just exposing
an existing bug. If you load this page in content_shell and then
open the inspector, you get the same broken rendering. The old
code just happened to be passing.

I don't fully understand the fast/forms change, but since forcing
a layout fixes it, I'm assuming it's just a timing difference.

Review URL: https://codereview.chromium.org/66993010

git-svn-id: svn://svn.chromium.org/blink/trunk@162393 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Change PartitonAlloc max size constant to ~2GB.

There is one additional constant beyond the work in https://src.chromium.org/viewvc/blink?view=rev&revision=162149 that needs to be incresed to get back to parity with TCMalloc.

BUG=319393
R=cevans@chromium.org,jochen@chromium.org

Review URL: https://codereview.chromium.org/76573003

git-svn-id: svn://svn.chromium.org/blink/trunk@162394 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Move HistoryController::restore* to FrameLoader

restorScrollPositionAndViewState is left mostly intact, while
restoreDocumentState is inlined into its only callsite.

BUG=321280

Review URL: https://codereview.chromium.org/76833002

git-svn-id: svn://svn.chromium.org/blink/trunk@162395 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert 161546 "Report size of the external memory to V8 in Stati..."

We increased the maximal allocation size instead.

> Report size of the external memory to V8 in StaticNodeList
> 
> When we create a lot of moderately large NodeLists, the V8 GC heuristic
> isn't aggressively enough collecting wrappers which can lead to an OOM
> crash. Reporting the size of the nodelists to V8 fixes this issue.
> 
> The other kinds of nodelists don't have variable sized members, so they
> don't have this problem
> 
> BUG=315082
> TEST=opening PerformanceTests/Parser/query-selector-all-class.html in a release build content shell on a fast computer doesn't crash.
> R=dslomov@chromium.org
> 
> Review URL: https://codereview.chromium.org/64203002

TBR=jochen@chromium.org

Review URL: https://codereview.chromium.org/79253002

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