Use new Traversal<> API more in the code base

Use new Traversal<> API more in the code base to simplify code a bit and
increase readability.

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

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

git-svn-id: svn://svn.chromium.org/blink/trunk@179067 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fix loop condition in BidiRunList::replaceRunWithRuns

Fix the loop condition in BidiRunList::replaceRunWithRuns to check if a
next run exists before accessing it.

R=inferno@chromium.org
BUG=397479

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

git-svn-id: svn://svn.chromium.org/blink/trunk@179068 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Use tighter typing in editing: DeleteSelectionCommand

Use tighter typing in editing to increase code readability.
This CL focuses on DeleteSelectionCommand.

R=leviw@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@179072 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Fix bugs in sheriff-o-matic's pixel zoomer.

-x/y were swapped. Create a mock canvas context so we actually
test this code path.
-The zoomer was below the test list. z-index:1 to put it above.

NOTRY=true

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

git-svn-id: svn://svn.chromium.org/blink/trunk@179073 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Treat calls to CanvasRenderingContext2D.clearRect as operations that clear the canvas

Currently RecordingImageBufferSurface determines whether
the canvas was cleared by tracking opaque draws.  For this
purpose we need all draw operations that completely
overwrite the destination pixels to be treated as opaque
even though the resulting pixels may not be opaque
(alpha = 1). To solve this problem we introduce an alternate
mode of operation in OpaqueRegionSkia, which was renamed to
RegionTracker, to reflect its new more generic vocation.

BUG=397205
TEST=blink platform unit test RecordingImageBufferSurface.clearRect

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

git-svn-id: svn://svn.chromium.org/blink/trunk@179074 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Set up mocha, chai and karma for sheriff-o-matic unit testing.

This is the first step in switching to the mocha testing framework.

We'll use the Chai assertion library, which provides should-style,
expect-style, and assert-style assertions. We should avoid 'should',
since it modifies Object.prototype. 'expect' is more readable and
flexible than 'assert', although the (optional) chaining keywords can
make it overly verbose. For a full comparison, see:
http://chaijs.com/guide/styles/

I've used 'expect' in the two example tests, but left out the unnecessary
chaining keywords. This makes the most sense to me but feel free to
disagree.

Finally, Karma is a test runner that allows us to remotely run unit tests
in Chrome from the command line. We may need to use some trickery to have
this work for both Chrome and Chromium, but that is for another patch.

R=esprehn@chromium.org,ojan@chromium.org
NOTRY=true

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

git-svn-id: svn://svn.chromium.org/blink/trunk@179075 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Disable paint invalidatin optimization about SVG transform change

The optimization prunes SVG subtree paint invalidation walking if
the container's transform changed. However, the transform changed
flag is only updated during layout causing:
- If multiple layouts before an invalidation, later layouts may
  clear the flag set by previous layout;
- For paint-only invalidation (after we use unified invalidation)
  the flag may remain uncleared if there is no layout causing
  incorrect pruning of tree walking.

SvgCubics doesn't show visible performance change with this patch.

BUG=394619

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

git-svn-id: svn://svn.chromium.org/blink/trunk@179076 bbb929c8-8fbe-4397-9dbb-9b2b20218538
run-webkit-tests: fix crash when trying to read a log that did not exist.

During error recovery after failing to start a server, there might actually
not be an error log where we think there should be one.

TBR=eseidel@chromium.org
BUG=378444

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

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