REGRESSION(r157081): Fix multipart handling of ResourceFetcher

r157081 broke multipart handling in ResourceFetcher.
The breakage was harmless except Motion JPEG case - ResourceFetcher
lost the reference to Motion JPEG resource so it was no longer
able to cancel the ongoing resource fetching.

This change makes the tracking working again.
Also, the change adds a stopFetching() call to DocumentLoder::stopLoading()
that is used to be there but was lost at some point.

This is re-landing of r171969 with a fix.

TEST=stop-loading.html
TBR=japhet@chromium.org
BUG=309641

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172081 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[pinch-to-zoom] Allow pinch viewport size to be different from main frame.

This patch allows the pinch viewport's unscaled size to be set. In normal
operation, the pinch viewport, when unscaled, will be the same size as
the main frame. However, for features like the virtual keyboard, we want
the ability to shrink the pinch viewport so that content under the keyboard
can be scrolled into view.

BUG=349941

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172083 bbb929c8-8fbe-4397-9dbb-9b2b20218538
--disable-layer-squashing should disable layer squashing

To avoid complicated three-sided CLs to enable layer squashing, we hard-enabled
squashing yesterday. Now that all the repos have caught up to each other, we
can connect --disable-layer-squashing to actually control whether layer
squashing is enabled.

R=chrishtr@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172085 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fix repaint in sub-pixel composited layers

Prior to properly accumulating sub-pixel offsets through composited layers,
there was a hack in RenderLayerRepainter to adjust repaint rects by the
sub-pixel accumulation. Now that this accumulation is properly handled in
the rest of the stack, this is no longer needed, and instead results in us
applying the sub-pixel offset twice (we'll do it again at paint-time).

BUG=362938

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172086 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Improve unprefixed MediaSource test coverage.

These changes add test cases for the unprefixed MediaSource API that are
derived from the existing prefixed MediaSource tests. These are being
added so that we don't lose test coverage when the prefixed API and
tests are removed.

BUG=363444

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172087 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Update VS2013 test expectations

Remove stale NeedsManualRebaseline expecations since VS2013 migration
and skip audio tests on win debug.

BUG=309197
TBR=scottmg@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172090 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Make window.navigator property non replaceable

Make window.navigator property non replaceable non replaceable to match
the specification:
http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#window

The new behavior also matches the behavior of Firefox 28 and IE11.

R=arv@chromium.org, tkent@chromium.org
BUG=364512
TEST=fast/dom/Window/get-set-properties.html

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172091 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Rename inCompositingMode to staleInCompositingMode.

Any code that reads the compositingMode bit when the dirty
bit is set is getting a stale value. We should remove
these callers. This patch has no change in behavior.
Just a rename.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172092 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Flush pending text after every chunk of Tokens

If you had a very slow loading page which would
hang in the middle of a text node, we would not
show the results of that text node until we
encountered the first token after that node.

This broke a web-based traceroute which used
http chunked encoding to keep the connection open
while it slowly piped the output of traceroute
over the http connection.
http://www.net.princeton.edu/cgi-bin/traceroute.pl?target=google.com&cmd=Go

This changes the behavior of our one test with a
gigantic text node by changing how the the text
is split.

I believe this also affected progressive loading of
text/plain documents.  I'm slightly surprised
no one complained.  I tested with:
http://norvig.com/big.txt
and we now progressively load that much better than
we do with dev channel chrome.

I'm not sure a good way to test this that won't be flaky.
If we encounter anything other than more text node
content in the http stream we'll immediately emit 
the pending text.  For now I'm going to presume
the one affected test is sufficient for coverage.

BUG=363974

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172094 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fix UMA collection of webfont CORS

We should check actual failures of webfont CORS because
|options().corsEnabled| won't set when the webfont has the same
origin.

BUG=286681

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172095 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Oilpan: MediaValuesDynamic should not hold a strong reference to a LocalFrame.

After r171843, Oilpan bots timed-out on LayoutTests which open windows.

This was because |window.closed| was only updated after Oilpan GC after r171843.
|window.closed| is updated when ~Frame, and last reference to the Frame was held by
StyleEngine(On-heap) --> StyleResolver -> MediaQueryEval -> MediaValues -> LocalFrame.
StyleEngine is finalized on GC, so we had to wait for a GC to have |window.closed| updated.

r171843 changed MediaValues to hold a strong reference to a LocalFrame.
This patch reverts the change to avoid MediaValues being the last reference to the LocalFrame.

I think |window.closed| relying on ~Frame is bad in Oilpan-world, and we also need to change that too, but that is to be done on a follow-up patch

TESTS=fast/dom/Window/window-early-properties.html do not [ Timeout ] on ENABLE(OILPAN)
BUG=None

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172097 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove prefixed Media Source API.

Removing prefixed Media Source API as discussed on blink-dev.
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/J_VC_Mq9wvg

BUG=363444

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172098 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert of Add [ Timeout ] to LeakExepctations to suppress Timeout failures on the Leak buildbot. (https://codereview.chromium.org/243703006/)

Reason for revert:
It looks like the bots timeout on the different LayoutTests on each run. Reverting the [ Timeout ] suppression entries.

Original issue's description:
> Add [ Timeout ] to LeakExepctations to suppress Timeout failures on the Leak buildbot.
> 
> TBR=hajimehoshi
> BUG=365202
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=172012

TBR=hajimehoshi@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=365202

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172099 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ServiceWorker unregister should not ASSERT on success.

The WebServiceWorkerProvider::unregisterServiceWorker interface
indicates the success callback accepts a WebServiceWorker. In
practice, unregister does not provide any value on success so Chrome
always passes NULL for this parameter. This wires Blink to commute
that NULL to 'undefined' for script, instead of ASSERTing
non-nullness.

Adds our first test for "unregister".

BUG=363851

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172100 bbb929c8-8fbe-4397-9dbb-9b2b20218538
compositing/overflow/iframe-scroll-children.html ASSERTs

The GraphicsLayerUpdater wasn't computing the compositingContainer correctly in
one corner case where the parent RenderLayer wasn't normal flow only. In that
case, the compositing ancestory comes from the stacking container, not just the
parent RenderLayer.

BUG=364991
NOTRY=true
R=vollick@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172101 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add a comment why raw-ptr to Frame in MediaValuesDynamic is safe.

This is a follow-up patch to r172097.

NOTRY=true
BUG=None

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172102 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Get rid of willBeCompositedOrSquashed setting for the root layer.

As best I can tell, this doesn't have any effect when we're
processing the root layer. In order to make that more clear,
I moved a bunch of code into an rootLayer and a !rootLayer
block.

Since we always process the root layer at the top of the
recursion, we don't need to do any of the updating of the
bits for the RecursionData. Also, there's a bunch of
properties that are never set for the root layer (e.g.
blending or reflections).

Finally, we never add the root layer to the overlap map
now, so we can assert that in OverlapMap::add.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172104 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove dead code from childIndex optimization

We used to use the childIndex in the DOMSiblingTraversalStrategy but
leviw@ removed it to fix a bug after he reversed the direction we did
recalcStyle in r160288 and r158839. We're going to need something like
this eventually, but I think we want something even better than this
old optimization since it didn't help querySelector at all.

Lets just delete this code for now while we figure out the right way
to optimize nth-child selectors.

BUG=364081

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172105 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Let Selection.collapse definition follow the current spec.

The Selection interface definition is following:
https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#selection

Selection.collpase is defined as:
collapse(Node node, unsigned long offset);

The spec says that the two arguments are not optional and |node| must be not null.
Both IE and FireFox implementations follow that spec in my short experiment.

This CL changes the Selection.collapse and setPosition behavior to throw exception when the function is called with a null node or less arguments so we need refine some tests.

BUG=346613,249598,361956

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172106 bbb929c8-8fbe-4397-9dbb-9b2b20218538
SimpleFontData::fillGlyphPage should not set zero for missing glyphs

From r171835, we call fillGlyphPage() multiple times on a glyph page
when initializing a page for SegmentedFontData. It introduced a bug
where glyph fallback for overlapping unicode ranges does not work
correctly, because fillGlyphPage() may overwrite zero for missing glyphs.

Since GlyphPage's constructor does zero-clear, there is no need to
set zero for missing glyphs.

BUG=none
TEST=fast/css/font-face-unicode-range.html,svg/custom/svg-fonts-segmented.xhtml

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

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