[RAL] Reduce SVG tree walks

This is based on an earlier patch from <fs@opera.com>.

The performance regression mostly came from excessive tree walks
on SVG_SvgCubics (with only a tiny part of it came also from
extra invalidations).

This change re-introduces what
SVGRenderSupport::checkForSVGRepaintingDuringLayout was doing to
prevent invalidation by checking if your parent had a transform
change, except that we use it to avoid entire subtree walks.

On my Z620, this changes the results of SVG_SvgCubics as follows:
- RAL without patch: 16 ms (std: 0.5)
- RAL with patch: 8.8 ms (std: 0.4)
- Pre-RAL: 9.2 ms (std: 0.3)

BUG=381138

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

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

Since we don't have the SVGInstance tree anymore we can get rid of this
template dispatcher.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175984 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fix some SVGFonts compilation errors

Fix some SVGFonts compilation errors that are seen when turning off the compile time flag SVG_FONTS.

BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175985 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove GraphicsContext::fastMod and ::isDrawingToLayer.

fastMod has been dead code for over one year (since I removed the only call site):
https://chromiumcodereview.appspot.com/14718009

isDrawingToLayer is trivial, and its only call site is inside GraphicsContext.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175986 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Start removing the double-negative !ASSERT_DISABLED

This CL is a simple s/if !ASSERT_DISABLED/if ASSERT_ENABLED/.
Subsequent CLs will clean up the remaining uses and then delete the macro.

NOTRY=true
R=dglazkov@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175987 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Initial ServiceWorker CacheStorage API polyfill.

This provides CacheStorage, the namespace of caches, although without
serialization. The idea is to let us test this API end-to-end early,
and we can replace it with something more sophisticated as we
progress.

R=jsbell@chromium.org,falken@chromium.org,jkarlin@chromium.org,asanka@chromium.org,slightlyoff@chromium.org,jakearchibald@chromium.org
TBR=jochen@chromium.org
BUG=374822

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175988 bbb929c8-8fbe-4397-9dbb-9b2b20218538
SVG: no need to call |clearAnimatedType| at SVGAnimate{,Motion}Element dtor.

The deleted code was used to ensure the ASSERT(!isAnimating()) on ~SVGAnimatedProperty.
The assert checks that animation is always stopped when the element is dead. However, the assert is removed now, so we don't need to ensure it.

The deleted code |clearAnimatedType| in ~SVGAnimateElement was triggered when a document was unloaded and its <animate> element was destructed before its target svg element. This stopped animation on the target svg elements before the ASSERT run.

BUG=370834

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175989 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Oilpan: Prepare to move FormSubmission to Oilpan heap.

This removes two Persistent<>s, and add one Persistent<>.

BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175990 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add a UMA histogram for type of web font usage

This patch adds WebFont.PackageFormat histogram that tracks the usage of
different format of web fonts. It records container format of font file;
both TrueType fonts and OpenType fonts are recorded as SFNT format.
If a font didn't pass OTS sanitization, it's recoreded as Unknown.

BUG=380988
TEST=manually tested with chrome://histograms

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175991 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove support for CompositingReasonPositionSticky

Our support for position: sticky isn't even in the experimental feature set. We
shouldn't be burning time during every frame checking whether any RenderLayers
have sticky position.

R=esprehn@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175992 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove scoped styles (retry)

Removes <style scoped>.

This was discussed and approved with LGTMs in blink-dev:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/R1x18ZLS5qQ/Bjuh_cENhlQJ

Chrome status dashboard entry:
http://www.chromestatus.com/features/5374137958662144

The previous one failed to land due to stale generated file issues and browser test failures (3 times):
https://codereview.chromium.org/310443002/ (original CL)
http://crrev.com/175550 -> http://crrev.com/175552 (stale generated file issue)
http://crrev.com/175555 -> http://crrev.com/175561 (stale generated file issue)
http://crrev.com/175720 -> http://crrev.com/175754 (browser test failures)

Browser test failure was due to HTMLStyleElement refcounting mismatch
in ShadowRoot.  This CL fixes the issue and adds a layout test
fast/css/shadow-style-removed-out-of-document.html
to catch the condition.

Note:
This is based on esprehn's original cl:
https://codereview.chromium.org/214693002/

BUG=379096
TEST=pass all layout tests and do not break any existing tests

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175993 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Make all CSSSelector data members private

Make all CSSSelector data members private. Previously, some of the data members
such as m_relation / m_match / m_pseudoType were public and accessed directly
from outside the class. The new approach is better because:
- Those members are bit fields so by using getters, we can hide the casts inside
  the getters. The setters can now also check that the bitfield is big enough to
  actually store the enum value.
- When using those in switch() statements, the compiler now complains if we fail
  to test some of the enum values as the value is now an enum, and not merely an
  unsigned integer.
- Some of these members already has getters (e.g. relation(), pseudoType()).
- Better encapsulation.

R=esprehn@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175994 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add ByteString support to IDL bindings

ByteString is like DOMString, but should throw TypeError 
during the V8->C++ hop if script tries to set a string with a 
code unit greater than 0x00FF. No enforcement is done on the 
C++->V8 side.

R=nbarth@chromium.org
BUG=347426

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175995 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Delete RenderLayerCompositor::requiresOverhangLayers

This function just returns whether we're the main frame.

R=jamesr@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175996 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Qualify the generated includes in platform.

BUG=381876

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175997 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Forbid creating new wrapper from SetWrapperReferenceTo

SetWrapperReferenceTo IDL attribute is a hack to use V8 wrapper reference
to avoid reference cycles in Blink. The |visitDOMWrapper| callback is
used to create a temporary strong reference between the wrappers in GC
prologue.

Before this patch, |visitDOMWrapper| was allowed to create a new wrapper
if the wrapper for target object didn't exist. However this is dangerous,
as the target object may be already destructed. The target wrapper must
already exist for this reference hack to work correctly.

This patch forbids creating a new wrapper from |visitDOMWrapper| callback,
and adds an ASSERT that checks that the target object wrapper already
exists.

BUG=None

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175998 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Delete scrollingCoordinatorEnabled setting

The scrollingCoordinatorEnabled setting is redundant with acceleratedCompositingEnabled.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175999 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Flex box word-wrap is not adhering to spec

The items that are set to flex-wrap and have a single flex line currently
has their cross size adjusted according to the max of the items cross size.
According to the specification section 9.4 number 8 point, it states that:

If the flex container has only one flex line (_even if it’s a multi-line
flex container_) and has a definite cross size the cross size of the flex line
is the flex container’s inner cross size.

link: http://www.w3.org/TR/2014/WD-css-flexbox-1-20140325/#cross-sizing

This patch fixes this bug by removing the condtion that checks if it's
a multiline container or not and based on that set flex line cross size.

Bug=362848

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176000 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Oilpan: |SVGViewSpec::m_contextElement| should be a member.

r175772 changed lifetime of SVGViewSpec to be always same as SVGSVGElement,
so this weak-ref can now be made a strong-ref.

BUG=357163

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176001 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add RELEASE_ASSERT for ensuring that we have no empty context to V8WrapperInstantiationScope.

BUG=369451

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

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