Call isValidProtocol() function first in order to remove duplicated protocol checking in NavigatorContentUtils

isValidProtocol() can check if protocl contains colon. If we call isValidProtocol() first in verifyProtocolHandlerScheme(), we're able to remove unnecessary protocol checking logic.

TEST=navigatorcontentutils
BUG=none

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

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

There are no callsites in Chromium.  This function is unsafe because it
ignores namespace URI.

BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176895 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Introduce SVGPropertyHelper to dedupe very similar implementations.

This CL introduces SVGPropertyHelper to dedupe:
- SVGPropertyBase c-tor calls where its argument is always classType()
- |SVGPropertyBase::cloneForAnimation()| implementations

BUG=378670

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176897 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add main world CSP bypass for isolated world iframe resource loads.

This adds support for bypass of the main world's CSP when an isolated world adds
an iframe to the page. This matches the behavior for images, scripts, styles,
etc. It is a slightly complicated case as when the resource actually loads, it
is no longer executing from the isolated world context since it is happening as
a task (even though it was created from an isolated world context).

BUG=386679
R=mkwst@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176898 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove #if ENABLE(OILPAN) from StyleEngine::m_documentStyleSheetCollection

This CL makes StyleEngine::m_documentStyleSheetCollection an OwnPtr in non-oilpan builds,
and fixes a FIXME in StyleEngine.h.

BUG=340522

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

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

The only test that fails when you remove this seems to be the one that was
added when the flag was introduced: https://bugs.webkit.org/show_bug.cgi?id=80847

Formerly we'd always go out of the shadow root when doing a hit test, which
seems to relate to some sketchy checks in EventHandler that assume when you
click an <input> that the hit test never returns an element inside it.

Seeing as no tests fail though, I think we should just remove this and then
beat down the bugs it exposes in EventHandler.cpp

BUG=386967

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176900 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Implement an infrastructure of Blink-in-JS (PrivateScriptController part)

* A design doc is here: https://docs.google.com/a/google.com/document/d/13cT9Klgvt_ciAR3ONGvzKvw6fz9-f6E0FrqYFqfoc8Y/edit

* A full CL is here:
https://codereview.chromium.org/345893002/

* This CL implements the PrivateScriptController part of Blink-in-JS.

-- PrivateScriptController::run() is a method to invoke JavaScript code. PrivateScriptController::run() is called from auto-generated code for PrivateScript interfaces.

-- PrivateScriptController.js caches all JavaScript code of PrivateScripts into window.installedClasses.

-- make_private_script_source.py converts a JavaScript file into byte stream and writes it to gen/blink/bindings/PrivateScriptSources.h

* This CL changes no behavior, since there is no customers of Blink-in-JS yet.

BUG=341031

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176901 bbb929c8-8fbe-4397-9dbb-9b2b20218538
UI tunings of repaint overlay

Tune some UIs of repaint overlay to improve its usability:

- Disable minimum-repaint related UI elements when not applicable to let
  user know when minimum-repaint is not available;

- Add 'overlay' link whenever repaint rects or minimum repaint exist.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176902 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add a comment about counter availability in M37 branch.

NOTRY=true
BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176903 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Simplify special case of EventTarget with hidden dependency action handling

This simplifies the most significant remaining special case for EventTarget
in the template code,
making both Python and Jinja much shorter.

Also a few Jinja formatting/whitespace fixes.

R=haraken
BUG=345503
TEST=fast/dom/event-target-arguments.html

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176904 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove now-working WebSocket throttling tests from TestExpectations.

BUG=343107

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176905 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert of Remove WebElement::hasTagName. (https://codereview.chromium.org/354763002/)

Reason for revert:
Broke Android build.


Original issue's description:
> Remove WebElement::hasTagName.
> 
> There are no callsites in Chromium.  This function is unsafe because it
> ignores namespace URI.
> 
> BUG=
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=176895

TBR=keishi@chromium.org,isherman@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176906 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Treat @font-face with nontrivial unicode-range as variable-pitch

Currently, FontFallbackList::determinePitch() uses only the primary font
data. This is wrong because @font-face with unicode-range may override
some characters over the primary font. So we need to go through the
fallback list. FontFallbackList is fixed-pitch iff the first available
FontData covers entire unicode-range, and that FontData is fixed pitch.

BUG=309407
TEST=fast/css/font-face-unicode-range-monospace.html

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176907 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Enable exception console logging for ServiceWorker.

Add worker inspector exception logging support like SharedWorker.

BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176908 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Added unprefixed version of Touch radius and force

Adding unprefixed version of Touch radius and force.
https://groups.google.com/a/chromium.org/d/msg/blink-dev/rjLM4KvRrjk/LnEHWYLZE8MJ

BUG=378780

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176909 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Rebaseline property-access-on-cached-window-after-frame-removed-and-gced.html

BUG=381683
TBR=jkarlin@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176910 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Peer::initialize() should wake up a worker thread after initializing Bridge::m_peer

This is another fix for threading issues of WebSocket in oilpan builds.

Currently Peer::initialize() wakes up a worker thread before initializing Bridge::m_peer. Thus the following scenario can happen:

(1) Bridge::m_peer is initialized to 0.
(2) Bridge::initialize() is called in the worker thread.
(3) Peer::initialize() is called in the main thread.
(4) Peer::initialize() wakes up the worker thread before setting Bridge::m_peer.
(5) A shutdown event is sent to the worker thread.
(6) The worker thread calls Bridge::destroy().
(7) Bridge::destroy() calls Peer::destroy() using the Bridge::m_peer that is not yet initialized.

This will hopefully fix flaky crashes of worker-reload.html and worker-reload-repeated.html in oilpan builds:

http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=%40ToT%20Blink&tests=http%2Ftests%2Fwebsocket%2Fworkers%2Fworker-reload-repeated.html%2Chttp%2Ftests%2Fwebsocket%2Fworkers%2Fworker-reload.html

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176911 bbb929c8-8fbe-4397-9dbb-9b2b20218538
DevTools: Prevent leak of target after its removing.

BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176912 bbb929c8-8fbe-4397-9dbb-9b2b20218538
SVG: Avoid adding element references on nested <use> on external document.

This has caused leak in oilpan builds.

r176803 moved element references management from per-Document ElementDependenciesMap to SVGElementRareData. This change allowed cross document SVGElement references.

In oilpan builds, these element references are made strong references. Normally, the strong reference cycles can be collected by oilpan-gc, but currently the external document is held via Persistent, so oilpan GC fails to collect the objects. The complete diagram of this reference cycle is here: https://docs.google.com/presentation/d/1U07XLSvNYa22Qfrgb0blojBraWRS235oNwxSkWecUxI/edit?usp=sharing

This patch avoids the situation by not adding element references when the target document is held by ResourcePtr. This should be safe, as the external document cannot by modified in any way. Also this reference was not present before r176803.

TEST=svg/batik/paints/gradientLimit.svg w/ --enable-leak-detection and ENABLE(OILPAN)
BUG=None

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176913 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Rename ScriptPromiseResolverWithContext to ScriptPromiseResolver.

I removed ScriptPromiseResolver at r176589.
This CL renames ScriptPromiseResolverWithContext to ScriptPromiseResolver.

BUG=386479

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

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