Cleanup a few loops into the new C++11 for-each style.

Inspired by changes in https://codereview.chromium.org/700463003/, this
CL cleans up a few loops where there was an ugly sizeof() calculation
needed. The new C++11 for-each style makes these unnecessary, thus
making the code more readable and less brittle.

R=mkwst@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184823 bbb929c8-8fbe-4397-9dbb-9b2b20218538
IDL: ArrayBuffer and ArrayBufferView support for union types

(ArrayBuffer or ArrayBufferView) is a common union type usage. For example,
CSS font loading[1] and fetch API[2] use it. Implement and use them for
FontFace constructor.

Change for FontFace is covered by fast/css/fontface-arraybuffer.html

This CL also fixed two minor bugs:
- Collect union types from constructors (we didn't before)
- We need to use 'implemented_as' for forward class declarations, instead of
  'name'.

[1] http://dev.w3.org/csswg/css-font-loading/#fontface-interface
[2] https://fetch.spec.whatwg.org/#body-mixin

BUG=240176

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184824 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Convert fast/multicol/margin-collapse to reftest.

The only notable change is setting column-gap explicitly.

R=mstensho@opera.com
BUG=386567

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184825 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Script streaming: detect encoding later.

It's possible that Resource::encoding() changes once we receive data.

This requires moving the creation of v8::ScriptCompiler::StreamedSource and
SourceStream forward in time (we need to know the encoding to create them).

Additional fix: m_cachedDataType was not initialized properly.

BUG=428137

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184826 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bindings: Window must be LocalDOMWindow by definition.

Window.idl declares that Window is ImplementedAs=LocalDOMWindow.
It also declares self/window/frames/opener/parent/top attributes
return Window, so LocalDOMWindow::self/window/frames/opener/parent/
top member functions must return LocalDOMWindow, not DOMWindow.

dcheng@, you can change Window.idl to declare ImplementedAs=DOMWindow
instead of LocalDOMWindow, if necessary.  Otherwise, please keep the
consistency here.

BUG=425623

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184827 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Expose a public API option to force 2D canvas to use display lists

BUG=386601

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184829 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[WebGL] Return meaningful information in WebGL context creation error message.
For example, vendor, renderer, driver version, etc.This
way a developer can gather data on what platforms the app
fails to run. This needs changes on both blink and chromium.

Below steps are followed to implement this

1. Add basic headers in blink.
2. Add the necessary apis in chromium.
3. Start using this in WebglRenderingContxt.cpp.

This patch represents step-3 in this process.

BUG=412440

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184830 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Correctly ignore "self" for border radius clipping when painting the background phase or fragments.

This was broken in crrev.com/653303003.

There is no test for the latter, but that code is not live yet. Punting to 
mstensho@opera.com.

BUG=425030

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184831 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Improves code readability in in core/html by

Using C++11 range-based loop.
Using ">>" instead of "> >" in templates.
Using nullptr instead of 0.


BUG=none
TEST=no layout test failures

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184834 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[WebSocket] Remove "Threadable" from class names.

"Threadable" in class names came from core/loader (e.g. ThreadableLoader),
but it doesn't have any meaning in modules/websockets. This CL drops
that adjective from class names.

R=tyoshino,mkwst
BUG=NONE

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184835 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Invalidate the frame view when changing the background image of the document or body.

To do this, add a method to request full paint invalidation on FrameView. This also requires moving the full invalidation code into invalidateTreeIfNeeded() instead of layout(), since otherwise the invalidation requested will not always happen if layout does not occur.

In any case, invalidation should be in invalidateTreeIfNeeded(), not layout().

BUG=425872

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184836 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove some EME tests from Oilpan failing list

These tests appear to be running normally now on the Mac Oilpan clients.

BUG=370586
TEST=flakiness dashboard all green for these tests

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184837 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert "Don't invalidate scrolling container layer when scrolling contents need invalidation"

This reverts commit 20feb3edc199015a96b39c081d50a083cf39ac87.

We still can't clearly distinguish invalidations for container layer
and scrolling contents layer. For example, crbug.com/429845, the shadow
div of an editor is scrollable, but the editor invalidates itself to
update selection, caret and content; With the change, the invalidation
will happen on the container only.

Revert first and try to find a good solution.

Perhaps we can just wait for slimming paint.

Still keep the layout tests added in the original change but will be
rebaselined.

TBR=vollick@chromium.org,chrishtr@chromium.org,dsinclair@chromium.org
BUG=416535,429845

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184838 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bluetooth: Initial WebBluetooth & WebBluetoothError.

In three patches the initial mock implementation of bluetooth.requestDevice
is implemented across blink & content. This allows layout tests to specify the
data responses the mock implemented in content should return via
testRunner.SetBluetoothMockDataSet and call bluetooth.requestDevice with the
expected results.

crrev.com/650613005 blink::WebBluetooth & WebBluetoothError interfaces.
crrev.com/702593002 content::WebBluetoothImpl & testRunner.SetBluetoothMockDataSet.
crrev.com/686813003 blink::BluetoothDiscovery::requestDevice implemented.

BUG=420284

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184839 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fixing two layout tests on Android broken by enabling virtual-viewport

The svg test turned out to simply need a rebaseline as the scrollbars should
no longer show up in layout tests.

The autoresize test was off by 1 pixel. This was happening because in
virtual viewport mode we size the main FrameView's width to the content
size and the height by the aspect ratio. This meant that the height would
have some tiny error in some aspect ratios which would get blown up to a
full pixel when we returned an expandedIntSize in
PageScaleConstraintsSet::mainFrameSize. This is fixed by explicitly setting
the FrameView size equal to the viewport size if the content width matches
the viewport width.

BUG=428189

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184840 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Auto-rebaseline for r184836

http://src.chromium.org/viewvc/blink?view=revision&revision=184836

BUG=425872
TBR=chrishtr@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184841 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Auto-rebaseline for r184838

http://src.chromium.org/viewvc/blink?view=revision&revision=184838

BUG=416535
TBR=wangxianzhu@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184842 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Replace custom code by hasOneTextChild API

This code just is the hasOneTextChild logic, so
to avoid confusion use that instead.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184843 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Create watchlist for bluetooth, add scheib.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184844 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Devirtualize animatedLocalTransform() and rename it for clarity

This patch devirtualizes animatedLocalTransform and renames it
calculateAnimatedLocalTransform to emphasize that it is not cheap.

SVGGraphicsElement::animatedLocalTransform was virtual to support
SVGTextElement's special transform code. The text-specific
transform code is only in an infrequently-taken codepath
(style && style->hasTransform()) so we can actually improve performance
by devirtalizing and combining the two transform codepaths. The real
benefit is code simplification though.

Secondly, I've renamed this function to make it clear that it is not
a simple lookup.

BUG=429551

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

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