Add DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION() macro

Add DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION() macro that generates better
type helpers for HTML Elements:
- Generates more isHTML*Element() helpers that are consistent with the ones
  in HTMLElementTypeHelpers.h so that there is no different in behavior /
  supported arguments.
- Supports more efficient isHTML*Element() helpers that take an HTMLElement
  in argument and thus don't need to check the namespace URI, only the local
  name.

R=esprehn, adamk
BUG=346095

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

git-svn-id: svn://svn.chromium.org/blink/trunk@169466 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add null check for frame when creating WebCore::Performance.

This regression was introduced in r168256. The previous behavior
depended on whether Frame had already been garbage collected after being
removed from the DOM. If it had not been garbage collected yet, then it
would return a Performance object, but if it had, then it would return
null.

This patch adds the now-necessary check that frame is non-null and makes
the behavior consistent whether or not the underlying Frame object has
already been garbage collected, which makes Firefox's behavior.

BUG=350978
R=abarth@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@169467 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fix crash in 2D canvas drawSystemFocusRing with invalid argument.

Added missing null ptr check.

BUG=353248

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

git-svn-id: svn://svn.chromium.org/blink/trunk@169468 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Introduce WTF::releaseStore and WTF::acquireLoad.

Use them to avoid data races in the SafePointBarrier discovered by TSAN and guarantee that compiler does not move any memory accesses around m_unparkedThreadCount and m_canResume loads.

This change is likely to affect only ARM with its weakly ordered memory model.

BUG=347559

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

git-svn-id: svn://svn.chromium.org/blink/trunk@169469 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert 169465 "Move deferred loading logic from WebMediaPlayerCl..."

Android builders fail compile

One exampel: http://chromegw.corp.google.com/i/chromium.webkit/builders/Android%20Builder/builds/36609

> Move deferred loading logic from WebMediaPlayerClientImpl to HTMLMediaElement.
> 
> BUG=350571
> TEST=All layout tests still pass.
> 
> Review URL: https://codereview.chromium.org/192013002

TBR=acolwell@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@169470 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Recalc sibling styles for forward positional rules on mutations only.

Forward positional rules only affect selector matching of siblings when
nodes are added to or removed from the DOM. However, selectors with indirect
adjacent combinators may affect sibling evaluation without node addition or
removal. For instance if a class selector left of an indirect adjacent
combinator is set on an element.

Since the indirect adjacent combinator was considered as a forward
positional rule, we were recalculating sibling styles in the presence of an
nth-selector. We now split indirect adjacent selector matching as a separate
flag to be able to optimize recalc in the presence if nth-selectors and
skip sibling recalc for forward positional rules if no mutations happened.

ElementRareData and ShadowRootRareData do not increase in size since they
were already padded in the relevant parts.

R=ojan
BUG=160212

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

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