Change the key type of CheckedRadioButtons::NameToGroupMap: StringImpl* -> AtomicString.

We had to manage the map lifetime and HTMLInputElement, which owns the
StringImpl, lifetime strictly. It made some optimization harder. Using
AtomicString is much simpler.

BUG=334556
TEST=none; no behavior changes.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165622 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Right align alt-text for RTL images

Change the rendering of image alt text to render the text right aligned
for images with RTL direction.

BUG=326921
TEST=fast/text/bidi-img-alt-text.html
R=leviw@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165623 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[import] Get rid of ad-hoc state machine.

This change removes its error-prone state transition logic from HTMLImport.
Instead, it introduces invalidate-and-recalc state model like style calculation.

In this model,

 * Possible state change is notified by HTMLImport::stateWillChange(),
   which schedules tree-wide state recalculation, that is done by
   HTMLImport::recalcTreeState() static member function.

 * HTMLImport::recalcTreeState() traverses the import tree
   and recomputes the state of each import through recalcState().

 * If the state of an import has changed, it gets stateDidChange() notification.
   This single notification replaces old didXxx() notification functions.

 * Per-import state calculation is extracted as HTMLImportStateResolver class.
   This class does compute the state based on the loader status and
   the state of other imports whose states should be already updated.

Although this doesn't stop maintaining the explicit state for
performance reasons, this recalc model is much more easy to reason
thus less error prone than original state machine model.

As a bonus, crbug.com/336646 is gone.
A crash reported there happened due to incorrect m_state value
and this change fixes it by giving correct state value.

On import-events-inline.html: The change happened to reveal a timing problem (crbug.com/336113).
It should be fixed in coming changes

TEST=import-events-inline.html, import-shared-crash.html
R=dglazkov, dominicc
BUG=336646

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165624 bbb929c8-8fbe-4397-9dbb-9b2b20218538
IDL compiler: [PutForwards]

The code generation is v. simple.

The complexity of this feature is that we want to introspect another
interface.

The Perl code does this by the CG reading in the file (!!),
which of course makes a mess of dependencies.
(Interfaces *should* depend on the target of [PutForwards], but they don't.)

Instead, we handle this in the dependency resolution
(compute_dependencies and interface_dependency_resolver);
the only CG change is that we make interfaces available as a global
(it's the global context), so the CG can introspect these as necessary.

If we want to add introspection of other interfaces, it's now an easy
change: just add the interface name in compute_dependencies, and everything
else is handled automatically!

This also ensures that dependencies are correctly calculated, as all the
dependencies are calculated in one place, instead of randomly called in
the CG.

There's a little bit of plumbing and refactoring, but that's it.

BUG=239771
R=haraken

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165625 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add methods to WebTestingSupport to detect memory leaks at content_shell

Added a functions to clean up and count DOM objects. This is intended to be used for leak detection. At the layout test, about:blank is loaded before and after one test, and by comparing the numbers of objects at about:blank, we can detect a leak.

https://docs.google.com/a/chromium.org/document/d/1sFAsZxeISKnbGdXoLZlB2tDZ8pvO102ePFQx6TX4X14/edit#

BUG=332630

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165626 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Align '<meta name="referrer" content="invalid">' behavior with CSP 1.1.

CSP 1.1 specifies that a 'referrer' directive with an invalid value
fails closed by setting the Document's referrer policy to 'never'[1].
This behavior conflicts with the <meta> definition on the WHATWG
wiki[2].

This patch resolves the conflict by preferring CSP's behavior. Since we
didn't have any tests for our behavior in the case of an invalid
referrer, I suppose that's acceptable. :)

Additionally, this patch adds a counter for sites which change their
referrer policies on the fly. That behavior is explicitly allowed by the
<meta> spec, and explicitly disallowed by the CSP spec. Depending
on usage in the wild, it would be nice to change one or the other of
these specifications.

[1]: http://w3c.github.io/webappsec/specs/content-security-policy/csp-specification.dev.html#referrer
[2]: http://wiki.whatwg.org/wiki/Meta_referrer#Specification

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

git-svn-id: svn://svn.chromium.org/blink/trunk@165627 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[CSS Blending] background-blend-mode fails for certain SVG files.
Porting webkit fix from https://bugs.webkit.org/show_bug.cgi?id=127350:
The graphics context of the SVG inherits the blend mode set on the
background layer. Fix consists in drawing the SVG in a transparency
layer.

BUG=229166

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

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