Use tighter typing in table rendering code

Use tighter typing in table rendering code:
- Rename RenderTableSection's firstChild() / lastChild() to firstRow() / lastRow()
  and have them return a RenderTableRow* instead of a RenderObject*.
- Rename RenderTableRow's firstChild() / lastChild() to firstCell() / lastCell()
  and have them return a RenderTableCell* instead of a RenderObject*.

Add previousRow() / nextRow() methods to RenderTableRow and previousCell() /
nextCell() to RenderTableCell to make traversal code more readable. Also hide
RenderObject's previousSibling() / nextSibling() in those classes to make sure
the more specialized methods are called.

This is based on WebKit r156355 by Antti Koivisto (antti@apple.com):
https://trac.webkit.org/r156355

R=esprehn@chromium.org, pdr@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174403 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Marked svg/custom/masking-clipping-hidpi.svg as flaky.

BUG=366442
TBR=fmalita@chromium.org,timvolodine@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174404 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Use a more standard decommit / recommit API on Windows.

BUG=343657

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174405 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Rebaseline one followup from r174200

For some reason this test didn't end up being rebaselined properly.  The
correct output for the test is to have a layer tree, like all other
platforms.

NOTRY=true
TBR=ojan@chromium.org
BUG=none

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174406 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Make AX update layout on all frames

When updating layout before exploring the AX tree, do it on
all frames. Relax the assertion in WebAXObject::boundingBoxRect
so that it's okay if the lifecycle is StyleClean and needsLayout() is false.

Also a bit of cleanup - the name "backing store", inherited from WebKit,
doesn't make sense in this context - changed it to be more clear.

BUG=374275

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174407 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Adding more p1 MSE spec compliancy tests.


BUG=
TEST=new tests are passing

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174408 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[Reland] Animated WebP: Alpha-blending support for semi-transparent pixels

When alpha pre-multiplication is on, use Skia for blending.
Most of Blink (including image-rendering in the browser)
uses this mode.

When alpha pre-multiplication is off, use a locally written method.
Only WebGL image conversion uses this mode:
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp&l=1554

Also, disable color profile handling for animated images. This is
an extremely rare use case and at the same time rather involved to
implement. Note: Color profiles in GIF images are ignored as well.

Testing:
Added a unit test to verify that decoded frames in case of alpha
pre-multiply on/off are equivalent.

Difference from earlier patch:
- Unit test corrected: SkPreMultiplyColor() uses 'SkColor', where a
  certain order of R,G,B,A components is assumed, while we need
  configuration specific order. So, we use SkGetPackedB32() etc
  instead.
- No logical changes in the code: using SkPackARGB32NoCheck() and
  some refactoring for clarity.

Reviewers:
Vikas: To review the diff from original patch.
Nico: For OWNER'S LGTM stamp.

BUG=364679

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174413 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[webcrypto] Fix a race in crypto.getRandomValues() when used from WebWorkers.

BUG=368814, 245025

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174414 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Test WordGranularity expansion in VisibleSelection.

BUG=None

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174416 bbb929c8-8fbe-4397-9dbb-9b2b20218538
FrameView resizes should always cause fixed-pos elements to relayout.

FrameView::viewportConstrainedVisibleContentSizeChanged had an early out when
viewportEnabled was off since it assumed changing the FrameView's size otherwise
would cause a relayout. With changes in the virtual-viewport model that's no
longer strictly the case. When a resize comes into Blink, we change the
FrameView's layout size. After layout completes we resize the FrameView's
rect. We do this so we can size the FrameView to be the size of the viewport at
minimum scale (i.e. content size on Android). On desktop, the layout size and
the FrameView rect will typically be one and the same, so when we resized the
rect in refreshPageScaleFactorAfterLayout() the layout size didn't change so we
didn't do a layout.

This was causing a bug in ChromeOS OOBE where the keyboard resizing the WebUI
would cause the fixed-pos shelf to appear in the wrong place and cut off pieces
of the UI.

This patch removes the early out if we're in virtual viewport pinch zoom mode.
In this mode, I also removed the call to
viewportConstrainedVisibleContentSizeChanged from setPageScaleFactor since the
new mode doesn't relayout fixed-pos elements when pinch-zooming.

BUG=361157

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174417 bbb929c8-8fbe-4397-9dbb-9b2b20218538
More refactoring towards more generic treatment of RenderLayers contributiong to a CompositedLayerMapping.

1. Rename adjustBoundsForSubpixelAccumulation to
computeBoundsOfOwningLayer, which is what it really does.

2. Rename delta to snappedOffsetFromCompositedAncestor, which is what it is. Add offsetFromCompositedAncestor.

3. Remove dependence of updateSquashingLayerGeometry on any
member variables of CompositedLayerMapping.


BUG=372837

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174418 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Strip anonymous blocks when change in style removes need for them

When a block element becomes a float or out of flow we should strip
any anonymous blocks wrapping its inline siblings.

BUG=331251

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

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

After r174347 we don't execute script blocked on stylesheets synchronously
inside ::removedFrom so we can remove this special case inside the
ChildNodeRemovalNotifier.

This code was originally added in
http://trac.webkit.org/changeset/125988

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

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

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

BUG=358460
TBR=wangxianzhu@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174422 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Navigation transitions: transition-exiting-stylesheet link rel type

This adds a new stylesheet rel type to <link> elements, which will be
fetched on node insertions but the linked stylesheet has to be explicitly 
enabled.

BUG=370696

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174423 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Defer style recalc when inserting extension stylesheets.

StyleEngine::addAuthorSheet, used when injecting stylesheets from extensions,
was doing a synchronous style recalc. Adding two stylesheets in a row would
cause two style recalcs. Do a deferred style recalc instead.

BUG=374901,374162

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174424 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Oilpan: Prepare to move XPath::NodeSet, XPath::ValueData, and XPath::Value to Oilpan heap.

Note:
- XPath::Value is a part object of XPathResult.
- XPath::NodeSet was a part object of XPathResult or XPath::ValueData, and
  NodeSet is also used as an independent object. This CL makes NodeSet not a
  part object because using GarbageCollected object as a part object is
  dangerous.
- Difference from r174239 is to add visitor->trace(m_value) to
  Number::trace and StringExpression::trace.

This is a preparation to remove RefPtr<Attr> and RefPtr<Node>.

BUG=357163,373814, 374814
R=haraken@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174425 bbb929c8-8fbe-4397-9dbb-9b2b20218538
HTMLImportChild does not need to be a ResourceOwner.

It's sufficient to keep HTMLImportLoader a ResourceOwner, since the
HTMLImportLoader is the one that actually does the loading and the
keeping of the resource.

Also updated HTMLImportChild functions to reflect the change.

Covered by existing tests.

R=morrita
BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174426 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fix page jumping back to initial position after an overflow-bounce scroll.

This CL is forked from the CL at https://codereview.chromium.org/122093002,
original author thakis. This CL fixes the layout test to correctly
differentiate between the correct and incorrect behaviors.

thakis's CL in turn is a merge of http://trac.webkit.org/changeset/160791 and
http://trac.webkit.org/changeset/160898 from Beth Dakin <bdakin@apple.com>;.

Depends on Chromium CL: https://codereview.chromium.org/283713002/

BUG=330887

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174427 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Update Gamepad.axes / GamepadButton.value to match the latest specification

Update Gamepad.axes / GamepadButton.value to match the latest specification:
https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#widl-Gamepad-axes
https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#widl-GamepadButton-value

Those attributes should be of type double as per the specification but Blink
was still using float type as in older version of the specification. This can
lead to precision problem on JavaScript side.

This CL introduces temporary ENABLE_NEW_GAMEPAD_API #ifdefs to help with the
transition. Those will be removed once the Chromium side has been updated.

R=eseidel@chromium.org, bajones@chromium.org
BUG=344556
TEST=gamepad/gamepad-events-basic.html

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

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