HTMLImportLoader does not need to be ref-counted.

Since HTMLImportsController controls the lifetime of HTMLImportChild
instances, there's no need for HTMLImportLoader to be ref-counted.
We can just let it be owned by HTMLImportsController, as well.

R=morrita
BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174975 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[DevTools] Fix regression: console message doesn't filter by source url.

BUG=376770

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174976 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Encoding API: Expose 'fatal' and 'ignoreBOM' readonly attributes

From private conversation with annevk - make the properties of the
TextDecoder object inspectable.

BUG=375847

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174977 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Rebaseline fast/events/onerror-no-constructor.html

Forgot to do this during my last gardening stint :(

BUG=369600
TBR=ojan

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174978 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Simplify ProgressEvent dispatching methods for readability

This reduces methods exposed on the throttle class and makes
throttling details hidden to XMLHttpRequest class.

- Use dispatchProgressEvent also for loadstart event
- Remove "throttled" from method names
- Move if-clause to switch how to dispatch a ProgressEvent based on its
  name to XMLHttpRequestProgressEventThrottle::dispatchProgressEvent()
- Remove dispatchThrottledProgressEvent and just call
  m_progressEventThrottle.dispatchProgressEvent for each event
- Make XMLHttpRequestProgressEventThrottle::dispatchEvent() private

BUG=none

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174979 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fixing GraphicsContext state checks to support oilpan

Debug assertions in the GraphicsContext destructor were
dependent on object destruction order, which made them
incompatible with oilpan. The state validation logic
was refactored to make the state validation checks more
useful.

BUG=370793

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174981 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge ChildNodeInsertionNotifier and ChildNodeRemovalNotifier into ContainerNode

We don't really need these classes anymore, we can just use methods on
ContainerNode. This gets us one step closer to completely eliminating
ContainerNodeAlgorithms which now only contains one shared method related
to SVGElementInstance and cleanup code that Oilpan will eliminate.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174982 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Change clip rect computation for multicol

Change the way clip rects are determined for multicol by using enclosing
IntRect instead of pixelSnappedIntRect to ensure that the colum contents
fully fits within the clip rect.

R=leviw@chromium.org, mstensho@opera.com

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174983 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Prevent <canvas> destructor from causing nested garbage collection

In the destruction of HTMLCanvasElement, we call
HTMLCanvasElement::existingDrawingContext(), whose behavior was changed
incorrectly in r162330 and was triggering the allocation of an ImageBuffer
during tear-down.  This is not only wasteful, but it can trigger a
garbage collection because the creation of an ImageBuffer will increase
the amount of externallay allocated memory that is declared to V8.
Triggering a GC during the finalization of a garbage collected object
is bad.

BUG=378289

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174984 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Avoid redundant initialization of GraphicsContextState.

When creating a new GraphicsContextState the constructor initializes the state
with various default values. In GraphicsContext::realizePaintState we immediately
overwrite these values after creation. This patch adds a copy constructor to
GraphicsContextState to avoid that.

Even though this seems like a clear win, the benefits are not visible when
profiling. Looks like the overhead of the redundant initialization is
not very large. Still seems worth fixing though.

BUG=377687

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174985 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Simplify Blink <-> V8 Microtask queue running protocol

V8 now implements Isolate::RunMicrotasks() in C++, which means its callers
no longer need to enter V8 Context::Scope before calling it. This simplifies
WebCore::Microtask::performCheckpoint, and gets us one step closer to ditching
V8PerIsolateData::ensureDomInJSContext().

This patch also gets rid of most of the microtask-related logic in
ScriptPromiseResolverWithContext, allowing WebCore::Microtask::performCheckpoint
to be the only code in Blink that calls Isolate::RunMicrotasks().
Instead of triggering microtask delivery directly, or via the RunMicrotasksTask,
ScriptPromiseResolverWithContext now utilizes V8RecursionScope to "simulate"
a JavaScript stack (from Blink's point of view). In workers, this will
result in a RunMicrotasks() call when the V8RecursionScope is destructed.

There are still two FIXMEs:
  - The V8RecursionScope discussed above would be unnecessary if there were
    a WebThread::TaskObserver on worker threads to handle microtask-running
    at the end of each task.
  - ensureDomInJSContext() is still needed in order to instantiate the v8::Functions
    that are passed into Isolate::EnqueueMicrotask(). Fixing this will require
    more work on the V8 side to allow passing in a C++ callback directly.

BUG=374772

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174987 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Don't repaint button when its click() method is called

When click() method is called, previously we change the active status
of the element to true and then back to false. This doesn't change
anything for a button (or other elements that status doesn't change
after click()) but causes a repaint.

Don't change active status when click() method is called. (Elements
that status changes after click() call (e.g. checkboxes) will still
repaint.)

This doesn't change how we handle real mouse down/up/click events.

BUG=369358
TEST=fast/repaint/button-checkbox-click-method-repaint.html
TEST=fast/events/button-mouse-active.html # ensures :active is correct on real mouse down events.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174988 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fix under-repaint in non-RAL mode

The under-repaint occurs in non-RAL mode when an object needs both
repaint and non-full layout. https://codereview.chromium.org/265703012/
caused this because it skips the direct repaint() call in the above
case.

BUG=376306
TEST=fast/repaint/change-text-content-and-background-color.html

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174989 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fix crash in the flakiness dashboard server.

In theory, this case should never happen, but clearly there's
a bug somewhere. I don't have time to dig into the bug right now,
so just bandaid over it by returning the empty string. This will
mean the old data is lost, since we basically treat this as an
empty file, but at least we start collecting the new data.

We'll still log the error though, so we can grep the log to find
these cases in the future and fix them.

BUG=377594
NOTRY=true

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174990 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add a page that shows all the bots that fail to load results in the flakiness dashboard.

I'd like to drive this number down to zero. Having a list of issues to
drive down is the starting place.

Mostly this just requires exposing a few more bits from builders and
loader. Otherwise, it's just going through the motions of loading
each result for testtype/group combination and seeing which ones
fail.

NOTRY=true

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174991 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Don't round x-axis for text runs when subpixel font scaling is enabled

When subpixel font scaling is enabled text runs are positioned at
subpixel boundaries on the x-axis and thus there is no reason to snap
the x value.
We still round the y-axis to ensure consistent line heights.

BUG=164167
R=leviw@chromium.org, mstensho@opera.com

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174992 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add aggregated stats to selected trace event details

BUG=361045

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174993 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add Apple copyright notice to HTMLSrcsetParser

When porting the original srcset parser from WebKit, the code was split from
HTMLParserIdioms into a separate file - HTMLSrcsetParser.
The Apple copyright notice of that code was mistakenly not copied to the new file.
This CL corrects this.

BUG=
TBR=pdr

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174994 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Adding cache for security origin validations in 2D/WebGL canvases

There used to be a similar cache before r168864. The old cache
system did not survive the refactoring, which caused a measurable
performance degradation on several mobile platforms.  This change
reinstates it in a refactored form.

BUG=354565
TEST=jsgamebench telemetry on android

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174995 bbb929c8-8fbe-4397-9dbb-9b2b20218538
DevTools: implement enable/disable commands in DOMAgent

BUG=

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

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