Merge 183216 "Recovery from memory allocation failure in Graphic..."

> Recovery from memory allocation failure in GraphicsContext::createRasterBuffer
> 
> BUG=420029
> 
> Review URL: https://codereview.chromium.org/625063002

TBR=junov@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183355 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 183110 "Image decoding: Read a multi-thread-accessed boole..."

> Image decoding: Read a multi-thread-accessed boolean within a lock
> 
> ThreadSafeDataTransport::m_allDataReceived is read and written on
> different threads. Protect access with a lock.
> 
> BUG=418261
> 
> Review URL: https://codereview.chromium.org/622623002

TBR=hclam@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183358 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 183010 "Fix caret rect calculations after r180941"

> Fix caret rect calculations after r180941
> 
> Blink r180941 changed FrameSelection to use Caret's invalidation rect
> calculation, which was subtly different in that it jumped to the
> caret's containing block without adjusting for the possible offsets
> involved. This leads to the caret being improperly invalidated in
> cases such as an input that scrolls its overflow.
> 
> This patch extracts the code from CaretBase::updateCaretRect, which
> does do the right adjustment, and reuses it in CaretBase::invalidateLocalCaretRect.
> 
> BUG=416534
> R=jchaffraix@chromium.org, wangxianzhu@chromium.org
> 
> Review URL: https://codereview.chromium.org/620723002

TBR=leviw@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183363 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 183118 "IndexedDB: Fix crash in ~IDBRequest and ~IDBCursor."

> IndexedDB: Fix crash in ~IDBRequest and ~IDBCursor.
> 
> IDBRequest::m_transaction can be destructed before the IDBRequest object.
> We can't dereference it in ~IDBRequest.
> 
> We apply the weak HashMap pattern to call handleBlobAcks() before destructing
> IDBRequest::m_transaction. In this case, we need to be careful to avoid the
> HashMap is not destructed with the IDBRequest object, and the HashMap is a
> per-thread object.
> 
> IDBPendingTransactionMonitor is an existing per-thread object in
> modules/indexeddb/.  So it should be responsible to handle the weak HashMap.
> IDBPendingTransactionMonitor can't have it because an
> IDBPendingTransactionMonitor object is destructed before thread cleanup GC.
> So we introduce new RefCounted object to own the weak HashMap.
> 
> IDBCursor had a problem same as IDBRequest.
> 
> This CL has no tests. The bug depends on memory layout, and there is no way to  
> make reliable tests.
> 
> BUG=417362
> 
> Review URL: https://codereview.chromium.org/610543002

TBR=tkent@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183371 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Manual merge of r183219 to m39 branch 2171

> Fix unmatched GraphicsContext::save/restore when using invalid
> css filter

BUG=419429


git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183419 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 183366 "Validate CompositedSelectionBounds before forwarding"

> Validate CompositedSelectionBounds before forwarding
> 
> As |RenderedPosition::positionInGraphicsLayerBacking| makes no
> guarantees that it will find an appropriate layer backing, the caller
> should not assume success. Check the result explicitly when updating
> the composited bounds, ensuring their validity before forwarding to the
> client. Also support forwrding of an empty (zero height) bound.
> 
> BUG=417306
> 
> Review URL: https://codereview.chromium.org/612323008

TBR=jdduke@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183427 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 183006 "Fix pixelated HiDPI Mac widgets with impl-side pai..."

> Fix pixelated HiDPI Mac widgets with impl-side painting
> 
> When drawing the native controls to a SkiaBitLocker, tell the bit locker
> about the target device scale factor, so that it will record a higher (or
> lower, if appropriate) resolution bitmap to play back on the painting
> thread.
> 
> Also, specify a clip rect for progress bars, since that was missed in or
> updated after the previous patch.
> 
> The ability to create a SkiaBitLocker without a clip rect will be removed
> soon.
> 
> BUG=408557
> 
> Review URL: https://codereview.chromium.org/617003002

TBR=ccameron@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183428 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 183162 "Fix progress bar regression on Mac"

> Fix progress bar regression on Mac
> 
> The clip rect in r183006 wasn't manually tested, and was wrong.
> Specify the un-translated clip rect, which empirically produces
> correct results in a variety of test scenarios (zoomed, retina,
> various page locations).
> 
> Use a LocalCurrentGraphicsContext and delete ContextContainer,
> because it is largely redundant.
> 
> BUG=419597
> 
> Review URL: https://codereview.chromium.org/620673006

TBR=ccameron@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183429 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 183492 "Pass setScriptableObjectProperty calls on to Peppe..."

> Pass setScriptableObjectProperty calls on to Pepper again
> 
> We previously removed the ability for Pepper plugins to intercept
> properties set on the plugin element as we thought that this
> private feature wasn't used anywhere. It turns out that this feature
> is still used by the deprecated gTalk plugin. This patch adds back
> the ability for the plugin to intercept the call.
> 
> Note that we are missing the ability (in V8) to detect whether
> the plugin has actually intercepted the call the avoid passing
> the SetProperty request onto the DOM element. But that turns
> out to be inconsequential for the gTalk plugin.
> 
> BUG=414842
> 
> Review URL: https://codereview.chromium.org/640073005

TBR=raymes@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183501 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fix large scroll offset reporting on Windows

In https://src.chromium.org/viewvc/blink?revision=182423&view=revision
I added initial support for fractional scroll offsets, including a
temporary rounding mechanism for dealing with code which wasn't yet
updated to support fractions.

Unfortunately I used 'lround' which returns 0 for numbers larger
than a long (which is only 32 bits on windows).  This meant that
scroll offsets above 214748 on Windows were reported as 0.

This CL fixes the issue by using 'round' instead of 'lround'.
Note this this rounding code is no longer present in ToT
(as of https://src.chromium.org/viewvc/blink?revision=183089&view=revision)
so this fix must go directly into the M39 branch (and hence no
point in writing a LayoutTest for it).

BUG=417646

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



git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183548 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 183042 "WTF: we need to initialize EcmaScriptConverter of ..."

> WTF: we need to initialize EcmaScriptConverter of DoubleToStringConverter in single thread mode.
> 
> It can't be converted into a global variable because -Wglobal-constructors compiler error. So the simplest way is to force the creation from the single thread mode. Otherwise we may get a race. See the bug.
> 
> BUG=418300
> 
> Review URL: https://codereview.chromium.org/612893002

TBR=loislo@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183590 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 183480 "Don't look into stale state in the squashed layers..."

> Don't look into stale state in the squashed layers vector when calling CLM::containingSquashedLayer.
> 
> BUG=412481
> 
> Review URL: https://codereview.chromium.org/644543002

TBR=chrishtr@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183610 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 183467 "[Cast, Android] Added isRemote() method to the Web..."

> [Cast, Android] Added isRemote() method to the WebMediaPlayer interface
> 
> Needed by https://codereview.chromium.org/644463003/
> 
> BUG=420665
> 
> Review URL: https://codereview.chromium.org/645503002

TBR=avayvod@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183615 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 183514 "When invalidating an area for a background image o..."

> When invalidating an area for a background image on the document, invalidate the larger of view() and documentElement().
> 
> This is required per spec.
> 
> BUG=419660
> 
> Review URL: https://codereview.chromium.org/645643002

TBR=chrishtr@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183629 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 182850 "Revert of Blink doesn't honor percent heights on c..."

> Revert of Blink doesn't honor percent heights on children of "align-self:stretch" flex items in a fixed-height (patchset #20 id:380001 of https://codereview.chromium.org/331203002/)
> 
> Reason for revert:
> The patch broke a canvas with forced height in DevTools. See crbug.com/418591
> 
> Original issue's description:
> > Blink doesn't honor percent heights on children of "align-self:stretch" flex items in a fixed-height flex container
> >     
> > Blink does not honor percent heights on children of flex items
> > having align-self:stretch in a fixed-height flex container. It
> > ignores the height specified in percent and take the height as
> > min-content height.
> >     
> > This bug occurs because while applying stretch alignment to the flex-item
> > we set the OverrideLogicalContentHeight for the flex-item but while
> > computing PercentageLogicalHeight for the children of the flex-item
> > in the api RenderBox::computePercentageLogicalHeight we are checking for
> > hasOverrideContainingBlockLogicalHeight() which checks if the child which
> > is having percentage height has overrideLogicalHeight or not. Since for
> > the child we had not set overideLogicalHeight so this condtion returns
> > false and available height for child becomes -1. Hence it takes height
> > as min-content height.
> >     
> > This patch fixes this bug by using overrideLogicalContentHeight() of 
> > containing block as availableHeight while computing the 
> > percentage heights of children of flex item having stretch alignment. 
> > Also for the cases where desiredLogicalHeight == logicalHeight() and 
> > flex item hasPercentHeightDescendants() we are forcing a relayout
> > of the flex item as overrideLogicalContentHeight() 
> > gets cleared off while calculating preferredMainAxisContentExtentForChild
> >     
> > BUG=341310,346275
> > 
> > Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=182735
> 
> TBR=a.bah@chromium.org,cbiesinger@chromium.org,leviw@chromium.org,tony@chromium.org,harpreet.sk@samsung.com
> NOTREECHECKS=true
> NOTRY=true
> BUG=341310,346275
> 
> Review URL: https://codereview.chromium.org/616583002

TBR=alph@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183654 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 183228 "DevTools: [CodeMirror] fix plus-one bug in omittin..."

> DevTools: [CodeMirror] fix plus-one bug in omitting quotes in string literals
> 
> The token value was determined erroneously, the patch fixes it.
> 
> R=apavlov
> BUG=420268
> 
> Review URL: https://codereview.chromium.org/623153002

TBR=lushnikov@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183737 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 183612 "DevTools: [SSP] fix live edit of property values"

> DevTools: [SSP] fix live edit of property values
> 
> The problem arises due to the fact that treeElement value is not updated
> at the moment of keyDown/keyPress events. The "input" event should be
> handled for the proper text value.
> 
> BUG=422928
> R=apavlov
> 
> Review URL: https://codereview.chromium.org/650123002

TBR=lushnikov@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183791 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 183058 "DevTools: [CSS] support different cssrule types in..."

> DevTools: [CSS] support different cssrule types in InspectorStyleSheet
> 
> The patch adds flattenning and source data collecting of the following
> CSSRules:
> - charset rule
> - page rule
> - font-face rule
> - viewport rule
> 
> The charset rule was lacking source data generation, so the bison grammer
> had to be changed in order to support it.
> 
> BUG=417778
> R=apavlov
> 
> Review URL: https://codereview.chromium.org/606023002

TBR=lushnikov@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183792 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 183558 "Fix LCD text handling for SVG filters."

> Fix LCD text handling for SVG filters.
> 
> Turn off LCD (subpixel AA) text while recording the DisplayList used
> for image filters, since we don't know about the opacity of the
> destination playback canvas (and using the recording canvas's
> opacity is wrong).
> 
> BUG=422176
> 
> Review URL: https://codereview.chromium.org/645993002

TBR=senorblanco@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183820 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Merge 183686 "DevTools: [SSP] show links for matched styles with..."

> DevTools: [SSP] show links for matched styles with spaces in source URL
> 
> The patch fixes couple of workspace inner methods used for fetching
> uiSourceCodes based on their URL's.
> 
> BUG=422073
> R=vsevik
> 
> Review URL: https://codereview.chromium.org/656453002

TBR=lushnikov@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/branches/chromium/2171@183866 bbb929c8-8fbe-4397-9dbb-9b2b20218538