StyleResolver should update RuleSets lazily.

This is a fixing patch for preformance regression caused by r159957.
Before applying r159957, removing a style element (or modifying a style element's textcontent)
destroys StyleResolver, e.g. style.textContent = '';

After applying r159957, we don't need to destroy StyleResolver.
The r159957 makes us to avoid FullStyleRecalc and full RuleSet re-creation (document,
and shadow trees).

But the patch caused Parser/css-parser-yui.html's performance regression.
Because firstly the performance test destroys StyleResolver and skip StyleResolver::appendAuthorStyleSheets.
(If we have no StyleResolver, we don't need to update RuleSet, StyleInvalidationAnalysis, and so on)

So we should update RuleSets lazily. This solution improves Parser/css-parser-yui.html's performance again.

BUG=305885,308796
TEST=all existing tests should pass.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162187 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add casting helper functions for ImmutableStylePropertySet and MutableStylePropertySet.

They are helpful to detect bad casts.

BUG=309516

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162188 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Simplifying error recovery in CSS parser for @import and @namespace.

BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162189 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Avoid crash on Promise::createPending

V8PromiseCustom::createPromise takes |creationContext| parameter.
Currently we pass toV8Context(context, world)->Global() for the parameter,
but toV8Context(context, ...) returns NULL when context is a document
without a Frame.
Changed to use a newly created object for the creation
context under such situation.

R=haraken
BUG=313143

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162190 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ImageResourceTest should use DummyPageHolder to create dummy page/frame.

This is part of the effort of consolidating dummy page/frame creation.
See <https://codereview.chromium.org/72383003/> for details.

Unit-test only change.

BUG=none
R=eseidel@chromium.org

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

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