Remove early returns from RenderLayerCompositor::setNeedsCompositingUpdate.

This function just sets dirty bits, enables compositing mode
and schedules a visual update. The early returns aren't
needed for correctness and there's nothing performance
sensitive here.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172328 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Allow touch events to be uncancelable

The touchevents specification says (http://www.w3.org/TR/touch-events/#list-of-touchevent-types) that touchcancel events should not be cancelable.

We'd also like to allow other touch events (touchmove and touchend) to sometimes be uncancelable (sent async) as well, so rather than special-case touchcancel here we plumb a bit from the browser.  This leaves the decision over which events are cancelable purely in the hands of the browser (except for edge cases around synthetic events), which makes sense because only the browser can know whether it plans to wait for an ACK for the event before proceeding with gesture recognition.

Note that I can't properly test this in a layout test without changing EventSender in the chromium repo, but I can't change EventSender until WebTouchEvent has changed.  So there's no avoiding a 3-sided patch here.  Once the first 2 CLs have landed I'll land a new LayoutTest before marking bug 365681 as Fixed.

BUG=365681, 361306

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172329 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove the early returns in FrameView::updateCompositingLayersAfterStyleChange.

This function used to do a lot, so the early return was needed
as a performance optimization. Now this function just sets
some dirty bits and sometimes does a bit more work, so we
don't need the early returns.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172330 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Separate repaint and layout requirements of StyleDifference (Step 1)

Previously StyleDifference was an enum that proximately bigger values
imply smaller values (e.g. StyleDifferenceLayout implies
StyleDifferenceRepaint). This causes unnecessary repaints in some cases
on layout change.

Convert StyleDifference to a structure containing relatively independent
flags.

This change doesn't directly improve the result, but can make further
repaint optimizations possible.

Step 1 doesn't change any functionality. RenderStyle still generate the
legacy StyleDifference enum when comparing styles and convert the result
to the new StyleDifference. Implicit requirements are not handled during
the conversion.

Converted call sites to use the new StyleDifference according to the
following conversion rules:
- diff == StyleDifferenceEqual (&& !context) => diff.hasNoChange()
- diff == StyleDifferenceRepaint => diff.needsRepaintObjectOnly()
- diff == StyleDifferenceRepaintLayer => diff.needsRepaintLayer()
- diff == StyleDifferenceRepaint || diff == StyleDifferenceRepaintLayer => diff.needsRepaintLayer()
- diff >= StyleDifferenceRepaint => diff.needsRepaint() || diff.needsLayout()
- diff >= StyleDifferenceRepaintLayer => diff.needsRepaintLayer() || diff.needsLayout()
- diff > StyleDifferenceRepaintLayer => diff.needsLayout()
- diff == StyleDifferencePositionedMovementLayoutOnly => diff.needsPositionedMovementLayoutOnly()
- diff == StyleDifferenceLayout => diff.needsFullLayout()

BUG=358460
TEST=All existing layout tests.
R=eseidel@chromium.org, esprehn@chromium.org, jchaffraix@chromium.org

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

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172331 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Web Animations API: Change API time values from seconds to milliseconds

As discussed on blink-dev[1] and public-fx[2].

[1] https://groups.google.com/a/chromium.org/d/msg/blink-dev/SWxBI0uPvUE/iZCNwoN3nKEJ
[2] http://lists.w3.org/Archives/Public/public-fx/2014AprJun/0014.html

BUG=364347

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172332 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Simplify HTMLDocumentParser a little

!isDocumentFragment() was already asserted above.

Might as well combine the ifs and make the comment one line.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172333 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Move flexbox-with-stretch-layout.html from PerformanceTests/ to PerformanceTests/layout/. This fixes the bug caused by the page referencing "../resources/runner.js" script whereas resources folder was in the same directory as flexbox-with-stretch-layout.html.
BUG=365599

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172334 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Avoid unnecessary allocation in EventPath::ensureTreeScopeEventContext.

We always allocated new TreeScopeEventContext object for a TreeScope even if
another object for the TreeScope is in TreeScopeEventContextMap. We should apply
an idiom of HashMap::AddResult that we pass nullptr to HashMap::add and check if
AddResult.isNewEntry.

BUG=364209

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172335 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Correcting menu button event trigger location

BUG=64415

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172336 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add TreeScope::commonAncestorTreeScope().

It turned out that it would be nice to have the functionality to calculate
the lowest common ancestor of tree scopes while I was trying to fix issue
365246.

This patch adds the titled function to TreeScope along with some unit tests.

BUG=365246

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172337 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove one more async step in test.

BUG=306228
TBR=vsevik

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

git-svn-id: svn://svn.chromium.org/blink/trunk@172338 bbb929c8-8fbe-4397-9dbb-9b2b20218538
updateRenderTreeForNodeIfNeeded should use NodeRenderingTraversal::parent

Elements inherit their styles from the composed parent, not the real parent,
so we need to check that in the loop to make sure all ancestors are correct.

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

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