[DevTools] Emulate UA stylesheet as a part of device emulation.

BUG=320278

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

git-svn-id: svn://svn.chromium.org/blink/trunk@163257 bbb929c8-8fbe-4397-9dbb-9b2b20218538
'media/video-frame-accurate-seek.html' is super flaky.

'media/video-frame-accurate-seek.html' is flaky on all platforms, but particularly on Windows, where it's practically indistinguishable from a failing test.

http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=media%2Fvideo-frame-accurate-seek.html

BUG=326139
TBR=scherkus@chromium.org
NOTRY=true

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

git-svn-id: svn://svn.chromium.org/blink/trunk@163258 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Inline ProfileType.createProfile method

The method is only called by corresponding profile types so I just inlined profile construction and removed createProfile method from the base class.

BUG=324769
R=loislo@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@163259 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Deflake fast/frames/seamless/*

These tests are periodically failing because a newline has been added to
the 'textContent' of a frame. This seems to be because of asynchronicity
in when the frame's 'load' event triggers (either the next line has been
parsed, or it hasn't).

This patch avoids the problem by trimming the string before comparing it
to the expected string.

BUG=316380

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

git-svn-id: svn://svn.chromium.org/blink/trunk@163260 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Plugin elements always start content loading asynchronously.

Before r162073 [1], HTMLPlugInElement started content loading with two ways:
A) For NPAPI plugins, RenderEmbededObject registered itself to FrameView,
   and FrameView asked elements to start loading.
B) For other content, post attach callback for HTMLPlugInElement started to
   load the content.

r162073 made A asynchronous. We should make B asynchronous too
because dispatching event in Document::updateLayout*() is dangerous.

This CL unifies B with A. We always start content loading after layout
asynchronously.

Implementation:
We want to make the content loading asynchronous, but it should affect
the top-level 'load' event as ever. So, this CL increments Document::
m_loadEventDelayCount until starting actual loading, and
m_loadEventDelayCount should affect the load event correctly
(DocumentLoader::isLoadingInAPISense).

Also, this change unveiled another bug that ScriptLoader didn't decrement
the counter in a case of script load error (ScriptLoader and ScriptRunner).


Test changes:
* APPLET/EMBED/OBJECT content rendering have some delay.
  editing/editability/ignored-content.html
  fast/css/acid2-pixel.html
  fast/css/acid2.html
  fast/dom/HTMLObjectElement/form/nested-form-element.html
  fast/replaced/invalid-object-with-fallback.html
  http/tests/loading/nested_bad_objects.php
  http/tests/misc/acid2-pixel.html
  http/tests/misc/acid2.html
  plugins/gesture-events-scrolled.html
  plugins/user-gesture.html
  WebPageNewSerializerTest
  WebPageSerializerTest

* Also, Document::shouldScheduleLayout requires <body>
  fast/dom/HTMLObjectElement/beforeload-set-text-crash.xhtml

* The test code was broken.  It seems a function has never called.
  http/tests/media/video-in-iframe-crash.html


[1] http://src.chromium.org/viewvc/blink?view=revision&revision=162073

BUG=322348

Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=162802

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

git-svn-id: svn://svn.chromium.org/blink/trunk@163261 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fast/html/imports/import-style-link.html is flaky on all platforms.

It appears that script isn't consistently being blocked inside the imported file as the test expects.

http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=fast%2Fhtml%2Fimports%2Fimport-style-link.html has details.

BUG=326153
TBR=dglazkov@chromium.org
NOTRY=true

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

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