Move GraphicsContextStateSaver into its own file.

Updates all call sites. Those that were including GraphicsContext
now include this, which in turn will pull in GraphicsContext.
Oddly, some things were using GraphcisContext implicitly and
needed this added as a header (since GraphcisContext no longer
includes it).

R=pdr@chromium.org,jamesr@chromium.org
BUG=237930

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

git-svn-id: svn://svn.chromium.org/blink/trunk@149741 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Move StyleResolver::State into separate file

Rename StyleResolver::State to StyleResolverState and move it out of
StyleResolver.h as it is being used outside of StyleResolver. This will
allow further work to move more functionality out of the StyleResolver
class.

R=eseidel@chromium.org
BUG=237982
TEST=No new tests, no change in functionality

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

git-svn-id: svn://svn.chromium.org/blink/trunk@149743 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Improve mitigation from r109406 to reset layout root in cases when document is getting destroyed.

BUG=209604
TEST=No test since it is flaky and will be tracked in a seperate functional bug to analyze why RenderSVGRoot is left as a layout root. Fix tested under ASAN.
R=schenney@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@149745 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove even more unused files in Source/wtf

Some classes were never used (CheckedBoolean), the other had some
methods or #include which were unneeded and hid this fact.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@149746 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Focus the affected frame on long press to select text

When long press selects text, it should also focus the frame containing that text.

BUG=168163

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

git-svn-id: svn://svn.chromium.org/blink/trunk@149747 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Move SVG animated property methods' implementation out of header files.

Currently, DECLARE_ANIMATED_PROPERTY fully expands 9 methods for each animated
property declared in SVG DOM classes. Since SVG animated properties are heavily
used, this introduces quite a bit of preprocessor bloat.

This patch moves the implementation of animated props methods into
DEFINE_ANIMATED_PROPERTY (and out of the header files). What we get:

* reduced preprocessed file size (SVGUseElement.cpp/gcc: 3518773 -> 3500411)
* faster build times (re-build after touching SVGElement.h reduced by ~2s out
  of about 1min total on a z620 workstation/Linux/gcc/ninja).
* no measurable performance impact.

BUG=237192

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

git-svn-id: svn://svn.chromium.org/blink/trunk@149749 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Use shouldRecalcStyle in Document::recalcStyle

We should use the shouldRecalcStyle helper in Document instead
of duplicating the logic for checking if we should call recalcStyle.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@149751 bbb929c8-8fbe-4397-9dbb-9b2b20218538
CSP: Check inline event handlers on each run, not only the first.

Injecting a policy into an existing document currently allows inline event
handlers to continue executing as long as they were executed once before
the policy was injected. This patch adjusts the check to ensure that it
always blocks execution.

BUG=237104

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

git-svn-id: svn://svn.chromium.org/blink/trunk@149752 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add FIXME about empty creation contexts

This issue was raised in IRC with dominicc@.
It would be better to have a FIXME until we fix it.

R=abarth,eseidel

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

git-svn-id: svn://svn.chromium.org/blink/trunk@149753 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Simplify and add caching for accessible bounding box calculation.

There were several mostly-redundant methods to compute the
bounding box rect of an accessible object. Simplified those all
to just one, elementRect(), which returns the absolute-coordinate
bounding box of the object in frame coordinates.

Adds a system to cache the rect so that the computation of the
absolute coordinates is really fast when it hasn't moved.
Relies on the fact that a RenderBox has a frameRect in local
coordinates that can be accessed directly; no computation is
needed.

Each AccessibleRenderObject caches its element rect and frame
rect lazily, along with a flag indicating if they're dirty.
If the frame rect changes, it invalidates all of its
children (marks them as dirty). When querying the (global) element
rect, it checks all of its parents - if none of them are dirty,
it can use the cached element rect.

I believe that the runtime to recompute the bounding rect of
every element in the tree is O(n * d), where d is the depth.
This is fine, lots of other accessibility code also requires a
quick walk up the parent chain; there's no easy way around this.

Perhaps we should rename elementRect and frameRect while we're
at it? How about elementRect -> absoluteRect and frameRect ->
localRect?

BUG=222636

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

git-svn-id: svn://svn.chromium.org/blink/trunk@149754 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add an 'isReadOnly' member to IDL parse tree structure

It is rediculous to set an attribute type as 'readonly attribute' in IDLParser
and then check 'if (type =~ /readonly/)' in CodeGeneratorV8.pm.

R=abarth,eseidel

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

git-svn-id: svn://svn.chromium.org/blink/trunk@149755 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[Replaceable] attributes must be readonly

Web IDL spec: http://dev.w3.org/2006/webapi/WebIDL/#Replaceable

This change doesn't affect generated code, because the code generator
already assumes that [Replaceable] attributes are readonly.

R=abarth,eseidel

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

git-svn-id: svn://svn.chromium.org/blink/trunk@149756 bbb929c8-8fbe-4397-9dbb-9b2b20218538
REGRESSION(r140907): Incorrect baseline on cells after updating vertical-align

Merge from WebKit http://trac.webkit.org/changeset/149553

Reviewed by Julien Chaffraix.

Source/WebCore:

If a cell changes vertical-align any intrinsic padding it has is now redundant. It
needs to calculate its new height from RenderTableRow::layout() and then find its
new intrinsic padding in RenderTableSection::layoutRows().

Test: fast/table/correct-baseline-after-style-change.html

* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::styleDidChange):

LayoutTests:
* fast/table/correct-baseline-after-style-change-expected.html: Added.
* fast/table/correct-baseline-after-style-change.html: Added.

BUG=233120

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

git-svn-id: svn://svn.chromium.org/blink/trunk@149757 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Make NavigationScheduler correctly track user gestures.

If a navigation is scheduled while a user gesture is active, store a token
for the gesture and use it to reinstantiate the UserGestureIndicator instead
of creating a new one all the time

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

git-svn-id: svn://svn.chromium.org/blink/trunk@149759 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove unused BindingState abstraction

The existing BindingState::instance() method returned an instance
of an empty class, which was then ignored by any method it was passed to.
This patch removes the BindingState argument from activeDOMWindow(),
firstDOMWindow(), and currentDocument() and moves them into V8Binding.h.

R=haraken@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@149761 bbb929c8-8fbe-4397-9dbb-9b2b20218538
RefPtr FrameView since updateWidgets call can blow us from underneath.

BUG=236245
R=japhet@chromium.org

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

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