Web Animations CSS: Implement AnimatableColor

Add support for animating colors in the new web animations engine.
We need to friend RenderStyle to support animating the visited and
unvisited colors separately. Note that we need to update both of them
at least in the case of displaying visited colors and returning
up-to-date unvisited colors to getComputedStyle.

BUG=257591

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

Review URL: https://chromiumcodereview.appspot.com/23135015

git-svn-id: svn://svn.chromium.org/blink/trunk@156925 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Rebaseline Skia suppressions.

BUG=265448,266315,275475,280292
TBR=robertphillips@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@156926 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Untangle RenderTheme from Page and RenderObject

Previously, any code wishing to access the theme for a given page had to
go through the Page::theme() method. Because there might not be a page in
some cases, this required NULL checks and/or ASSERTS.

However, having a different RenderTheme based on the Page it's being applied
to is something we're not using in Blink anymore. This also means that the
RenderTheme::defaultTheme() method returns exactly the same as RenderTheme::
themeForPage(), regardless which Page object was being passed in.

Remove the Page::theme() method and change RenderTheme to no longer care
about which page is being passed in. Unify RenderTheme::{themeForPage,
defaultTheme} in RenderTheme::theme(), because the implementation differs
based on the platform. The RenderTheme implementation is now also being
passed as a reference, because it will never be NULL.

BUG=
R=ojan

Review URL: https://chromiumcodereview.appspot.com/23506007

git-svn-id: svn://svn.chromium.org/blink/trunk@156927 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ImageBuffer-less SVG masking and clipping.

This CL refactors the SVG clipping and masking logic using Skia saveLayer()
operations instead of explicitly allocated ImageBuffers.

The masking process involves two layers:

  * a mask layer, where the mask shapes are drawn and which is composited into
    the backdrop layer using regular SrcOver transfer mode.
  * a content layer, where the content to-be-masked is drawn and which is
    composited into the mask layer using SrcIn transfer mode.

The sequence of operations:

  - saveLayer(SrcOver)
      - draw mask shapes
      - saveLayer(SrcIn)
          - draw content
      - restoreLayer(SrcIn) (content gets masked by the mask layer content)
  - restoreLayer(SrcOver) (the now-masked content is blended into the backdrop)

For luminance masks, a custom Skia transfer mode wrapper (SkLumaMaskXfermode)
is used instead of regular SrcIn.

If needed, mask color space conversion is handled using an SkTableColorFilter.

As far as the number of allocated off-screen buffers goes, the two approaches
are equivalent: 2 SK layers vs. 1 SK layer + 1 ImageBuffer previously. But the
new implementation has several advantages:

  * off-screen buffer allocation is now handled by Skia at rasterization time,
    when the true resolution is known - this fixes various problems related to
    impl-side painting on HiDPI devices (due to mask rasterization at record
    time).
  * masks are drawn directly into the target canvas, using the coordinate
    system already in place - this avoids pixel snapping artifacts due to
    integral ImageBuffer sizing.
  * reduced memory utilization - we are no longer holding SVG mask/clip bitmaps
    indefinitely in Blink.
  * color space conversion and luminance calculation are handled more
    efficiently using native Skia constructs instead of additional ImageBuffer
    data copies/traversals.
  * general code cleanup - GraphicsContext no longer needs to track an
    imgbuffer clip as part of its state, and several related utility methods
    can be removed.

One possible downside: we are losing the ability to cache mask ImageBuffers in
Blink, which may have a negative performance impact under certain conditions
(static mask reused frequently due to constantly re-painting a dynamic target).
There are plans to add caching capabilities in Skia to compensate for this.

23 pixel tests require rebaselining due to minor blending/rounding
differences.

R=pdr@chromium.org,schenney@chromium.org,dschulze@chromium.org,senorblanco@chromium.org

Review URL: https://chromiumcodereview.appspot.com/23643003

git-svn-id: svn://svn.chromium.org/blink/trunk@156928 bbb929c8-8fbe-4397-9dbb-9b2b20218538
TestExpecations: LayoutTest virtual/gpu/compositedscrolling/overflow/overflow-positioning.html image failure on Linux

BUG=247982
TBR=danakj

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

git-svn-id: svn://svn.chromium.org/blink/trunk@156929 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Date/time form LayoutTests tests depends on System settings

The date/time form LayoutTests (fast/forms/calendar-picker, fast/forms/
date*, fast/forms/time*) depends on the system local settings.

On windows the user may override the settings for a local (i.e. change
the date format or use 24h time for en_US) and doing so will cause 60+
tests to fail.

Change LocaleWin to use the system default for locales when running
tests, ignoring user overrides.

BUG=280185

Review URL: https://chromiumcodereview.appspot.com/23468004

git-svn-id: svn://svn.chromium.org/blink/trunk@156930 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Rebaseline aac and mp3 files on Android for CL 22652005

BUG=267061

TBR=dalecurtis@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@156931 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove Android's existing layout test result files.

Most of these results were based on results created using DRT, and are no
longer relevant now that we're going to run tests using content_shell. Keep
a few media tests which have been added recently (r153818, r154314 and
r155769).

BUG=232044
TBR=dpranke

git-svn-id: svn://svn.chromium.org/blink/trunk@156932 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Document that the WebNode class and its subclasses must not have any virtual methods.

This requirement allows code using classes in this heirarchy to safely
static_cast to the appropriate subclass based on the actual type of the wrapped
node.

BUG=278295
TEST=none
R=jamesr@chromium.org

Review URL: https://chromiumcodereview.appspot.com/23453016

git-svn-id: svn://svn.chromium.org/blink/trunk@156933 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Rebaseline SVG mask/clip tests after r156928

TBR=pdr@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@156934 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Increase playForMillisecs timeout in video-played tests

Increases this timeout to reduce flakiness risk for the loop portion of the video-played-collapse layout test.
Uses window.performance.now() instead of 'new Date().getTime()' in video-played.js to be more resilient to time changes.

R=scherkus@chromium.org
BUG=280848
TEST=All video-played.js layout tests pass 100 runs each locally on debug linux while machine is heavily loaded.

Review URL: https://chromiumcodereview.appspot.com/23456007

git-svn-id: svn://svn.chromium.org/blink/trunk@156935 bbb929c8-8fbe-4397-9dbb-9b2b20218538
On linux when no VDMX table is present the leading is applied twice causing the line gap to be doubled.

When isVDMXValid is false, the following effectively happens:

descent = metrics.fDescent + metrics.fLeading;
lineGap = SkScalarToFloat(metrics.fLeading);
m_fontMetrics.setLineGap(lineGap);
m_fontMetrics.setLineSpacing(ascent + descent + lineGap);

Note that since descent already incorporates the fLeading, the fLeading will be applied twice in the total height. When isVDMXValid is true, the descent does not incorporate the fLeading.

BUG=265268

Review URL: https://chromiumcodereview.appspot.com/21259002

git-svn-id: svn://svn.chromium.org/blink/trunk@156936 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Rebaseline Skia suppressions.

Missed a couple in r156926.

TBR=robertphillips@chromium.org
BUG=263331,280292

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

git-svn-id: svn://svn.chromium.org/blink/trunk@156937 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Address regression bug report, revert the PaintInfo rect member function 
in r156859.

BUG=281490

Review URL: https://chromiumcodereview.appspot.com/23509003

git-svn-id: svn://svn.chromium.org/blink/trunk@156938 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Document that WebNode's subclasses must not add any data members.

This requirement allows code using classes in this heirarchy to safely
static_cast to the appropriate subclass based on the actual type of the wrapped
node.

BUG=278295
TEST=none
R=darin@chromium.org

Review URL: https://chromiumcodereview.appspot.com/23672019

git-svn-id: svn://svn.chromium.org/blink/trunk@156939 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Encoding API: Matching BOMs should be consumed

The Encoding standard specifies that the decode() API operation
consumes a matching byte-order-mark (BOM) at the start of a
data stream for the UTF encodings. Make it so.

BUG=277034

Review URL: https://chromiumcodereview.appspot.com/23619011

git-svn-id: svn://svn.chromium.org/blink/trunk@156940 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fix the flexbox performance tests.

The tests were incorrectly using -webkit-flexbox, which is not a valid
display type, so it got interpreted as display: block and didn't do
much.

I'm also using the opportunity to unprefix the flex properties used by
the tests.

NOTE: It is expected that the performance dashboard will show a huge
one-time regression from this change, except for the lots-of-data test.

R=ojan@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/23695003

git-svn-id: svn://svn.chromium.org/blink/trunk@156941 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Unprefix flexbox properties in various CSS files

R=ojan@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/23793002

git-svn-id: svn://svn.chromium.org/blink/trunk@156943 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Gardening: The following tests are flaky.

- virtual/web-animations-css/animations/animation-direction-normal.html
- svg/custom/repaint-shadow.svg

BUG=281911,281915
TBR=rjkroege@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@156944 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Insert placeholder when removing selection at end of editable root after line break

This patch fixes regression introduced by r156139, which inserts placeholder when text after deleting ends with line break, by inserting placeholder when selection to delete followed by line break.

For example, typing backspace key in sample text, where "|" denotes caret:
 1 "ab<br>c|" => "ab<br>"
 2 "abc|<br> => "ab<br>"
r156139 inserts placeholder for example 2.


BUG=277132
TEST=LayoutTests/editing/deleting/delete-character-004.html

Review URL: https://chromiumcodereview.appspot.com/23749002

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