Convert some text-based-repaint tests for spv2

This ensures test coverage of repaint tests for spv2.

paint/invalidation/spv2/resources/convert.sh is a semi-automatic tool to
convert an text-based-repaint test to a spv2 paint invalidation test.

See https://codereview.chromium.org/1324763002/ for details about spv2 paint
invalidation test.

Removed fast/repaint and compositing/repaint as spv2 virtual suites.
Run paint/invalidation/spv2 as spv2 physical suite.

BUG=524236,524134,527242

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

git-svn-id: svn://svn.chromium.org/blink/trunk@201813 bbb929c8-8fbe-4397-9dbb-9b2b20218538
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations
index 71580d1..a19b78e 100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -2,64 +2,59 @@
 crbug.com/524134 virtual/spv2/paint/invalidation/spv2 [ Skip ]
 
 # TODO(wangxianzhu): Triage the failures
-crbug.com/524134 virtual/spv2/compositing/repaint/opacity-between-absolute.html [ ImageOnlyFailure ]
-crbug.com/524134 virtual/spv2/compositing/repaint/opacity-between-absolute2.html [ ImageOnlyFailure ]
-crbug.com/524134 virtual/spv2/fast/repaint/absolute-position-changed.html [ Failure ImageOnlyFailure ]
-crbug.com/524134 virtual/spv2/fast/repaint/align-self-change-keeping-geometry-grid.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/block-selection-gap-in-composited-layer.html [ ImageOnlyFailure ]
-crbug.com/524134 virtual/spv2/fast/repaint/clip-path-constant-repaint.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/composited-iframe-scroll-repaint.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/dont-invalidate-root-layer-when-composited-layer-becomes-visible.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/fixed-element-repaint-after-compositing-update.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/fixed-position-layer-moved.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/japanese-rl-selection-clear.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/japanese-rl-selection-repaint.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/justify-self-change-keeping-geometry.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/overflow-move-after-scroll.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/overflow-scroll-after-move.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/relative-positioned-movement-repaint.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/relayout-fixed-position-after-scale.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/repaint-composited-child-in-scrolled-container.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/selection-after-delete.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/selection-after-remove.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/selection-change-in-iframe-with-relative-parent.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/selection-clear.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/selection-gap-absolute-child.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/selection-gap-fixed-child.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/selection-gap-flipped-absolute-child.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/selection-gap-flipped-fixed-child.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/selection-gap-overflow-scroll-2.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/selection-gap-overflow-scroll.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/selection-gap-transformed-absolute-child.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/selection-gap-transformed-fixed-child.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/selection-partial-invalidation-between-blocks.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/stacking-context-lost.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/video-mute-repaint.html [ Failure ]
-crbug.com/524134 virtual/spv2/fast/repaint/video-unmute-repaint.html [ Failure ]
 crbug.com/524134 virtual/spv2/paint/invalidation/invalidate-after-composited-scroll.html [ Failure ]
 crbug.com/524134 virtual/spv2/paint/selection/text-selection-drag.html [ ImageOnlyFailure ]
 crbug.com/524134 virtual/spv2/paint/deprecatedpaintlayer/non-self-painting-layer-overrides-visibility.html [ Crash ImageOnlyFailure ]
-crbug.com/524134 [ SnowLeopard ] virtual/spv2/compositing/repaint/newly-composited-on-scroll.html [ ImageOnlyFailure ]
-crbug.com/524134 [ SnowLeopard ] virtual/spv2/fast/repaint/background-image-paint-invalidation-large-abspos-div.html [ ImageOnlyFailure ]
-crbug.com/524134 [ SnowLeopard ] virtual/spv2/fast/repaint/repaint-during-scroll.html [ ImageOnlyFailure ]
-crbug.com/524134 [ Win10 ] virtual/spv2/compositing/repaint/become-overlay-composited-layer.html [ Timeout ]
-crbug.com/524134 [ Win10 ] virtual/spv2/compositing/repaint/clipped-layer-size-change.html [ Timeout ]
-crbug.com/524134 [ Win10 ] virtual/spv2/compositing/repaint/layer-repaint.html [ Timeout ImageOnlyFailure ]
-crbug.com/524134 [ Win10 ] virtual/spv2/compositing/repaint/layer-repaint-rects.html [ Timeout ImageOnlyFailure ]
+crbug.com/524134 paint/invalidation/spv2/destroy-scrollbar.html [ ImageOnlyFailure ]
+crbug.com/524134 paint/invalidation/spv2/focus-ring-on-continuation-move.html [ ImageOnlyFailure ] 
+crbug.com/524134 paint/invalidation/spv2/justify-self-change-keeping-geometry.html [ ImageOnlyFailure ]
+crbug.com/524134 paint/invalidation/spv2/fixed-scroll-in-empty-root-layer.html [ ImageOnlyFailure ]
+crbug.com/524134 paint/invalidation/spv2/layout-state-only-positioned.html [ ImageOnlyFailure ]
 
-crbug.com/524236 virtual/spv2/compositing/repaint/clipping-should-not-repaint-composited-descendants.html [ Failure ]
-crbug.com/524236 virtual/spv2/compositing/repaint/scroll-fixed-layer-no-content.html [ Failure ]
-crbug.com/524236 virtual/spv2/compositing/repaint/scroll-fixed-layer-out-of-view.html [ Failure ]
-crbug.com/524236 virtual/spv2/compositing/repaint/scroll-fixed-squahed-layer.html [ Failure ]
-crbug.com/524236 virtual/spv2/compositing/repaint/should-not-clip-composited-overflow-scrolling-layer.html [ Failure ]
-crbug.com/524236 virtual/spv2/compositing/repaint/should-not-repaint-composited-descendants-on-overflow-change.html [ Failure ]
-crbug.com/524236 virtual/spv2/compositing/repaint/should-not-repaint-composited-descendants.html [ Failure ]
-crbug.com/524236 virtual/spv2/compositing/repaint/should-not-repaint-composited-filter.html [ Failure ]
-crbug.com/524236 virtual/spv2/compositing/repaint/should-not-repaint-composited-opacity.html [ Failure ]
-crbug.com/524236 virtual/spv2/compositing/repaint/should-not-repaint-composited-transform.html [ Failure ]
-crbug.com/524236 virtual/spv2/compositing/repaint/should-not-repaint-composited-z-index.html [ Failure ]
-crbug.com/524236 virtual/spv2/fast/repaint/absolute-layer-specified-left-or-right-auto-width-moved-vertically.html [ Failure ]
+crbug.com/524236 paint/invalidation/spv2/align-self-change-keeping-geometry-grid.html [ ImageOnlyFailure ]
+crbug.com/524236 paint/invalidation/spv2/clipping-should-not-repaint-composited-descendants.html [ ImageOnlyFailure ]
+crbug.com/524236 paint/invalidation/spv2/scroll-fixed-layer-no-content.html [ ImageOnlyFailure ]
+crbug.com/524236 paint/invalidation/spv2/scroll-fixed-layer-out-of-view.html [ ImageOnlyFailure ]
+crbug.com/524236 paint/invalidation/spv2/scroll-fixed-squahed-layer.html [ ImageOnlyFailure ]
+crbug.com/524236 paint/invalidation/spv2/should-not-clip-composited-overflow-scrolling-layer.html [ ImageOnlyFailure ]
+crbug.com/524236 paint/invalidation/spv2/should-not-repaint-composited-descendants-on-overflow-change.html [ ImageOnlyFailure ]
+crbug.com/524236 paint/invalidation/spv2/should-not-repaint-composited-descendants.html [ ImageOnlyFailure ]
+crbug.com/524236 paint/invalidation/spv2/should-not-repaint-composited-filter.html [ ImageOnlyFailure ]
+crbug.com/524236 paint/invalidation/spv2/should-not-repaint-composited-opacity.html [ ImageOnlyFailure ]
+crbug.com/524236 paint/invalidation/spv2/should-not-repaint-composited-transform.html [ ImageOnlyFailure ]
+crbug.com/524236 paint/invalidation/spv2/should-not-repaint-composited-z-index.html [ ImageOnlyFailure ]
+crbug.com/524236 paint/invalidation/spv2/absolute-layer-specified-left-or-right-auto-width-moved-vertically.html [ ImageOnlyFailure ]
 crbug.com/524236 paint/invalidation/spv2/invalidate-after-composited-scroll.html [ ImageOnlyFailure ]
+crbug.com/524236 paint/invalidation/spv2/clip-path-constant-repaint.html [ ImageOnlyFailure ]
+crbug.com/524236 paint/invalidation/spv2/relative-positioned-movement-repaint.html [ ImageOnlyFailure ]
+crbug.com/524236 paint/invalidation/spv2/repaint-tile-clipped.html [ ImageOnlyFailure ]
+crbug.com/524236 paint/invalidation/spv2/updating-scrolling-content.html [ ImageOnlyFailure ]
+crbug.com/524236 paint/invalidation/spv2/scrolling-without-painting.html [ ImageOnlyFailure ]
+
+crbug.com/524134 paint/invalidation/spv2/paint-caret-in-div-with-negative-indent.html [ NeedsRebaseline ]
+crbug.com/524134 paint/invalidation/spv2/selection-gap-absolute-child.html [ NeedsRebaseline ]
+crbug.com/524134 paint/invalidation/spv2/selection-gap-fixed-child.html [ NeedsRebaseline ]
+crbug.com/524134 paint/invalidation/spv2/selection-gap-flipped-absolute-child.html [ NeedsRebaseline ]
+crbug.com/524134 paint/invalidation/spv2/selection-gap-flipped-fixed-child.html [ NeedsRebaseline ]
+crbug.com/524134 paint/invalidation/spv2/selection-gap-transformed-absolute-child.html [ NeedsRebaseline ]
+crbug.com/524134 paint/invalidation/spv2/selection-gap-transformed-fixed-child.html [ NeedsRebaseline ]
+crbug.com/524134 paint/invalidation/spv2/set-text-content-same.html [ NeedsRebaseline ]
+crbug.com/524134 paint/invalidation/spv2/text-match-highlight.html [ NeedsRebaseline ]
+crbug.com/524134 paint/invalidation/spv2/obscured-background-no-repaint.html [ NeedsRebaseline ]
+crbug.com/524134 paint/invalidation/spv2/percent-size-image-resize-container.html [ NeedsRebaseline ]
+crbug.com/524134 paint/invalidation/spv2/selection-within-composited-scroller.html [ NeedsRebaseline ]
+crbug.com/524134 paint/invalidation/spv2/selection-change-in-iframe-with-relative-parent.html [ NeedsRebaseline ]
+crbug.com/524134 paint/invalidation/spv2/background-resize-height.html [ NeedsRebaseline ]
+crbug.com/524134 paint/invalidation/spv2/background-resize-width.html [ NeedsRebaseline ]
+
+crbug.com/527242 paint/invalidation/spv2/cached-cell-append.html [ ImageOnlyFailure ]
+crbug.com/527242 paint/invalidation/spv2/cached-cell-remove.html [ ImageOnlyFailure ]
+crbug.com/527242 paint/invalidation/spv2/cached-change-cell-border-width.html [ ImageOnlyFailure ]
+crbug.com/527242 paint/invalidation/spv2/cached-change-col-border-width.html [ ImageOnlyFailure ]
+crbug.com/527242 paint/invalidation/spv2/cached-change-colgroup-border-width.html [ ImageOnlyFailure ]
+crbug.com/527242 paint/invalidation/spv2/cached-change-row-border-width.html [ ImageOnlyFailure ]
+crbug.com/527242 paint/invalidation/spv2/cached-change-table-border-width.html [ ImageOnlyFailure ]
+crbug.com/527242 paint/invalidation/spv2/cached-change-tbody-border-width.html [ ImageOnlyFailure ]
 
 crbug.com/504613 crbug.com/524248 paint/images/image-backgrounds-not-antialiased.html [ Skip ]
 crbug.com/504613 crbug.com/524248 virtual/spv2/paint/images/image-backgrounds-not-antialiased.html [ Skip ]
@@ -215,7 +210,6 @@
 crbug.com/469657 fast/events/mouse-event-buttons-attribute.html [ Failure Pass ]
 crbug.com/432129 fast/html/marquee-scroll.html [ Failure Pass ]
 crbug.com/320139 fast/repaint/block-layout-inline-children-replaced.html [ Failure Pass ]
-crbug.com/320139 virtual/spv2/fast/repaint/block-layout-inline-children-replaced.html [ Skip ]
 crbug.com/518929 [ Precise Debug ] http/tests/appcache/obsolete-error-events.html [ Failure Pass Timeout ]
 crbug.com/518929 [ Precise Debug ] http/tests/appcache/remove-cache.html [ Failure Pass ]
 crbug.com/248938 virtual/threaded/transitions/cancel-and-start-new.html [ Pass Failure ]
diff --git a/third_party/WebKit/LayoutTests/VirtualTestSuites b/third_party/WebKit/LayoutTests/VirtualTestSuites
index be13293..751f8754 100644
--- a/third_party/WebKit/LayoutTests/VirtualTestSuites
+++ b/third_party/WebKit/LayoutTests/VirtualTestSuites
@@ -171,20 +171,7 @@
   },
   {
     "prefix": "spv2",
-    "base": "compositing/repaint",
-    "args": ["--enable-slimming-paint-v2",
-             "--enable-blink-features=SelectionPaintingWithoutSelectionGaps"]
-  },
-  {
-    "prefix": "spv2",
-    "base": "fast/repaint",
-    "args": ["--enable-slimming-paint-v2",
-             "--enable-blink-features=SelectionPaintingWithoutSelectionGaps"]
-  },
-  {
-    "prefix": "spv2",
     "base": "paint",
-    "args": ["--enable-slimming-paint-v2",
-             "--enable-blink-features=SelectionPaintingWithoutSelectionGaps"]
+    "args": ["--enable-slimming-paint-v2"]
   }
 ]
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/README.txt b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/README.txt
new file mode 100644
index 0000000..9749765
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/README.txt
@@ -0,0 +1,2 @@
+This directory contains tests converted from original text-based-repaint tests.
+http://pastebin.com/NBWbTScC is the semi-automatic convertion tool.
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-display-block-to-none-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-display-block-to-none-expected.html
new file mode 100644
index 0000000..62ecb86
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-display-block-to-none-expected.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+When an absolute positioned element is set display:none, we should not invalidate the whole body.
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-display-block-to-none.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-display-block-to-none.html
new file mode 100644
index 0000000..b184418
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-display-block-to-none.html
@@ -0,0 +1,14 @@
+<!-- Based on fast/repaint/absolute-display-block-to-none.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='absolute'",
+];
+function paintInvalidationTest() {
+  document.getElementById('absolute').style.display = 'none';
+}
+onload = runPaintInvalidationTest;
+</script>
+When an absolute positioned element is set display:none, we should not invalidate the whole body.
+<div id="absolute" style="position: absolute; width: 100px; height: 100px; top: 100px; left: 100px; background-color: red"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-layer-specified-left-or-right-auto-width-moved-vertically-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-layer-specified-left-or-right-auto-width-moved-vertically-expected.html
new file mode 100644
index 0000000..2f45995
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-layer-specified-left-or-right-auto-width-moved-vertically-expected.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<style>
+    #left, #right {
+        position: absolute;
+        top: 400px;
+        -webkit-backface-visibility: hidden;
+    }
+    #left {
+        left: 0px;
+    }
+    #right {
+        right: 0px;
+    }
+</style>
+
+There should be no repaint when the divs are moved vertically.
+<div id="left">Left</div>
+<div id="right">Right</div>
+<pre id="result"></pre>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-layer-specified-left-or-right-auto-width-moved-vertically.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-layer-specified-left-or-right-auto-width-moved-vertically.html
new file mode 100644
index 0000000..736e548
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-layer-specified-left-or-right-auto-width-moved-vertically.html
@@ -0,0 +1,33 @@
+<!-- Based on fast/repaint/absolute-layer-specified-left-or-right-auto-width-moved-vertically.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+];
+function paintInvalidationTest()
+{
+    document.getElementById('left').style.top = '400px';
+    document.getElementById('right').style.top = '400px';
+}
+
+window.onload = runPaintInvalidationTest;
+</script>
+
+<style>
+    #left, #right {
+        position: absolute;
+        top: 200px;
+        -webkit-backface-visibility: hidden;
+    }
+    #left {
+        left: 0px;
+    }
+    #right {
+        right: 0px;
+    }
+</style>
+
+There should be no repaint when the divs are moved vertically.
+<div id="left">Left</div>
+<div id="right">Right</div>
+<pre id="result"></pre>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-margin-change-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-margin-change-repaint-expected.html
new file mode 100644
index 0000000..10d9fd7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-margin-change-repaint-expected.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<style>
+    body {
+        margin: 0;
+    }
+    #container {
+        position: relative;
+        top: 40px;
+        width: 200px;
+        height: 400px;
+    }
+    #test {
+        position: absolute;
+        background-color: green;
+        width: 100px;
+        height: 100px;
+        margin-top: 20px;
+    }
+</style>
+<div id="container">
+    <div id="test"></div>
+</div>
+Tests the repainting of absolute element when margin-top changes.
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-margin-change-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-margin-change-repaint.html
new file mode 100644
index 0000000..5e0a94f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-margin-change-repaint.html
@@ -0,0 +1,34 @@
+<!-- Based on fast/repaint/absolute-margin-change-repaint.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<style>
+    body {
+        margin: 0;
+    }
+    #container {
+        position: relative;
+        top: 40px;
+        width: 200px;
+        height: 400px;
+    }
+    #test {
+        position: absolute;
+        background-color: green;
+        width: 100px;
+        height: 100px;
+    }
+</style>
+<script>
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow (positioned) DIV id='test'",
+    ];
+    function paintInvalidationTest()
+    {
+        document.getElementById("test").style['margin-top'] = '20px';
+    }
+    window.onload = runPaintInvalidationTest;
+</script>
+<div id="container">
+    <div id="test"></div>
+</div>
+Tests the repainting of absolute element when margin-top changes.
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-position-change-containing-block-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-position-change-containing-block-expected.html
new file mode 100644
index 0000000..76b2a32
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-position-change-containing-block-expected.html
@@ -0,0 +1,8 @@
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+</head>
+<body style="height:2000px;">
+    <div id="container" class="blue"><div style="top:100px; left:100px;" class="absolute green"></div></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-position-change-containing-block.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-position-change-containing-block.html
new file mode 100644
index 0000000..71e4346
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-position-change-containing-block.html
@@ -0,0 +1,26 @@
+<!-- Based on fast/repaint/absolute-position-change-containing-block.html -->
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (positioned) DIV id='container' class='fixed blue'",
+            "LayoutBlockFlow (positioned) DIV class='absolute green'",
+            "LayoutBlockFlow DIV id='container' class='fixed blue'",
+            "LayoutBlockFlow (positioned) DIV class='absolute green'",
+            "LayoutBlockFlow BODY",
+            "LayoutBlockFlow DIV id='container' class='fixed blue'",
+            "LayoutBlockFlow (positioned) DIV class='absolute green'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById('container').style.position = 'static';
+        }
+    </script>
+</head>
+<body style="height:2000px;" onload="runPaintInvalidationTest()">
+    <!-- You should see 2 overlapping rectangles in the output: a green one (on top) and a blue one. -->
+    <div id="container" style="top: 5000px;" class="fixed blue"><div style="top:100px; left:100px;" class="absolute green"></div></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-position-changed-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-position-changed-expected.html
new file mode 100644
index 0000000..05903dd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-position-changed-expected.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <style>
+        ::-webkit-scrollbar {
+            width: 0px;
+            height: 0px;
+        }
+        html {
+            overflow: scroll;
+        }
+    </style>
+    <script type="text/javascript">
+        window.onload = function() {
+            window.scrollTo(0, 500);
+        };
+    </script>
+</head>
+<body style="height:2000px;">
+    <!-- You should see 1 green rectangle in the output and no red. -->
+    <div style="top: 200px; left: 100px;" class="fixed red"></div>
+    <div id="absoluteDiv" style="top: 700px; left:100px;" class="absolute green"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-position-changed.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-position-changed.html
new file mode 100644
index 0000000..5d08a8a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-position-changed.html
@@ -0,0 +1,35 @@
+<!-- Based on fast/repaint/absolute-position-changed.html -->
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <style>
+        ::-webkit-scrollbar {
+            width: 0px;
+            height: 0px;
+        }
+        html {
+            overflow: scroll;
+        }
+    </style>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        window.onload = function() {
+            window.scrollTo(0, 500);
+            runPaintInvalidationTest();
+        };
+
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (positioned) DIV id='absoluteDiv' class='absolute green'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById('absoluteDiv').style.top = '700px';
+        }
+    </script>
+</head>
+<body style="height:2000px;">
+    <!-- You should see 1 green rectangle in the output and no red. -->
+    <div style="top: 200px; left: 100px;" class="fixed red"></div>
+    <div id="absoluteDiv" style="top: 500px; left:100px;" class="absolute green"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-position-moved-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-position-moved-expected.html
new file mode 100644
index 0000000..3369bfe
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-position-moved-expected.html
@@ -0,0 +1,9 @@
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+</head>
+<body style="height:2000px;">
+    <div style="top: 5000px;" class="fixed red"></div>
+    <div id="absoluteDiv" style="top:100px; left:100px;" class="absolute green"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-position-moved.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-position-moved.html
new file mode 100644
index 0000000..60bcf1c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/absolute-position-moved.html
@@ -0,0 +1,23 @@
+<!-- Based on fast/repaint/absolute-position-moved.html -->
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (positioned) DIV id='absoluteDiv' class='absolute green'",
+            "LayoutBlockFlow (positioned) DIV id='absoluteDiv' class='absolute green'",
+        ];
+        function paintInvalidationTest()
+        {
+            var absoluteDiv = document.getElementById('absoluteDiv');
+            absoluteDiv.parentNode.removeChild(absoluteDiv);
+            document.body.appendChild(absoluteDiv);
+        }
+    </script>
+</head>
+<body style="height:2000px;" onload="runPaintInvalidationTest()">
+    <!-- You should see 1 green rectangle in the output and no red. -->
+    <div style="top: 5000px;" class="fixed red"><div id="absoluteDiv" style="top:100px; left:100px;" class="absolute green"></div></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/add-table-overpaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/add-table-overpaint-expected.html
new file mode 100644
index 0000000..089321e2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/add-table-overpaint-expected.html
@@ -0,0 +1,18 @@
+
+<!DOCTYPE html>
+<html>
+<body style="margin: 0px">
+<style>
+td {
+  height: 150px;
+  width: 150px;
+  background-color: blue;
+}
+</style>
+<div id="container">
+  <div><table><td></td></table></div>
+  <div><table><td></td></table></div>
+  <div><table><td></td></table></div>
+</div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/add-table-overpaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/add-table-overpaint.html
new file mode 100644
index 0000000..3b9604d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/add-table-overpaint.html
@@ -0,0 +1,37 @@
+<!-- Based on fast/repaint/add-table-overpaint.html -->
+
+<!DOCTYPE html>
+<html>
+<body onload="runPaintInvalidationTest()" style="margin: 0px">
+<script src="resources/paint-invalidation-test.js"></script>
+<style>
+td {
+  height: 150px;
+  width: 150px;
+  background-color: blue;
+}
+</style>
+<!-- This test adds 3 tables do the document.  Adding the 3rd table should not cause the first table to repaint. -->
+<div id="container"></div>
+<script>
+function addTable() {
+	var div = document.createElement('div');
+	document.getElementById('container').appendChild(div);
+  div.innerHTML = '<table><td></td></table>';
+}
+addTable();
+addTable();
+window.expectedPaintInvalidationObjects = [
+  "LayoutBlockFlow DIV",
+  "LayoutTable TABLE",
+  "LayoutTableCell TD",
+  "LayoutTableSection TBODY",
+  "LayoutTableRow TR",
+  "LayoutTableCell TD",
+];
+function paintInvalidationTest() {
+  addTable();
+}
+</script>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-change-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-change-expected.html
new file mode 100644
index 0000000..c189fab
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-change-expected.html
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: flex;
+  align-content: stretch;
+  flex-flow: row wrap;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item {
+  background-color: green;
+  border: solid thin blue;
+  width: 200px;
+}
+</style>
+<p style="height: 20px">Tests invalidation on align-content style change. Passes if there is no red.</p>
+<div id="container">
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-change-keeping-geometry-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-change-keeping-geometry-expected.html
new file mode 100644
index 0000000..dd98018f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-change-keeping-geometry-expected.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML>
+<style>
+#container {
+  display: flex;
+  align-items: flex-start;
+  align-content: center;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item {
+  background-color: green;
+  border: solid thin blue;
+  width: 100px;
+  height: 300px;
+}
+</style>
+<p style="height: 20px">There should be no invalidations because align-content style change causes no visual change.</p>
+<div id="container">
+  <div class="item"></div>
+  <div class="item"></div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-change-keeping-geometry.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-change-keeping-geometry.html
new file mode 100644
index 0000000..53dd1ac
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-change-keeping-geometry.html
@@ -0,0 +1,31 @@
+<!-- Based on fast/repaint/align-content-change-keeping-geometry.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+];
+function paintInvalidationTest() {
+  document.getElementById('container').style.alignContent = 'center';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+#container {
+  display: flex;
+  align-items: flex-start;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item {
+  background-color: green;
+  border: solid thin blue;
+  width: 100px;
+  height: 300px;
+}
+</style>
+<p style="height: 20px">There should be no invalidations because align-content style change causes no visual change.</p>
+<div id="container">
+  <div class="item"></div>
+  <div class="item"></div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-change-no-flex-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-change-no-flex-expected.html
new file mode 100644
index 0000000..60f1276
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-change-no-flex-expected.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML>
+<style>
+.container {
+  width: 200px;
+  height: 300px;
+  background-color: blue;
+  align-content: flex-end;
+}
+.item {
+  background-color: green;
+  border: solid thin blue;
+}
+</style>
+There should be no invalidations when align-content changes on a non-flex container.
+<div id="container">
+  <div class="item">
+    <div style="height: 100px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 150px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-change-no-flex.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-change-no-flex.html
new file mode 100644
index 0000000..b7a1ce37
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-change-no-flex.html
@@ -0,0 +1,31 @@
+<!-- Based on fast/repaint/align-content-change-no-flex.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+];
+function paintInvalidationTest() {
+  document.getElementById('container').style.alignContent = 'flex-end';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+.container {
+  width: 200px;
+  height: 300px;
+  background-color: blue;
+}
+.item {
+  background-color: green;
+  border: solid thin blue;
+}
+</style>
+There should be no invalidations when align-content changes on a non-flex container.
+<div id="container">
+  <div class="item">
+    <div style="height: 100px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 150px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-change.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-change.html
new file mode 100644
index 0000000..6978f3a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-change.html
@@ -0,0 +1,42 @@
+<!-- Based on fast/repaint/align-content-change.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+];
+function paintInvalidationTest() {
+  document.getElementById('container').style.alignContent = 'stretch';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: flex;
+  align-content: space-around;
+  flex-flow: row wrap;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item {
+  background-color: green;
+  border: solid thin blue;
+  width: 200px;
+}
+</style>
+<p style="height: 20px">Tests invalidation on align-content style change. Passes if there is no red.</p>
+<div id="container">
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-distribution-change-grid-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-distribution-change-grid-expected.html
new file mode 100644
index 0000000..c469c55
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-distribution-change-grid-expected.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid-auto-columns: 200px;
+  grid-auto-rows: auto;
+  grid-auto-flow: row;
+  align-content: stretch;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item {
+  background-color: green;
+}
+</style>
+<p style="height: 20px">Tests invalidation on align-content style change (distribution). Passes if there is no red.</p>
+<div id="container">
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-distribution-change-grid.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-distribution-change-grid.html
new file mode 100644
index 0000000..c3f2b7a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-distribution-change-grid.html
@@ -0,0 +1,48 @@
+<!-- Based on fast/repaint/align-content-distribution-change-grid.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutGrid DIV id='container'",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+];
+function paintInvalidationTest() {
+  document.getElementById('container').style.alignContent = 'stretch';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid-auto-columns: 200px;
+  grid-auto-rows: auto;
+  grid-auto-flow: row;
+  align-content: space-around;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item {
+  background-color: green;
+}
+</style>
+<p style="height: 20px">Tests invalidation on align-content style change (distribution). Passes if there is no red.</p>
+<div id="container">
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-position-change-grid-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-position-change-grid-expected.html
new file mode 100644
index 0000000..a4aec8d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-position-change-grid-expected.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid-auto-columns: 200px;
+  grid-auto-rows: auto;
+  grid-auto-flow: row;
+  align-content: end;
+  width: 200px;
+  height: 300px;
+  background-color: orange;
+}
+.item {
+  background-color: green;
+}
+</style>
+<p style="height: 20px">Tests invalidation on align-content style change (position). Passes if the orange half is on the top.</p>
+<div id="container">
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-position-change-grid.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-position-change-grid.html
new file mode 100644
index 0000000..dd5b26f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-content-position-change-grid.html
@@ -0,0 +1,48 @@
+<!-- Based on fast/repaint/align-content-position-change-grid.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutGrid DIV id='container'",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+];
+function paintInvalidationTest() {
+  document.getElementById('container').style.alignContent = 'end';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid-auto-columns: 200px;
+  grid-auto-rows: auto;
+  grid-auto-flow: row;
+  align-content: start;
+  width: 200px;
+  height: 300px;
+  background-color: orange;
+}
+.item {
+  background-color: green;
+}
+</style>
+<p style="height: 20px">Tests invalidation on align-content style change (position). Passes if the orange half is on the top.</p>
+<div id="container">
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-items-change-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-items-change-expected.html
new file mode 100644
index 0000000..8285627
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-items-change-expected.html
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: flex;
+  align-items: stretch;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item {
+  background-color: green;
+  border: solid thin blue;
+  width: 100px;
+}
+</style>
+<p style="height: 20px">Tests invalidation on align-items style change. Passes if there is no red.</p>
+<div id="container">
+  <div class="item">
+    <div style="height: 100px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 150px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-items-change.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-items-change.html
new file mode 100644
index 0000000..c5ae0ed
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-items-change.html
@@ -0,0 +1,47 @@
+<!-- Based on fast/repaint/align-items-change.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutFlexibleBox DIV id='container'",
+    "LayoutFlexibleBox DIV id='container'",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+];
+function paintInvalidationTest() {
+  document.getElementById('container').style.alignItems = 'stretch';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: flex;
+  align-items: flex-start;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item {
+  background-color: green;
+  border: solid thin blue;
+  width: 100px;
+}
+</style>
+<p style="height: 20px">Tests invalidation on align-items style change. Passes if there is no red.</p>
+<div id="container">
+  <div class="item">
+    <div style="height: 100px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 150px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-items-overflow-change-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-items-overflow-change-expected.html
new file mode 100644
index 0000000..01d0195
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-items-overflow-change-expected.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid: 200px / 150px 150px;
+  align-items: end safe;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item1 {
+  grid-row: 1;
+  grid-column: 1;
+  background-color: green;
+}
+.item2 {
+  grid-row: 2;
+  grid-column: 1;
+  background-color: green;
+}
+</style>
+<p style="height: 20px">Tests invalidation on align-items style change (just overflow). Passes if there is no red.</p>
+<div id="container">
+    <div class="item1">
+        <div style="height: 200px"></div>
+    </div>
+    <div class="item2">
+        <div style="height: 100px"></div>
+    </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-items-overflow-change.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-items-overflow-change.html
new file mode 100644
index 0000000..b511175
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-items-overflow-change.html
@@ -0,0 +1,54 @@
+<!-- Based on fast/repaint/align-items-overflow-change.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item1'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item2'",
+    "LayoutGrid DIV id='container'",
+    "LayoutBlockFlow BODY",
+    "LayoutGrid DIV id='container'",
+    "LayoutBlockFlow DIV class='item1'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item2'",
+    "LayoutBlockFlow DIV",
+];
+function paintInvalidationTest() {
+  document.getElementById('container').style.alignItems = 'end safe';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid: 200px / 150px 150px;
+  align-items: end true;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item1 {
+  grid-row: 1;
+  grid-column: 1;
+  background-color: green;
+}
+.item2 {
+  grid-row: 2;
+  grid-column: 1;
+  background-color: green;
+}
+</style>
+<p style="height: 20px">Tests invalidation on align-items style change (just overflow). Passes if there is no red.</p>
+<div id="container">
+    <div class="item1">
+        <div style="height: 200px"></div>
+    </div>
+    <div class="item2">
+        <div style="height: 100px"></div>
+    </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-expected.html
new file mode 100644
index 0000000..e7e9a83
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-expected.html
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML>
+<style>
+body {
+  margin: 0;
+}
+.flex {
+  display: flex;
+  align-items: flex-start;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item {
+  background-color: green;
+  border: solid thin blue;
+  width: 100px;
+  align-self: stretch;
+}
+</style>
+<p style="height: 20px">Tests invalidation on align-self style change. Passes if there is no red.</p>
+<div class="flex">
+  <div class="item">
+    <div style="height: 100px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 150px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-grid-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-grid-expected.html
new file mode 100644
index 0000000..66bdd22
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-grid-expected.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid: 100px 100px / 300px;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item1 {
+  grid-row: 1;
+  grid-column: 1;
+  align-self: stretch;
+  background-color: green;
+}
+.item2 {
+  grid-row: 1;
+  grid-column: 2;
+  align-self: stretch;
+  background-color: green;
+}
+</style>
+<p style="height: 20px">Tests invalidation on align-self style change. Passes if there is no red.</p>
+<div id="container">
+  <div class="item1">
+    <div style="height: 50px"></div>
+  </div>
+  <div class="item2">
+    <div style="height: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-grid.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-grid.html
new file mode 100644
index 0000000..b703ade
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-grid.html
@@ -0,0 +1,48 @@
+<!-- Based on fast/repaint/align-self-change-grid.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV class='item1'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item2'",
+];
+function paintInvalidationTest() {
+  document.getElementsByClassName('item1')[0].style.alignSelf = 'stretch';
+  document.getElementsByClassName('item2')[0].style.alignSelf = 'stretch';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid: 100px 100px / 300px;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item1 {
+  grid-row: 1;
+  grid-column: 1;
+  align-self: end;
+  background-color: green;
+}
+.item2 {
+  grid-row: 1;
+  grid-column: 2;
+  align-self: start;
+  background-color: green;
+}
+</style>
+<p style="height: 20px">Tests invalidation on align-self style change. Passes if there is no red.</p>
+<div id="container">
+  <div class="item1">
+    <div style="height: 50px"></div>
+  </div>
+  <div class="item2">
+    <div style="height: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-keeping-geometry-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-keeping-geometry-expected.html
new file mode 100644
index 0000000..151a3c6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-keeping-geometry-expected.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML>
+<style>
+.flex {
+  display: flex;
+  align-items: flex-start;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item {
+  background-color: green;
+  border: solid thin blue;
+  width: 100px;
+  height: 300px;
+  align-self: stretch;
+}
+</style>
+<p style="height: 20px">There should be no invalidations because align-self style change causes no visual change.</p>
+<div class="flex">
+  <div class="item"></div>
+  <div class="item"></div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-keeping-geometry-grid-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-keeping-geometry-grid-expected.html
new file mode 100644
index 0000000..dcf4062
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-keeping-geometry-grid-expected.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid: 100px / 300px;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item {
+  grid-row: 1;
+  grid-column: 1;
+  align-self: stretch;
+  background-color: green;
+}
+</style>
+<p style="height: 20px">There should be no invalidations because align-self style change causes no visual change.</p>
+<div id="container">
+  <div class="item">
+    <div style="height: 300px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-keeping-geometry-grid.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-keeping-geometry-grid.html
new file mode 100644
index 0000000..5467e12
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-keeping-geometry-grid.html
@@ -0,0 +1,35 @@
+<!-- Based on fast/repaint/align-self-change-keeping-geometry-grid.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+];
+function paintInvalidationTest() {
+  document.getElementsByClassName('item')[0].style.alignSelf = 'stretch';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid: 100px / 300px;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item {
+  grid-row: 1;
+  grid-column: 1;
+  align-self: start;
+  background-color: green;
+}
+</style>
+<p style="height: 20px">There should be no invalidations because align-self style change causes no visual change.</p>
+<div id="container">
+  <div class="item">
+    <div style="height: 300px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-keeping-geometry.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-keeping-geometry.html
new file mode 100644
index 0000000..8b7d4806
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-keeping-geometry.html
@@ -0,0 +1,32 @@
+<!-- Based on fast/repaint/align-self-change-keeping-geometry.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+];
+function paintInvalidationTest() {
+  document.getElementsByClassName('item')[0].style.alignSelf = 'stretch';
+  document.getElementsByClassName('item')[1].style.alignSelf = 'stretch';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+.flex {
+  display: flex;
+  align-items: flex-start;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item {
+  background-color: green;
+  border: solid thin blue;
+  width: 100px;
+  height: 300px;
+}
+</style>
+<p style="height: 20px">There should be no invalidations because align-self style change causes no visual change.</p>
+<div class="flex">
+  <div class="item"></div>
+  <div class="item"></div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-no-flex-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-no-flex-expected.html
new file mode 100644
index 0000000..d3819d0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-no-flex-expected.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML>
+<style>
+.container {
+  width: 200px;
+  height: 300px;
+  background-color: blue;
+}
+.item {
+  background-color: green;
+  border: solid thin blue;
+  align-self: stretch;
+}
+</style>
+There should be no invalidations when align-self changes on a non-flex container.
+<div id="container">
+  <div class="item">
+    <div style="height: 100px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 150px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-no-flex.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-no-flex.html
new file mode 100644
index 0000000..1d79451
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change-no-flex.html
@@ -0,0 +1,32 @@
+<!-- Based on fast/repaint/align-self-change-no-flex.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+];
+function paintInvalidationTest() {
+  document.getElementsByClassName('item')[0].style.alignSelf = 'stretch';
+  document.getElementsByClassName('item')[1].style.alignSelf = 'stretch';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+.container {
+  width: 200px;
+  height: 300px;
+  background-color: blue;
+}
+.item {
+  background-color: green;
+  border: solid thin blue;
+}
+</style>
+There should be no invalidations when align-self changes on a non-flex container.
+<div id="container">
+  <div class="item">
+    <div style="height: 100px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 150px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change.html
new file mode 100644
index 0000000..20b899c7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-change.html
@@ -0,0 +1,40 @@
+<!-- Based on fast/repaint/align-self-change.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV class='item'",
+];
+function paintInvalidationTest() {
+  document.getElementsByClassName('item')[0].style.alignSelf = 'stretch';
+  document.getElementsByClassName('item')[1].style.alignSelf = 'stretch';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+.flex {
+  display: flex;
+  align-items: flex-start;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item {
+  background-color: green;
+  border: solid thin blue;
+  width: 100px;
+}
+</style>
+<p style="height: 20px">Tests invalidation on align-self style change. Passes if there is no red.</p>
+<div class="flex">
+  <div class="item">
+    <div style="height: 100px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 150px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-overflow-change-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-overflow-change-expected.html
new file mode 100644
index 0000000..2a25c8e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-overflow-change-expected.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid: 200px / 150px 150px;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item1 {
+  grid-row: 1;
+  grid-column: 1;
+  align-self: end safe;
+  background-color: green;
+}
+.item2 {
+  grid-row: 2;
+  grid-column: 1;
+  align-self: end safe;
+  background-color: green;
+</style>
+<p style="height: 20px">Tests invalidation on align-self style change (just overflow). Passes if there is no red.</p>
+<div id="container">
+  <div class="item1">
+    <div style="height: 200px"></div>
+  </div>
+  <div class="item2">
+    <div style="height: 100px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-overflow-change.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-overflow-change.html
new file mode 100644
index 0000000..b9fe1dc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/align-self-overflow-change.html
@@ -0,0 +1,49 @@
+<!-- Based on fast/repaint/align-self-overflow-change.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow BODY",
+    "LayoutGrid DIV id='container'",
+    "LayoutBlockFlow DIV class='item1'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item2'",
+];
+function paintInvalidationTest() {
+  document.getElementsByClassName('item1')[0].style.alignSelf = 'end safe';
+  document.getElementsByClassName('item2')[0].style.alignSelf = 'end safe';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid: 200px / 150px 150px;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item1 {
+  grid-row: 1;
+  grid-column: 1;
+  align-self: end true;
+  background-color: green;
+}
+.item2 {
+  grid-row: 2;
+  grid-column: 1;
+  align-self: end true;
+  background-color: green;
+</style>
+<p style="height: 20px">Tests invalidation on align-self style change (just overflow). Passes if there is no red.</p>
+<div id="container">
+  <div class="item1">
+    <div style="height: 200px"></div>
+  </div>
+  <div class="item2">
+    <div style="height: 100px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-currentColor-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-currentColor-repaint-expected.html
new file mode 100644
index 0000000..1fc0572
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-currentColor-repaint-expected.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+
+<style>
+div {
+    width: 100px;
+    height: 100px;
+    background: currentColor;    
+}
+
+#div1 {
+    color: transparent;
+}
+
+#div2 {
+    color: blue;
+}
+
+</style>
+
+<div id="div1"></div>
+<div id="div2"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-currentColor-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-currentColor-repaint.html
new file mode 100644
index 0000000..6a113a4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-currentColor-repaint.html
@@ -0,0 +1,38 @@
+<!-- Based on fast/repaint/background-currentColor-repaint.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+
+<style>
+div {
+    width: 100px;
+    height: 100px;
+    background: currentColor;    
+}
+
+#div1 {
+    color: blue;
+}
+
+#div2 {
+    color: transparent;
+}
+
+</style>
+
+<div id="div1"></div>
+<div id="div2"></div>
+
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV id='div1'",
+    "LayoutBlockFlow DIV id='div2'",
+];
+function paintInvalidationTest()
+{
+	div1.style.color = 'transparent';
+ 	div2.style.color = 'blue';
+}
+
+window.onload = runPaintInvalidationTest;
+
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-generated-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-generated-expected.html
new file mode 100644
index 0000000..b86c0e7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-generated-expected.html
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML>
+<body">
+    <div style="width: 100px;
+                padding-top: 100px;
+                background-image: -webkit-gradient(linear, left top, left bottom, from(red), to(blue));
+    ">
+        <div id="target" style="height: 200px;"></div>
+    </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-generated.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-generated.html
new file mode 100644
index 0000000..f5f6ce2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-generated.html
@@ -0,0 +1,23 @@
+<!-- Based on fast/repaint/background-generated.html -->
+<!DOCTYPE HTML>
+<head>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow DIV",
+            "LayoutBlockFlow DIV id='target'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById("target").style.height = "200px";
+        }
+    </script>
+</head>
+<body onload="runPaintInvalidationTest();">
+    <div style="width: 100px;
+                padding-top: 100px;
+                background-image: -webkit-gradient(linear, left top, left bottom, from(red), to(blue));
+    ">
+        <div id="target" style="height: 100px;"></div>
+    </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-image-paint-invalidation-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-image-paint-invalidation-expected.html
new file mode 100644
index 0000000..c3d1cb3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-image-paint-invalidation-expected.html
@@ -0,0 +1,3 @@
+<!DOCTYPE html>
+<body style="background: url(../../../fast/repaint/resources/ducky.png); width: 800px; height: 2000px;">
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-image-paint-invalidation.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-image-paint-invalidation.html
new file mode 100644
index 0000000..cd9a21f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-image-paint-invalidation.html
@@ -0,0 +1,17 @@
+<!-- Based on fast/repaint/background-image-paint-invalidation.html -->
+<!DOCTYPE html>
+<body style="background: ; width: 800px; height: 2000px;">
+</body>
+<script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+<script>
+// Tests that repaint when changing a document background image invalidates the whole document, not just the part that is visible on the screen.
+
+window.expectedPaintInvalidationObjects = [
+    "LayoutView #document",
+    "LayoutBlockFlow BODY",
+];
+function paintInvalidationTest() {
+    document.body.style.background = 'url(../../../fast/repaint/resources/ducky.png)';
+}
+runPaintInvalidationTest();
+</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-misaligned-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-misaligned-expected.html
new file mode 100644
index 0000000..52564c7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-misaligned-expected.html
@@ -0,0 +1,11 @@
+<body>
+    <div style="
+        width: 267px;
+        height: 270px;
+        border: solid black;
+        background-image: url(../../../fast/backgrounds/size/resources/bikes.bmp);
+        -webkit-background-size: 500% 500%;
+        position: relative;
+    ">
+    </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-misaligned.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-misaligned.html
new file mode 100644
index 0000000..f85cb07c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-misaligned.html
@@ -0,0 +1,29 @@
+<!-- Based on fast/repaint/background-misaligned.html -->
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow (positioned) DIV id='target'",
+    ];
+    function paintInvalidationTest()
+    {
+        document.getElementById("target").style.display = "none";
+    }
+</script>
+<body onload="runPaintInvalidationTest()">
+    <div style="
+        width: 267px;
+        height: 270px;
+        border: solid black;
+        background-image: url(../../../fast/backgrounds/size/resources/bikes.bmp);
+        -webkit-background-size: 500% 500%;
+        position: relative;
+    ">
+        <div id="target" style="
+            width: 40px;
+            height: 40px;
+            position: absolute;
+            bottom: 0;
+            right: 0;
+        "></div>
+    </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-resize-height.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-resize-height.html
new file mode 100644
index 0000000..92a0982
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-resize-height.html
@@ -0,0 +1,122 @@
+<!-- Based on fast/repaint/background-resize-height.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsTextWithPixelResults();
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='container'",
+    "LayoutBlockFlow (positioned) DIV class='test image'",
+    "LayoutBlockFlow (positioned) DIV class='test image size-cover'",
+    "LayoutBlockFlow (positioned) DIV class='test image size-contain'",
+    "LayoutBlockFlow (positioned) DIV class='test image fixed-height'",
+    "LayoutBlockFlow (positioned) DIV class='test image percent-height'",
+    "LayoutBlockFlow (positioned) DIV class='test image top'",
+    "LayoutBlockFlow (positioned) DIV class='test image bottom'",
+    "LayoutBlockFlow (positioned) DIV class='test image center'",
+    "LayoutBlockFlow (positioned) DIV class='test image no-repeat'",
+    "LayoutBlockFlow (positioned) DIV class='test image repeat-space'",
+    "LayoutBlockFlow (positioned) DIV class='test image repeat-round'",
+    "LayoutBlockFlow (positioned) DIV class='test generated'",
+    "LayoutBlockFlow (positioned) DIV class='test generated cover'",
+    "LayoutBlockFlow (positioned) DIV class='test generated contain'",
+    "LayoutBlockFlow (positioned) DIV class='test generated fixed-height'",
+    "LayoutBlockFlow (positioned) DIV class='test generated percent-height'",
+    "LayoutBlockFlow (positioned) DIV class='test generated top'",
+    "LayoutBlockFlow (positioned) DIV class='test generated bottom'",
+    "LayoutBlockFlow (positioned) DIV class='test generated center'",
+    "LayoutBlockFlow (positioned) DIV class='test generated no-repeat'",
+    "LayoutBlockFlow (positioned) DIV class='test generated repeat-space'",
+    "LayoutBlockFlow (positioned) DIV class='test generated repeat-round'",
+];
+function paintInvalidationTest()
+{
+    document.getElementById('container').style.height = '550px';
+}
+window.onload = runPaintInvalidationTest;
+</script>
+<style>
+#container {
+    position: absolute;
+    width: 600px;
+    height: 500px;
+}
+.test {
+    backface-visibility: hidden;
+    position: absolute;
+    width: 10%;
+    height: 8%;
+}
+.image {
+    background-image: url(../../../fast/repaint/resources/small-apple.jpg);
+    top: 0px;
+}
+.generated {
+    background-image: linear-gradient(blue, green);
+    top: 100px;
+}
+.size-cover {
+    background-size: cover;
+    left: 50px;
+}
+.size-contain {
+    background-size: contain;
+    left: 100px;
+}
+.fixed-height {
+    background-size: auto 30px;
+    left: 150px;
+}
+.percent-height {
+    background-size: auto 50%;
+    left: 200px;
+}
+.top {
+    background-position: left 0px top 10px;
+    left: 250px;
+}
+.bottom {
+    background-position: left 0px bottom 10px;
+    left: 300px;
+}
+.center {
+    background-position: center; 
+    left: 350px;
+}
+.no-repeat {
+    background-repeat: no-repeat;
+    left: 400px;
+}
+.repeat-space {
+    background-repeat: space;
+    left: 450px;
+}
+.repeat-round {
+    background-repeat: round;
+    left: 500px;
+}
+</style>
+<div id="container">
+    <div class="test image"></div>
+    <div class="test image size-cover"></div>
+    <div class="test image size-contain"></div>
+    <div class="test image fixed-height"></div>
+    <div class="test image percent-height"></div>
+    <div class="test image top"></div>
+    <div class="test image bottom"></div>
+    <div class="test image center"></div>
+    <div class="test image no-repeat"></div>
+    <div class="test image repeat-space"></div>
+    <div class="test image repeat-round"></div>
+    <div class="test generated"></div>
+    <div class="test generated cover"></div>
+    <div class="test generated contain"></div>
+    <div class="test generated fixed-height"></div>
+    <div class="test generated percent-height"></div>
+    <div class="test generated top"></div>
+    <div class="test generated bottom"></div>
+    <div class="test generated center"></div>
+    <div class="test generated no-repeat"></div>
+    <div class="test generated repeat-space"></div>
+    <div class="test generated repeat-round"></div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-resize-width.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-resize-width.html
new file mode 100644
index 0000000..1ad78d7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-resize-width.html
@@ -0,0 +1,122 @@
+<!-- Based on fast/repaint/background-resize-width.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsTextWithPixelResults();
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='container'",
+    "LayoutBlockFlow (positioned) DIV class='test image'",
+    "LayoutBlockFlow (positioned) DIV class='test image size-cover'",
+    "LayoutBlockFlow (positioned) DIV class='test image size-contain'",
+    "LayoutBlockFlow (positioned) DIV class='test image fixed-width'",
+    "LayoutBlockFlow (positioned) DIV class='test image percent-width'",
+    "LayoutBlockFlow (positioned) DIV class='test image left'",
+    "LayoutBlockFlow (positioned) DIV class='test image right'",
+    "LayoutBlockFlow (positioned) DIV class='test image center'",
+    "LayoutBlockFlow (positioned) DIV class='test image no-repeat'",
+    "LayoutBlockFlow (positioned) DIV class='test image repeat-space'",
+    "LayoutBlockFlow (positioned) DIV class='test image repeat-round'",
+    "LayoutBlockFlow (positioned) DIV class='test generated'",
+    "LayoutBlockFlow (positioned) DIV class='test generated cover'",
+    "LayoutBlockFlow (positioned) DIV class='test generated contain'",
+    "LayoutBlockFlow (positioned) DIV class='test generated fixed-width'",
+    "LayoutBlockFlow (positioned) DIV class='test generated percent-width'",
+    "LayoutBlockFlow (positioned) DIV class='test generated left'",
+    "LayoutBlockFlow (positioned) DIV class='test generated right'",
+    "LayoutBlockFlow (positioned) DIV class='test generated center'",
+    "LayoutBlockFlow (positioned) DIV class='test generated no-repeat'",
+    "LayoutBlockFlow (positioned) DIV class='test generated repeat-space'",
+    "LayoutBlockFlow (positioned) DIV class='test generated repeat-round'",
+];
+function paintInvalidationTest()
+{
+    document.getElementById('container').style.width = '550px';
+}
+window.onload = runPaintInvalidationTest;
+</script>
+<style>
+#container {
+    position: absolute;
+    width: 600px;
+    height: 500px;
+}
+.test {
+    backface-visibility: hidden;
+    position: absolute;
+    width: 10%;
+    height: 8%;
+}
+.image {
+    background-image: url(../../../fast/repaint/resources/small-apple.jpg);
+    top: 0px;
+}
+.generated {
+    background-image: linear-gradient(blue, green);
+    top: 100px;
+}
+.size-cover {
+    background-size: cover;
+    left: 50px;
+}
+.size-contain {
+    background-size: contain;
+    left: 100px;
+}
+.fixed-width {
+    background-size: 30px auto;
+    left: 150px;
+}
+.percent-width {
+    background-size: 50% auto;
+    left: 200px;
+}
+.left {
+    background-position: left 10px top 0px;
+    left: 250px;
+}
+.right {
+    background-position: right 20px top 0px;
+    left: 300px;
+}
+.center {
+    background-position: center; 
+    left: 350px;
+}
+.no-repeat {
+    background-repeat: no-repeat;
+    left: 400px;
+}
+.repeat-space {
+    background-repeat: space;
+    left: 450px;
+}
+.repeat-round {
+    background-repeat: round;
+    left: 500px;
+}
+</style>
+<div id="container">
+    <div class="test image"></div>
+    <div class="test image size-cover"></div>
+    <div class="test image size-contain"></div>
+    <div class="test image fixed-width"></div>
+    <div class="test image percent-width"></div>
+    <div class="test image left"></div>
+    <div class="test image right"></div>
+    <div class="test image center"></div>
+    <div class="test image no-repeat"></div>
+    <div class="test image repeat-space"></div>
+    <div class="test image repeat-round"></div>
+    <div class="test generated"></div>
+    <div class="test generated cover"></div>
+    <div class="test generated contain"></div>
+    <div class="test generated fixed-width"></div>
+    <div class="test generated percent-width"></div>
+    <div class="test generated left"></div>
+    <div class="test generated right"></div>
+    <div class="test generated center"></div>
+    <div class="test generated no-repeat"></div>
+    <div class="test generated repeat-space"></div>
+    <div class="test generated repeat-round"></div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-shorthand-with-gradient-and-height-changes-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-shorthand-with-gradient-and-height-changes-expected.html
new file mode 100644
index 0000000..99a9245
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-shorthand-with-gradient-and-height-changes-expected.html
@@ -0,0 +1,28 @@
+<html>
+<head>
+
+<style>
+#outer {
+    padding-top: 200px;
+    /* background-size is implicitly set to initial via the background shorthand. */
+	background:-webkit-gradient(
+	    linear, 
+	    left top, 
+	    left bottom, 
+	    color-stop(0%, rgba(255,255,0,0)), color-stop(100%, rgba(0,0,0,1))
+	);
+}
+
+#inner {
+    height: 300px;
+}
+</style>
+
+</head>
+<body'>
+<div id='outer'>
+    <div id='inner'>
+    </div>
+</div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-shorthand-with-gradient-and-height-changes.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-shorthand-with-gradient-and-height-changes.html
new file mode 100644
index 0000000..5edb167
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-shorthand-with-gradient-and-height-changes.html
@@ -0,0 +1,41 @@
+<!-- Based on fast/repaint/background-shorthand-with-gradient-and-height-changes.html -->
+<html>
+<head>
+<script src="resources/paint-invalidation-test.js"></script>
+
+<style>
+#outer {
+    padding-top: 200px;
+    /* background-size is implicitly set to initial via the background shorthand. */
+	background:-webkit-gradient(
+	    linear, 
+	    left top, 
+	    left bottom, 
+	    color-stop(0%, rgba(255,255,0,0)), color-stop(100%, rgba(0,0,0,1))
+	);
+}
+
+#inner {
+    height: 100px;
+}
+</style>
+
+<script>
+//This test verifies that gradient background gets repainted properly after child box height change.
+
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV id='outer'",
+    "LayoutBlockFlow DIV id='inner'",
+];
+function paintInvalidationTest() {
+    document.getElementById('inner').style.height = 300 + 'px';
+}
+</script>
+</head>
+<body onload='runPaintInvalidationTest();'>
+<div id='outer'>
+    <div id='inner'>
+    </div>
+</div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-size-auto-with-gradient-and-height-changes-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-size-auto-with-gradient-and-height-changes-expected.html
new file mode 100644
index 0000000..7accf5e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-size-auto-with-gradient-and-height-changes-expected.html
@@ -0,0 +1,29 @@
+<html>
+<head>
+
+<style>
+#outer {
+    padding-top: 200px;
+    background: -webkit-gradient(
+        linear,
+        left top,
+        left bottom,
+        color-stop(0%, rgba(255,255,0,0)), color-stop(100%, rgba(0,0,0,1))
+    );
+    background-size: auto;
+}
+
+#inner {
+    height: 300px;
+}
+</style>
+
+</head>
+
+<body'>
+<div id='outer'>
+    <div id='inner'>
+    </div>
+</div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-size-auto-with-gradient-and-height-changes.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-size-auto-with-gradient-and-height-changes.html
new file mode 100644
index 0000000..a942cb9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/background-size-auto-with-gradient-and-height-changes.html
@@ -0,0 +1,41 @@
+<!-- Based on fast/repaint/background-size-auto-with-gradient-and-height-changes.html -->
+<html>
+<head>
+<script src="resources/paint-invalidation-test.js"></script>
+
+<style>
+#outer {
+    padding-top: 200px;
+    background: -webkit-gradient(
+        linear,
+        left top,
+        left bottom,
+        color-stop(0%, rgba(255,255,0,0)), color-stop(100%, rgba(0,0,0,1))
+    );
+    background-size: auto;
+}
+
+#inner {
+    height: 100px;
+}
+</style>
+
+<script>
+// This test verifies that gradient background gets repainted properly after child box height change.
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV id='outer'",
+    "LayoutBlockFlow DIV id='inner'",
+];
+function paintInvalidationTest() {
+    document.getElementById('inner').style.height = '300px';
+}
+</script>
+</head>
+
+<body onload='runPaintInvalidationTest();'>
+<div id='outer'>
+    <div id='inner'>
+    </div>
+</div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/block-shift-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/block-shift-repaint-expected.html
new file mode 100644
index 0000000..c270f24a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/block-shift-repaint-expected.html
@@ -0,0 +1,41 @@
+<html>
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=12079</title>
+    <style type="text/css">
+        div.playground { position: relative; width: 90px; height: 90px; }
+        .red { background-color: yellow; }
+        .blue { background-color: blue; }
+        .green { background-color: green; }
+        .zero { height: 0; width: 60px; }
+        .half { height: 30px; width: 60px; }
+        .full { height: 60px; width: 60px; }
+    </style>
+</head>
+<body>
+    <div class="playground">
+        <div id="div1" class="blue zero"></div>
+        <div class="red half"></div>
+        <div class="green half"></div>
+    </div>
+
+    <div class="playground">
+        <div><div id="top" class="blue zero"></div></div>
+        <div class="red half"></div>
+        <div class="green half"></div>
+    </div>
+
+    <div class="playground">
+        <div id="div2" class="half"></div>
+        <div class="green half"></div>
+        <div class="red half"></div>
+    </div>
+
+    <div class="playground" style="margin-top: 30px;">
+        <div style="width: 10px; margin: auto;">
+            <div id="innerDiv" style="height: 15px"></div>
+        </div>
+        <div class="half"></div>
+        <div class="half" style="border-top: solid yellow 8px;"></div>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/block-shift-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/block-shift-repaint.html
new file mode 100644
index 0000000..8c7a63f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/block-shift-repaint.html
@@ -0,0 +1,73 @@
+<!-- Based on fast/repaint/block-shift-repaint.html -->
+<html>
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=12079</title>
+    <style type="text/css">
+        div.playground { position: relative; width: 90px; height: 90px; }
+        .red { background-color: yellow; }
+        .blue { background-color: blue; }
+        .green { background-color: green; }
+        .zero { height: 0; width: 60px; }
+        .half { height: 30px; width: 60px; }
+        .full { height: 60px; width: 60px; }
+    </style>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow DIV id='div1' class='blue half'",
+            "LayoutBlockFlow DIV class='red half'",
+            "LayoutBlockFlow DIV class='green half'",
+            "LayoutBlockFlow DIV id='top' class='blue half'",
+            "LayoutBlockFlow DIV class='red half'",
+            "LayoutBlockFlow DIV class='green half'",
+            "LayoutBlockFlow DIV id='div2' class='zero'",
+            "LayoutBlockFlow DIV class='green half'",
+            "LayoutBlockFlow DIV class='red half'",
+            "LayoutBlockFlow DIV id='innerDiv'",
+            "LayoutBlockFlow DIV class='half'",
+            "LayoutBlockFlow DIV class='half'",
+        ];
+        function paintInvalidationTest()
+        {
+            var div1 = document.getElementById("div1");
+            div1.style.height = "0";
+
+            var div2 = document.getElementById("div2");
+            div2.style.height = "30px";
+
+            var top = document.getElementById("top");
+            top.style.height = "0";
+
+            var top = document.getElementById("innerDiv");
+            innerDiv.style.height = "15px";
+        }
+    </script>
+</head>
+<body onload="runPaintInvalidationTest()">
+    <div class="playground">
+        <div id="div1" class="blue half"></div>
+        <div class="red half"></div>
+        <div class="green half"></div>
+    </div>
+
+    <div class="playground">
+        <div><div id="top" class="blue half"></div></div>
+        <div class="red half"></div>
+        <div class="green half"></div>
+    </div>
+
+    <div class="playground">
+        <div id="div2" class="zero"></div>
+        <div class="green half"></div>
+        <div class="red half"></div>
+    </div>
+
+    <div class="playground" style="margin-top: 30px;">
+        <div style="width: 10px; margin: auto;">
+            <div id="innerDiv"></div>
+        </div>
+        <div class="half"></div>
+        <div class="half" style="border-top: solid yellow 8px;"></div>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-outline-0-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-outline-0-expected.html
new file mode 100644
index 0000000..855e8db
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-outline-0-expected.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+
+<style>
+#border-image,
+#border,
+#outline {
+    height: 100px;
+    width: 100px;
+}
+
+td {
+    height: 50px;
+    width: 50px;
+    border-style: hidden;
+}
+
+#border-image {
+    position: absolute;
+    top: 10px;
+    left: 10px;
+}
+</style>
+
+<p>Tests that setting an outline or a border of 0 on an element without a border or outline doesn't repaint.</p>
+
+<div id="border"></div>
+<div id="outline"></div>
+<div id="border-image"></div>
+
+<table>
+    <tr>
+        <td id="cell"></td>
+        <td></td>
+    </tr>
+</table>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-outline-0.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-outline-0.html
new file mode 100644
index 0000000..b0ffdf4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-outline-0.html
@@ -0,0 +1,60 @@
+<!-- Based on fast/repaint/border-outline-0.html -->
+<!DOCTYPE html>
+
+<style>
+#border-image,
+#border,
+#outline {
+    height: 100px;
+    width: 100px;
+}
+
+td {
+    height: 50px;
+    width: 50px;
+    border-style: hidden;
+}
+
+#border-image {
+    border-image: url(../../../fast/repaint/_example.png) 100% 100 100 round;
+    border-style: none;
+    border-width: 50px;
+    position: absolute;
+    top: 10px;
+    left: 10px;
+}
+</style>
+
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='border-image'",
+];
+function paintInvalidationTest() {
+    var border = document.getElementById("border");
+    border.style.border = "0";
+
+    var outline = document.getElementById("outline");
+    outline.style.outline = "0";
+
+    var outline = document.getElementById("cell");
+    outline.style.borderWidth = "0";
+
+    var borderImage = document.getElementById("border-image");
+    borderImage.style.borderWidth = "0";
+}
+onload = runPaintInvalidationTest;
+</script>
+
+<p>Tests that setting an outline or a border of 0 on an element without a border or outline doesn't repaint.</p>
+
+<div id="border"></div>
+<div id="outline"></div>
+<div id="border-image"></div>
+
+<table>
+    <tr>
+        <td id="cell"></td>
+        <td></td>
+    </tr>
+</table>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-radius-repaint-2-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-radius-repaint-2-expected.html
new file mode 100644
index 0000000..a96f3e4b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-radius-repaint-2-expected.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<html>
+<head>
+<title>Repaint test for crbug.com/222851</title>
+<script>
+if (window.internals) {
+    // Avoid the noise caused by change of scrollbar existence.
+    internals.settings.setOverlayScrollbarsEnabled(true);
+    internals.settings.setMockScrollbarsEnabled(true);
+}
+</script>
+</head>
+<body style="background-color: #3F3F3F;">
+  <div style="border-radius: 150px; background-color: #EFEFEF; width: 90%; padding: 5em; margin: 0 auto;">
+	<div style="border-radius: 5px; border: solid 3px #367CAF; width: 85%; margin: 0 auto;">
+	  <div class="notARealClass" style="background-color: #367CAF; height: 3em; cursor: pointer;">		
+	  </div>
+	  <div id="target" style="width: 100%; height: 2px;">
+	  </div>
+	</div>
+  </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-radius-repaint-2.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-radius-repaint-2.html
new file mode 100644
index 0000000..f69e913
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-radius-repaint-2.html
@@ -0,0 +1,37 @@
+<!-- Based on fast/repaint/border-radius-repaint-2.html -->
+<!doctype html>
+<html>
+<head>
+<title>Repaint test for crbug.com/222851</title>
+<script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+<script>
+if (window.internals) {
+    // Avoid the noise caused by change of scrollbar existence.
+    internals.settings.setOverlayScrollbarsEnabled(true);
+    internals.settings.setMockScrollbarsEnabled(true);
+}
+
+window.expectedPaintInvalidationObjects = [
+    "LayoutView #document",
+    "LayoutBlockFlow HTML",
+    "LayoutBlockFlow BODY",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV id='target'",
+];
+function paintInvalidationTest() {
+    document.getElementById('target').style.height = '2px';
+}
+</script>
+</head>
+<body style="background-color: #3F3F3F;" onload="runPaintInvalidationTest()">
+  <div style="border-radius: 150px; background-color: #EFEFEF; width: 90%; padding: 5em; margin: 0 auto;">
+	<div style="border-radius: 5px; border: solid 3px #367CAF; width: 85%; margin: 0 auto;">
+	  <div class="notARealClass" style="background-color: #367CAF; height: 3em; cursor: pointer;">		
+	  </div>
+	  <div id="target" style="width: 100%; height: 550px;">
+	  </div>
+	</div>
+  </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-radius-with-outline-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-radius-with-outline-expected.html
new file mode 100644
index 0000000..93ec19a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-radius-with-outline-expected.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<style>
+body {
+    margin: 0;
+}
+div {
+    position: absolute;
+    width: 200px;
+    height: 200px;
+    top: 100px;
+    left: 100px;
+    background-color: green;
+    border-radius: 50px;
+    outline: 5px solid green;
+    outline-offset: 50px;
+}
+</style>
+<div id="target"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-radius-with-outline.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-radius-with-outline.html
new file mode 100644
index 0000000..04332774
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-radius-with-outline.html
@@ -0,0 +1,31 @@
+<!-- Based on fast/repaint/border-radius-with-outline.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+<!-- Should full repaint because the actual border radius changes. -->
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='target'",
+];
+function paintInvalidationTest()
+{
+    document.getElementById('target').style.width = '200px';
+}
+window.onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+    margin: 0;
+}
+div {
+    position: absolute;
+    width: 80px;
+    height: 200px;
+    top: 100px;
+    left: 100px;
+    background-color: green;
+    border-radius: 50px;
+    outline: 5px solid green;
+    outline-offset: 50px;
+}
+</style>
+<div id="target"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-radius-without-border-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-radius-without-border-expected.html
new file mode 100644
index 0000000..0190ced
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-radius-without-border-expected.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<style>
+body {
+    margin: 0;
+}
+div {
+    width: 100px;
+    height: 100px;
+    background-color: green;
+    border-radius: 10px 15px 20px 25px;
+    position: absolute;
+}
+</style>
+<div id="target1" style="top: 0px; width: 200px"></div>
+<div id="target2" style="top: 200px; height: 200px"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-radius-without-border.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-radius-without-border.html
new file mode 100644
index 0000000..93b4180
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/border-radius-without-border.html
@@ -0,0 +1,29 @@
+<!-- Based on fast/repaint/border-radius-without-border.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='target1'",
+    "LayoutBlockFlow (positioned) DIV id='target2'",
+];
+function paintInvalidationTest()
+{
+    document.getElementById('target1').style.width = '200px';
+    document.getElementById('target2').style.height = '200px';
+}
+window.onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+    margin: 0;
+}
+div {
+    width: 100px;
+    height: 100px;
+    background-color: green;
+    border-radius: 10px 15px 20px 25px;
+    position: absolute;
+}
+</style>
+<div id="target1" style="top: 0px"></div>
+<div id="target2" style="top: 200px"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-shadow-inset-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-shadow-inset-repaint-expected.html
new file mode 100644
index 0000000..26ee8d2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-shadow-inset-repaint-expected.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style type="text/css" media="screen">
+        div#container {
+            padding: 15px;
+            box-shadow: inset cyan 0 -60px 0 0;
+        }
+    </style>
+</head>
+<body>
+    <div id="container" style="width:200px;">
+        <div style='width:100px; height:100px; background-color:green'></div>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-shadow-inset-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-shadow-inset-repaint.html
new file mode 100644
index 0000000..f11c938
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-shadow-inset-repaint.html
@@ -0,0 +1,26 @@
+<!-- Based on fast/repaint/box-shadow-inset-repaint.html -->
+<!DOCTYPE html>
+<html>
+<head>
+    <style type="text/css" media="screen">
+        div#container {
+            padding: 15px;
+            box-shadow: inset cyan 0 -60px 0 0;
+        }
+    </style>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script type="text/javascript">
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow DIV id='container'",
+        "LayoutBlockFlow DIV",
+    ];
+    function paintInvalidationTest()
+    {
+        document.getElementById('container').innerHTML = "<div style='width:100px; height:100px; background-color:green'></div>";
+    }
+    </script>
+</head>
+<body onload="runPaintInvalidationTest()">
+    <div id="container" style="width:200px;"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-sizing-border-keeping-size-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-sizing-border-keeping-size-expected.html
new file mode 100644
index 0000000..9c54332
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-sizing-border-keeping-size-expected.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<style>
+body {
+    margin: 0;
+}
+div {
+    position: absolute;
+    background-color: green;
+}
+.border-box {
+    width: 100px;
+    height: 100px;
+    box-sizing: border-box;
+}
+.content-box {
+    width: 60px;
+    height: 60px;
+    box-sizing: content-box;
+    border: blue solid 20px;
+}
+</style>
+<div id="target1" class="content-box" style="top: 0px"></div>
+<div id="target2" class="border-box" style="top: 200px"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-sizing-border-keeping-size.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-sizing-border-keeping-size.html
new file mode 100644
index 0000000..d13fee0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-sizing-border-keeping-size.html
@@ -0,0 +1,37 @@
+<!-- Based on fast/repaint/box-sizing-border-keeping-size.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='target1' class='content-box'",
+    "LayoutBlockFlow (positioned) DIV id='target2' class='border-box'",
+];
+function paintInvalidationTest()
+{
+    document.getElementById('target1').className = 'content-box';
+    document.getElementById('target2').className = 'border-box';
+}
+window.onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+    margin: 0;
+}
+div {
+    position: absolute;
+    background-color: green;
+}
+.border-box {
+    width: 100px;
+    height: 100px;
+    box-sizing: border-box;
+}
+.content-box {
+    width: 60px;
+    height: 60px;
+    box-sizing: content-box;
+    border: blue solid 20px;
+}
+</style>
+<div id="target1" class="border-box" style="top: 0px"></div>
+<div id="target2" class="content-box" style="top: 200px"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-sizing-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-sizing-expected.html
new file mode 100644
index 0000000..ba1b3e3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-sizing-expected.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<style>
+body {
+    margin: 0;
+}
+div {
+    width: 50%;
+    height: 100px;
+    position: absolute;
+    background-color: green;
+    border: blue solid 20px;
+}
+.border-box {
+    box-sizing: border-box;
+}
+.content-box {
+    box-sizing: content-box;
+}
+</style>
+<div id="target1" class="content-box" style="top: 0px"></div>
+<div id="target2" class="border-box" style="top: 200px"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-sizing-padding-keeping-size-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-sizing-padding-keeping-size-expected.html
new file mode 100644
index 0000000..c48c8a1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-sizing-padding-keeping-size-expected.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<style>
+body {
+    margin: 0;
+}
+div {
+    position: absolute;
+    background-color: green;
+}
+.border-box {
+    width: 100px;
+    height: 100px;
+    box-sizing: border-box;
+}
+.content-box {
+    width: 60px;
+    height: 60px;
+    box-sizing: content-box;
+    padding: 20px;
+}
+</style>
+<div id="target1" class="content-box" style="top: 0px"></div>
+<div id="target2" class="border-box" style="top: 200px"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-sizing-padding-keeping-size.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-sizing-padding-keeping-size.html
new file mode 100644
index 0000000..b2ada3e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-sizing-padding-keeping-size.html
@@ -0,0 +1,35 @@
+<!-- Based on fast/repaint/box-sizing-padding-keeping-size.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+];
+function paintInvalidationTest()
+{
+    document.getElementById('target1').className = 'content-box';
+    document.getElementById('target2').className = 'border-box';
+}
+window.onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+    margin: 0;
+}
+div {
+    position: absolute;
+    background-color: green;
+}
+.border-box {
+    width: 100px;
+    height: 100px;
+    box-sizing: border-box;
+}
+.content-box {
+    width: 60px;
+    height: 60px;
+    box-sizing: content-box;
+    padding: 20px;
+}
+</style>
+<div id="target1" class="border-box" style="top: 0px"></div>
+<div id="target2" class="content-box" style="top: 200px"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-sizing.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-sizing.html
new file mode 100644
index 0000000..57765b5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/box-sizing.html
@@ -0,0 +1,35 @@
+<!-- Based on fast/repaint/box-sizing.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='target1' class='content-box'",
+    "LayoutBlockFlow (positioned) DIV id='target2' class='border-box'",
+];
+function paintInvalidationTest()
+{
+    document.getElementById('target1').className = 'content-box';
+    document.getElementById('target2').className = 'border-box';
+}
+window.onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+    margin: 0;
+}
+div {
+    width: 50%;
+    height: 100px;
+    position: absolute;
+    background-color: green;
+    border: blue solid 20px;
+}
+.border-box {
+    box-sizing: border-box;
+}
+.content-box {
+    box-sizing: content-box;
+}
+</style>
+<div id="target1" class="border-box" style="top: 0px"></div>
+<div id="target2" class="content-box" style="top: 200px"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/button-inner-no-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/button-inner-no-repaint-expected.html
new file mode 100644
index 0000000..f0fcd51
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/button-inner-no-repaint-expected.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<style>
+button {
+  position: absolute;
+  width: 300px;
+  height: 100px;
+}
+</style>
+<button>Should not repaint on style change that doesn't change visual.</button>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/button-inner-no-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/button-inner-no-repaint.html
new file mode 100644
index 0000000..6722443
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/button-inner-no-repaint.html
@@ -0,0 +1,19 @@
+<!-- Based on fast/repaint/button-inner-no-repaint.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+];
+function paintInvalidationTest() {
+  document.getElementsByTagName('button')[0].style.maxWidth = '1000px';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+button {
+  position: absolute;
+  width: 300px;
+  height: 100px;
+}
+</style>
+<button>Should not repaint on style change that doesn't change visual.</button>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/button-spurious-layout-hint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/button-spurious-layout-hint-expected.html
new file mode 100644
index 0000000..71ee2c9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/button-spurious-layout-hint-expected.html
@@ -0,0 +1,3 @@
+<body>
+    <button id="target" style="height: 100px; width: 100px; background-color: lightpink; border: none;">&nbsp;</button>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/button-spurious-layout-hint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/button-spurious-layout-hint.html
new file mode 100644
index 0000000..5f4ab7c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/button-spurious-layout-hint.html
@@ -0,0 +1,16 @@
+<!-- Based on fast/repaint/button-spurious-layout-hint.html -->
+<head>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script>
+        window.expectedPaintInvalidationObjects = [
+            "LayoutButton BUTTON id='target'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById("target").style.backgroundColor = "lightpink";
+        }
+    </script>
+</head>
+<body onload="runPaintInvalidationTest()">
+    <button id="target" style="height: 100px; width: 100px; background-color: lightblue; border: none;">&nbsp;</button>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-69296-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-69296-expected.html
new file mode 100644
index 0000000..a976d89
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-69296-expected.html
@@ -0,0 +1,39 @@
+<!--
+Test for bug69296.
+Collapsed borders should not disappear.
+-->
+<html>
+    <head>
+        <style>
+            BODY {
+                margin: 20px;
+            }
+            TABLE {
+                border-collapse: collapse;
+            }
+            TD {
+                width: 50px;
+                height: 50px;
+                border: 1px solid #333333;
+            }
+        </style>
+    </head>
+    <body>
+        <table>
+            <tr id="row1">
+                <td valign="top"/>
+                <td/>
+                <td>
+                    <div>
+                        <div style="width: 20px; height: 20px; background: lime;"/>
+                    </div>
+                </td>
+            </tr>
+            <tr id="row2">
+                <td/>
+                <td/>
+                <td/>
+            </tr>
+        </table>
+    </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-69296.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-69296.html
new file mode 100644
index 0000000..c69e7f3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-69296.html
@@ -0,0 +1,75 @@
+<!-- Based on fast/table/border-collapsing/cached-69296.html -->
+<!--
+Test for bug69296.
+Collapsed borders should not disappear.
+-->
+<html>
+    <head>
+        <script src="resources/paint-invalidation-test.js"></script>
+        <style>
+            BODY {
+                margin: 20px;
+            }
+            TABLE {
+                border-collapse: collapse;
+            }
+            TD {
+                width: 50px;
+                height: 50px;
+                border: 1px solid #333333;
+            }
+            #row1:hover {
+                background-color: #ddd;
+                color: #111;
+            }
+        </style>
+    <head>
+        <script type="text/javascript">
+            window.expectedPaintInvalidationObjects = [
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableRow TR id='row1'",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableRow TR id='row1'",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+            ];
+            function paintInvalidationTest() {
+                row = document.getElementById('row1');
+                rowRect = row.getBoundingClientRect();
+                x = rowRect.left + 75;
+                y = rowRect.top;
+                document.body.offsetTop;
+                if (window.eventSender) {
+                    eventSender.mouseMoveTo(x, y + 1);
+                    eventSender.mouseMoveTo(x, y - 1);
+                }
+            }
+        </script>
+    </head>
+    <body onload="runPaintInvalidationTest()">
+        <table>
+            <tr id="row1">
+                <td valign="top"/>
+                <td/>
+                <td>
+                    <div>
+                        <div style="width: 20px; height: 20px; background: lime;"/>
+                    </div>
+                </td>
+            </tr>
+            <tr id="row2">
+                <td/>
+                <td/>
+                <td/>
+            </tr>
+        </table>
+    </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-cell-append-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-cell-append-expected.html
new file mode 100644
index 0000000..f5f7704
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-cell-append-expected.html
@@ -0,0 +1,19 @@
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we append new cell, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+    </head>
+    <body>
+        <table style="border-collapse:collapse; border:2px solid blue">
+            <tr id="row">
+                <td style="border:4px solid lime"/>
+                <td style="border-left: 6px solid yellow"/>
+            </tr>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-cell-append.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-cell-append.html
new file mode 100644
index 0000000..9c70d14
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-cell-append.html
@@ -0,0 +1,35 @@
+<!-- Based on fast/table/border-collapsing/cached-cell-append.html -->
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we append new cell, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+        <script src="resources/paint-invalidation-test.js"></script>
+        <script type="text/javascript">
+            window.expectedPaintInvalidationObjects = [
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTable TABLE",
+                "LayoutTableCell TD",
+            ];
+            function paintInvalidationTest() {
+                newCell = document.createElement("td");
+                newCell.style.borderLeftWidth = "6px";
+                newCell.style.borderLeftStyle = "solid";
+                newCell.style.borderLeftColor = "yellow";
+                document.getElementById("row").appendChild(newCell);
+            }
+        </script>
+    </head>
+    <body onload="runPaintInvalidationTest()">
+        <table style="border-collapse:collapse; border:2px solid blue">
+            <tr id="row">
+                <td style="border:4px solid lime"/>
+            </tr>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-cell-remove-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-cell-remove-expected.html
new file mode 100644
index 0000000..4a3b70a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-cell-remove-expected.html
@@ -0,0 +1,19 @@
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we remove cell, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+    </head>
+    <body>
+        <table style="border-collapse:collapse; border:2px solid blue">
+            <tr id="row">
+                <td style="border:4px solid lime"/>
+                <td/>
+            </tr>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-cell-remove.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-cell-remove.html
new file mode 100644
index 0000000..795b699
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-cell-remove.html
@@ -0,0 +1,39 @@
+<!-- Based on fast/table/border-collapsing/cached-cell-remove.html -->
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we remove cell, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+        <script src="resources/paint-invalidation-test.js"></script>
+        <script type="text/javascript">
+            window.expectedPaintInvalidationObjects = [
+                "LayoutTableCell TD id='bar'",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTable TABLE",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableSection TBODY",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+            ];
+            function paintInvalidationTest() {
+                barCell = document.getElementById("bar");
+                document.getElementById("row").removeChild(barCell);
+            }
+        </script>
+    </head>
+    <body onload="runPaintInvalidationTest()">
+        <table style="border-collapse:collapse; border:2px solid blue">
+            <tr id="row">
+                <td style="border:4px solid lime"/>
+                <td style="border-left:6px solid yellow" id="bar"/>
+                <td/>
+            </tr>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-cell-border-color-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-cell-border-color-expected.html
new file mode 100644
index 0000000..bd8df01
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-cell-border-color-expected.html
@@ -0,0 +1,19 @@
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change cell border color, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+    </head>
+    <body>
+        <table style="border-collapse:collapse; border:2px solid blue">
+            <tr>
+                <td style="border:4px solid lime" id="foo"/>
+                <td style="border:1px solid black"/>
+            </tr>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-cell-border-color.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-cell-border-color.html
new file mode 100644
index 0000000..466e8c82
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-cell-border-color.html
@@ -0,0 +1,31 @@
+<!-- Based on fast/table/border-collapsing/cached-change-cell-border-color.html -->
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change cell border color, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+        <script src="resources/paint-invalidation-test.js"></script>
+        <script type="text/javascript">
+            window.expectedPaintInvalidationObjects = [
+                "LayoutTableCell TD id='foo'",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD id='foo'",
+            ];
+            function paintInvalidationTest() {
+                document.getElementById("foo").style.borderColor = "lime";
+            }
+        </script>
+    </head>
+    <body onload="runPaintInvalidationTest()">
+        <table style="border-collapse:collapse; border:2px solid blue">
+            <tr>
+                <td style="border:4px solid pink" id="foo"/>
+                <td style="border:1px solid black"/>
+            </tr>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-cell-border-width-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-cell-border-width-expected.html
new file mode 100644
index 0000000..07cf3ab
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-cell-border-width-expected.html
@@ -0,0 +1,19 @@
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change cell border width, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+    </head>
+    <body>
+        <table style="border-collapse:collapse; border:2px solid blue">
+            <tr>
+                <td style="border:4px solid lime" id="foo"/>
+                <td style="border:1px solid black"/>
+            </tr>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-cell-border-width.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-cell-border-width.html
new file mode 100644
index 0000000..9d29a61
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-cell-border-width.html
@@ -0,0 +1,36 @@
+<!-- Based on fast/table/border-collapsing/cached-change-cell-border-width.html -->
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change cell border width, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+        <script src="resources/paint-invalidation-test.js"></script>
+        <script type="text/javascript">
+            window.expectedPaintInvalidationObjects = [
+                "LayoutTableCell TD id='foo'",
+                "LayoutTableCell TD",
+                "LayoutTable TABLE",
+                "LayoutTableSection TBODY",
+                "LayoutTableRow TR",
+                "LayoutTableCell TD id='foo'",
+                "LayoutTableCell TD",
+            ];
+            function paintInvalidationTest() {
+                document.getElementById("foo").style.borderWidth = "4px";
+                document.getElementById("foo").style.borderColor = "lime";
+            }
+        </script>
+    </head>
+    <body onload="runPaintInvalidationTest()">
+        <table style="border-collapse:collapse; border:2px solid blue">
+            <tr>
+                <td style="border:1px solid lime" id="foo"/>
+                <td style="border:1px solid black"/>
+            </tr>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-col-border-color-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-col-border-color-expected.html
new file mode 100644
index 0000000..05ed9ec
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-col-border-color-expected.html
@@ -0,0 +1,29 @@
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change col border color, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+    </head>
+    <body>
+        <table style="border-collapse:collapse; border:1px solid blue">
+            <colgroup>
+                <col style="border:4px solid yellow" id="col">
+                <col>
+            </colgroup>
+            <tbody>
+                <tr>
+                    <td style="border:2px solid lime"/>
+                    <td/>
+                </tr>
+                <tr>
+                    <td/>
+                    <td/>
+                </tr>
+            </tbody>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-col-border-color.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-col-border-color.html
new file mode 100644
index 0000000..ff9fa3e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-col-border-color.html
@@ -0,0 +1,45 @@
+<!-- Based on fast/table/border-collapsing/cached-change-col-border-color.html -->
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change col border color, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+        <script src="resources/paint-invalidation-test.js"></script>
+        <script type="text/javascript">
+            window.expectedPaintInvalidationObjects = [
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCol COL id='col'",
+            ];
+            function paintInvalidationTest() {
+                document.getElementById("col").style.borderColor = "yellow";
+            }
+        </script>
+    </head>
+    <body onload="runPaintInvalidationTest()">
+        <table style="border-collapse:collapse; border:1px solid blue">
+            <colgroup>
+                <col style="border:4px solid pink" id="col">
+                <col>
+            </colgroup>
+            <tbody>
+                <tr>
+                    <td style="border:2px solid lime"/>
+                    <td/>
+                </tr>
+                <tr>
+                    <td/>
+                    <td/>
+                </tr>
+            </tbody>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-col-border-width-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-col-border-width-expected.html
new file mode 100644
index 0000000..1639890
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-col-border-width-expected.html
@@ -0,0 +1,29 @@
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change col border width, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+    </head>
+    <body>
+        <table style="border-collapse:collapse; border:1px solid blue">
+            <colgroup>
+                <col style="border:4px solid yellow" id="col">
+                <col>
+            </colgroup>
+            <tbody>
+                <tr>
+                    <td style="border:2px solid lime"/>
+                    <td/>
+                </tr>
+                <tr>
+                    <td/>
+                    <td/>
+                </tr>
+            </tbody>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-col-border-width.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-col-border-width.html
new file mode 100644
index 0000000..981467a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-col-border-width.html
@@ -0,0 +1,53 @@
+<!-- Based on fast/table/border-collapsing/cached-change-col-border-width.html -->
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change col border width, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+        <script src="resources/paint-invalidation-test.js"></script>
+        <script type="text/javascript">
+            window.expectedPaintInvalidationObjects = [
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTable TABLE",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCol COL id='col'",
+                "LayoutTableSection TBODY",
+                "LayoutTableRow TR",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableRow TR",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+            ];
+            function paintInvalidationTest() {
+                document.getElementById("col").style.borderWidth = "4px";
+            }
+        </script>
+    </head>
+    <body onload="runPaintInvalidationTest()">
+        <table style="border-collapse:collapse; border:1px solid blue">
+            <colgroup>
+                <col style="border:1px solid yellow" id="col">
+                <col>
+            </colgroup>
+            <tbody>
+                <tr>
+                    <td style="border:2px solid lime"/>
+                    <td/>
+                </tr>
+                <tr>
+                    <td/>
+                    <td/>
+                </tr>
+            </tbody>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-colgroup-border-color-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-colgroup-border-color-expected.html
new file mode 100644
index 0000000..61f6852
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-colgroup-border-color-expected.html
@@ -0,0 +1,34 @@
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change colgroup border color, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+    </head>
+    <body>
+        <table style="border-collapse:collapse; border:1px solid blue">
+            <colgroup style="border:4px solid yellow" id="colgroup">
+                <col>
+                <col>
+            </colgroup>
+            <colgroup>
+                <col>
+            </colgroup>
+            <tbody>
+                <tr>
+                    <td style="border:2px solid lime"/>
+                    <td/>
+                    <td/>
+                </tr>
+                <tr>
+                    <td/>
+                    <td/>
+                    <td/>
+                </tr>
+            </tbody>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-colgroup-border-color.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-colgroup-border-color.html
new file mode 100644
index 0000000..2d2a35d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-colgroup-border-color.html
@@ -0,0 +1,54 @@
+<!-- Based on fast/table/border-collapsing/cached-change-colgroup-border-color.html -->
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change colgroup border color, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+        <script src="resources/paint-invalidation-test.js"></script>
+        <script type="text/javascript">
+            window.expectedPaintInvalidationObjects = [
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCol COLGROUP id='colgroup'",
+            ];
+            function paintInvalidationTest() {
+                document.getElementById("colgroup").style.borderColor = "yellow";
+            }
+        </script>
+    </head>
+    <body onload="runPaintInvalidationTest()">
+        <table style="border-collapse:collapse; border:1px solid blue">
+            <colgroup style="border:4px solid pink" id="colgroup">
+                <col>
+                <col>
+            </colgroup>
+            <colgroup>
+                <col>
+            </colgroup>
+            <tbody>
+                <tr>
+                    <td style="border:2px solid lime"/>
+                    <td/>
+                    <td/>
+                </tr>
+                <tr>
+                    <td/>
+                    <td/>
+                    <td/>
+                </tr>
+            </tbody>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-colgroup-border-width-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-colgroup-border-width-expected.html
new file mode 100644
index 0000000..fd90d81
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-colgroup-border-width-expected.html
@@ -0,0 +1,34 @@
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change colgroup border width, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+    </head>
+    <body>
+        <table style="border-collapse:collapse; border:1px solid blue">
+            <colgroup style="border:4px solid yellow" id="colgroup">
+                <col>
+                <col>
+            </colgroup>
+            <colgroup>
+                <col>
+            </colgroup>
+            <tbody>
+                <tr>
+                    <td style="border:2px solid lime"/>
+                    <td/>
+                    <td/>
+                </tr>
+                <tr>
+                    <td/>
+                    <td/>
+                    <td/>
+                </tr>
+            </tbody>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-colgroup-border-width.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-colgroup-border-width.html
new file mode 100644
index 0000000..f5ddd04
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-colgroup-border-width.html
@@ -0,0 +1,58 @@
+<!-- Based on fast/table/border-collapsing/cached-change-colgroup-border-width.html -->
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change colgroup border width, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+        <script src="resources/paint-invalidation-test.js"></script>
+        <script type="text/javascript">
+            window.expectedPaintInvalidationObjects = [
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCol COLGROUP id='colgroup'",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+            ];
+            function paintInvalidationTest() {
+                document.getElementById("colgroup").style.borderWidth = "4px";
+            }
+        </script>
+    </head>
+    <body onload="runPaintInvalidationTest()">
+        <table style="border-collapse:collapse; border:1px solid blue">
+            <colgroup style="border:1px solid yellow" id="colgroup">
+                <col>
+                <col>
+            </colgroup>
+            <colgroup>
+                <col>
+            </colgroup>
+            <tbody>
+                <tr>
+                    <td style="border:2px solid lime"/>
+                    <td/>
+                    <td/>
+                </tr>
+                <tr>
+                    <td/>
+                    <td/>
+                    <td/>
+                </tr>
+            </tbody>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-row-border-color-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-row-border-color-expected.html
new file mode 100644
index 0000000..fd1688098
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-row-border-color-expected.html
@@ -0,0 +1,21 @@
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change row border color, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+    </head>
+    <body>
+        <table style="border-collapse:collapse; border:1px solid blue">
+            <tr style="border:4px solid yellow" id="row">
+                <td style="border:2px solid lime"/>
+            </tr>
+            <tr>
+                <td/>
+            </tr>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-row-border-color.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-row-border-color.html
new file mode 100644
index 0000000..c8e13cd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-row-border-color.html
@@ -0,0 +1,34 @@
+<!-- Based on fast/table/border-collapsing/cached-change-row-border-color.html -->
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change row border color, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+        <script src="resources/paint-invalidation-test.js"></script>
+        <script type="text/javascript">
+            window.expectedPaintInvalidationObjects = [
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableRow TR id='row'",
+            ];
+            function paintInvalidationTest() {
+                document.getElementById("row").style.borderColor = "yellow";
+            }
+        </script>
+    </head>
+    <body onload="runPaintInvalidationTest()">
+        <table style="border-collapse:collapse; border:1px solid blue">
+            <tr style="border:4px solid pink" id="row">
+                <td style="border:2px solid lime"/>
+            </tr>
+            <tr>
+                <td/>
+            </tr>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-row-border-width-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-row-border-width-expected.html
new file mode 100644
index 0000000..0f07471
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-row-border-width-expected.html
@@ -0,0 +1,21 @@
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change row border width, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+    </head>
+    <body>
+        <table style="border-collapse:collapse; border:1px solid blue">
+            <tr style="border:4px solid yellow" id="row">
+                <td style="border:2px solid lime"/>
+            </tr>
+            <tr>
+                <td/>
+            </tr>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-row-border-width.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-row-border-width.html
new file mode 100644
index 0000000..724cebe
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-row-border-width.html
@@ -0,0 +1,39 @@
+<!-- Based on fast/table/border-collapsing/cached-change-row-border-width.html -->
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change row border width, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+        <script src="resources/paint-invalidation-test.js"></script>
+        <script type="text/javascript">
+            window.expectedPaintInvalidationObjects = [
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTable TABLE",
+                "LayoutTableCell TD",
+                "LayoutTableSection TBODY",
+                "LayoutTableRow TR id='row'",
+                "LayoutTableCell TD",
+                "LayoutTableRow TR",
+                "LayoutTableCell TD",
+            ];
+            function paintInvalidationTest() {
+                document.getElementById("row").style.borderWidth = "4px";
+            }
+        </script>
+    </head>
+    <body onload="runPaintInvalidationTest()">
+        <table style="border-collapse:collapse; border:1px solid blue">
+            <tr style="border:1px solid yellow" id="row">
+                <td style="border:2px solid lime"/>
+            </tr>
+            <tr>
+                <td/>
+            </tr>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-table-border-color-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-table-border-color-expected.html
new file mode 100644
index 0000000..e135358
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-table-border-color-expected.html
@@ -0,0 +1,18 @@
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change table border color, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+    </head>
+    <body>
+        <table style="border-collapse:collapse; border:4px solid yellow" id="tbl">
+            <tr>
+                <td style="border:2px solid lime"/>
+            </tr>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-table-border-color.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-table-border-color.html
new file mode 100644
index 0000000..2efaa0a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-table-border-color.html
@@ -0,0 +1,29 @@
+<!-- Based on fast/table/border-collapsing/cached-change-table-border-color.html -->
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change table border color, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+        <script src="resources/paint-invalidation-test.js"></script>
+        <script type="text/javascript">
+            window.expectedPaintInvalidationObjects = [
+                "LayoutTableCell TD",
+                "LayoutTable TABLE id='tbl'",
+            ];
+            function paintInvalidationTest() {
+                document.getElementById("tbl").style.borderColor = "yellow";
+            }
+        </script>
+    </head>
+    <body onload="runPaintInvalidationTest()">
+        <table style="border-collapse:collapse; border:4px solid blue" id="tbl">
+            <tr>
+                <td style="border:2px solid lime"/>
+            </tr>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-table-border-width-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-table-border-width-expected.html
new file mode 100644
index 0000000..ed9bd59
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-table-border-width-expected.html
@@ -0,0 +1,18 @@
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change table border width, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+    </head>
+    <body>
+        <table style="border-collapse:collapse; border:4px solid blue" id="tbl">
+            <tr>
+                <td style="border:2px solid lime"/>
+            </tr>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-table-border-width.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-table-border-width.html
new file mode 100644
index 0000000..32f5945
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-table-border-width.html
@@ -0,0 +1,32 @@
+<!-- Based on fast/table/border-collapsing/cached-change-table-border-width.html -->
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change table border width, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+        <script src="resources/paint-invalidation-test.js"></script>
+        <script type="text/javascript">
+            window.expectedPaintInvalidationObjects = [
+                "LayoutTableCell TD",
+                "LayoutTable TABLE id='tbl'",
+                "LayoutTableSection TBODY",
+                "LayoutTableRow TR",
+                "LayoutTableCell TD",
+            ];
+            function paintInvalidationTest() {
+                document.getElementById("tbl").style.borderWidth = "4px";
+            }
+        </script>
+    </head>
+    <body onload="runPaintInvalidationTest()">
+        <table style="border-collapse:collapse; border:1px solid blue" id="tbl">
+            <tr>
+                <td style="border:2px solid lime"/>
+            </tr>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-tbody-border-color-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-tbody-border-color-expected.html
new file mode 100644
index 0000000..e439d5e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-tbody-border-color-expected.html
@@ -0,0 +1,31 @@
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change tbody border color, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+    </head>
+    <body>
+        <table style="border-collapse:collapse; border:1px solid blue">
+            <tbody style="border:4px solid yellow" id="tbody">
+                <tr>
+                    <td style="border:2px solid lime"/>
+                    <td/>
+                </tr>
+                <tr>
+                    <td/>
+                    <td/>
+                </tr>
+            </tbody>
+            <tbody>
+                <tr>
+                    <td/>
+                    <td/>
+                </tr>
+            </tbody>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-tbody-border-color.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-tbody-border-color.html
new file mode 100644
index 0000000..0d351f9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-tbody-border-color.html
@@ -0,0 +1,51 @@
+<!-- Based on fast/table/border-collapsing/cached-change-tbody-border-color.html -->
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change tbody border color, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+        <script src="resources/paint-invalidation-test.js"></script>
+        <script type="text/javascript">
+            window.expectedPaintInvalidationObjects = [
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableSection TBODY id='tbody'",
+            ];
+            function paintInvalidationTest() {
+                document.getElementById("tbody").style.borderColor = "yellow";
+            }
+        </script>
+    </head>
+    <body onload="runPaintInvalidationTest()">
+        <table style="border-collapse:collapse; border:1px solid blue">
+            <tbody style="border:4px solid pink" id="tbody">
+                <tr>
+                    <td style="border:2px solid lime"/>
+                    <td/>
+                </tr>
+                <tr>
+                    <td/>
+                    <td/>
+                </tr>
+            </tbody>
+            <tbody>
+                <tr>
+                    <td/>
+                    <td/>
+                </tr>
+            </tbody>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-tbody-border-width-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-tbody-border-width-expected.html
new file mode 100644
index 0000000..8638e91
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-tbody-border-width-expected.html
@@ -0,0 +1,31 @@
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change tbody border width, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+    </head>
+    <body>
+        <table style="border-collapse:collapse; border:1px solid blue">
+            <tbody style="border:4px solid yellow" id="tbody">
+                <tr>
+                    <td style="border:2px solid lime"/>
+                    <td/>
+                </tr>
+                <tr>
+                    <td/>
+                    <td/>
+                </tr>
+            </tbody>
+            <tbody>
+                <tr>
+                    <td/>
+                    <td/>
+                </tr>
+            </tbody>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-tbody-border-width.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-tbody-border-width.html
new file mode 100644
index 0000000..bcb4de1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/cached-change-tbody-border-width.html
@@ -0,0 +1,62 @@
+<!-- Based on fast/table/border-collapsing/cached-change-tbody-border-width.html -->
+<!--
+Calculating collapsed borders for big tables is expensive, so we cache them and recalculate when needed.
+Here we change tbody border width, expect that cache is invalidated and paint produces expected image.
+-->
+<html>
+    <head>
+        <title></title>
+        <link rel="stylesheet" href="../../../fast/table/border-collapsing/resources/cached.css">
+        <script src="resources/paint-invalidation-test.js"></script>
+        <script type="text/javascript">
+            window.expectedPaintInvalidationObjects = [
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTable TABLE",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableSection TBODY id='tbody'",
+                "LayoutTableRow TR",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableRow TR",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+                "LayoutTableSection TBODY",
+                "LayoutTableRow TR",
+                "LayoutTableCell TD",
+                "LayoutTableCell TD",
+            ];
+            function paintInvalidationTest() {
+                document.getElementById("tbody").style.borderWidth = "4px";
+            }
+        </script>
+    </head>
+    <body onload="runPaintInvalidationTest()">
+        <table style="border-collapse:collapse; border:1px solid blue">
+            <tbody style="border:1px solid yellow" id="tbody">
+                <tr>
+                    <td style="border:2px solid lime"/>
+                    <td/>
+                </tr>
+                <tr>
+                    <td/>
+                    <td/>
+                </tr>
+            </tbody>
+            <tbody>
+                <tr>
+                    <td/>
+                    <td/>
+                </tr>
+            </tbody>
+        </table>
+    </body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/canvas-putImageData-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/canvas-putImageData-expected.html
new file mode 100644
index 0000000..bab19f0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/canvas-putImageData-expected.html
@@ -0,0 +1,31 @@
+<!-- Test for https://bugs.webkit.org/show_bug.cgi?id=46319 -->
+<head>
+</head>
+<body>
+    <canvas id="canvas" width="100" height="100"></canvas> 
+    <script>
+        var canvas = document.getElementById('canvas');
+        var ctx = canvas.getContext('2d');
+
+        // prepare imagedata
+        ctx.fillStyle = "rgb(255, 0, 0)"; ctx.fillRect(0, 0, 100, 100); // red background
+        ctx.fillStyle = "rgb(0, 255, 0)"; ctx.fillRect(10, 10, 10, 10); // inset green square
+        var imageDataGreen = ctx.getImageData(10, 10, 10, 10);
+        var imageDataRedWithInsetGreen = ctx.getImageData(0, 0, 30, 30);
+
+        // clear canvas to dark green 
+        ctx.fillStyle = "rgb(0, 128, 0)";
+        ctx.fillRect(0, 0, 100, 100);
+
+        // fill target locations with dark red
+        ctx.fillStyle = "rgb(128, 0, 0)";
+        ctx.fillRect(0, 0, 10, 10);
+        ctx.fillRect(40, 40, 10, 10);
+        ctx.fillRect(80, 80, 10, 10);
+
+        // patch up red squares with putImageData
+        ctx.putImageData(imageDataGreen, 0, 0);
+        ctx.putImageData(imageDataGreen, 40, 40);
+        ctx.putImageData(imageDataRedWithInsetGreen, 70, 70, 10, 10, 10, 10);
+    </script>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/canvas-putImageData.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/canvas-putImageData.html
new file mode 100644
index 0000000..1af7766
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/canvas-putImageData.html
@@ -0,0 +1,45 @@
+<!-- Based on fast/repaint/canvas-putImageData.html -->
+<!-- Test for https://bugs.webkit.org/show_bug.cgi?id=46319 -->
+<head>
+    <script src="resources/paint-invalidation-test.js"></script>
+</head>
+<body>
+    <canvas id="canvas" width="100" height="100"></canvas> 
+    <script>
+        var canvas = document.getElementById('canvas');
+        var ctx = canvas.getContext('2d');
+
+        // prepare imagedata
+        ctx.fillStyle = "rgb(255, 0, 0)"; ctx.fillRect(0, 0, 100, 100); // red background
+        ctx.fillStyle = "rgb(0, 255, 0)"; ctx.fillRect(10, 10, 10, 10); // inset green square
+        var imageDataGreen = ctx.getImageData(10, 10, 10, 10);
+        var imageDataRedWithInsetGreen = ctx.getImageData(0, 0, 30, 30);
+
+        // clear canvas to dark green 
+        ctx.fillStyle = "rgb(0, 128, 0)";
+        ctx.fillRect(0, 0, 100, 100);
+
+        // fill target locations with dark red
+        ctx.fillStyle = "rgb(128, 0, 0)";
+        ctx.fillRect(0, 0, 10, 10);
+        ctx.fillRect(40, 40, 10, 10);
+        ctx.fillRect(80, 80, 10, 10);
+        window.testIsAsync = true;
+        
+        window.expectedPaintInvalidationObjects = [
+            "LayoutHTMLCanvas CANVAS id='canvas'",
+        ];
+        function paintInvalidationTest()
+        {
+            // patch up red squares with putImageData
+            ctx.putImageData(imageDataGreen, 0, 0);
+            ctx.putImageData(imageDataGreen, 40, 40);
+            ctx.putImageData(imageDataRedWithInsetGreen, 70, 70, 10, 10, 10, 10);
+            // Because canvas invalidations are processed at the end of the current task,
+            // the repaint test has to end in a subsequent task in order to capture the repaint.
+            setTimeout(finishPaintInvalidationTest, 0);
+        }
+
+        window.onload = runPaintInvalidationTest;
+    </script>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/canvas-resize-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/canvas-resize-expected.html
new file mode 100644
index 0000000..0ba42df
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/canvas-resize-expected.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<style>
+canvas {
+  position: absolute;
+  width: 500px;
+  height: 500px;
+  top: 50px;
+  left: 50px;
+}
+</style>
+Tests paint invalidation of canvas when it's resized. Passes if there is a whole green circle.
+<canvas id="canvas" width="500" height="500"></canvas>
+
+<script>
+var ctx = document.getElementById('canvas').getContext('2d');
+ctx.beginPath();
+ctx.arc(250, 250, 250, 0, 2 * Math.PI);
+ctx.fillStyle = 'green';
+ctx.fill();
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/canvas-resize-no-full-invalidation-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/canvas-resize-no-full-invalidation-expected.html
new file mode 100644
index 0000000..9652660
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/canvas-resize-no-full-invalidation-expected.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<style>
+canvas {
+  position: absolute;
+  width: 500px;
+  height: 500px;
+  top: 50px;
+  left: 50px;
+  /* object-fit and object-position make the content of the canvas not affected
+     by the resize in repaintTest(). */  
+  object-fit: contain;
+  object-position: 0 0;
+  background-color: #030;
+}
+</style>
+Tests paint invalidation of canvas when it's resized which doesn't affect its contents. Passes if there is only incremental invalidation for the resized background.
+<canvas id="canvas" width="500" height="500"></canvas>
+
+<script>
+var ctx = document.getElementById('canvas').getContext('2d');
+ctx.beginPath();
+ctx.arc(250, 250, 250, 0, 2 * Math.PI);
+ctx.fillStyle = 'green';
+ctx.fill();
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/canvas-resize-no-full-invalidation.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/canvas-resize-no-full-invalidation.html
new file mode 100644
index 0000000..f0c1a7b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/canvas-resize-no-full-invalidation.html
@@ -0,0 +1,38 @@
+<!-- Based on fast/repaint/canvas-resize-no-full-invalidation.html -->
+<!DOCTYPE html>
+<style>
+canvas {
+  position: absolute;
+  width: 600px;
+  height: 500px;
+  top: 50px;
+  left: 50px;
+  /* object-fit and object-position make the content of the canvas not affected
+     window.expectedPaintInvalidationObjects = [
+         "LayoutHTMLCanvas (positioned) CANVAS id='canvas'",
+     ];
+     by the resize in paintInvalidationTest(). */  
+  object-fit: contain;
+  object-position: 0 0;
+  background-color: #030;
+}
+</style>
+Tests paint invalidation of canvas when it's resized which doesn't affect its contents. Passes if there is only incremental invalidation for the resized background.
+<canvas id="canvas" width="500" height="500"></canvas>
+
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+     window.expectedPaintInvalidationObjects = [
+         "LayoutHTMLCanvas (positioned) CANVAS id='canvas'",
+     ];
+function paintInvalidationTest() {
+  document.getElementById('canvas').style.width = '500px';
+}
+onload = runPaintInvalidationTest;
+
+var ctx = document.getElementById('canvas').getContext('2d');
+ctx.beginPath();
+ctx.arc(250, 250, 250, 0, 2 * Math.PI);
+ctx.fillStyle = 'green';
+ctx.fill();
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/canvas-resize.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/canvas-resize.html
new file mode 100644
index 0000000..f573f42
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/canvas-resize.html
@@ -0,0 +1,30 @@
+<!-- Based on fast/repaint/canvas-resize.html -->
+<!DOCTYPE html>
+<style>
+canvas {
+  position: absolute;
+  width: 600px;
+  height: 500px;
+  top: 50px;
+  left: 50px;
+}
+</style>
+Tests paint invalidation of canvas when it's resized. Passes if there is a whole green circle.
+<canvas id="canvas" width="500" height="500"></canvas>
+
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutHTMLCanvas (positioned) CANVAS id='canvas'",
+];
+function paintInvalidationTest() {
+  document.getElementById('canvas').style.width = '500px';
+}
+onload = runPaintInvalidationTest;
+
+var ctx = document.getElementById('canvas').getContext('2d');
+ctx.beginPath();
+ctx.arc(250, 250, 250, 0, 2 * Math.PI);
+ctx.fillStyle = 'green';
+ctx.fill();
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/change-transform-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/change-transform-expected.html
new file mode 100644
index 0000000..4fd0e67
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/change-transform-expected.html
@@ -0,0 +1,28 @@
+<html>
+<head>
+  <style type="text/css" media="screen">
+    body {
+      margin: 10px;
+    }
+    #square {
+      width: 100px;
+      height: 100px;
+    }
+    #overlay {
+      position: absolute;
+      left: 35px;
+      top: 35px;
+      width: 50px;
+      height: 50px;
+      background: green
+    }
+  </style>
+</head>
+<body>
+<div id="square"></div>
+<div id="overlay"></div>
+
+<p><a href="https://bugs.webkit.org/show_bug.cgi?id=19623">https://bugs.webkit.org/show_bug.cgi?id=19623</a></p>
+<p>Test for incomplete repaint when a non-layer object gains a transform. You should see a green square above. If you see any red, the test has failed.</p>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/change-transform.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/change-transform.html
new file mode 100644
index 0000000..c5e1fae
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/change-transform.html
@@ -0,0 +1,41 @@
+<!-- Based on fast/repaint/change-transform.html -->
+<html>
+<head>
+  <script src="resources/paint-invalidation-test.js"></script>
+  <script type="text/javascript" charset="utf-8">
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow DIV id='square'",
+    ];
+    function paintInvalidationTest()
+    {
+        var target = document.getElementById("square");
+        target.style.webkitTransform = "scale(0.5, 0.5)";
+    }
+  </script>
+  <style type="text/css" media="screen">
+    body {
+      margin: 10px;
+    }
+    #square {
+      width: 100px;
+      height: 100px;
+      background: red;
+    }
+    #overlay {
+      position: absolute;
+      left: 35px;
+      top: 35px;
+      width: 50px;
+      height: 50px;
+      background: green
+    }
+  </style>
+</head>
+<body onload="runPaintInvalidationTest()">
+<div id="square"></div>
+<div id="overlay"></div>
+
+<p><a href="https://bugs.webkit.org/show_bug.cgi?id=19623">https://bugs.webkit.org/show_bug.cgi?id=19623</a></p>
+<p>Test for incomplete repaint when a non-layer object gains a transform. You should see a green square above. If you see any red, the test has failed.</p>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/child-of-sub-pixel-offset-composited-layer-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/child-of-sub-pixel-offset-composited-layer-expected.html
new file mode 100644
index 0000000..78cb87a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/child-of-sub-pixel-offset-composited-layer-expected.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+.container {
+  position: absolute;
+  top: 100px;
+  left:100.5px;
+}
+
+#target {
+  position: absolute;
+  left: 0px;
+  width: 10px;
+  height: 10px;
+  border: 2px solid green;
+}
+</style>
+</head>
+<body">
+<div class="container">
+<div id="target">
+</div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/child-of-sub-pixel-offset-composited-layer.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/child-of-sub-pixel-offset-composited-layer.html
new file mode 100644
index 0000000..4c5bd03
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/child-of-sub-pixel-offset-composited-layer.html
@@ -0,0 +1,43 @@
+<!-- Based on fast/repaint/child-of-sub-pixel-offset-composited-layer.html -->
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+.container {
+  transform: translateZ(0);
+  position: absolute;
+  top: 100px;
+  left:100.5px;
+  background-color: red;
+}
+
+#target {
+  position: absolute;
+  left: 0px;
+  width: 10px;
+  height: 10px;
+  border: 2px solid red;
+}
+
+#target.green {
+  border-color: green;
+}
+</style>
+<script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+</head>
+<body onload="runPaintInvalidationTest();">
+<div class="container">
+<div id="target">
+</div>
+</div>
+<script>
+// This test ensures that children of a composited element with a sub-pixel offset are properly repainted.
+// The box should have a fully green border.
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='target' class='green'",
+];
+function paintInvalidationTest() {
+  var target = document.getElementById('target');
+  target.classList.add('green');
+}
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/clip-path-constant-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/clip-path-constant-repaint-expected.html
new file mode 100644
index 0000000..79dc5fa
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/clip-path-constant-repaint-expected.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+#clip {
+  width: 100%;
+  height: 300px;
+  position: fixed;
+  background-color: rgba(255, 0, 0, 0.9);
+  -webkit-clip-path: polygon(0px 0px, 100% 0px, 100% 100%, 0px 83%);
+  -webkit-backface-visibility: hidden;
+  transform: translateY(100px);
+}
+</style>
+</head>
+<body>
+  <div id="clip"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/clip-path-constant-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/clip-path-constant-repaint.html
new file mode 100644
index 0000000..4c7757e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/clip-path-constant-repaint.html
@@ -0,0 +1,31 @@
+<!-- Based on fast/repaint/clip-path-constant-repaint.html -->
+<!DOCTYPE html>
+<html>
+<head>
+<script src="resources/paint-invalidation-test.js"></script>
+<script type="text/javascript">
+window.onload = function() {
+    runPaintInvalidationTest();
+};
+
+window.expectedPaintInvalidationObjects = [
+];
+function paintInvalidationTest() {
+    document.getElementById('clip').style.transform = 'translateY(100px)';
+}
+</script>
+<style>
+#clip {
+  width: 100%;
+  height: 300px;
+  position: fixed;
+  background-color: rgba(255, 0, 0, 0.9);
+  -webkit-clip-path: polygon(0px 0px, 100% 0px, 100% 100%, 0px 83%);
+  -webkit-backface-visibility: hidden;
+}
+</style>
+</head>
+<body>
+  <div id="clip"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/clipped-overflow-visible-subtree-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/clipped-overflow-visible-subtree-expected.html
new file mode 100644
index 0000000..8ea2a93
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/clipped-overflow-visible-subtree-expected.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<div style="visibility: hidden; opacity: 0.9; width: 600px;">
+ <div style="float:right">
+  <div style="float:left; width: 300px">
+    <div>
+      <div style="opacity: 0.9; visibility: visible; background-color: green; width: 100px; height: 100px;"> </div>
+    </div>
+  </div>
+ </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/clipped-overflow-visible-subtree.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/clipped-overflow-visible-subtree.html
new file mode 100644
index 0000000..8ab47a5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/clipped-overflow-visible-subtree.html
@@ -0,0 +1,29 @@
+<!-- Based on fast/repaint/clipped-overflow-visible-subtree.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+  window.expectedPaintInvalidationObjects = [
+      "LayoutBlockFlow (floating) DIV id='node'",
+      "LayoutBlockFlow (floating) DIV",
+      "LayoutBlockFlow (floating) DIV",
+      "LayoutBlockFlow DIV",
+      "LayoutBlockFlow DIV",
+  ];
+  function paintInvalidationTest()
+  {
+    document.getElementById('node').remove();
+  }
+  onload = runPaintInvalidationTest;
+</script>
+
+<div style="visibility: hidden; opacity: 0.9; width: 600px;">
+ <div style="float:right">
+  <div style="float:left; width: 300px">
+    <div>
+      <div style="opacity: 0.9; visibility: visible; background-color: green; width: 100px; height: 100px;"> </div>
+    </div>
+  </div>
+
+  <div id='node' style="float:left; width: 300px;"> </div>
+ </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/clipping-should-not-repaint-composited-descendants-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/clipping-should-not-repaint-composited-descendants-expected.html
new file mode 100644
index 0000000..ae88e81
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/clipping-should-not-repaint-composited-descendants-expected.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<style>
+    .spacer {
+        position: relative;
+        width: 300px;
+        height: 300px;
+    }
+
+    .clipping-container {
+        position: absolute;
+        height: 300px;
+        transform: translateZ(0);
+        width: 100%;
+        clip: rect(100px, 200px, 200px, 100px);
+    }
+
+    .clipped-composited-child {
+        width: 250px;
+        height: 250px;
+        background-color: yellow;
+        border: 1px solid black;
+        transform: translateZ(0);
+    }
+</style>
+<div class="spacer">
+    <div class="clipping-container">
+        <div class="clipped-composited-child"></div>
+    </div>
+</div>
+<div class="spacer">
+    <div class="clipping-container">
+        <div class="clipped-composited-child"></div>
+    </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/clipping-should-not-repaint-composited-descendants.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/clipping-should-not-repaint-composited-descendants.html
new file mode 100644
index 0000000..a97e0a7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/clipping-should-not-repaint-composited-descendants.html
@@ -0,0 +1,64 @@
+<!-- Based on compositing/repaint/clipping-should-not-repaint-composited-descendants.html -->
+<!DOCTYPE html>
+<style>
+    .spacer {
+        position: relative;
+        width: 300px;
+        height: 300px;
+    }
+
+    .clipping-container {
+        position: absolute;
+        height: 300px;
+        transform: translateZ(0);
+    }
+
+    .with-initial-clipping {
+        clip: rect(50px, 250px, 250px, 50px);
+    }
+
+    .clipped-composited-child {
+        width: 250px;
+        height: 250px;
+        background-color: yellow;
+        border: 1px solid black;
+        transform: translateZ(0);
+    }
+</style>
+<style id="alt1">
+    .clipping-container {
+        width: 300px;
+    }
+</style>
+<style id="alt2">
+    .clipping-container {
+        width: 100%;
+        clip: rect(100px, 200px, 200px, 100px);
+    }
+</style>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    var alt1 = document.getElementById('alt1');
+    var alt2 = document.getElementById('alt2');
+    alt2.disabled = true;
+
+    window.expectedPaintInvalidationObjects = [
+    ];
+    function paintInvalidationTest() {
+        alt2.disabled = false;
+        alt1.disabled = true;
+    }
+
+    runPaintInvalidationTest();
+</script>
+
+<div class="spacer">
+    <div class="clipping-container">
+        <div class="clipped-composited-child"></div>
+    </div>
+</div>
+<div class="spacer">
+    <div class="clipping-container with-initial-clipping">
+        <div class="clipped-composited-child"></div>
+    </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/compositing-reason-removed-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/compositing-reason-removed-expected.html
new file mode 100644
index 0000000..febe7e7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/compositing-reason-removed-expected.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<style>
+  #square {
+    background-color: blue;
+    width: 30px;
+    height: 30px;
+    position: relative;
+  }
+</style>
+<div id="square"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/compositing-reason-removed.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/compositing-reason-removed.html
new file mode 100644
index 0000000..c3cd91a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/compositing-reason-removed.html
@@ -0,0 +1,24 @@
+<!-- Based on compositing/layer-creation/compositing-reason-removed.html -->
+<!DOCTYPE html>
+<style>
+  #square {
+    background-color: blue;
+    width: 30px;
+    height: 30px;
+    position: relative;
+    -webkit-backface-visibility: hidden;
+  }
+</style>
+
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+  window.expectedPaintInvalidationObjects = [
+  ];
+  function paintInvalidationTest() {
+    // Remove the div's only compositing reason. This should trigger a repaint.
+    document.getElementById("square").style.webkitBackfaceVisibility = "visible";
+  }
+  runPaintInvalidationTest();
+</script>
+
+<div id="square"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/content-into-overflow-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/content-into-overflow-expected.html
new file mode 100644
index 0000000..9d2ebcd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/content-into-overflow-expected.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=12885</title>
+    <style type="text/css">
+        div.wide { width: 100px; height: 50px; }
+        div.tall { width: 50px; height: 100px; }
+        div.short { height: 50px; width: 50px; }
+        #main-content { float: left; width: 100px; height: 80px; }
+        #target3 { clear: both; height: 20px; background: green; }
+    </style>
+</head>
+<body">
+    <div style="position: absolute; border: medium solid green; top: 8px; height: 100px;">
+        <div id="target1">
+            <div class="wide"></div>
+        </div>
+    </div>
+
+    <div style="position: absolute; border: medium solid green; top: 158px; width: 100px;">
+        <div style="width: 50px" id="target2">
+            <div class="tall"></div>
+        </div>
+    </div>
+
+    <div style="position: absolute; top: 308px;">
+        <div style="background: green;">
+            <div style="position: relative;">
+                <div id="main-content">
+                </div>
+            </div>
+            <div id="target3"></div>
+        </div>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/content-into-overflow.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/content-into-overflow.html
new file mode 100644
index 0000000..68a34a8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/content-into-overflow.html
@@ -0,0 +1,53 @@
+<!-- Based on fast/repaint/content-into-overflow.html -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=12885</title>
+    <style type="text/css">
+        div.wide { width: 100px; height: 50px; }
+        div.narrow { width: 50px; }
+        div.tall { width: 50px; height: 100px; }
+        div.short { height: 50px; width: 50px; }
+        #main-content { float: left; width: 100px; height: 80px; }
+        #target3 { display: none; clear: both; height: 20px; background: green; }
+    </style>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script>
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (positioned) DIV",
+            "LayoutBlockFlow (positioned) DIV",
+            "LayoutBlockFlow DIV",
+            "LayoutBlockFlow DIV id='target3'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById('target1').style.width = 'auto';
+            document.getElementById('target2').style.height = 'auto';
+            document.getElementById('target3').style.display = 'block';
+        }
+    </script>
+</head>
+<body onload="runPaintInvalidationTest();">
+    <div style="position: absolute; border: medium solid green; top: 8px; height: 100px;">
+        <div class="narrow" id="target1">
+            <div class="wide"></div>
+        </div>
+    </div>
+
+    <div style="position: absolute; border: medium solid green; top: 158px; width: 100px;">
+        <div class="short" id="target2">
+            <div class="tall"></div>
+        </div>
+    </div>
+
+    <div style="position: absolute; top: 308px;">
+        <div style="background: green;">
+            <div style="position: relative;">
+                <div id="main-content">
+                </div>
+            </div>
+            <div id="target3"></div>
+        </div>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/destroy-scrollbar-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/destroy-scrollbar-expected.html
new file mode 100644
index 0000000..c0328f3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/destroy-scrollbar-expected.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+Tests invalidation when a scrollbar is destroyed. Passes if there is no scrollbar.
+<div style="position: absolute; top: 100px; left: 0; width: 200px; height: 200px; overflow: auto">
+  <div id="content" style="width: 100px; height: 100px"></div>
+</div>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/destroy-scrollbar.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/destroy-scrollbar.html
new file mode 100644
index 0000000..b720dab
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/destroy-scrollbar.html
@@ -0,0 +1,17 @@
+<!-- Based on fast/repaint/destroy-scrollbar.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "VerticalScrollbar",
+    "LayoutBlockFlow (positioned) DIV",
+];
+function paintInvalidationTest() {
+  document.getElementById('content').style.height = '100px';
+}
+onload = runPaintInvalidationTest;
+</script>
+Tests invalidation when a scrollbar is destroyed. Passes if there is no scrollbar.
+<div style="position: absolute; top: 100px; left: 0; width: 200px; height: 200px; overflow: auto">
+  <div id="content" style="width: 100px; height: 400px"></div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/do-not-paint-below-image-baseline-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/do-not-paint-below-image-baseline-expected.html
new file mode 100644
index 0000000..d667aa1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/do-not-paint-below-image-baseline-expected.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <style>
+      img {
+        margin: 50px;
+      }
+      body {
+          margin: 0px;
+      }
+    </style>
+  </head>
+  <body>
+    <img src="../../../fast/images/resources/59.jpg">
+    <p> When painting an inline image, do not paint below its baseline unless its selected.
+        The invalidation rect should not extend outside the content rect of the image. </p>
+  </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/do-not-paint-below-image-baseline.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/do-not-paint-below-image-baseline.html
new file mode 100644
index 0000000..a013dab
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/do-not-paint-below-image-baseline.html
@@ -0,0 +1,34 @@
+<!-- Based on fast/images/do-not-paint-below-image-baseline.html -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <script src="resources/paint-invalidation-test.js"></script>
+    <script>
+      window.expectedPaintInvalidationObjects = [
+          "LayoutImage IMG",
+      ];
+      function paintInvalidationTest()
+      {
+        var things = document.getElementsByClassName("before");
+        while (things.length)
+          things[0].classList.remove("before");
+      }
+    </script>
+    <style>
+      img {
+        margin: 50px;
+      }
+      body {
+          margin: 0px;
+      }
+      .before {
+        background-color: green;
+      }
+    </style>
+  </head>
+  <body onload="runPaintInvalidationTest()">
+    <img class="before" src="../../../fast/images/resources/59.jpg">
+    <p> When painting an inline image, do not paint below its baseline unless its selected.
+        The invalidation rect should not extend outside the content rect of the image. </p>
+  </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/dont-invalidate-root-layer-when-composited-layer-becomes-visible-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/dont-invalidate-root-layer-when-composited-layer-becomes-visible-expected.html
new file mode 100644
index 0000000..b3b070f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/dont-invalidate-root-layer-when-composited-layer-becomes-visible-expected.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body>
+    <div id="target"
+      style="will-change: transform;
+             position: absolute;
+             top: 200px; left: 200px;
+             width: 200px; height: 200px;
+             background-color: redl "></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/dont-invalidate-root-layer-when-composited-layer-becomes-visible.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/dont-invalidate-root-layer-when-composited-layer-becomes-visible.html
new file mode 100644
index 0000000..a6f0f2c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/dont-invalidate-root-layer-when-composited-layer-becomes-visible.html
@@ -0,0 +1,28 @@
+<!-- Based on fast/repaint/dont-invalidate-root-layer-when-composited-layer-becomes-visible.html -->
+<!DOCTYPE html>
+<html>
+<head>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        window.onload = function() {
+            runPaintInvalidationTest();
+        };
+
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (positioned) DIV id='target'",
+        ];
+        function paintInvalidationTest() {
+            document.getElementById('target').style.visibility = 'visible';
+        }
+    </script>
+</head>
+<body>
+    <div id="target"
+      style="will-change: transform;
+             visibility:hidden;
+             position: absolute;
+             top: 200px; left: 200px;
+             width: 200px; height: 200px;
+             background-color: redl "></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/erase-overflow-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/erase-overflow-expected.html
new file mode 100644
index 0000000..f830f31
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/erase-overflow-expected.html
@@ -0,0 +1,14 @@
+<html>
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=11935</title>
+    <style type="text/css">
+        div.square { width: 100px; height: 100px; overflow: hidden; }
+    </style>
+</head>
+<body>
+    <div id="target" class="square">
+        <div class="square" style="background-color: green"></div>
+        <div class="square" style="background-color: red"></div>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/erase-overflow.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/erase-overflow.html
new file mode 100644
index 0000000..47f541c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/erase-overflow.html
@@ -0,0 +1,26 @@
+<!-- Based on fast/repaint/erase-overflow.html -->
+<html>
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=11935</title>
+    <style type="text/css">
+        div.square { width: 100px; height: 100px; }
+    </style>
+    <script type="text/javascript" src="resources/paint-invalidation-test.js"></script>
+    <script type="text/javascript">
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow DIV id='target' class='square'",
+            "LayoutBlockFlow DIV class='square'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById("target").style.overflow = "hidden";
+        }
+    </script>
+</head>
+<body onload="runPaintInvalidationTest()">
+    <div id="target" class="square">
+        <div class="square" style="background-color: green"></div>
+        <div class="square" style="background-color: red"></div>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-invalidation-after-display-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-invalidation-after-display-expected.html
new file mode 100644
index 0000000..f51796a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-invalidation-after-display-expected.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<style>
+.green {
+  background-color: green;
+}
+.box {
+  width: 200px;
+  height: 200px;
+  position: absolute;
+  left: 300px;
+}
+.drop-shadowed {
+  -webkit-filter: drop-shadow(100px 100px 10px red);
+}
+</style>
+<!--
+    This test checks that we correctly invalidate filters when they are removed.
+    There should be no red below.
+-->
+<div class="green box" id="box"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-invalidation-after-display.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-invalidation-after-display.html
new file mode 100644
index 0000000..af33f7c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-invalidation-after-display.html
@@ -0,0 +1,33 @@
+<!-- Based on fast/repaint/filter-invalidation-after-display.html -->
+<!DOCTYPE html>
+<style>
+.green {
+  background-color: green;
+}
+.box {
+  width: 200px;
+  height: 200px;
+  position: absolute;
+  left: 300px;
+}
+.drop-shadowed {
+  -webkit-filter: drop-shadow(100px 100px 10px red);
+}
+</style>
+<!--
+    This test checks that we correctly invalidate filters when they are removed.
+    There should be no red below.
+-->
+<div class="green drop-shadowed box" id="box"></div>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='box' class='green box'",
+    "LayoutBlockFlow (positioned) DIV id='box' class='green box'",
+];
+function paintInvalidationTest() {
+    var box = document.getElementById('box');
+    box.classList.toggle('drop-shadowed');
+}
+window.onload = runPaintInvalidationTest;
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-invalidation-with-composited-container-change-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-invalidation-with-composited-container-change-expected.html
new file mode 100644
index 0000000..61bd9bc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-invalidation-with-composited-container-change-expected.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<style>
+.green {
+  background-color: green;
+}
+.box {
+  width: 200px;
+  height: 200px;
+}
+.drop-shadowed {
+  -webkit-filter: drop-shadow(100px 100px 10px red);
+}
+.blurry {
+  -webkit-filter: blur(10px);
+  transform: translateZ(0);
+}
+</style>
+<!--
+    This test checks that we correctly invalidate filters along with a paint invalidation container change.
+    There should be no red below.
+-->
+<div class="green blurry box" id="box"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-invalidation-with-composited-container-change.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-invalidation-with-composited-container-change.html
new file mode 100644
index 0000000..f89ef0d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-invalidation-with-composited-container-change.html
@@ -0,0 +1,35 @@
+<!-- Based on fast/repaint/filter-invalidation-with-composited-container-change.html -->
+<!DOCTYPE html>
+<style>
+.green {
+  background-color: green;
+}
+.box {
+  width: 200px;
+  height: 200px;
+}
+.drop-shadowed {
+  -webkit-filter: drop-shadow(100px 100px 10px red);
+}
+.blurry {
+  -webkit-filter: blur(10px);
+  transform: translateZ(0);
+}
+</style>
+<!--
+    This test checks that we correctly invalidate filters along with a paint invalidation container change.
+    There should be no red below.
+-->
+<div class="green drop-shadowed box" id="box"></div>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV id='box' class='green box blurry'",
+];
+function paintInvalidationTest() {
+    var box = document.getElementById('box');
+    box.classList.toggle('drop-shadowed');
+    box.classList.toggle('blurry');
+}
+runPaintInvalidationTest();
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-repaint-accelerated-child-with-filter-child-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-repaint-accelerated-child-with-filter-child-expected.html
new file mode 100644
index 0000000..c7f75a1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-repaint-accelerated-child-with-filter-child-expected.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<style>
+div {
+    width: 200px;
+    height: 200px;
+}
+
+.blur {
+    -webkit-filter: blur(10px);
+}
+
+.drop-shadow {
+    -webkit-filter: drop-shadow(16px 16px 10px black);
+}
+
+.accelerated {
+    transform: translateZ(0);
+}
+
+#resize {
+    background-color: green;
+    width: 100px;
+}
+</style>
+
+<div class="blur">
+    <div class="accelerated">
+        <div class="drop-shadow" id="resize"></div>
+    </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-repaint-accelerated-child-with-filter-child.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-repaint-accelerated-child-with-filter-child.html
new file mode 100644
index 0000000..2c9a098
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-repaint-accelerated-child-with-filter-child.html
@@ -0,0 +1,43 @@
+<!-- Based on fast/repaint/filter-repaint-accelerated-child-with-filter-child.html -->
+<!DOCTYPE html>
+<style>
+div {
+    width: 200px;
+    height: 200px;
+}
+
+.blur {
+    -webkit-filter: blur(10px);
+}
+
+.drop-shadow {
+    -webkit-filter: drop-shadow(16px 16px 10px black);
+}
+
+.accelerated {
+    transform: translateZ(0);
+}
+
+#resize {
+    background-color: green;
+}
+</style>
+
+<div class="blur">
+    <div class="accelerated">
+        <div class="drop-shadow" id="resize"></div>
+    </div>
+</div>
+
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV id='resize' class='drop-shadow'",
+];
+function paintInvalidationTest() {
+    var resizeElement = document.getElementById("resize");
+    resizeElement.style.width = "100px";
+}
+window.onload = runPaintInvalidationTest;
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-repaint-accelerated-on-accelerated-filter-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-repaint-accelerated-on-accelerated-filter-expected.html
new file mode 100644
index 0000000..2426b6a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-repaint-accelerated-on-accelerated-filter-expected.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<style>
+div {
+    width: 200px;
+    height: 200px;
+}
+
+.blur {
+    -webkit-filter: blur(10px);
+}
+
+.drop-shadow {
+    -webkit-filter: drop-shadow(16px 16px 10px black);
+}
+
+.accelerated {
+    transform: translateZ(0);
+}
+
+#resize {
+    background-color: green;
+    width: 100px;
+}
+</style>
+
+<div class="blur accelerated">
+    <div class="drop-shadow accelerated" id="resize"></div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-repaint-accelerated-on-accelerated-filter.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-repaint-accelerated-on-accelerated-filter.html
new file mode 100644
index 0000000..8110664
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-repaint-accelerated-on-accelerated-filter.html
@@ -0,0 +1,43 @@
+<!-- Based on fast/repaint/filter-repaint-accelerated-on-accelerated-filter.html -->
+<!DOCTYPE html>
+<style>
+div {
+    width: 200px;
+    height: 200px;
+}
+
+.blur {
+    -webkit-filter: blur(10px);
+}
+
+.drop-shadow {
+    -webkit-filter: drop-shadow(16px 16px 10px black);
+}
+
+.accelerated {
+    transform: translateZ(0);
+}
+
+#resize {
+    background-color: green;
+}
+</style>
+
+<div class="blur accelerated">
+    <div class="drop-shadow accelerated" id="resize"></div>
+</div>
+
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.testIsAsync = true;
+
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV id='resize' class='drop-shadow accelerated'",
+];
+function paintInvalidationTest() {
+    var resizeElement = document.getElementById("resize");
+    resizeElement.style.width = "100px";
+    finishPaintInvalidationTest();
+}
+window.onload = runPaintInvalidationTest;
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-repaint-on-accelerated-layer-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-repaint-on-accelerated-layer-expected.html
new file mode 100644
index 0000000..1a4d279
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-repaint-on-accelerated-layer-expected.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<style>
+div {
+    width: 200px;
+    height: 200px;
+}
+
+.blur {
+    -webkit-filter: blur(10px);
+}
+
+.accelerated {
+    transform: translateZ(0);
+}
+
+#resize {
+    background-color: green;
+    width: 100px;
+}
+</style>
+
+<div class="blur">
+    <div class="accelerated" id="resize"></div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-repaint-on-accelerated-layer.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-repaint-on-accelerated-layer.html
new file mode 100644
index 0000000..4a2ebc7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/filter-repaint-on-accelerated-layer.html
@@ -0,0 +1,36 @@
+<!-- Based on fast/repaint/filter-repaint-on-accelerated-layer.html -->
+<!DOCTYPE html>
+<style>
+div {
+    width: 200px;
+    height: 200px;
+}
+
+.blur {
+    -webkit-filter: blur(10px);
+}
+
+.accelerated {
+    transform: translateZ(0);
+}
+
+#resize {
+    background-color: green;
+}
+</style>
+
+<div class="blur">
+    <div class="accelerated" id="resize"></div>
+</div>
+
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV id='resize' class='accelerated'",
+];
+function paintInvalidationTest() {
+    var resizeElement = document.getElementById("resize");
+    resizeElement.style.width = "100px";
+}
+window.onload = runPaintInvalidationTest;
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-after-scroll-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-after-scroll-expected.html
new file mode 100644
index 0000000..cdd9b0f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-after-scroll-expected.html
@@ -0,0 +1,16 @@
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <script>
+        window.onload = function() {
+            window.scrollTo(0, 500);
+        };
+    </script>
+</head>
+
+<body style="height:2000px;">
+    <!-- Repaint test for https://bugs.webkit.org/show_bug.cgi?id=64650: Layer fixed position logic needs more basic testing -->
+    <!-- You should see no red on this page. -->
+    <div id="t" style="top: 700px;" class="green absolute"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-after-scroll.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-after-scroll.html
new file mode 100644
index 0000000..f893377
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-after-scroll.html
@@ -0,0 +1,29 @@
+<!-- Based on fast/repaint/fixed-after-scroll.html -->
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <script src="resources/paint-invalidation-test.js"></script>
+    <script>
+        window.onload = function() {
+            window.scrollTo(0, 500);
+            runPaintInvalidationTest();
+        };
+
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (positioned) DIV id='t' class='green absolute'",
+            "LayoutBlockFlow (positioned) DIV id='t' class='green absolute'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById('t').style.position = "fixed";
+        }
+    </script>
+</head>
+
+<body style="height:2000px;">
+    <!-- Repaint test for https://bugs.webkit.org/show_bug.cgi?id=64650: Layer fixed position logic needs more basic testing -->
+    <!-- You should see no red on this page. -->
+    <div style="top: 200px;" class="red fixed"></div>
+    <div id="t" style="top: 200px;" class="green absolute"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-and-absolute-position-scrolled-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-and-absolute-position-scrolled-expected.html
new file mode 100644
index 0000000..65fc254
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-and-absolute-position-scrolled-expected.html
@@ -0,0 +1,14 @@
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <script type="text/javascript">
+        window.onload = function() {
+            window.scrollTo(0, 500);
+        }
+    </script>
+</head>
+<body style="height:2000px;">
+    <!-- You should see 1 green rectangle in the output and no red. -->
+    <div id="container" style="top: 5000px;"><div id="absoluteDiv" style="top: 700px; left:100px;" class="absolute green"></div></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-and-absolute-position-scrolled.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-and-absolute-position-scrolled.html
new file mode 100644
index 0000000..e8e4d79
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-and-absolute-position-scrolled.html
@@ -0,0 +1,32 @@
+<!-- Based on fast/repaint/fixed-and-absolute-position-scrolled.html -->
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        if (window.testRunner)
+            testRunner.dumpAsTextWithPixelResults();
+
+        window.onload = function() {
+            window.scrollTo(0, 500);
+            runPaintInvalidationTest();
+        }
+
+        window.expectedPaintInvalidationObjects = [
+            "LayoutView #document",
+            "LayoutBlockFlow HTML",
+            "LayoutBlockFlow DIV id='container' class='relative'",
+            "LayoutBlockFlow (positioned) DIV id='absoluteDiv' class='absolute green'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById('container').style.position = 'static';
+        }
+    </script>
+</head>
+<body style="height:2000px;">
+    <!-- You should see 1 green rectangle in the output and no red. -->
+    <div style="top: 200px; left: 100px;" class="fixed red"></div>
+    <div id="container" style="top: 5000px;" class="relative"><div id="absoluteDiv" style="top: 700px; left:100px;" class="absolute green"></div></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-move-after-scroll-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-move-after-scroll-expected.html
new file mode 100644
index 0000000..db8609a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-move-after-scroll-expected.html
@@ -0,0 +1,12 @@
+<html>
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+</head>
+  <body onload="scrollBy(0, 200)" style="height: 3000px;">
+    <div style="position: fixed: top: 0; left: 0;">
+      <p style="position: absolute; top: 210px">You should see a yellow rect on the left, and a green one on the right. No red pixels.</p>
+      <div id="toMove" style="width: 100px; height: 100px; background-color: green; position: fixed; top: 70px; left: 150px;"></div>
+      <div style="width: 100px; height: 100px; background-color: yellow; position: absolute; top: 270px; left: 10px; z-index: -5;"></div>
+    </div>
+  </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-move-after-scroll.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-move-after-scroll.html
new file mode 100644
index 0000000..20ebd27
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-move-after-scroll.html
@@ -0,0 +1,30 @@
+<!-- Based on fast/repaint/fixed-child-move-after-scroll.html -->
+<html>
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+  <script src="resources/paint-invalidation-test.js"></script>
+  <script type="text/javascript">
+      function scrollAndRepaint()
+      {
+          scrollBy(0, 200);
+          runPaintInvalidationTest();
+      }
+
+      window.expectedPaintInvalidationObjects = [
+          "LayoutBlockFlow (positioned) DIV id='toMove'",
+      ];
+      function paintInvalidationTest()
+      {
+          document.getElementById('toMove').style.left = "150px";
+          document.getElementById('toMove').style.backgroundColor = "green";
+      }
+  </script>
+</head>
+  <body onload="scrollAndRepaint()" style="height: 3000px;">
+    <div style="position: fixed: top: 0; left: 0;">
+      <p style="position: absolute; top: 210px">You should see a yellow rect on the left, and a green one on the right. No red pixels.</p>
+      <div id="toMove" style="width: 100px; height: 100px; background-color: red; position: fixed; top: 70px; left: 10px;"></div>
+      <div style="width: 100px; height: 100px; background-color: yellow; position: absolute; top: 270px; left: 10px; z-index: -5;"></div>
+    </div>
+  </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-of-fixed-move-after-scroll-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-of-fixed-move-after-scroll-expected.html
new file mode 100644
index 0000000..db8609a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-of-fixed-move-after-scroll-expected.html
@@ -0,0 +1,12 @@
+<html>
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+</head>
+  <body onload="scrollBy(0, 200)" style="height: 3000px;">
+    <div style="position: fixed: top: 0; left: 0;">
+      <p style="position: absolute; top: 210px">You should see a yellow rect on the left, and a green one on the right. No red pixels.</p>
+      <div id="toMove" style="width: 100px; height: 100px; background-color: green; position: fixed; top: 70px; left: 150px;"></div>
+      <div style="width: 100px; height: 100px; background-color: yellow; position: absolute; top: 270px; left: 10px; z-index: -5;"></div>
+    </div>
+  </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-of-fixed-move-after-scroll.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-of-fixed-move-after-scroll.html
new file mode 100644
index 0000000..2720040
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-of-fixed-move-after-scroll.html
@@ -0,0 +1,29 @@
+<!-- Based on fast/repaint/fixed-child-of-fixed-move-after-scroll.html -->
+<html>
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+  <script src="resources/paint-invalidation-test.js"></script>
+  <script type="text/javascript">
+      function scrollAndRepaint()
+      {
+          scrollBy(0, 200);
+          runPaintInvalidationTest();
+      }
+      window.expectedPaintInvalidationObjects = [
+          "LayoutBlockFlow (positioned) DIV id='toMove'",
+      ];
+      function paintInvalidationTest()
+      {
+          document.getElementById('toMove').style.left = "150px";
+          document.getElementById('toMove').style.backgroundColor = "green";
+      }
+  </script>
+</head>
+  <body onload="scrollAndRepaint()" style="height: 3000px;">
+    <div style="position: fixed: top: 0; left: 0;">
+      <p style="position: absolute; top: 210px">You should see a yellow rect on the left, and a green one on the right. No red pixels.</p>
+      <div id="toMove" style="width: 100px; height: 100px; background-color: red; position: fixed; top: 70px; left: 10px;"></div>
+      <div style="width: 100px; height: 100px; background-color: yellow; position: absolute; top: 270px; left: 10px; z-index: -5;"></div>
+    </div>
+  </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-of-transformed-move-after-scroll-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-of-transformed-move-after-scroll-expected.html
new file mode 100644
index 0000000..cce87606
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-of-transformed-move-after-scroll-expected.html
@@ -0,0 +1,12 @@
+<html>
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+</head>
+  <body onload="scrollBy(0, 200)" style="height: 3000px;">
+    <div style="position: absolute: top: 0; left: 0; transform: translate(0, 0);">
+      <p style="position: absolute; top: 210px">You should see a yellow rect on the left, and a green one on the right. No red pixels.</p>
+      <div id="toMove" style="width: 100px; height: 100px; background-color: green; position: fixed; top: 270px; left: 150px;"></div>
+      <div style="width: 100px; height: 100px; background-color: yellow; position: absolute; top: 270px; left: 10px; z-index: -5;"></div>
+    </div>
+  </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-of-transformed-move-after-scroll.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-of-transformed-move-after-scroll.html
new file mode 100644
index 0000000..3cef7819
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-of-transformed-move-after-scroll.html
@@ -0,0 +1,29 @@
+<!-- Based on fast/repaint/fixed-child-of-transformed-move-after-scroll.html -->
+<html>
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+  <script src="resources/paint-invalidation-test.js"></script>
+  <script type="text/javascript">
+      function scrollAndRepaint()
+      {
+          scrollBy(0, 200);
+          runPaintInvalidationTest();
+      }
+      window.expectedPaintInvalidationObjects = [
+          "LayoutBlockFlow (positioned) DIV id='toMove'",
+      ];
+      function paintInvalidationTest()
+      {
+          document.getElementById('toMove').style.left = "150px";
+          document.getElementById('toMove').style.backgroundColor = "green";
+      }
+  </script>
+</head>
+  <body onload="scrollAndRepaint()" style="height: 3000px;">
+    <div style="position: absolute: top: 0; left: 0; transform: translate(0, 0);">
+      <p style="position: absolute; top: 210px">You should see a yellow rect on the left, and a green one on the right. No red pixels.</p>
+      <div id="toMove" style="width: 100px; height: 100px; background-color: red; position: fixed; top: 270px; left: 10px;"></div>
+      <div style="width: 100px; height: 100px; background-color: yellow; position: absolute; top: 270px; left: 10px; z-index: -5;"></div>
+    </div>
+  </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-of-transformed-scrolled-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-of-transformed-scrolled-expected.html
new file mode 100644
index 0000000..5428a98
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-of-transformed-scrolled-expected.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<script>
+onload = function() {
+  document.getElementById('transformed').scrollTop = 50;
+}
+</script>
+<style>
+#transformed {
+  position: absolute;
+  top: 50px;
+  left: 100px;
+  transform: translateX(0);
+  overflow: scroll;
+  width: 300px;
+  height: 300px;
+}
+#fixed {
+  position: fixed;
+  top: 150px;
+  left: 200px;
+  width: 100px;
+  height: 100px;
+  background-color: green;
+}
+/* to make the transformed container scrollable */
+#content {
+  width: 1000px;
+  height: 1000px;
+}
+</style>
+Tests invalidation of a fixed-position child of a transformed scrolled element.
+Passes if there is a green box at the center of the scrollable area.
+<div id="transformed">
+  <div id="content"></div>
+</div>
+<div id="fixed"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-of-transformed-scrolled.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-of-transformed-scrolled.html
new file mode 100644
index 0000000..8a2c857f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-child-of-transformed-scrolled.html
@@ -0,0 +1,45 @@
+<!-- Based on fast/repaint/fixed-child-of-transformed-scrolled.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='fixed'",
+];
+function paintInvalidationTest() {
+  document.getElementById('fixed').style.backgroundColor = 'green';
+}
+onload = function() {
+  document.getElementById('transformed').scrollTop = 50;
+  runPaintInvalidationTest();
+}
+</script>
+<style>
+#transformed {
+  position: absolute;
+  top: 50px;
+  left: 100px;
+  transform: translateX(0);
+  overflow: scroll;
+  width: 300px;
+  height: 300px;
+}
+#fixed {
+  position: fixed;
+  top: 150px;
+  left: 100px;
+  width: 100px;
+  height: 100px;
+  background-color: red;
+}
+/* to make the transformed container scrollable */
+#content {
+  width: 1000px;
+  height: 1000px;
+}
+</style>
+Tests invalidation of a fixed-position child of a transformed scrolled element.
+Passes if there is a green box at the center of the scrollable area.
+<div id="transformed">
+  <div id="fixed"></div>
+  <div id="content"></div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-descendant-of-transformed-scrolled-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-descendant-of-transformed-scrolled-expected.html
new file mode 100644
index 0000000..9bbc2d6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-descendant-of-transformed-scrolled-expected.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<script>
+onload = function() {
+  document.getElementById('transformed').scrollTop = 50;
+}
+</script>
+<style>
+#transformed {
+  position: absolute;
+  top: 50px;
+  left: 100px;
+  transform: translateX(0);
+  overflow: scroll;
+  width: 300px;
+  height: 300px;
+}
+#fixed {
+  position: fixed;
+  top: 150px;
+  left: 100px;
+  width: 100px;
+  height: 100px;
+  background-color: green;
+}
+#relative {
+  position: relative;
+  top: 50px;
+  left: 50px;
+}
+/* to make the transformed container scrollable */
+#content {
+  width: 1000px;
+  height: 1000px;
+}
+</style>
+Tests invalidation of a fixed-position descendant of a transformed scrolled element.
+Passes if there is a green box at the center of the scrollable area.
+<div id="transformed">
+  <div id="relative">
+    <div id="fixed"></div>
+    <div id="content"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-descendant-of-transformed-scrolled.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-descendant-of-transformed-scrolled.html
new file mode 100644
index 0000000..7fbd415
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-descendant-of-transformed-scrolled.html
@@ -0,0 +1,52 @@
+<!-- Based on fast/repaint/fixed-descendant-of-transformed-scrolled.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='fixed'",
+];
+function paintInvalidationTest() {
+  document.getElementById('fixed').style.backgroundColor = 'green';
+}
+onload = function() {
+  document.getElementById('transformed').scrollTop = 50;
+  runPaintInvalidationTest();
+}
+</script>
+<style>
+#transformed {
+  position: absolute;
+  top: 50px;
+  left: 100px;
+  transform: translateX(0);
+  overflow: scroll;
+  width: 300px;
+  height: 300px;
+}
+#fixed {
+  position: fixed;
+  top: 150px;
+  left: 100px;
+  width: 100px;
+  height: 100px;
+  background-color: red;
+}
+#relative {
+  position: relative;
+  top: 50px;
+  left: 50px;
+}
+/* to make the transformed container scrollable */
+#content {
+  width: 1000px;
+  height: 1000px;
+}
+</style>
+Tests invalidation of a fixed-position descendant of a transformed scrolled element.
+Passes if there is a green box at the center of the scrollable area.
+<div id="transformed">
+  <div id="relative">
+    <div id="fixed"></div>
+    <div id="content"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-img-src-change-after-scroll-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-img-src-change-after-scroll-expected.html
new file mode 100644
index 0000000..e8e5c43b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-img-src-change-after-scroll-expected.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<script>
+onload = function() {
+  window.scrollTo(0, 1000);
+}
+</script>
+<body style="height: 2000px">
+Checks correct paint invalidation on image src change after a pending scroll.
+Passes if there is no assert failure about pending scroll offsets in a debug build
+(http://crbug.com/434950), and both the old location and new location of the img are
+correctly invalidated.
+  <img id='img' src='../../../fast/images/resources/green.jpg' style="width: 100px; height: 100px; position: fixed; top: 50px; left: 0">
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-img-src-change-after-scroll.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-img-src-change-after-scroll.html
new file mode 100644
index 0000000..402688c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-img-src-change-after-scroll.html
@@ -0,0 +1,20 @@
+<!-- Based on fast/images/fixed-img-src-change-after-scroll.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutImage (positioned) IMG id='img'",
+];
+function paintInvalidationTest() {
+  window.scrollTo(0, 1000);
+  document.getElementById('img').src = '../../../fast/images/resources/green.jpg';
+}
+onload = runPaintInvalidationTest;
+</script>
+<body style="height: 2000px">
+Checks correct paint invalidation on image src change after a pending scroll.
+Passes if there is no assert failure about pending scroll offsets in a debug build
+(http://crbug.com/434950), and both the old location and new location of the img are
+correctly invalidated.
+  <img id='img' style="width: 100px; height: 100px; position: fixed; top: 50px; left: 0">
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-margin-change-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-margin-change-repaint-expected.html
new file mode 100644
index 0000000..02cf75b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-margin-change-repaint-expected.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<style>
+    body {
+        margin: 0;
+    }
+    #container {
+        position: relative;
+        top: 40px;
+        width: 200px;
+        height: 400px;
+    }
+    #test {
+        position: fixed;
+        background-color: green;
+        width: 100px;
+        height: 100px;
+        margin-top: 20px;
+    }
+</style>
+<div id="container">
+    <div id="test"></div>
+</div>
+Tests the repainting of fixed element when margin-top changes.
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-margin-change-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-margin-change-repaint.html
new file mode 100644
index 0000000..bfe83a89
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-margin-change-repaint.html
@@ -0,0 +1,34 @@
+<!-- Based on fast/repaint/fixed-margin-change-repaint.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<style>
+    body {
+        margin: 0;
+    }
+    #container {
+        position: relative;
+        top: 40px;
+        width: 200px;
+        height: 400px;
+    }
+    #test {
+        position: fixed;
+        background-color: green;
+        width: 100px;
+        height: 100px;
+    }
+</style>
+<script>
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow (positioned) DIV id='test'",
+    ];
+    function paintInvalidationTest()
+    {
+        document.getElementById("test").style['margin-top'] = '20px';
+    }
+    window.onload = runPaintInvalidationTest;
+</script>
+<div id="container">
+    <div id="test"></div>
+</div>
+Tests the repainting of fixed element when margin-top changes.
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-move-after-scroll-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-move-after-scroll-expected.html
new file mode 100644
index 0000000..6a1ed2d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-move-after-scroll-expected.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+</head>
+  <body onload="scrollBy(0, 200)" style="height: 3000px;">
+    <p style="position: absolute; top: 210">You should see a yellow rect on the left, and a green one on the right. No red pixels.</p>
+    <div id="toMove" style="width: 100px; height: 100px; background-color: green; position: absolute; top: 270px; left: 150px;"></div>
+    <div style="width: 100px; height: 100px; background-color: yellow; position: absolute; top: 270px; left: 10px; z-index: -5;"></div>
+  </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-move-after-scroll.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-move-after-scroll.html
new file mode 100644
index 0000000..8f0c588
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-move-after-scroll.html
@@ -0,0 +1,27 @@
+<!-- Based on fast/repaint/fixed-move-after-scroll.html -->
+<html>
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+  <script src="resources/paint-invalidation-test.js"></script>
+  <script type="text/javascript">
+      function scrollAndRepaint()
+      {
+          scrollBy(0, 200);
+          runPaintInvalidationTest();
+      }
+      window.expectedPaintInvalidationObjects = [
+          "LayoutBlockFlow (positioned) DIV id='toMove'",
+      ];
+      function paintInvalidationTest()
+      {
+          document.getElementById('toMove').style.left = "150px";
+          document.getElementById('toMove').style.backgroundColor = "green";
+      }
+  </script>
+</head>
+  <body onload="scrollAndRepaint()" style="height: 3000px;">
+    <p style="position: absolute; top: 210">You should see a yellow rect on the left, and a green one on the right. No red pixels.</p>
+    <div id="toMove" style="width: 100px; height: 100px; background-color: red; position: fixed; top: 70px; left: 10px;"></div>
+    <div style="width: 100px; height: 100px; background-color: yellow; position: absolute; top: 270px; left: 10px; z-index: -5;"></div>
+  </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-pos-inside-composited-intermediate-layer-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-pos-inside-composited-intermediate-layer-expected.html
new file mode 100644
index 0000000..b508705
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-pos-inside-composited-intermediate-layer-expected.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+<style>
+
+.compositedBehind {
+  width: 500px;
+  height: 500px;
+  transform: translatez(0);
+  background-color: cyan;
+}
+
+.containerOverlapsComposited {
+  position: absolute;
+  z-index: 2; /* Creates a stacking context so that the fixed-pos layer is contained instead of a sibling */
+  top: 20px;
+  left: 20px;
+  width: 100px;
+  height: 30000px;
+  background-color: green;
+}
+
+.absolute {
+  position: absolute;
+  top: 145px;
+  left: 45px;
+  background-color: lime;
+  width: 50px;
+  height: 50px;
+  z-index: 3;
+}
+
+</style>
+
+<script>
+        if (window.internals) {
+            /* Note carefully, compositing for fixed position is _disabled_ here */
+            internals.settings.setPreferCompositingToLCDTextEnabled(false);
+        }
+
+        onload = function() {
+             window.scrollTo(0, 100);
+        }
+</script>
+
+</head>
+
+
+
+<body>
+  <!--
+       Among other duplicate bugs: https://code.google.com/p/chromium/issues/detail?id=128375
+       A non-composited fixed-position element can get grouped into a composited container.
+       In this case, repaint invalidations were incorrectly going to the LayoutView instead
+       of the composited container.  The incorrect result was that the fixed-position element
+       never repainted, and it appeared to scroll along with the composited container.
+    -->
+  <div class="compositedBehind"> </div>
+
+  <div class="containerOverlapsComposited"></div>
+
+  <div class="absolute"></div>
+</body>
+
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-pos-inside-composited-intermediate-layer.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-pos-inside-composited-intermediate-layer.html
new file mode 100644
index 0000000..af6a4fe
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-pos-inside-composited-intermediate-layer.html
@@ -0,0 +1,70 @@
+<!-- Based on compositing/repaint/fixed-pos-inside-composited-intermediate-layer.html -->
+<!DOCTYPE html>
+<html>
+
+<head>
+<script src="resources/paint-invalidation-test.js"></script>
+<style>
+
+.compositedBehind {
+  width: 500px;
+  height: 500px;
+  transform: translatez(0);
+  background-color: cyan;
+}
+
+.containerOverlapsComposited {
+  position: absolute;
+  z-index: 2; /* Creates a stacking context so that the fixed-pos layer is contained instead of a sibling */
+  top: 20px;
+  left: 20px;
+  width: 100px;
+  height: 30000px;
+  background-color: green;
+}
+
+.fixed {
+  position: fixed;
+  top: 45px;
+  left: 45px;
+  background-color: lime;
+  width: 50px;
+  height: 50px;
+}
+
+</style>
+
+<script>
+        if (window.internals) {
+            /* Note carefully, compositing for fixed position is _disabled_ here */
+            internals.settings.setPreferCompositingToLCDTextEnabled(false);
+        }
+
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (positioned) DIV class='fixed'",
+        ];
+        function paintInvalidationTest() {
+             window.scrollTo(0, 100);
+        }
+</script>
+
+</head>
+
+
+
+<body onload="runPaintInvalidationTest()">
+  <!--
+       Among other duplicate bugs: https://code.google.com/p/chromium/issues/detail?id=128375
+       A non-composited fixed-position element can get grouped into a composited container.
+       In this case, repaint invalidations were incorrectly going to the LayoutView instead
+       of the composited container.  The incorrect result was that the fixed-position element
+       never repainted, and it appeared to scroll along with the composited container.
+    -->
+  <div class="compositedBehind"> </div>
+
+  <div class="containerOverlapsComposited">
+    <div class="fixed"></div>
+  </div>
+</body>
+
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-position-transparency-with-overflow-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-position-transparency-with-overflow-expected.html
new file mode 100644
index 0000000..55565705
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-position-transparency-with-overflow-expected.html
@@ -0,0 +1,9 @@
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+</head>
+<body style="height:2000px;">
+    <!-- You should see 2 rectangles touching on one corner in the output: a green one (top left) and a green one. -->
+    <div id="container" style="top: 200px; opacity: 0.4" class="relative blue"><div style="top:100px; left:100px;" class="absolute green"></div></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-position-transparency-with-overflow.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-position-transparency-with-overflow.html
new file mode 100644
index 0000000..ab9f4e5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-position-transparency-with-overflow.html
@@ -0,0 +1,21 @@
+<!-- Based on fast/repaint/fixed-position-transparency-with-overflow.html -->
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (relative positioned) DIV id='container' class='relative blue'",
+            "LayoutBlockFlow (positioned) DIV class='absolute green'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById('container').style.opacity = '0.4';
+        }
+    </script>
+</head>
+<body style="height:2000px;" onload="runPaintInvalidationTest()">
+    <!-- You should see 2 rectangles touching on one corner in the output: a green one (top left) and a green one. -->
+    <div id="container" style="top: 200px;" class="relative blue"><div style="top:100px; left:100px;" class="absolute green"></div></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-scale-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-scale-expected.html
new file mode 100644
index 0000000..ad486496
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-scale-expected.html
@@ -0,0 +1,15 @@
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <script>
+        window.onload = function() {
+            window.scrollTo(0, 200);
+        };
+    </script>
+</head>
+<body style="height:2000px;">
+    <!-- Repaint test for https://bugs.webkit.org/show_bug.cgi?id=64650: Layer fixed position logic needs more basic testing -->
+    <!-- You should see no red on this page. -->
+    <div id="t" style="position: absolute; top: 300px; left: 100px" class="green"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-scale.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-scale.html
new file mode 100644
index 0000000..1940fe2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-scale.html
@@ -0,0 +1,35 @@
+<!-- Based on fast/repaint/fixed-scale.html -->
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <style>
+        .translated {
+            transform: scale(2, 2);
+        }
+    </style>
+    <script src="resources/paint-invalidation-test.js"></script>
+    <script>
+        if (window.testRunner)
+            testRunner.dumpAsTextWithPixelResults();
+
+        window.onload = function() {
+            window.scrollTo(0, 200);
+            runPaintInvalidationTest();
+        };
+
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (positioned) DIV id='t' class='green translated'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById('t').setAttribute("class", "green translated");
+        }
+    </script>
+</head>
+<body style="height:2000px;">
+    <!-- Repaint test for https://bugs.webkit.org/show_bug.cgi?id=64650: Layer fixed position logic needs more basic testing -->
+    <!-- You should see no red on this page. -->
+    <div style="position: absolute; top: 300px; left: 100px;" class="red"></div>
+    <div id="t" style="position: fixed; top: 125px; left: 125px; width: 50px; height: 50px;" class="green"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-scroll-in-empty-root-layer-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-scroll-in-empty-root-layer-expected.html
new file mode 100644
index 0000000..38d2b66
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-scroll-in-empty-root-layer-expected.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<script>
+onload = function() {
+  window.scrollBy(0, 200);
+}
+</script>
+<body style="height: 2000px">
+  Tests invalidation of fixed element when scrolled in a page with empty root layer. Passes if there is no red.
+  <div style="
+    position: absolute;
+    top: 250px;
+    left: 0;
+    width: 100px;
+    height: 100px;
+    background: green">
+  </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-scroll-in-empty-root-layer.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-scroll-in-empty-root-layer.html
new file mode 100644
index 0000000..95bf034
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-scroll-in-empty-root-layer.html
@@ -0,0 +1,35 @@
+<!-- Based on compositing/overflow/fixed-scroll-in-empty-root-layer.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV",
+    "LayoutBlockFlow (positioned) DIV",
+];
+function paintInvalidationTest() {
+  window.scrollBy(0, 200);
+}
+onload = runPaintInvalidationTest;
+</script>
+<body style="height: 2000px">
+  Tests invalidation of fixed element when scrolled in a page with empty root layer. Passes if there is no red.
+  <div style="
+    position: fixed;
+    top: 50px;
+    left: 0;
+    width: 100px;
+    height: 100px;
+    background: green">
+  </div>
+  <!-- This div makes all of the contents of the page be in sublayers of the root layer, so root layer is empty. -->
+  <div style="
+    position: absolute;
+    z-index: -1;
+    backface-visibility: hidden;
+    top: 250px;
+    left: 0;
+    background-color: red;
+    width: 100px;
+    height: 100px">
+  </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-scroll-simple-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-scroll-simple-expected.html
new file mode 100644
index 0000000..f761fed
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-scroll-simple-expected.html
@@ -0,0 +1,16 @@
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <script>
+        onload = function()
+        {
+            window.scrollTo(0, 100);
+        }
+    </script>
+</head>
+<body style="height:2000px;">
+    <!-- Repaint test for https://bugs.webkit.org/show_bug.cgi?id=64650: Layer fixed position logic needs more basic testing -->
+    <!-- You should see no red on this page. -->
+    <div style="position: absolute; top: 200px;" class="green"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-scroll-simple.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-scroll-simple.html
new file mode 100644
index 0000000..47bbbc4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-scroll-simple.html
@@ -0,0 +1,25 @@
+<!-- Based on fast/repaint/fixed-scroll-simple.html -->
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <script src="resources/paint-invalidation-test.js"></script>
+    <script>
+        if (window.testRunner)
+            testRunner.dumpAsTextWithPixelResults();
+
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (positioned) DIV class='green'",
+        ];
+        function paintInvalidationTest()
+        {
+            window.scrollTo(0, 100);
+        }
+    </script>
+</head>
+<body style="height:2000px;" onload="runPaintInvalidationTest()">
+    <!-- Repaint test for https://bugs.webkit.org/show_bug.cgi?id=64650: Layer fixed position logic needs more basic testing -->
+    <!-- You should see no red on this page. -->
+    <div style="position: absolute; top: 200px;" class="red"></div>
+    <div style="position: fixed; top: 100px;" class="green"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-table-cell-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-table-cell-expected.html
new file mode 100644
index 0000000..a9c46ae
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-table-cell-expected.html
@@ -0,0 +1,21 @@
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <style>
+        table { top: 0px; left: 0px; border-spacing: 50px; position: absolute; }
+        td { background: green; padding: 0px; border-style: none; border: 0px; }
+    </style>
+    <script>
+        window.onload = function() {
+            window.scrollTo(0, 100);
+        };
+    </script>
+</head>
+<body style="height:2000px;">
+    <!-- Repaint test for https://bugs.webkit.org/show_bug.cgi?id=64650: Layer fixed position logic needs more basic testing -->
+    <!-- You should see no red on this page. -->
+    <table>
+        <tr><td></td><td></td></tr>
+        <tr><td></td></tr>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-table-cell.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-table-cell.html
new file mode 100644
index 0000000..1aa465d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-table-cell.html
@@ -0,0 +1,41 @@
+<!-- Based on fast/repaint/fixed-table-cell.html -->
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <style>
+        table { top: 0px; left: 0px; border-spacing: 50px; position: absolute; }
+        td { background: green; padding: 0px; border-style: none; border: 0px; }
+        td.fixed { position: fixed; left: 50px; top: 100px; }
+    </style>
+    <script src="resources/paint-invalidation-test.js"></script>
+    <script>
+        window.onload = function() {
+            window.scrollTo(0, 100);
+            runPaintInvalidationTest();
+        };
+
+        window.expectedPaintInvalidationObjects = [
+            "LayoutTableCell TD id='moveMe' class='fixed'",
+            "LayoutTable (positioned) TABLE",
+            "LayoutTableCell TD",
+            "LayoutTableCell TD",
+            "LayoutTableCell TD class='red'",
+            "LayoutTableCell (anonymous)",
+            "LayoutTableSection TBODY",
+            "LayoutTableCell (anonymous)",
+            "LayoutBlockFlow (positioned) TD id='moveMe' class='fixed'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById('moveMe').className = "fixed";
+        }
+    </script>
+</head>
+<body style="height:2000px;">
+    <!-- Repaint test for https://bugs.webkit.org/show_bug.cgi?id=64650: Layer fixed position logic needs more basic testing -->
+    <!-- You should see no red on this page. -->
+    <table>
+        <tr><td></td><td></td></tr>
+        <tr><td class="red"></td><td id="moveMe"></td></tr>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-table-overflow-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-table-overflow-expected.html
new file mode 100644
index 0000000..1214053
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-table-overflow-expected.html
@@ -0,0 +1,31 @@
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <style>
+        table { top: 0px; left: 0px; border-spacing: 0px; position: absolute; }
+        td { background: green; padding: 0px; border-style: none; border: 0px; }
+        td.fixed { position: fixed; left: 100px; top: 0px; }
+    </style>
+    <script>
+        if (window.testRunner)
+            testRunner.dumpAsTextWithPixelResults();
+
+        window.onload = function() {
+            window.scrollTo(0, 100);
+            runRepaintTest();
+        };
+
+        function repaintTest()
+        {
+            document.getElementById('moveMe').className = "fixed";
+        }
+    </script>
+</head>
+<body style="height:2000px;">
+    <!-- Repaint test for https://bugs.webkit.org/show_bug.cgi?id=64650: Layer fixed position logic needs more basic testing -->
+    <!-- You should see no red on this page. -->
+    <table>
+        <tr><td></td><td></td></tr>
+        <tr><td class="red"></td><td id="moveMe"><div style="position: relative; left: -100px; top: 0px;" class="green"></div></td></tr>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-table-overflow-zindex-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-table-overflow-zindex-expected.html
new file mode 100644
index 0000000..6d5f342
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-table-overflow-zindex-expected.html
@@ -0,0 +1,21 @@
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <style>
+        table { top: 0px; left: 0px; border-spacing: 0px; position: absolute; }
+        td { background: green; padding: 0px; border-style: none; border: 0px; }
+    </style>
+    <script>
+        window.onload = function() {
+            window.scrollTo(0, 100);
+        };
+    </script>
+</head>
+<body style="height:2000px;">
+    <!-- Repaint test for https://bugs.webkit.org/show_bug.cgi?id=64650: Layer fixed position logic needs more basic testing -->
+    <!-- You should see no red on this page. -->
+    <table>
+        <tr><td></td><td></td></tr>
+        <tr><td></td><td></td></tr>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-table-overflow-zindex.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-table-overflow-zindex.html
new file mode 100644
index 0000000..4706e2f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-table-overflow-zindex.html
@@ -0,0 +1,41 @@
+<!-- Based on fast/repaint/fixed-table-overflow-zindex.html -->
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <style>
+        table { top: 0px; left: 0px; border-spacing: 0px; position: absolute; }
+        td { background: green; padding: 0px; border-style: none; border: 0px; }
+        td.fixed { position: fixed; left: 100px; top: 0px; z-index: 3; }
+    </style>
+    <script src="resources/paint-invalidation-test.js"></script>
+    <script>
+        window.onload = function() {
+            window.scrollTo(0, 100);
+            runPaintInvalidationTest();
+        };
+
+        window.expectedPaintInvalidationObjects = [
+            "LayoutTableCell TD id='moveMe' class='fixed'",
+            "LayoutTable (positioned) TABLE",
+            "LayoutTableCell TD",
+            "LayoutTableCell TD",
+            "LayoutTableCell (anonymous)",
+            "LayoutTableCell TD class='red'",
+            "LayoutTableSection TBODY",
+            "LayoutTableCell (anonymous)",
+            "LayoutBlockFlow (positioned) TD id='moveMe' class='fixed'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById('moveMe').className = "fixed";
+        }
+    </script>
+</head>
+<body style="height:2000px;">
+    <!-- Repaint test for https://bugs.webkit.org/show_bug.cgi?id=64650: Layer fixed position logic needs more basic testing -->
+    <!-- You should see no red on this page. -->
+    <table>
+        <tr><td></td><td></td></tr>
+        <tr><td id="moveMe"></td><td class="red"><div class="green" style="position: relative; left: -100px; top: 0px;"></div></td></tr>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-table-overflow.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-table-overflow.html
new file mode 100644
index 0000000..b720e42
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-table-overflow.html
@@ -0,0 +1,43 @@
+<!-- Based on fast/repaint/fixed-table-overflow.html -->
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <style>
+        table { top: 0px; left: 0px; border-spacing: 0px; position: absolute; }
+        td { background: green; padding: 0px; border-style: none; border: 0px; }
+        td.fixed { position: fixed; left: 100px; top: 0px; }
+    </style>
+    <script src="resources/paint-invalidation-test.js"></script>
+    <script>
+        window.onload = function() {
+            window.scrollTo(0, 100);
+            runPaintInvalidationTest();
+        };
+
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (relative positioned) DIV class='green'",
+            "LayoutTableCell TD id='moveMe' class='fixed'",
+            "LayoutTable (positioned) TABLE",
+            "LayoutTableCell TD",
+            "LayoutTableCell TD",
+            "LayoutTableCell TD class='red'",
+            "LayoutTableCell (anonymous)",
+            "LayoutTableSection TBODY",
+            "LayoutTableCell (anonymous)",
+            "LayoutBlockFlow (positioned) TD id='moveMe' class='fixed'",
+            "LayoutBlockFlow (relative positioned) DIV class='green'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById('moveMe').className = "fixed";
+        }
+    </script>
+</head>
+<body style="height:2000px;">
+    <!-- Repaint test for https://bugs.webkit.org/show_bug.cgi?id=64650: Layer fixed position logic needs more basic testing -->
+    <!-- You should see no red on this page. -->
+    <table>
+        <tr><td></td><td></td></tr>
+        <tr><td class="red"></td><td id="moveMe"><div style="position: relative; left: -100px; top: 0px;" class="green"></div></td></tr>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-to-relative-position-with-absolute-child-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-to-relative-position-with-absolute-child-expected.html
new file mode 100644
index 0000000..653bfb9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-to-relative-position-with-absolute-child-expected.html
@@ -0,0 +1,9 @@
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+</head>
+<body style="height:2000px;">
+    <!-- You should see 2 rectangles touching on one corner in the output: a green one (top left) and a green one. -->
+    <div id="container" style="top: 200px;" class="relative blue"><div style="top:100px; left:100px;" class="absolute green"></div></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-to-relative-position-with-absolute-child.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-to-relative-position-with-absolute-child.html
new file mode 100644
index 0000000..7d69746
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-to-relative-position-with-absolute-child.html
@@ -0,0 +1,26 @@
+<!-- Based on fast/repaint/fixed-to-relative-position-with-absolute-child.html -->
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (positioned) DIV id='container' class='fixed blue'",
+            "LayoutBlockFlow (positioned) DIV class='absolute green'",
+            "LayoutBlockFlow (relative positioned) DIV id='container' class='fixed blue'",
+            "LayoutBlockFlow (positioned) DIV class='absolute green'",
+            "LayoutBlockFlow BODY",
+            "LayoutBlockFlow (relative positioned) DIV id='container' class='fixed blue'",
+            "LayoutBlockFlow (positioned) DIV class='absolute green'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById('container').style.position = 'relative';
+        }
+    </script>
+</head>
+<body style="height:2000px;" onload="runPaintInvalidationTest()">
+    <!-- You should see 2 rectangles touching on one corner in the output: a green one (top left) and a green one. -->
+    <div id="container" style="top: 200px;" class="fixed blue"><div style="top:100px; left:100px;" class="absolute green"></div></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-tranformed-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-tranformed-expected.html
new file mode 100644
index 0000000..13c7198
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-tranformed-expected.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style type="text/css" media="screen">
+        body {
+          height: 1000px;
+          margin: 0;
+        }
+        #test {
+        width: 100px;
+        height: 100px;
+        background-color: green;
+        position: absolute;
+        top: 110px;
+        left: 60px;
+        }
+    </style>
+    <script type="text/javascript">
+        function setupTest() {
+            window.scrollBy(0, 50);
+        };
+        window.addEventListener('load', setupTest, false);
+    </script>
+</head>
+<body>
+
+<!--
+    https://bugs.webkit.org/show_bug.cgi?id=36686
+    Test repainting of a fixed-position element with a transform.
+    The box should be entirely green.
+-->
+<div id="test"></div>
+
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-tranformed.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-tranformed.html
new file mode 100644
index 0000000..6f382d6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-tranformed.html
@@ -0,0 +1,52 @@
+<!-- Based on fast/repaint/fixed-tranformed.html -->
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style type="text/css" media="screen">
+        body {
+          height: 1000px;
+          margin: 0;
+        }
+        #test {
+        width: 100px;
+        height: 100px;
+        background-color: red;
+        position: fixed;
+        top: 10px;
+        left: 10px;
+        transform: translate(50px, 50px);
+        }
+
+        .box:hover {
+          background-color: green;
+        }
+    </style>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (positioned) DIV id='test'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById('test').style.background='green';
+        }
+
+        function setupTest() {
+            window.scrollBy(0, 50);
+            runPaintInvalidationTest();
+        };
+        window.addEventListener('load', setupTest, false);
+    </script>
+</head>
+<body>
+
+<!--
+    https://bugs.webkit.org/show_bug.cgi?id=36686
+    Test repainting of a fixed-position element with a transform.
+    The box should be entirely green.
+-->
+<div id="test"></div>
+
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-under-composited-absolute-scrolled-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-under-composited-absolute-scrolled-expected.html
new file mode 100644
index 0000000..4bb6c89
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-under-composited-absolute-scrolled-expected.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<script>
+onload = function() {
+  window.scrollTo(0, 400);
+};
+</script>
+<style>
+#indicator {
+  position: absolute;
+  height: 200px;
+  width: 100px;
+  top: 400px;
+  left: 0;
+  background-color: green;
+}
+#absolute {
+  position: absolute;
+  top: 2000px;
+  width: 1px;
+  height: 1px;
+}
+</style>
+Tests paint invalidation of fixed element under a composited absolute element on resize after scrolled.
+Passes if there is a 100x200 green rectangle and no red.
+<div id="indicator"></div>
+<div id="absolute"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-under-composited-absolute-scrolled.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-under-composited-absolute-scrolled.html
new file mode 100644
index 0000000..7258773
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-under-composited-absolute-scrolled.html
@@ -0,0 +1,51 @@
+<!-- Based on fast/repaint/fixed-under-composited-absolute-scrolled.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='fixed'",
+];
+function paintInvalidationTest() {
+  document.getElementById('fixed').style.height = '200px';
+}
+onload = function() {
+  // Scroll before repaint test to test correct scroll offset of invalidation rect
+  // for fixed-position element when it needs repaint.
+  window.scrollTo(0, 400);
+  runPaintInvalidationTest();
+};
+</script>
+<style>
+#indicator {
+  position: absolute;
+  height: 200px;
+  width: 100px;
+  top: 400px;
+  left: 0;
+  background-color: red;
+}
+#absolute {
+  position: absolute;
+  top: 2000px;
+  width: 1px;
+  height: 1px;
+  background-color: red;
+  backface-visibility: hidden;
+  z-index: 1000;
+}
+#fixed {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100px;
+  height: 100px; 
+  background-color: green;
+}
+</style>
+Tests paint invalidation of fixed element under a composited absolute element on resize after scrolled.
+Passes if there is a 100x200 green rectangle and no red.
+<div id="indicator"></div>
+<div id="absolute">
+  <div id="fixed">
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-under-composited-fixed-scrolled-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-under-composited-fixed-scrolled-expected.html
new file mode 100644
index 0000000..836f5db
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-under-composited-fixed-scrolled-expected.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<script>
+onload = function() {
+  window.scrollTo(0, 400);
+};
+</script>
+<style>
+body {
+  height: 2000px;
+}
+#fixed-container {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  background-color: green;
+  backface-visibility: hidden;
+}
+</style>
+Tests paint invalidation of fixed elements under a composited fixed element after scrolled.
+Passes if there is only green background.
+<div id="fixed-container">
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-under-composited-fixed-scrolled.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-under-composited-fixed-scrolled.html
new file mode 100644
index 0000000..4b9c66a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/fixed-under-composited-fixed-scrolled.html
@@ -0,0 +1,44 @@
+<!-- Based on fast/repaint/fixed-under-composited-fixed-scrolled.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='fixed'",
+];
+function paintInvalidationTest() {
+  document.getElementById('fixed').style.display = 'none';
+}
+onload = function() {
+  // Scroll before repaint test to test correct scroll offset of invalidation rect
+  // for fixed-position element when it needs repaint.
+  window.scrollTo(0, 400);
+  runPaintInvalidationTest();
+};
+</script>
+<style>
+body {
+  height: 2000px;
+}
+#fixed-container {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  background-color: green;
+  backface-visibility: hidden;
+}
+#fixed {
+  position: fixed;
+  top: 100px;
+  left: 100px;
+  width: 200px;
+  height: 200px;
+  background-color: red;
+}
+</style>
+Tests paint invalidation of fixed elements under a composited fixed element after scrolled.
+Passes if there is only green background.
+<div id="fixed-container">
+  <div id="fixed"></div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/float-in-new-block-with-layout-delta-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/float-in-new-block-with-layout-delta-expected.html
new file mode 100644
index 0000000..3bae818
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/float-in-new-block-with-layout-delta-expected.html
@@ -0,0 +1,6 @@
+<body>
+    <div style="height: 100px;"></div>
+    <div id="target">
+        <div style="float: left; width: 100px; height: 100px; background-color: green;"></div>
+    </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/float-in-new-block-with-layout-delta.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/float-in-new-block-with-layout-delta.html
new file mode 100644
index 0000000..be3caaf
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/float-in-new-block-with-layout-delta.html
@@ -0,0 +1,18 @@
+<!-- Based on fast/repaint/float-in-new-block-with-layout-delta.html -->
+<script src="resources/paint-invalidation-test.js" type="text/javascript" charset="utf-8"></script>
+<script>
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow DIV id='target'",
+        "LayoutBlockFlow (floating) DIV",
+    ];
+    function paintInvalidationTest()
+    {
+        document.getElementById("target").style.removeProperty("display");
+    }
+</script>
+<body onload="runPaintInvalidationTest()">
+    <div style="height: 100px;"></div>
+    <div id="target" style="display: none">
+        <div style="float: left; width: 100px; height: 100px; background-color: green;"></div>
+    </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/float-new-in-block-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/float-new-in-block-expected.html
new file mode 100644
index 0000000..228ffe8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/float-new-in-block-expected.html
@@ -0,0 +1,5 @@
+<body>
+    <div style="height: 20px; background-color: lightblue;">
+        <div id="target" style="float: left; width: 100px; height: 100px; background-color: green;"></div>
+    </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/float-new-in-block.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/float-new-in-block.html
new file mode 100644
index 0000000..8706db8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/float-new-in-block.html
@@ -0,0 +1,17 @@
+<!-- Based on fast/repaint/float-new-in-block.html -->
+<script src="resources/paint-invalidation-test.js" type="text/javascript" charset="utf-8"></script>
+<script>
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow DIV",
+        "LayoutBlockFlow (floating) DIV id='target'",
+    ];
+    function paintInvalidationTest()
+    {
+        document.getElementById("target").style.removeProperty("display");
+    }
+</script>
+<body onload="runPaintInvalidationTest()">
+    <div style="height: 20px; background-color: lightblue;">
+        <div id="target" style="display: none; float: left; width: 100px; height: 100px; background-color: green;"></div>
+    </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/focus-ring-on-continuation-move-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/focus-ring-on-continuation-move-expected.html
new file mode 100644
index 0000000..9d3729e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/focus-ring-on-continuation-move-expected.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+Tests paint invalidation of focus ring of an inline when a block content of the inline moves.
+Passes if the focus ring encloses the moved green rectangle.
+<div style="position: absolute; top: 200px">
+  <div id="block" style="outline: auto; position: relative; left: 200px; width: 100px; height: 100px; background-color: green"></div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/focus-ring-on-continuation-move.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/focus-ring-on-continuation-move.html
new file mode 100644
index 0000000..d2f8256
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/focus-ring-on-continuation-move.html
@@ -0,0 +1,19 @@
+<!-- Based on fast/repaint/focus-ring-on-continuation-move.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (relative positioned) DIV id='block'",
+];
+function paintInvalidationTest() {
+  document.getElementById('block').style.left = '200px';
+}
+onload = runPaintInvalidationTest;
+</script>
+Tests paint invalidation of focus ring of an inline when a block content of the inline moves.
+Passes if the focus ring encloses the moved green rectangle.
+<div style="position: absolute; top: 200px">
+  <span style="outline: auto">
+    <div id="block" style="position: relative; width: 100px; height: 100px; background-color: green"></div>
+  </span>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/full-viewport-repaint-for-background-attachment-fixed-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/full-viewport-repaint-for-background-attachment-fixed-expected.html
new file mode 100644
index 0000000..b8a1798
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/full-viewport-repaint-for-background-attachment-fixed-expected.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<style>
+body {
+    background-image: linear-gradient(red, blue);
+    background-attachment: fixed;
+    margin: 0;
+}
+</style>
+<script>
+if (window.testRunner)
+    window.internals.settings.setPreferCompositingToLCDTextEnabled(false);
+
+window.onload = function() {
+    window.scrollTo(0, 1000);
+};
+</script>
+<div style="height: 5000px">
+Tests that scrolling a frame with background-attachment: fixed invalidates the entire viewport.
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/full-viewport-repaint-for-background-attachment-fixed.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/full-viewport-repaint-for-background-attachment-fixed.html
new file mode 100644
index 0000000..1521e60
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/full-viewport-repaint-for-background-attachment-fixed.html
@@ -0,0 +1,29 @@
+<!-- Based on fast/repaint/full-viewport-repaint-for-background-attachment-fixed.html -->
+<!DOCTYPE html>
+<style>
+body {
+    background-image: linear-gradient(red, blue);
+    background-attachment: fixed;
+    margin: 0;
+}
+</style>
+<script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+<script>
+if (window.testRunner)
+    window.internals.settings.setPreferCompositingToLCDTextEnabled(false);
+
+window.expectedPaintInvalidationObjects = [
+    "##ALL##",
+    "LayoutView #document",
+];
+function paintInvalidationTest() {
+    window.scrollTo(0, 1000);
+}
+
+window.onload = function() {
+    runPaintInvalidationTest();
+};
+</script>
+<div style="height: 5000px">
+Tests that scrolling a frame with background-attachment: fixed invalidates the entire viewport.
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-element-change-columns-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-element-change-columns-repaint-expected.html
new file mode 100644
index 0000000..22ebebb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-element-change-columns-repaint-expected.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<link href="../../../fast/css-grid-layout/resources/grid.css" rel="stylesheet">
+<style>
+body {
+    font: 10px/1 Ahem;
+}
+
+.grid {
+    width: -webkit-fit-content;
+    grid-template-rows: 50px;
+    grid-template-columns: minmax(50px, 180px) 100px 100px;
+}
+.sizedToGridArea {
+    background-color: purple;
+}
+</style>
+<body>
+<div> This test checks that changing the grid-template-columns lead to a repaint. The final grid element should be 250px * 50px, the grid item should be 50px * 50px. No trace of the elements before the grid-template-columns change should be seen.</div>
+<div class="constrainedContainer">
+    <div class="grid">
+        <div class="sizedToGridArea"></div>
+    </div>
+</div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-element-change-columns-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-element-change-columns-repaint.html
new file mode 100644
index 0000000..071a483
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-element-change-columns-repaint.html
@@ -0,0 +1,40 @@
+<!-- Based on fast/css-grid-layout/grid-element-change-columns-repaint.html -->
+<!DOCTYPE html>
+<html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutGrid DIV class='grid'",
+    "LayoutBlockFlow DIV class='sizedToGridArea'",
+];
+function paintInvalidationTest()
+{
+    var gridElement = document.getElementsByClassName("grid")[0];
+    gridElement.style.gridTemplateColumns = "minmax(50px, 180px) 100px 100px";
+}
+window.addEventListener("load", runPaintInvalidationTest, false);
+</script>
+<link href="../../../fast/css-grid-layout/resources/grid.css" rel="stylesheet">
+<style>
+body {
+    font: 10px/1 Ahem;
+}
+
+.grid {
+    width: -webkit-fit-content;
+    grid-template-rows: 50px;
+    grid-template-columns: minmax(100px, 180px) 100px minmax(50px, 100px);
+}
+.sizedToGridArea {
+    background-color: purple;
+}
+</style>
+<body>
+<div> This test checks that changing the grid-template-columns lead to a repaint. The final grid element should be 250px * 50px, the grid item should be 50px * 50px. No trace of the elements before the grid-template-columns change should be seen.</div>
+<div class="constrainedContainer">
+    <div class="grid">
+        <div class="sizedToGridArea"></div>
+    </div>
+</div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-element-change-rows-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-element-change-rows-repaint-expected.html
new file mode 100644
index 0000000..e365d6d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-element-change-rows-repaint-expected.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<link href="../../../fast/css-grid-layout/resources/grid.css" rel="stylesheet">
+<style>
+body {
+    font: 10px/1 Ahem;
+}
+
+.grid {
+    width: -webkit-fit-content;
+    grid-template-rows: 100px 50px;
+    grid-template-columns: 100px;
+}
+.sizedToGridArea {
+    background-color: purple;
+}
+</style>
+<body>
+<div>This test checks that changing the grid-template-rows lead to a repaint. The final grid element should be 100px * 150px, the grid item should be 100px * 100px. No trace of the elements before the grid-template-rows change should be seen.</div>
+<div class="constrainedContainer">
+    <div class="grid">
+        <div class="sizedToGridArea"></div>
+    </div>
+</div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-element-change-rows-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-element-change-rows-repaint.html
new file mode 100644
index 0000000..8bbe13a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-element-change-rows-repaint.html
@@ -0,0 +1,40 @@
+<!-- Based on fast/css-grid-layout/grid-element-change-rows-repaint.html -->
+<!DOCTYPE html>
+<html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutGrid DIV class='grid'",
+    "LayoutBlockFlow DIV class='sizedToGridArea'",
+];
+function paintInvalidationTest()
+{
+    var gridElement = document.getElementsByClassName("grid")[0];
+    gridElement.style.gridTemplateRows = "100px 50px";
+}
+window.addEventListener("load", runPaintInvalidationTest, false);
+</script>
+<link href="../../../fast/css-grid-layout/resources/grid.css" rel="stylesheet">
+<style>
+body {
+    font: 10px/1 Ahem;
+}
+
+.grid {
+    width: -webkit-fit-content;
+    grid-template-rows: 50px 100px;
+    grid-template-columns: 100px;
+}
+.sizedToGridArea {
+    background-color: purple;
+}
+</style>
+<body>
+<div>This test checks that changing the grid-template-rows lead to a repaint. The final grid element should be 100px * 150px, the grid item should be 100px * 100px. No trace of the elements before the grid-template-rows change should be seen.</div>
+<div class="constrainedContainer">
+    <div class="grid">
+        <div class="sizedToGridArea"></div>
+    </div>
+</div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-item-change-column-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-item-change-column-repaint-expected.html
new file mode 100644
index 0000000..bbbe3fd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-item-change-column-repaint-expected.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<link href="../../../fast/css-grid-layout/resources/grid.css" rel="stylesheet">
+<style>
+.grid {
+    width: -webkit-fit-content;
+    grid-template-rows: 50px;
+    grid-template-columns: minmax(100px, 180px) 100px minmax(50px, 100px);
+}
+.sizedToGridArea {
+    background-color: purple;
+    grid-column: 3;
+}
+</style>
+<body>
+<div>This test checks that changing the grid-column on a grid item properly repaint. The final grid item should be 50px * 50px. There should be no trace of the grid item at the old position.</div>
+<div class="constrainedContainer">
+    <div class="grid">
+        <div class="sizedToGridArea"></div>
+    </div>
+</div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-item-change-column-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-item-change-column-repaint.html
new file mode 100644
index 0000000..88a8a19
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-item-change-column-repaint.html
@@ -0,0 +1,35 @@
+<!-- Based on fast/css-grid-layout/grid-item-change-column-repaint.html -->
+<!DOCTYPE html>
+<html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV class='sizedToGridArea'",
+];
+function paintInvalidationTest()
+{
+    var gridItem = document.getElementsByClassName("sizedToGridArea")[0];
+    gridItem.style.gridColumn = "3";
+}
+window.addEventListener("load", runPaintInvalidationTest, false);
+</script>
+<link href="../../../fast/css-grid-layout/resources/grid.css" rel="stylesheet">
+<style>
+.grid {
+    width: -webkit-fit-content;
+    grid-template-rows: 50px;
+    grid-template-columns: minmax(100px, 180px) 100px minmax(50px, 100px);
+}
+.sizedToGridArea {
+    background-color: purple;
+}
+</style>
+<body>
+<div>This test checks that changing the grid-column on a grid item properly repaint. The final grid item should be 50px * 50px. There should be no trace of the grid item at the old position.</div>
+<div class="constrainedContainer">
+    <div class="grid">
+        <div class="sizedToGridArea"></div>
+    </div>
+</div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-item-change-row-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-item-change-row-repaint-expected.html
new file mode 100644
index 0000000..4fe105c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-item-change-row-repaint-expected.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<link href="../../../fast/css-grid-layout/resources/grid.css" rel="stylesheet">
+<style>
+.grid {
+    grid-template-rows: 50px 100px;
+    grid-template-columns: 100px 50px;
+    /* Make the grid shrink to fit. */
+    position: absolute;
+}
+.sizedToGridArea {
+    background-color: purple;
+    grid-row: 2;
+}
+</style>
+<body>
+<div>This test checks that changing the grid-row on a grid item properly repaint. The final grid item should be 100px * 100px. There should be no trace of the grid item at the old position.</div>
+<div class="grid">
+    <div class="sizedToGridArea"></div>
+</div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-item-change-row-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-item-change-row-repaint.html
new file mode 100644
index 0000000..aa205a6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-item-change-row-repaint.html
@@ -0,0 +1,34 @@
+<!-- Based on fast/css-grid-layout/grid-item-change-row-repaint.html -->
+<!DOCTYPE html>
+<html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV class='sizedToGridArea'",
+];
+function paintInvalidationTest()
+{
+    var gridItem = document.getElementsByClassName("sizedToGridArea")[0];
+    gridItem.style.gridRow = "2";
+}
+window.addEventListener("load", runPaintInvalidationTest, false);
+</script>
+<link href="../../../fast/css-grid-layout/resources/grid.css" rel="stylesheet">
+<style>
+.grid {
+    grid-template-rows: 50px 100px;
+    grid-template-columns: 100px 50px;
+    /* Make the grid shrink to fit. */
+    position: absolute;
+}
+.sizedToGridArea {
+    background-color: purple;
+}
+</style>
+<body>
+<div>This test checks that changing the grid-row on a grid item properly repaint. The final grid item should be 100px * 100px. There should be no trace of the grid item at the old position.</div>
+<div class="grid">
+    <div class="sizedToGridArea"></div>
+</div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-item-z-index-change-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-item-z-index-change-repaint-expected.html
new file mode 100644
index 0000000..60823da
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-item-z-index-change-repaint-expected.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="../../../fast/css-grid-layout/resources/grid.css" rel="stylesheet">
+<style>
+.grid {
+    grid-template-rows: 100px;
+    grid-template-columns: 200px 200px;
+    width: -webkit-fit-content;
+    margin-top: 10px;
+}
+.red {
+    background-color: red;
+}
+.green {
+    background-color: green;
+}
+.negativeZIndex {
+    z-index: -1;
+}
+</style>
+</head>
+<body>
+<div style="height: 100px">
+    <p>This test checks that grid items correctly repaint when 'z-index' changes.</p>
+    <p>For this test to pass, there should be no red below.</p>
+</div>
+
+<div class="grid">
+    <div id="item1" class="sizedToGridArea green" style="z-index: 1"></div>
+    <div class="sizedToGridArea red"></div>
+</div>
+
+<div class="grid">
+    <div id="item2" class="sizedToGridArea green" style="z-index: 1"></div>
+    <div class="sizedToGridArea red"></div>
+</div>
+
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-item-z-index-change-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-item-z-index-change-repaint.html
new file mode 100644
index 0000000..50655e4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/grid-item-z-index-change-repaint.html
@@ -0,0 +1,55 @@
+<!-- Based on fast/css-grid-layout/grid-item-z-index-change-repaint.html -->
+<!DOCTYPE html>
+<html>
+<head>
+<link href="../../../fast/css-grid-layout/resources/grid.css" rel="stylesheet">
+<style>
+.grid {
+    grid-template-rows: 100px;
+    grid-template-columns: 200px 200px;
+    width: -webkit-fit-content;
+    margin-top: 10px;
+}
+.red {
+    background-color: red;
+}
+.green {
+    background-color: green;
+}
+.negativeZIndex {
+    z-index: -1;
+}
+</style>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV id='item1' class='sizedToGridArea green negativeZIndex'",
+    "LayoutBlockFlow DIV id='item2' class='sizedToGridArea green'",
+];
+function paintInvalidationTest()
+{
+    document.getElementById('item1').style.zIndex = 1;
+    document.getElementById('item2').style.zIndex = 1;
+}
+
+window.onload = runPaintInvalidationTest;
+</script>
+</head>
+<body>
+<div style="height: 100px">
+    <p>This test checks that grid items correctly repaint when 'z-index' changes.</p>
+    <p>For this test to pass, there should be no red below.</p>
+</div>
+
+<div class="grid">
+    <div id="item1" class="sizedToGridArea green negativeZIndex"></div>
+    <div class="sizedToGridArea red"></div>
+</div>
+
+<div class="grid">
+    <div id="item2" class="sizedToGridArea green"></div>
+    <div class="sizedToGridArea red"></div>
+</div>
+
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/horizontal-bt-overflow-child-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/horizontal-bt-overflow-child-expected.html
new file mode 100644
index 0000000..12dbfc0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/horizontal-bt-overflow-child-expected.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html><head>
+    <style>
+        .container {
+            margin: 20px;
+            width: 300px;
+            height: 200px;
+            border: 1px solid black;
+            overflow: scroll;
+        }
+        .horizontal-bt {
+            -webkit-writing-mode: horizontal-bt;
+        }
+        .offset {
+            width: 100px;
+            height: 2000px;
+        }
+        .target {
+            width: 100px;
+            height: 100px;
+            background-color: orange;
+        }
+    </style>
+</head>
+<body>
+    <div class="container">
+    <div class="horizontal-bt">
+        <div class="target"></div>
+        <div class="offset"></div>
+    </div></div>
+    An orange rect should be painted.<br/>
+    In DumpRenderTree, there should be repaint logs of 100x100 rect. We don't care how many times is the log dumpped.
+    <script>
+        var container = document.getElementsByClassName("container")[0];
+        onload = function() {
+            container.scrollTop = 3000;
+        };
+    </script>
+</body></html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/horizontal-bt-overflow-child.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/horizontal-bt-overflow-child.html
new file mode 100644
index 0000000..4efe5c3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/horizontal-bt-overflow-child.html
@@ -0,0 +1,51 @@
+<!-- Based on fast/repaint/horizontal-bt-overflow-child.html -->
+<!DOCTYPE html>
+<html><head>
+    <style>
+        .container {
+            margin: 20px;
+            width: 300px;
+            height: 200px;
+            border: 1px solid black;
+            overflow: scroll;
+        }
+        .horizontal-bt {
+            -webkit-writing-mode: horizontal-bt;
+        }
+        .offset {
+            width: 100px;
+            height: 2000px;
+        }
+        .target {
+            width: 100px;
+            height: 100px;
+            background-color: orange;
+            visibility: hidden;
+        }
+    </style>
+</head>
+<body>
+    <div class="container">
+    <div class="horizontal-bt">
+        <div class="target"></div>
+        <div class="offset"></div>
+    </div></div>
+    An orange rect should be painted.<br/>
+    In DumpRenderTree, there should be repaint logs of 100x100 rect. We don't care how many times is the log dumpped.
+    <script src="../../../resources/run-after-layout-and-paint.js"></script>
+    <script src="resources/paint-invalidation-test.js"></script>
+    <script>
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow DIV class='target'",
+        ];
+        function paintInvalidationTest() {
+            var target = document.getElementsByClassName("target")[0];
+            target.style.visibility = "visible";
+        };
+        var container = document.getElementsByClassName("container")[0];
+        runAfterLayoutAndPaint(function() {
+            container.scrollTop = 3000;
+            runPaintInvalidationTest();
+        });
+    </script>
+</body></html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/horizontal-bt-overflow-parent-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/horizontal-bt-overflow-parent-expected.html
new file mode 100644
index 0000000..77d7da8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/horizontal-bt-overflow-parent-expected.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html><head>
+    <style>
+        .container {
+            margin: 20px;
+            width: 300px;
+            height: 200px;
+            border: 1px solid black;
+            overflow: scroll;
+        }
+        .horizontal-bt {
+            -webkit-writing-mode: horizontal-bt;
+        }
+        .offset {
+            width: 100px;
+            height: 2000px;
+        }
+        .target {
+            width: 100px;
+            height: 100px;
+            background-color: orange;
+        }
+    </style>
+</head>
+<body>
+    <div class="horizontal-bt">
+    <div class="container">
+        <div class="offset"></div>
+        <div class="target"></div>
+    </div></div>
+    An orange rect should be painted.<br/>
+    In DumpRenderTree, there should be repaint logs of 100x100 rect. We don't care how many times is the log dumpped.
+    <script>
+        var container = document.getElementsByClassName("container")[0];
+        onload = function() {
+            container.scrollTop = 0;
+        };
+    </script>
+</body></html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/horizontal-bt-overflow-parent.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/horizontal-bt-overflow-parent.html
new file mode 100644
index 0000000..c018ed9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/horizontal-bt-overflow-parent.html
@@ -0,0 +1,51 @@
+<!-- Based on fast/repaint/horizontal-bt-overflow-parent.html -->
+<!DOCTYPE html>
+<html><head>
+    <style>
+        .container {
+            margin: 20px;
+            width: 300px;
+            height: 200px;
+            border: 1px solid black;
+            overflow: scroll;
+        }
+        .horizontal-bt {
+            -webkit-writing-mode: horizontal-bt;
+        }
+        .offset {
+            width: 100px;
+            height: 2000px;
+        }
+        .target {
+            width: 100px;
+            height: 100px;
+            background-color: orange;
+            visibility: hidden;
+        }
+    </style>
+</head>
+<body>
+    <div class="horizontal-bt">
+    <div class="container">
+        <div class="offset"></div>
+        <div class="target"></div>
+    </div></div>
+    An orange rect should be painted.<br/>
+    In DumpRenderTree, there should be repaint logs of 100x100 rect. We don't care how many times is the log dumpped.
+    <script src="../../../resources/run-after-layout-and-paint.js"></script>
+    <script src="resources/paint-invalidation-test.js"></script>
+    <script>
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow DIV class='target'",
+        ];
+        function paintInvalidationTest() {
+            var target = document.getElementsByClassName("target")[0];
+            target.style.visibility = "visible";
+        };
+        var container = document.getElementsByClassName("container")[0];
+        runAfterLayoutAndPaint(function() {
+            container.scrollTop = 0;
+            runPaintInvalidationTest();
+        });
+    </script>
+</body></html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/horizontal-bt-overflow-same-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/horizontal-bt-overflow-same-expected.html
new file mode 100644
index 0000000..a24c889
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/horizontal-bt-overflow-same-expected.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html><head>
+    <style>
+        .container {
+            margin: 20px;
+            width: 300px;
+            height: 200px;
+            border: 1px solid black;
+            overflow: scroll;
+        }
+        .horizontal-bt {
+            -webkit-writing-mode: horizontal-bt;
+        }
+        .offset {
+            width: 100px;
+            height: 2000px;
+        }
+        .target {
+            width: 100px;
+            height: 100px;
+            background-color: orange;
+        }
+    </style>
+</head>
+<body>
+    <div class="horizontal-bt container">
+        <div class="offset"></div>
+        <div class="target"></div>
+    </div>
+    An orange rect should be painted.<br/>
+    In DumpRenderTree, there should be repaint logs of 100x100 rect. We don't care how many times is the log dumpped.
+    <script>
+        var container = document.getElementsByClassName("container")[0];
+        onload = function() {
+            container.scrollTop = 0;
+        };
+    </script>
+</body></html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/horizontal-bt-overflow-same.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/horizontal-bt-overflow-same.html
new file mode 100644
index 0000000..e702858
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/horizontal-bt-overflow-same.html
@@ -0,0 +1,50 @@
+<!-- Based on fast/repaint/horizontal-bt-overflow-same.html -->
+<!DOCTYPE html>
+<html><head>
+    <style>
+        .container {
+            margin: 20px;
+            width: 300px;
+            height: 200px;
+            border: 1px solid black;
+            overflow: scroll;
+        }
+        .horizontal-bt {
+            -webkit-writing-mode: horizontal-bt;
+        }
+        .offset {
+            width: 100px;
+            height: 2000px;
+        }
+        .target {
+            width: 100px;
+            height: 100px;
+            background-color: orange;
+            visibility: hidden;
+        }
+    </style>
+</head>
+<body>
+    <div class="horizontal-bt container">
+        <div class="offset"></div>
+        <div class="target"></div>
+    </div>
+    An orange rect should be painted.<br/>
+    In DumpRenderTree, there should be repaint logs of 100x100 rect. We don't care how many times is the log dumpped.
+    <script src="../../../fast/repaint/../../resources/run-after-layout-and-paint.js"></script>
+    <script src="resources/paint-invalidation-test.js"></script>
+    <script>
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow DIV class='target'",
+        ];
+        function paintInvalidationTest() {
+            var target = document.getElementsByClassName("target")[0];
+            target.style.visibility = "visible";
+        };
+        var container = document.getElementsByClassName("container")[0];
+        runAfterLayoutAndPaint(function() {
+            container.scrollTop = 0;
+            runPaintInvalidationTest();
+        });
+    </script>
+</body></html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/hover-invalidation-table-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/hover-invalidation-table-expected.html
new file mode 100644
index 0000000..4d0d72ea
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/hover-invalidation-table-expected.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<style>
+.bla {
+    background-color: green;
+}
+
+table {
+    position:relative;
+    top: 180px;
+}
+</style>
+<table>
+    <tr>
+        <td rowspan="2">1,1</td>
+        <td>1,4</td>
+    </tr>
+    <tr>
+        <td>2,3</td>
+    </tr>
+    <tr class="bla">
+        <td rowspan="2" id="secondRowSpan">3,1</td>
+        <td>3,4</td>
+    </tr>
+    <tr>
+        <td>4,4</td>
+    </tr>
+</table>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/hover-invalidation-table.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/hover-invalidation-table.html
new file mode 100644
index 0000000..b581966
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/hover-invalidation-table.html
@@ -0,0 +1,51 @@
+<!-- Based on fast/repaint/hover-invalidation-table.html -->
+<!DOCTYPE html>
+<style>
+tr:hover {
+    background-color: green;
+}
+
+table {
+    position:relative;
+    top: 180px;
+}
+</style>
+<script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutTableCell TD id='secondRowSpan'",
+    "LayoutTableCell TD",
+    "LayoutTableRow TR class='bla'",
+];
+function paintInvalidationTest()
+{
+    var secondRowSpan = document.getElementById("secondRowSpan");
+    var secondRowSpanBox = secondRowSpan.getBoundingClientRect();
+    var secondRowSpanCenterX = (secondRowSpanBox.left + secondRowSpanBox.right) / 2;
+    var secondRowSpanCenterY = (secondRowSpanBox.top + secondRowSpanBox.bottom) / 2;
+
+    if (window.eventSender) {
+        eventSender.mouseMoveTo(secondRowSpanCenterX, secondRowSpanCenterY);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+    }
+}
+
+window.addEventListener("load", runPaintInvalidationTest);
+</script>
+<table>
+    <tr>
+        <td rowspan="2">1,1</td>
+        <td>1,4</td>
+    </tr>
+    <tr>
+        <td>2,3</td>
+    </tr>
+    <tr class="bla">
+        <td rowspan="2" id="secondRowSpan">3,1</td>
+        <td>3,4</td>
+    </tr>
+    <tr>
+        <td>4,4</td>
+    </tr>
+</table>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/hover-pseudo-borders-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/hover-pseudo-borders-expected.html
new file mode 100644
index 0000000..36e7952
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/hover-pseudo-borders-expected.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+.hitregion {
+  width: 100px;
+  height: 100px;
+  background-color: green;
+}
+.hitregion:after {
+  content: "";
+  border: 40px solid;
+  outline: 10px solid;
+  position: absolute;
+  width: 0;
+  height: 0;
+  margin-left: 140px;
+  margin-top: 10px;
+  color: green;
+}
+</style>
+</head>
+<body>
+<!--
+    REGRESSION: :hover doesn't work on :after content with borders or outlines.
+    To test this bug outside DRT, hover on the square below.
+    This test passes if there are two green squares.
+-->
+<div class="hitregion"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/hover-pseudo-borders-whitespace-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/hover-pseudo-borders-whitespace-expected.html
new file mode 100644
index 0000000..db4faef
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/hover-pseudo-borders-whitespace-expected.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<style>
+
+div {
+    width: 100px;
+    height: 100px;
+    color: green;
+}
+
+#div_border {
+    border: 10px solid;
+}
+
+#div_outline {
+    outline: 10px solid;
+    margin: 20px 0 0 10px;
+}
+
+</style>
+<div id="div_border"></div>
+<div id="div_outline"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/hover-pseudo-borders-whitespace.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/hover-pseudo-borders-whitespace.html
new file mode 100644
index 0000000..5b1707fd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/hover-pseudo-borders-whitespace.html
@@ -0,0 +1,38 @@
+<!-- Based on fast/repaint/hover-pseudo-borders-whitespace.html -->
+<!doctype html>
+<style>
+
+div {
+    width: 100px;
+    height: 100px;
+}
+
+#div_border {
+    border: 10px solid;
+}
+
+#div_outline {
+    outline: 10px solid;
+    margin: 20px 0 0 10px;
+}
+
+#div_border:hover, #div_border:hover + #div_outline {
+    color: green;
+}
+
+</style>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow DIV id='div_border'",
+        "LayoutBlockFlow DIV id='div_outline'",
+    ];
+    function paintInvalidationTest() {
+        if (!window.testRunner)
+            return;
+        eventSender.mouseMoveTo(50, 50);
+    }
+    window.addEventListener("load", runPaintInvalidationTest);
+</script>
+<div id="div_border"></div>
+<div id="div_outline"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/hover-pseudo-borders.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/hover-pseudo-borders.html
new file mode 100644
index 0000000..0b76dffd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/hover-pseudo-borders.html
@@ -0,0 +1,53 @@
+<!-- Based on fast/repaint/hover-pseudo-borders.html -->
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+.hitregion {
+  width: 100px;
+  height: 100px;
+  background-color: red;
+}
+.hitregion:after {
+  content: "";
+  border: 40px solid;
+  outline: 10px solid;
+  position: absolute;
+  width: 0;
+  height: 0;
+  margin-left: 140px;
+  margin-top: 10px;
+}
+.hitregion:hover {
+  background-color: green; /* Changes the left box's color. */
+}
+.hitregion:hover:after {
+  color: green; /* Changes the right box's color. */
+}
+</style>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV class='hitregion'",
+    "LayoutBlockFlow (positioned) \u003Cpseudo:after\u003E",
+    "LayoutTextFragment (anonymous)",
+];
+function paintInvalidationTest() {
+  if (!window.testRunner)
+    return;
+  eventSender.mouseMoveTo(50, 50);
+  eventSender.mouseDown();
+  eventSender.mouseUp();
+}
+window.addEventListener("load", runPaintInvalidationTest);
+</script>
+</head>
+<body>
+<!--
+    REGRESSION: :hover doesn't work on :after content with borders or outlines.
+    To test this bug outside DRT, hover on the square below.
+    This test passes if there are two green squares.
+-->
+<div class="hitregion"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/image-resize-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/image-resize-expected.txt
new file mode 100644
index 0000000..7b0dca4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/image-resize-expected.txt
@@ -0,0 +1 @@
+The image should be fully repainted on resize. Passes if there is a whole apple after resize. 
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/image-resize.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/image-resize.html
new file mode 100644
index 0000000..dfc9efd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/image-resize.html
@@ -0,0 +1,27 @@
+<!-- Based on fast/repaint/image-resize.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+if (window.testRunner)
+  testRunner.dumpAsText();
+window.expectedPaintInvalidationObjects = [
+    "LayoutImage (positioned) IMG",
+];
+function paintInvalidationTest() {
+  var img = document.getElementsByTagName('img')[0];
+  img.style.width = '100px';
+  img.style.height = '200px';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+img {
+  position: absolute;
+  top: 50px;
+  left: 0px;
+  width: 150px;
+  height: 150px;
+}
+</style>
+The image should be fully repainted on resize. Passes if there is a whole apple after resize.
+<img src="../../../fast/repaint/resources/apple.jpg">
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-block-resize-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-block-resize-expected.html
new file mode 100644
index 0000000..3b6ebfc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-block-resize-expected.html
@@ -0,0 +1,8 @@
+<html>
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=12885</title>
+</head>
+<body">
+    <div style="position:absolute; height:100px; width:100px; background-color:green"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-block-resize.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-block-resize.html
new file mode 100644
index 0000000..4e08cbb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-block-resize.html
@@ -0,0 +1,30 @@
+<!-- Based on fast/repaint/inline-block-resize.html -->
+<html>
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=12885</title>
+    <style type="text/css">
+      
+    </style>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script>
+        window.expectedPaintInvalidationObjects = [
+            "RootInlineBox",
+            "InlineBox",
+            "LayoutBlockFlow (positioned) DIV",
+            "LayoutBlockFlow DIV id='target'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById('target').style.width = '100px';
+            document.getElementById('target').style.height = '100px';
+            document.getElementById('target').style.marginTop = '-100px';
+        }
+    </script>
+</head>
+<body onload="runPaintInvalidationTest();">
+    <div style="position:absolute; height:100px; width:100px;background-color:red"></div>
+    <div style="padding-top:100px"></div>
+    <div style="position:absolute"><div id="target" style="display:inline-block; background-color:green"></div></div>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-horizontal-bt-overflow-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-horizontal-bt-overflow-expected.html
new file mode 100644
index 0000000..d1c1613
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-horizontal-bt-overflow-expected.html
@@ -0,0 +1,4 @@
+<script src="../../../resources/ahem.js"></script>
+<body style="padding: 50px; -webkit-writing-mode:horizontal-bt">
+    <div><span id="target" style="font-family: Ahem; font-size: 50px; -webkit-text-stroke: 50px green;">A&nbsp;&nbsp;B</span></div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-horizontal-bt-overflow.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-horizontal-bt-overflow.html
new file mode 100644
index 0000000..2c16b5a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-horizontal-bt-overflow.html
@@ -0,0 +1,16 @@
+<!-- Based on fast/repaint/inline-horizontal-bt-overflow.html -->
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    window.expectedPaintInvalidationObjects = [
+        "LayoutText #text",
+        "InlineTextBox 'A\u00A0\u00A0B'",
+    ];
+    function paintInvalidationTest()
+    {
+        document.getElementById("target").style.webkitTextStrokeColor = "green";
+    }
+</script>
+<script src="../../../fast/repaint/../../resources/ahem.js"></script>
+<body onload="runPaintInvalidationTest()" style="padding: 50px; -webkit-writing-mode:horizontal-bt">
+    <div><span id="target" style="font-family: Ahem; font-size: 50px; -webkit-text-stroke: 50px red;">A&nbsp;&nbsp;B</span></div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-outline-repaint-2-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-outline-repaint-2-expected.html
new file mode 100644
index 0000000..eae981b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-outline-repaint-2-expected.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<style>
+body {
+  margin: 0;
+  padding: 0;
+}
+#container {
+  position: absolute;
+  width: 255px;
+  text-align: right;
+  color: green;
+}
+#container > span {
+  outline: 5px solid blue;
+}
+</style>
+<div id=container>
+  <span>Test</span>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-outline-repaint-2.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-outline-repaint-2.html
new file mode 100644
index 0000000..6a2657c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-outline-repaint-2.html
@@ -0,0 +1,32 @@
+<!-- Based on fast/repaint/inline-outline-repaint-2.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<style>
+body {
+  margin: 0;
+  padding: 0;
+}
+#container {
+  position: absolute;
+  width: 255px;
+  text-align: right;
+}
+#container > span {
+  outline: 5px solid blue;
+}
+</style>
+<div id=container>
+  <span>Test</span>
+</div>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutInline SPAN",
+    "InlineFlowBox",
+    "LayoutText #text",
+    "InlineTextBox 'Test'",
+];
+function paintInvalidationTest() {
+  document.getElementById('container').style.color = 'green';
+}
+onload = runPaintInvalidationTest;
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-overflow-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-overflow-expected.html
new file mode 100644
index 0000000..dd94aff
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-overflow-expected.html
@@ -0,0 +1,4 @@
+<script src="../../../resources/ahem.js"></script>
+<body style="padding: 50px;">
+    <span id="target" style="font-family: Ahem; font-size: 50px; -webkit-text-stroke: 50px green;">A&nbsp;&nbsp;B</span>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-overflow.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-overflow.html
new file mode 100644
index 0000000..ec01d22
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-overflow.html
@@ -0,0 +1,16 @@
+<!-- Based on fast/repaint/inline-overflow.html -->
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    window.expectedPaintInvalidationObjects = [
+        "LayoutText #text",
+        "InlineTextBox 'A\u00A0\u00A0B'",
+    ];
+    function paintInvalidationTest()
+    {
+        document.getElementById("target").style.webkitTextStrokeColor = "green";
+    }
+</script>
+<script src="../../../fast/repaint/../../resources/ahem.js"></script>
+<body onload="runPaintInvalidationTest()" style="padding: 50px;">
+    <span id="target" style="font-family: Ahem; font-size: 50px; -webkit-text-stroke: 50px red;">A&nbsp;&nbsp;B</span>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-reflow-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-reflow-expected.html
new file mode 100644
index 0000000..7017810
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-reflow-expected.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<style>
+body {
+    margin: 0;
+}
+.container {
+    font: 20px Ahem;
+    width: 200px;
+    position: absolute;
+}
+</style>
+<div class="container" id="div1" style="width: 300px">
+A A A A A AA AA AA AA AAA AAA AAA AAAA AAAA AAAAA AAAAA AAAAAA AAAAAAA AAAAAA AAAAA AAAAA AAAA AAAA AAA AAA AAA AA AA AA AA A A A A A
+</div>
+<div class="container" id="div2" style="top: 300px; width: 300px">
+A A A A A
+</div>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-reflow.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-reflow.html
new file mode 100644
index 0000000..7c17f44
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-reflow.html
@@ -0,0 +1,74 @@
+<!-- Based on fast/repaint/inline-reflow.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "RootInlineBox",
+    "RootInlineBox",
+    "RootInlineBox",
+    "RootInlineBox",
+    "RootInlineBox",
+    "RootInlineBox",
+    "RootInlineBox",
+    "RootInlineBox",
+    "RootInlineBox",
+    "RootInlineBox",
+    "RootInlineBox",
+    "RootInlineBox",
+    "RootInlineBox",
+    "RootInlineBox",
+    "RootInlineBox",
+    "InlineTextBox 'A A A A A'",
+    "InlineTextBox 'AA AA AA'",
+    "InlineTextBox 'AA AAA AAA'",
+    "InlineTextBox 'AAA AAAA'",
+    "InlineTextBox 'AAAA AAAAA'",
+    "InlineTextBox 'AAAAA'",
+    "InlineTextBox 'AAAAAA'",
+    "InlineTextBox 'AAAAAAA'",
+    "InlineTextBox 'AAAAAA'",
+    "InlineTextBox 'AAAAA'",
+    "InlineTextBox 'AAAAA AAAA'",
+    "InlineTextBox 'AAAA AAA'",
+    "InlineTextBox 'AAA AAA AA'",
+    "InlineTextBox 'AA AA AA A'",
+    "InlineTextBox 'A A A A'",
+    "RootInlineBox",
+    "InlineTextBox 'A A A A A'",
+    "LayoutBlockFlow (positioned) DIV id='div1' class='container'",
+    "LayoutText #text",
+    "InlineTextBox 'A A A A A AA AA'",
+    "InlineTextBox 'AA AA AAA AAA'",
+    "InlineTextBox 'AAA AAAA AAAA'",
+    "InlineTextBox 'AAAAA AAAAA'",
+    "InlineTextBox 'AAAAAA AAAAAAA'",
+    "InlineTextBox 'AAAAAA AAAAA'",
+    "InlineTextBox 'AAAAA AAAA AAAA'",
+    "InlineTextBox 'AAA AAA AAA AA'",
+    "InlineTextBox 'AA AA AA A A A'",
+    "InlineTextBox 'A A'",
+    "LayoutBlockFlow (positioned) DIV id='div2' class='container'",
+];
+function paintInvalidationTest()
+{
+    document.getElementById('div1').style.width = '300px';
+    document.getElementById('div2').style.width = '300px';
+}
+window.onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+    margin: 0;
+}
+.container {
+    font: 20px Ahem;
+    width: 200px;
+    position: absolute;
+}
+</style>
+<div class="container" id="div1">
+A A A A A AA AA AA AA AAA AAA AAA AAAA AAAA AAAAA AAAAA AAAAAA AAAAAAA AAAAAA AAAAA AAAAA AAAA AAAA AAA AAA AAA AA AA AA AA A A A A A
+</div>
+<div class="container" id="div2" style="top: 300px">
+A A A A A
+</div>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-relative-positioned-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-relative-positioned-expected.html
new file mode 100644
index 0000000..5012be8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-relative-positioned-expected.html
@@ -0,0 +1,5 @@
+<script src="../../../resources/ahem.js"></script>
+<body>
+<span style="position: relative; top: 80px;">
+    <div id="target" style="display: inline-block; width: 100px; height: 100px; overflow: hidden; font-family: Ahem; font-size: 100px; background: red; color: green;">a</div>
+</span>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-relative-positioned.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-relative-positioned.html
new file mode 100644
index 0000000..6e93fb9e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-relative-positioned.html
@@ -0,0 +1,20 @@
+<!-- Based on fast/repaint/inline-relative-positioned.html -->
+<script src="resources/paint-invalidation-test.js"></script>
+<script src="../../../fast/repaint/../../resources/ahem.js"></script>
+<body onload="runPaintInvalidationTest()">
+<span style="position: relative; top: 80px;">
+    <div id="target" style="display: inline-block; width: 100px; height: 100px; overflow: hidden; font-family: Ahem; font-size: 100px; background: red; color: green;">p</div>
+</span>
+<script>
+    window.expectedPaintInvalidationObjects = [
+        "InlineTextBox ''",
+        "RootInlineBox",
+        "LayoutBlockFlow DIV id='target'",
+        "LayoutText #text",
+        "InlineTextBox 'a'",
+    ];
+    function paintInvalidationTest()
+    {
+        document.getElementById("target").firstChild.data = "a";
+    }
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-vertical-lr-overflow-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-vertical-lr-overflow-expected.html
new file mode 100644
index 0000000..c6d6556
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-vertical-lr-overflow-expected.html
@@ -0,0 +1,3 @@
+<body style="padding: 50px; -webkit-writing-mode:vertical-lr">
+    <div><span id="target" style="font-family: Ahem; font-size: 50px; -webkit-text-stroke: 50px green;">A&nbsp;&nbsp;B</span></div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-vertical-lr-overflow.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-vertical-lr-overflow.html
new file mode 100644
index 0000000..2c81b82
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-vertical-lr-overflow.html
@@ -0,0 +1,15 @@
+<!-- Based on fast/repaint/inline-vertical-lr-overflow.html -->
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    window.expectedPaintInvalidationObjects = [
+        "LayoutText #text",
+        "InlineTextBox 'A\u00A0\u00A0B'",
+    ];
+    function paintInvalidationTest()
+    {
+        document.getElementById("target").style.webkitTextStrokeColor = "green";
+    }
+</script>
+<body onload="runPaintInvalidationTest()" style="padding: 50px; -webkit-writing-mode:vertical-lr">
+    <div><span id="target" style="font-family: Ahem; font-size: 50px; -webkit-text-stroke: 50px red;">A&nbsp;&nbsp;B</span></div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-vertical-rl-overflow-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-vertical-rl-overflow-expected.html
new file mode 100644
index 0000000..86c4bda4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-vertical-rl-overflow-expected.html
@@ -0,0 +1,3 @@
+<body style="padding: 50px; -webkit-writing-mode:vertical-rl">
+    <div><span id="target" style="font-family: Ahem; font-size: 50px; -webkit-text-stroke: 50px green;">A&nbsp;&nbsp;B</span></div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-vertical-rl-overflow.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-vertical-rl-overflow.html
new file mode 100644
index 0000000..ddfa203
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/inline-vertical-rl-overflow.html
@@ -0,0 +1,15 @@
+<!-- Based on fast/repaint/inline-vertical-rl-overflow.html -->
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    window.expectedPaintInvalidationObjects = [
+        "LayoutText #text",
+        "InlineTextBox 'A\u00A0\u00A0B'",
+    ];
+    function paintInvalidationTest()
+    {
+        document.getElementById("target").style.webkitTextStrokeColor = "green";
+    }
+</script>
+<body onload="runPaintInvalidationTest()" style="padding: 50px; -webkit-writing-mode:vertical-rl">
+    <div><span id="target" style="font-family: Ahem; font-size: 50px; -webkit-text-stroke: 50px red;">A&nbsp;&nbsp;B</span></div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/intermediate-layout-position-clip-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/intermediate-layout-position-clip-expected.html
new file mode 100644
index 0000000..8696380
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/intermediate-layout-position-clip-expected.html
@@ -0,0 +1,15 @@
+<html>
+<head>
+    <title></title>
+    <style type="text/css">
+        .float { float: right; height: 40px; width: 40px; }
+        .test { height: 200px; background-color: aliceblue }
+    </style>
+</head>
+<body>
+    <div id="scroller" style="overflow: hidden; height: 40px">
+        <div class="test"></div>
+    </div>
+    <script>scroller.scrollTop = 60;</script>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/intermediate-layout-position-clip.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/intermediate-layout-position-clip.html
new file mode 100644
index 0000000..54e61fa
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/intermediate-layout-position-clip.html
@@ -0,0 +1,32 @@
+<!-- Based on fast/repaint/intermediate-layout-position-clip.html -->
+<html>
+<head>
+    <title></title>
+    <style type="text/css">
+        .float { float: right; height: 40px; width: 40px; }
+        .test { height: 200px; background-color: aliceblue }
+    </style>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow DIV id='target'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById('target').style.height='20px';
+        }
+    </script>
+</head>
+<body onload="runPaintInvalidationTest()">
+    <div id="scroller" style="overflow: hidden; height: 40px">
+        <div class="test">
+            <div class="float"></div>
+            <div style="clear: right; padding-bottom: 10px;">
+                <div style="height: 40px; width: 40px; background-color: red;" id="target">
+                </div>
+            </div>
+        </div>
+    </div>
+    <script>scroller.scrollTop = 60;</script>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/intermediate-layout-position-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/intermediate-layout-position-expected.html
new file mode 100644
index 0000000..1145c66
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/intermediate-layout-position-expected.html
@@ -0,0 +1,28 @@
+<html>
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=10522</title>
+    <style type="text/css">
+        .float { float: right; height: 40px; width: 40px; }
+        .test { height: 100px; background-color: aliceblue }
+    </style>
+</head>
+<body>
+    <div class="test">
+        <div class="float"></div>
+        <div style="clear: right; background-color: purple; width: 40px; padding: 3px;">
+            <div style="height: 20px; width: 0;" id="target">
+            </div>
+        </div>
+    </div>
+    
+    <div class="test">
+        <div class="float"></div>
+        <table style="clear: both; background-color: purple;">
+            <tr>
+                <td id="cell" style="height: 20px; width: 40px;">
+                </td>
+            </tr>
+        </table>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/intermediate-layout-position.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/intermediate-layout-position.html
new file mode 100644
index 0000000..210f564
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/intermediate-layout-position.html
@@ -0,0 +1,43 @@
+<!-- Based on fast/repaint/intermediate-layout-position.html -->
+<html>
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=10522</title>
+    <style type="text/css">
+        .float { float: right; height: 40px; width: 40px; }
+        .test { height: 100px; background-color: aliceblue }
+    </style>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow DIV",
+            "LayoutBlockFlow DIV id='target'",
+            "LayoutTable TABLE",
+            "LayoutTableCell TD id='cell'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById('target').style.height='20px';
+            document.getElementById('cell').style.height='20px';
+        }
+    </script>
+</head>
+<body onload="runPaintInvalidationTest()">
+    <div class="test">
+        <div class="float"></div>
+        <div style="clear: right; background-color: purple; width: 40px; padding: 3px;">
+            <div style="height: 40px; width: 0;" id="target">
+            </div>
+        </div>
+    </div>
+    
+    <div class="test">
+        <div class="float"></div>
+        <table style="clear: both; background-color: purple;">
+            <tr>
+                <td id="cell" style="height: 40px; width: 40px;">
+                </td>
+            </tr>
+        </table>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-invisible-element-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-invisible-element-expected.html
new file mode 100644
index 0000000..d41a36e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-invisible-element-expected.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<body>
+    <div id="target"
+      style="position: absolute;
+             top: 300px; left: 200px;
+             width: 200px; height: 200px;
+             background-color: redl "></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-invisible-element.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-invisible-element.html
new file mode 100644
index 0000000..26fe0f1a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-invisible-element.html
@@ -0,0 +1,30 @@
+<!-- Based on fast/repaint/invalidate-invisible-element.html -->
+<!DOCTYPE html>
+<html>
+<head>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        window.onload = function() {
+            runPaintInvalidationTest();
+        };
+
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (positioned) DIV id='target'",
+        ];
+        function paintInvalidationTest() {
+            var target = document.getElementById('target');
+            target.style.visibility = 'visible';
+            getComputedStyle(target).color;
+            target.style.top = '300px';
+        }
+    </script>
+</head>
+<body>
+    <div id="target"
+      style="visibility:hidden;
+             position: absolute;
+             top: 200px; left: 200px;
+             width: 200px; height: 200px;
+             background-color: redl "></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-paint-for-fixed-pos-inside-iframe-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-paint-for-fixed-pos-inside-iframe-expected.html
new file mode 100644
index 0000000..7f9d24b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-paint-for-fixed-pos-inside-iframe-expected.html
@@ -0,0 +1,3 @@
+<!DOCTYPE html>
+<div style="height: 400px"></div>
+<iframe srcdoc="<div style='position: fixed; height: 50px; width: 50px; background-color: green;'></div>"></iframe>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-paint-for-fixed-pos-inside-iframe.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-paint-for-fixed-pos-inside-iframe.html
new file mode 100644
index 0000000..48d0b93
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-paint-for-fixed-pos-inside-iframe.html
@@ -0,0 +1,24 @@
+<!-- Based on fast/repaint/invalidate-paint-for-fixed-pos-inside-iframe.html -->
+<!DOCTYPE html>
+<html>
+<head>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.onload = function() {
+    runPaintInvalidationTest();
+};
+
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV",
+];
+function paintInvalidationTest() {
+    document.getElementsByTagName('iframe')[0]
+        .contentDocument
+        .getElementsByTagName('div')[0]
+        .style
+        .backgroundColor = 'green';
+}
+</script>
+</head>
+<div style="height: 400px"></div>
+<iframe srcdoc="<div style='position: fixed; height: 50px; width: 50px; background-color: red;'></div>"></iframe>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-paint-in-iframe-in-composited-layer-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-paint-in-iframe-in-composited-layer-expected.html
new file mode 100644
index 0000000..67bb04b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-paint-in-iframe-in-composited-layer-expected.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<div style="height: 400px"></div>
+<div style="height: 200px; width: 200px">
+    <iframe srcdoc="<div style='height: 50px; width: 50px; background-color: green;'></div>"></iframe>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-paint-in-iframe-in-composited-layer.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-paint-in-iframe-in-composited-layer.html
new file mode 100644
index 0000000..9ee9ae8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-paint-in-iframe-in-composited-layer.html
@@ -0,0 +1,26 @@
+<!-- Based on fast/repaint/invalidate-paint-in-iframe-in-composited-layer.html -->
+<!DOCTYPE html>
+<html>
+<head>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.onload = function() {
+    runPaintInvalidationTest();
+};
+
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV",
+];
+function paintInvalidationTest() {
+    document.getElementsByTagName('iframe')[0]
+        .contentDocument
+        .getElementsByTagName('div')[0]
+        .style
+        .backgroundColor = 'green';
+}
+</script>
+</head>
+<div style="height: 400px"></div>
+<div style="height: 200px; width: 200px; transform: translateZ(0)">
+    <iframe srcdoc="<div style='height: 50px; width: 50px; background-color: red;'></div>"></iframe>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-when-leaving-squashed-layer-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-when-leaving-squashed-layer-expected.html
new file mode 100644
index 0000000..f30722e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-when-leaving-squashed-layer-expected.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<div style="position:absolute; height: 200px; width: 200px; background: lightgray"></div>
+<div style="position:absolute; height: 200px; width: 200px; top: 50px; left: 50px; background:lightblue"></div>
+<div id="target" style="position:absolute; height: 200px; width: 200px; top: 50px; left: 50px; background:lightblue"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-when-leaving-squashed-layer.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-when-leaving-squashed-layer.html
new file mode 100644
index 0000000..abf5ed5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidate-when-leaving-squashed-layer.html
@@ -0,0 +1,18 @@
+<!-- Based on compositing/squashing/invalidate-when-leaving-squashed-layer.html -->
+<!DOCTYPE html>
+<div style="position:absolute; height: 200px; width: 200px; transform: translateZ(0); background: lightgray"></div>
+<div style="position:absolute; height: 200px; width: 200px; top: 50px; left: 50px; background:lightblue"></div>
+<div id="target" style="position:absolute; height: 200px; width: 200px; top: 50px; left: 50px; background:lightblue"></div>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+// Tests that causing a squashed layer to leave its squashing layer causes an invalidation in the squashing layer for the previous
+// location of the squashed layer.
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='target'",
+];
+function paintInvalidationTest() {
+    var target = document.getElementById("target");
+    target.style.transform = 'translateZ(0)';
+};
+runPaintInvalidationTest();
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidation-for-subpixel-offset-of-squashed-layer-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidation-for-subpixel-offset-of-squashed-layer-expected.html
new file mode 100644
index 0000000..b87563c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidation-for-subpixel-offset-of-squashed-layer-expected.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+
+<div style="position: absolute; width: 200px; height: 200px; background: lightgray; will-change: transform"></div>
+
+<div style="position: absolute; width: 200px; height: 200px; top: 50px; left: 50px; background: lightblue"></div>
+<div id="target" style="position: absolute; width: 200px; height: 200px; top: 100.45px; left: 100.45px; background: red"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidation-for-subpixel-offset-of-squashed-layer.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidation-for-subpixel-offset-of-squashed-layer.html
new file mode 100644
index 0000000..8e37e0d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidation-for-subpixel-offset-of-squashed-layer.html
@@ -0,0 +1,18 @@
+<!-- Based on compositing/squashing/invalidation-for-subpixel-offset-of-squashed-layer.html -->
+<!DOCTYPE html>
+
+<div style="position: absolute; width: 200px; height: 200px; background: lightgray; will-change: transform"></div>
+
+<div style="position: absolute; width: 200px; height: 200px; top: 50px; left: 50px; background: lightblue"></div>
+<div id="target" style="position: absolute; width: 200px; height: 200px; top: 100.45px; left: 100.45px; background: papayawhip"></div>
+
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='target'",
+];
+function paintInvalidationTest() {
+    target.style.backgroundColor = 'red';
+}
+runPaintInvalidationTest();
+</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidation-with-zero-size-object-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidation-with-zero-size-object-expected.html
new file mode 100644
index 0000000..c50eddd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidation-with-zero-size-object-expected.html
@@ -0,0 +1 @@
+<!doctype html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidation-with-zero-size-object.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidation-with-zero-size-object.html
new file mode 100644
index 0000000..caa11eb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidation-with-zero-size-object.html
@@ -0,0 +1,29 @@
+<!-- Based on fast/repaint/invalidation-with-zero-size-object.html -->
+<!doctype html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow DIV id='element'",
+    ];
+    function paintInvalidationTest()
+    {
+      document.getElementById('element').style.width = '0';
+      document.getElementById('element').style.height = '0';
+    }
+
+    onload = runPaintInvalidationTest;
+</script>
+<style>
+    #element {
+      width: 200px;
+      height: 200px;
+      background-color: red;
+    }
+    #inner {
+      width: 100%;
+      height: 100%;
+    }
+</style>
+<div id='element'>
+  <div id='inner'></div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidations-on-composited-layers-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidations-on-composited-layers-expected.html
new file mode 100644
index 0000000..ac9c6a0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidations-on-composited-layers-expected.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+
+<!--
+This test checks that repaint testing works with composited layers.
+-->
+
+<html>
+<head>
+  <style type="text/css">
+    #parent {
+        width: 400px;
+        height: 400px;
+        background: green;
+    }
+
+    #child {
+        position: relative;
+        left: 50px;
+        top: 50px;
+        width: 75px;
+        height: 75px;
+        background: blue;
+    }
+
+  </style>
+</head>
+<body>
+  <div id="parent">
+    <div id="child"></div>
+  </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidations-on-composited-layers.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidations-on-composited-layers.html
new file mode 100644
index 0000000..d765a4d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidations-on-composited-layers.html
@@ -0,0 +1,51 @@
+<!-- Based on compositing/repaint/invalidations-on-composited-layers.html -->
+<!DOCTYPE html>
+
+<!--
+This test checks that repaint testing works with composited layers.
+-->
+
+<html>
+<head>
+  <style type="text/css">
+    #parent {
+        transform: translateZ(0px);
+        width: 400px;
+        height: 400px;
+        background: blue;
+    }
+
+    #child {
+        transform: translateZ(0px);
+        position: relative;
+        left: 50px;
+        top: 50px;
+        width: 75px;
+        height: 75px;
+        background: green;
+    }
+
+  </style>
+  <script src="resources/paint-invalidation-test.js"></script>
+  <script>
+      window.expectedPaintInvalidationObjects = [
+          "LayoutBlockFlow DIV id='parent'",
+          "LayoutBlockFlow (relative positioned) DIV id='child'",
+      ];
+      function paintInvalidationTest() {
+          var parent = document.getElementById('parent');
+          var child = document.getElementById('child');
+
+          child.style.background = 'blue';
+          parent.style.background = 'green';
+      }
+
+      runPaintInvalidationTest();
+  </script>
+</head>
+<body>
+  <div id="parent">
+    <div id="child"></div>
+  </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidations-with-large-negative-margin-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidations-with-large-negative-margin-expected.html
new file mode 100644
index 0000000..8e07152
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidations-with-large-negative-margin-expected.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<div style="height:200px;width:600px;overflow:scroll">
+  <div style="position:relative">
+    <div style="height:400px;margin-bottom:-400px;position:relative">
+      <div id="chip" style="width:50px;height:50px;position:absolute;background:lightblue;margin:0; left: 400px"></div>
+    </div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidations-with-large-negative-margin.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidations-with-large-negative-margin.html
new file mode 100644
index 0000000..e724f40
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invalidations-with-large-negative-margin.html
@@ -0,0 +1,24 @@
+<!-- Based on compositing/squashing/invalidations-with-large-negative-margin.html -->
+<!DOCTYPE html>
+<div style="height:200px;width:600px;overflow:scroll">
+  <div style="position:relative">
+    <div style="height:400px;margin-bottom:-400px;position:relative">
+      <div id="chip" style="width:50px;height:50px;position:absolute;background:lightblue;margin:0"></div>
+    </div>
+  </div>
+</div>
+
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+// Test that moving a Layer that is squashed relative to its squashing container repaints correctly.
+// In particular, the repaint rect needs to be recorded in the correct position relative to the squashing GraphicsLayer.
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='chip'",
+];
+function paintInvalidationTest()
+{
+    document.getElementById('chip').style.left = "400px";
+}
+
+runPaintInvalidationTest();
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invisible-objects-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invisible-objects-expected.html
new file mode 100644
index 0000000..a81cbce
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invisible-objects-expected.html
@@ -0,0 +1,2 @@
+<body>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invisible-objects.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invisible-objects.html
new file mode 100644
index 0000000..6fb8a82
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/invisible-objects.html
@@ -0,0 +1,27 @@
+<!-- Based on fast/repaint/invisible-objects.html -->
+<html>
+<head>
+    <script src="resources/paint-invalidation-test.js"></script>
+    <script>
+        window.expectedPaintInvalidationObjects = [
+            "InlineTextBox ''",
+            "RootInlineBox",
+            "LayoutText #text",
+            "InlineTextBox 'is invisible'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById("block").style.height = "100px";
+            document.getElementById("inline").innerText = "is invisible";
+        }
+    </script>
+</head>
+<body onload="runPaintInvalidationTest()">
+    <div style="visibility: hidden; position: relative;">
+        <span id="inline">Invisible text</span>
+    </div>
+    <div style="visibility: hidden; position: relative;">
+        <div id="block" style="height: 50px;"></div>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-change-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-change-expected.html
new file mode 100644
index 0000000..37cb227
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-change-expected.html
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: flex;
+  justify-content: space-between;
+  width: 200px;
+  height: 300px;
+  background-color: orange;
+}
+.item {
+  background-color: green;
+  border: solid thin blue;
+  width: 50px;
+}
+</style>
+<p style="height: 20px">Tests invalidation on justify-content style change. Passes if only one big orange bar appear in the middle of the box.</p>
+<div id="container">
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-change.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-change.html
new file mode 100644
index 0000000..15e714d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-change.html
@@ -0,0 +1,41 @@
+<!-- Based on fast/repaint/justify-content-change.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+];
+function paintInvalidationTest() {
+  document.getElementById('container').style.justifyContent = 'space-between';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: flex;
+  justify-content: space-around;
+  width: 200px;
+  height: 300px;
+  background-color: orange;
+}
+.item {
+  background-color: green;
+  border: solid thin blue;
+  width: 50px;
+}
+</style>
+<p style="height: 20px">Tests invalidation on justify-content style change. Passes if only one big orange bar appear in the middle of the box.</p>
+<div id="container">
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-distribution-change-grid-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-distribution-change-grid-expected.html
new file mode 100644
index 0000000..67f3de1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-distribution-change-grid-expected.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid-auto-columns: auto;
+  grid-auto-rows: 200px;
+  grid-auto-flow: column;
+  justify-content: stretch;
+  width: 300px;
+  height: 200px;
+  background-color: red;
+}
+.item {
+  background-color: green;
+}
+</style>
+<p style="height: 20px">Tests invalidation on justify-content style change (distribution). Passes if there is no red.</p>
+<div id="container">
+  <div class="item">
+    <div style="width: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="width: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="width: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-distribution-change-grid.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-distribution-change-grid.html
new file mode 100644
index 0000000..dd2e2a8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-distribution-change-grid.html
@@ -0,0 +1,48 @@
+<!-- Based on fast/repaint/justify-content-distribution-change-grid.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutGrid DIV id='container'",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+];
+function paintInvalidationTest() {
+  document.getElementById('container').style.justifyContent = 'stretch';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid-auto-columns: auto;
+  grid-auto-rows: 200px;
+  grid-auto-flow: column;
+  justify-content: space-around;
+  width: 300px;
+  height: 200px;
+  background-color: red;
+}
+.item {
+  background-color: green;
+}
+</style>
+<p style="height: 20px">Tests invalidation on justify-content style change (distribution). Passes if there is no red.</p>
+<div id="container">
+  <div class="item">
+    <div style="width: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="width: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="width: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-position-change-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-position-change-expected.html
new file mode 100644
index 0000000..9cec3b1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-position-change-expected.html
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: flex;
+  justify-content: flex-start;
+  width: 200px;
+  height: 300px;
+  background-color: orange;
+}
+.item {
+  background-color: green;
+  border: solid thin blue;
+  width: 50px;
+}
+</style>
+<p style="height: 20px">Tests invalidation on justify-content style change. Passes if only one big orange bar appear aligned to the box's right edge.</p>
+<div id="container">
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-position-change-grid-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-position-change-grid-expected.html
new file mode 100644
index 0000000..23f2c4c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-position-change-grid-expected.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid-auto-columns: auto;
+  grid-auto-rows: 200px;
+  grid-auto-flow: column;
+  justify-content: end;
+  width: 300px;
+  height: 200px;
+  background-color: red;
+}
+.item {
+  background-color: green;
+}
+</style>
+<p style="height: 20px">Tests invalidation on justify-content style change (position). Passes if the red half is on the left.</p>
+<div id="container">
+  <div class="item">
+    <div style="width: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="width: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="width: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-position-change-grid.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-position-change-grid.html
new file mode 100644
index 0000000..b055941
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-position-change-grid.html
@@ -0,0 +1,48 @@
+<!-- Based on fast/repaint/justify-content-position-change-grid.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutGrid DIV id='container'",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+];
+function paintInvalidationTest() {
+  document.getElementById('container').style.justifyContent = 'end';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid-auto-columns: auto;
+  grid-auto-rows: 200px;
+  grid-auto-flow: column;
+  justify-content: start;
+  width: 300px;
+  height: 200px;
+  background-color: red;
+}
+.item {
+  background-color: green;
+}
+</style>
+<p style="height: 20px">Tests invalidation on justify-content style change (position). Passes if the red half is on the left.</p>
+<div id="container">
+  <div class="item">
+    <div style="width: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="width: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="width: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-position-change.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-position-change.html
new file mode 100644
index 0000000..252fdc7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-content-position-change.html
@@ -0,0 +1,41 @@
+<!-- Based on fast/repaint/justify-content-position-change.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+];
+function paintInvalidationTest() {
+  document.getElementById('container').style.justifyContent = 'flex-start';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: flex;
+  justify-content: center;
+  width: 200px;
+  height: 300px;
+  background-color: orange;
+}
+.item {
+  background-color: green;
+  border: solid thin blue;
+  width: 50px;
+}
+</style>
+<p style="height: 20px">Tests invalidation on justify-content style change. Passes if only one big orange bar appear aligned to the box's right edge.</p>
+<div id="container">
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-items-change-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-items-change-expected.html
new file mode 100644
index 0000000..9d62eff
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-items-change-expected.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid: 200px / 300px;
+  justify-items: start;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item {
+  grid-row: 1;
+  grid-column: 1;
+  background-color: green;
+  width: 50px;
+}
+</style>
+<p style="height: 20px">Tests invalidation on justify-items style change. Passes if green bar is left aligned.</p>
+<div id="container">
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-items-change.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-items-change.html
new file mode 100644
index 0000000..d589bf9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-items-change.html
@@ -0,0 +1,42 @@
+<!-- Based on fast/repaint/justify-items-change.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutGrid DIV id='container'",
+    "LayoutGrid DIV id='container'",
+    "LayoutBlockFlow DIV class='item'",
+    "LayoutBlockFlow DIV",
+];
+function paintInvalidationTest() {
+  document.getElementById('container').style.justifyItems = 'start';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid: 200px / 300px;
+  justify-items: end;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item {
+  grid-row: 1;
+  grid-column: 1;
+  background-color: green;
+  width: 50px;
+}
+</style>
+<p style="height: 20px">Tests invalidation on justify-items style change. Passes if green bar is left aligned.</p>
+<div id="container">
+  <div class="item">
+    <div style="height: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-items-legacy-change-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-items-legacy-change-expected.html
new file mode 100644
index 0000000..eddd3f5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-items-legacy-change-expected.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML>
+<style>
+body {
+  margin: 0;
+}
+#parentContainer {
+  justify-items: legacy center;
+  background-color: orange;
+  width: 300px;
+  height: 400px;
+}
+
+#container {
+  display: grid;
+  grid: 100px 100px / 150px 150px;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item1 {
+  grid-row: 1;
+  grid-column: 1;
+  background-color: green;
+  border: solid thin blue;
+  width: 50px;
+}
+.item2 {
+  grid-row: 1;
+  grid-column: 2;
+  background-color: green;
+  border: solid thin blue;
+  width: 50px;
+</style>
+<p style="height: 20px">Tests invalidation on justify-items style change (legacy value). Passes if green bars are centerd inside their red container.</p>
+<div id="parentContainer">
+    <div id="container">
+        <div class="item1">
+            <div style="height: 50px"></div>
+        </div>
+        <div class="item2">
+            <div style="height: 50px"></div>
+        </div>
+    </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-items-legacy-change.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-items-legacy-change.html
new file mode 100644
index 0000000..ec8d85f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-items-legacy-change.html
@@ -0,0 +1,66 @@
+<!-- Based on fast/repaint/justify-items-legacy-change.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item1'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item2'",
+    "LayoutGrid DIV id='container'",
+    "LayoutBlockFlow DIV id='parentContainer'",
+    "LayoutBlockFlow DIV id='parentContainer'",
+    "LayoutGrid DIV id='container'",
+    "LayoutBlockFlow DIV class='item1'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item2'",
+    "LayoutBlockFlow DIV",
+];
+function paintInvalidationTest() {
+  document.getElementById('parentContainer').style.justifyItems = 'legacy center';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+#parentContainer {
+  justify-items: center;
+  background-color: orange;
+  width: 300px;
+  height: 400px;
+}
+
+#container {
+  display: grid;
+  grid: 100px 100px / 150px 150px;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item1 {
+  grid-row: 1;
+  grid-column: 1;
+  background-color: green;
+  border: solid thin blue;
+  width: 50px;
+}
+.item2 {
+  grid-row: 1;
+  grid-column: 2;
+  background-color: green;
+  border: solid thin blue;
+  width: 50px;
+</style>
+<p style="height: 20px">Tests invalidation on justify-items style change (legacy value). Passes if green bars are centerd inside their red container.</p>
+<div id="parentContainer">
+    <div id="container">
+        <div class="item1">
+            <div style="height: 50px"></div>
+        </div>
+        <div class="item2">
+            <div style="height: 50px"></div>
+        </div>
+    </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-items-overflow-change-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-items-overflow-change-expected.html
new file mode 100644
index 0000000..8cf02fc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-items-overflow-change-expected.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid: 100px 100px / 300px;
+  justify-items: end safe;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item1 {
+  grid-row: 1;
+  grid-column: 1;
+  background-color: green;
+  width: 160px;
+}
+.item2 {
+  grid-row: 1;
+  grid-column: 2;
+  background-color: green;
+  width: 50px;
+</style>
+<p style="height: 20px">Tests invalidation on justify-items style change. Passes if there is no red.</p>
+<div id="container">
+  <div class="item1">
+    <div style="height: 50px"></div>
+  </div>
+  <div class="item2">
+    <div style="height: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-items-overflow-change.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-items-overflow-change.html
new file mode 100644
index 0000000..1cfabcd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-items-overflow-change.html
@@ -0,0 +1,56 @@
+<!-- Based on fast/repaint/justify-items-overflow-change.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item1'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item2'",
+    "LayoutGrid DIV id='container'",
+    "LayoutBlockFlow HTML",
+    "LayoutBlockFlow BODY",
+    "LayoutGrid DIV id='container'",
+    "LayoutBlockFlow DIV class='item1'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item2'",
+    "LayoutBlockFlow DIV",
+];
+function paintInvalidationTest() {
+  document.getElementById('container').style.justifyItems = 'end safe';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid: 100px 100px / 300px;
+  justify-items: end true;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item1 {
+  grid-row: 1;
+  grid-column: 1;
+  background-color: green;
+  width: 160px;
+}
+.item2 {
+  grid-row: 1;
+  grid-column: 2;
+  background-color: green;
+  width: 50px;
+</style>
+<p style="height: 20px">Tests invalidation on justify-items style change. Passes if there is no red.</p>
+<div id="container">
+  <div class="item1">
+    <div style="height: 50px"></div>
+  </div>
+  <div class="item2">
+    <div style="height: 50px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-self-change-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-self-change-expected.html
new file mode 100644
index 0000000..11b5cc4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-self-change-expected.html
@@ -0,0 +1,38 @@
+<!DOCTYPE HTML>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid: 100px 100px / 150px 150px;
+  justify-items: center;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item1 {
+  grid-row: 1;
+  grid-column: 1;
+  background-color: green;
+  border: solid thin blue;
+  width: 50px;
+  justify-self: start;
+}
+.item2 {
+  grid-row: 1;
+  grid-column: 2;
+  background-color: green;
+  border: solid thin blue;
+  width: 50px;
+  justify-self: end;
+</style>
+<p style="height: 20px">Tests invalidation on justify-self style change. Passes if there is no red.</p>
+<div id="container">
+  <div class="item1">
+    <div style="height: 150px"></div>
+  </div>
+  <div class="item2">
+    <div style="height: 100px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-self-change-keeping-geometry-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-self-change-keeping-geometry-expected.html
new file mode 100644
index 0000000..47546db
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-self-change-keeping-geometry-expected.html
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid: 100px 100px / 150px 150px;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item1 {
+  grid-row: 1;
+  grid-column: 1;
+  justify-self: left;
+  background-color: green;
+  width: 50px;
+}
+.item2 {
+  grid-row: 1;
+  grid-column: 2;
+  justify-self: right;
+  background-color: green;
+  width: 50px;
+</style>
+<p style="height: 20px">Tests invalidation on justify-self style change. Passes if there is no red.</p>
+<div id="container">
+  <div class="item1">
+    <div style="height: 150px"></div>
+  </div>
+  <div class="item2">
+    <div style="height: 100px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-self-change-keeping-geometry.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-self-change-keeping-geometry.html
new file mode 100644
index 0000000..f12e2d58
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-self-change-keeping-geometry.html
@@ -0,0 +1,46 @@
+<!-- Based on fast/repaint/justify-self-change-keeping-geometry.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+];
+function paintInvalidationTest() {
+  document.getElementsByClassName('item1')[0].style.justifySelf = 'left';
+  document.getElementsByClassName('item2')[0].style.justifySelf = 'right';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid: 100px 100px / 150px 150px;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item1 {
+  grid-row: 1;
+  grid-column: 1;
+  justify-self: start;
+  background-color: green;
+  width: 50px;
+}
+.item2 {
+  grid-row: 1;
+  grid-column: 2;
+  justify-self: end;
+  background-color: green;
+  width: 50px;
+</style>
+<p style="height: 20px">Tests invalidation on justify-self style change. Passes if there is no red.</p>
+<div id="container">
+  <div class="item1">
+    <div style="height: 150px"></div>
+  </div>
+  <div class="item2">
+    <div style="height: 100px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-self-change.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-self-change.html
new file mode 100644
index 0000000..8d0e10f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-self-change.html
@@ -0,0 +1,51 @@
+<!-- Based on fast/repaint/justify-self-change.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV class='item1'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item2'",
+    "LayoutBlockFlow DIV",
+];
+function paintInvalidationTest() {
+  document.getElementsByClassName('item1')[0].style.justifySelf = 'start';
+  document.getElementsByClassName('item2')[0].style.justifySelf = 'end';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid: 100px 100px / 150px 150px;
+  justify-items: center;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item1 {
+  grid-row: 1;
+  grid-column: 1;
+  background-color: green;
+  border: solid thin blue;
+  width: 50px;
+}
+.item2 {
+  grid-row: 1;
+  grid-column: 2;
+  background-color: green;
+  border: solid thin blue;
+  width: 50px;
+</style>
+<p style="height: 20px">Tests invalidation on justify-self style change. Passes if there is no red.</p>
+<div id="container">
+  <div class="item1">
+    <div style="height: 150px"></div>
+  </div>
+  <div class="item2">
+    <div style="height: 100px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-self-overflow-change-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-self-overflow-change-expected.html
new file mode 100644
index 0000000..e0f288a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-self-overflow-change-expected.html
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid: 100px 100px / 300px;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item1 {
+  grid-row: 1;
+  grid-column: 1;
+  justify-self: end safe;
+  background-color: green;
+  width: 150px;
+}
+.item2 {
+  grid-row: 1;
+  grid-column: 2;
+  background-color: green;
+  justify-self: end safe;
+  width: 50px;
+</style>
+<p style="height: 20px">Tests invalidation on justify-self style change. Passes if there is no red.</p>
+<div id="container">
+  <div class="item1">
+    <div style="height: 150px"></div>
+  </div>
+  <div class="item2">
+    <div style="height: 100px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-self-overflow-change.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-self-overflow-change.html
new file mode 100644
index 0000000..31b9871
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/justify-self-overflow-change.html
@@ -0,0 +1,52 @@
+<!-- Based on fast/repaint/justify-self-overflow-change.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow HTML",
+    "LayoutBlockFlow BODY",
+    "LayoutGrid DIV id='container'",
+    "LayoutBlockFlow DIV class='item1'",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV class='item2'",
+];
+function paintInvalidationTest() {
+  document.getElementsByClassName('item1')[0].style.justifySelf = 'end safe';
+  document.getElementsByClassName('item2')[0].style.justifySelf = 'end safe';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+#container {
+  display: grid;
+  grid: 100px 100px / 300px;
+  width: 200px;
+  height: 300px;
+  background-color: red;
+}
+.item1 {
+  grid-row: 1;
+  grid-column: 1;
+  justify-self: end true;
+  background-color: green;
+  width: 150px;
+}
+.item2 {
+  grid-row: 1;
+  grid-column: 2;
+  background-color: green;
+  justify-self: end true;
+  width: 50px;
+</style>
+<p style="height: 20px">Tests invalidation on justify-self style change. Passes if there is no red.</p>
+<div id="container">
+  <div class="item1">
+    <div style="height: 150px"></div>
+  </div>
+  <div class="item2">
+    <div style="height: 100px"></div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layer-full-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layer-full-repaint-expected.html
new file mode 100644
index 0000000..15439b0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layer-full-repaint-expected.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=13655</title>
+    <style type="text/css">
+        div {
+            position: relative;
+            height: 100px;
+            width: 100px;
+            background-color: green;
+            text-shadow: red 5px 5px 0;
+        }
+    </style>
+</head>
+<body">
+        <div id="test"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layer-full-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layer-full-repaint.html
new file mode 100644
index 0000000..17ad28c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layer-full-repaint.html
@@ -0,0 +1,33 @@
+<!-- Based on fast/repaint/layer-full-repaint.html -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=13655</title>
+    <style type="text/css">
+        div {
+            position: relative;
+            height: 100px;
+            width: 100px;
+            background-color: red;
+        }
+        
+        div.selected {
+            background-color: green;
+            text-shadow: red 5px 5px 0;
+        }
+    </style>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script>
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (relative positioned) DIV id='test' class='selected'",
+        ];
+        function paintInvalidationTest()
+        {
+           document.getElementById('test').className = "selected";
+        }
+    </script>
+</head>
+<body onload="runPaintInvalidationTest();">
+        <div id="test"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layer-hide-when-needs-layout-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layer-hide-when-needs-layout-expected.html
new file mode 100644
index 0000000..e119d31
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layer-hide-when-needs-layout-expected.html
@@ -0,0 +1,9 @@
+<html>
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=13544</title>
+</head>
+<body>
+    <div style="background: green; width: 100px; height: 100px;">
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layer-hide-when-needs-layout.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layer-hide-when-needs-layout.html
new file mode 100644
index 0000000..b36ab96
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layer-hide-when-needs-layout.html
@@ -0,0 +1,27 @@
+<!-- Based on fast/repaint/layer-hide-when-needs-layout.html -->
+<html>
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=13544</title>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (positioned) DIV id='target'",
+        ];
+        function paintInvalidationTest()
+        {
+            var div = document.getElementById("target");
+            div.style.visibility = 'hidden';
+            // Now make this a layout hint to avoid the repaint done in setStyle().
+            div.style.width = '50px';
+        }
+    </script>
+</head>
+<body onload="runPaintInvalidationTest()">
+    <div style="position: relative;">
+        <div style="background: green; width: 100px; height: 100px;">
+        </div>
+        <div id="target" style="position: absolute; top: 0; width: 100px; height: 100px; background: red;">
+        </div>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layer-visibility-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layer-visibility-expected.html
new file mode 100644
index 0000000..e2f0a32
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layer-visibility-expected.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+    <div id="target" style="position: absolute; top: 0; left: 0; width: 100px; height: 100px; background-color: green"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layer-visibility.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layer-visibility.html
new file mode 100644
index 0000000..8561d1e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layer-visibility.html
@@ -0,0 +1,30 @@
+<!-- Based on fast/repaint/layer-visibility.html -->
+<html>
+<head>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    function test()
+    {
+        document.body.offsetTop;
+        var target = document.getElementById("target");
+        target.style.visibility = "visible";
+        document.body.offsetTop;
+        
+        runPaintInvalidationTest();
+    }
+
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow (positioned) DIV id='target'",
+    ];
+    function paintInvalidationTest()
+    {
+        var target = document.getElementById("target");
+        target.style.left = "0";
+        target.style.backgroundColor = "green";
+    }
+</script>
+</head>
+<body onload="test()">
+    <div id="target" style="position: absolute; top: 0; left: 100px; width: 100px; height: 100px; background-color: red; visibility: hidden;"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layout-state-only-positioned-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layout-state-only-positioned-expected.html
new file mode 100644
index 0000000..7d1ecbe3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layout-state-only-positioned-expected.html
@@ -0,0 +1,5 @@
+<body>
+    <div style="position: absolute; top: 50px; left: 0; overflow: overlay; width: 100px; height: 100px; border: solid">
+        <div id="q" style="position: absolute; top: 0; height: 200px; width: 10px;"></div>
+    </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layout-state-only-positioned.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layout-state-only-positioned.html
new file mode 100644
index 0000000..09e2b52
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/layout-state-only-positioned.html
@@ -0,0 +1,22 @@
+<!-- Based on fast/repaint/layout-state-only-positioned.html -->
+<head>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script>
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (positioned) DIV",
+            "VerticalScrollbar",
+            "VerticalScrollbar",
+            "VerticalScrollbar",
+            "LayoutBlockFlow (positioned) DIV id='q'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById("q").style.height = "200px";
+        }
+    </script>
+</head>
+<body onload="runPaintInvalidationTest()">
+    <div style="position: absolute; top: 50px; left: 0; overflow: overlay; width: 100px; height: 100px; border: solid">
+        <div id="q" style="position: absolute; top: 0; height: 50px; width: 10px;"></div>
+    </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/margin-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/margin-expected.html
new file mode 100644
index 0000000..baf43bfc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/margin-expected.html
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML>
+<style>
+body {
+    margin: 0;
+}
+div {
+    width: 100px;
+    height: 100px;
+    position: absolute;
+    background-color: green;
+    margin: 20px;
+}
+</style>
+<div id="target"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/margin.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/margin.html
new file mode 100644
index 0000000..aa0cfa2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/margin.html
@@ -0,0 +1,27 @@
+<!-- Based on fast/repaint/margin.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='target'",
+];
+function paintInvalidationTest()
+{
+    // Margin change will visually move the content of the div.
+    // Should repaint the old position and the new position.
+    document.getElementById('target').style.margin = '20px';
+}
+window.onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+    margin: 0;
+}
+div {
+    width: 100px;
+    height: 100px;
+    position: absolute;
+    background-color: green;
+}
+</style>
+<div id="target"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/mix-blend-mode-separate-stacking-context-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/mix-blend-mode-separate-stacking-context-expected.html
new file mode 100644
index 0000000..0e3b777
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/mix-blend-mode-separate-stacking-context-expected.html
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+    div {
+        margin: 20px;
+        width: 60px;
+        height: 60px;
+        float: left;
+    }
+</style>
+<!-- Repaint test to ensure that setting a blend mode dynamically triggers this operation
+    only with the contents of the nearest ancestor stacking context. -->
+<body>
+    <div style="background: green; position: relative; z-index: -1;">
+        <div id="first" style="mix-blend-mode: multiply; background-color: blue;"></div>
+    </div>
+    <div style="background: green; position: relative; z-index: -1;">
+        <div id="second" style="mix-blend-mode: normal; background-color: blue;"></div>
+    </div>
+    <div style="background: green; position: relative; z-index: -1;">
+        <div id="third" style="mix-blend-mode: multiply; background-color: blue;"></div>
+    </div>
+    <div id="fourth" style="background: green; position: relative; z-index: -1;">
+        <div style="mix-blend-mode: hue; background-color: blue;"></div>
+    </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/mix-blend-mode-separate-stacking-context.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/mix-blend-mode-separate-stacking-context.html
new file mode 100644
index 0000000..7f38ae6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/mix-blend-mode-separate-stacking-context.html
@@ -0,0 +1,49 @@
+<!-- Based on fast/repaint/mix-blend-mode-separate-stacking-context.html -->
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+    div {
+        margin: 20px;
+        width: 60px;
+        height: 60px;
+        float: left;
+    }
+</style>
+<script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+<!-- Repaint test to ensure that setting a blend mode dynamically triggers this operation
+    only with the contents of the nearest ancestor stacking context. -->
+<body onload="runPaintInvalidationTest()">
+    <div style="background: green; position: relative; z-index: -1;">
+        <div id="first" style="mix-blend-mode: normal; background-color: blue;"></div>
+    </div>
+    <div style="background: green; position: relative; z-index: -1;">
+        <div id="second" style="mix-blend-mode: hue; background-color: blue;"></div>
+    </div>
+    <div style="background: green; position: relative; z-index: -1;">
+        <div id="third" style="mix-blend-mode: hue; background-color: blue;"></div>
+    </div>
+    <div id="fourth" style="background: green;">
+        <div style="mix-blend-mode: hue; background-color: blue;"></div>
+    </div>
+
+    <script>
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (floating) DIV id='second'",
+            "LayoutBlockFlow (relative positioned) (floating) DIV",
+            "LayoutBlockFlow (floating) DIV id='first'",
+            "LayoutBlockFlow (relative positioned) (floating) DIV",
+            "LayoutBlockFlow (floating) DIV id='second'",
+            "LayoutBlockFlow (floating) DIV id='third'",
+            "LayoutBlockFlow (relative positioned) (floating) DIV id='fourth'",
+            "LayoutBlockFlow (floating) DIV",
+        ];
+        function paintInvalidationTest() {
+            document.getElementById('first').style.mixBlendMode = "multiply";
+            document.getElementById('second').style.mixBlendMode = "normal";
+            document.getElementById('third').style.mixBlendMode = "multiply";
+            document.getElementById('fourth').style.position = "relative";
+            document.getElementById('fourth').style.zIndex = -1;
+        }
+    </script>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-as-paint-container-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-as-paint-container-expected.html
new file mode 100644
index 0000000..cded408
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-as-paint-container-expected.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<div id="target" style="-webkit-columns:2; -webkit-backface-visibility:hidden; width:630px; font:20px/1 Ahem; color:green;">
+    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce
+    varius, metus eu fringilla pulvinar, ipsum sapien ultricies arcu,
+    non condimentum quam est eu purus. Ut nisl libero, suscipit ut leo
+    eget, dapibus ultrices dolor.
+</div>
+<p>All text above should be green.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-as-paint-container.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-as-paint-container.html
new file mode 100644
index 0000000..07848e3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-as-paint-container.html
@@ -0,0 +1,38 @@
+<!-- Based on fast/repaint/multicol-as-paint-container.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    onload = runPaintInvalidationTest;
+    window.expectedPaintInvalidationObjects = [
+        "LayoutText #text",
+        "InlineTextBox 'Lorem ipsum'",
+        "InlineTextBox 'dolor sit amet,'",
+        "InlineTextBox 'consectetur'",
+        "InlineTextBox 'adipiscing'",
+        "InlineTextBox 'elit. Fusce'",
+        "InlineTextBox 'varius, metus'",
+        "InlineTextBox 'eu fringilla'",
+        "InlineTextBox 'pulvinar, ipsum'",
+        "InlineTextBox 'sapien'",
+        "InlineTextBox 'ultricies arcu,'",
+        "InlineTextBox 'non condimentum'",
+        "InlineTextBox 'quam est eu'",
+        "InlineTextBox 'purus. Ut nisl'",
+        "InlineTextBox 'libero,'",
+        "InlineTextBox 'suscipit ut leo'",
+        "InlineTextBox 'eget, dapibus'",
+        "InlineTextBox 'ultrices dolor.'",
+        "LayoutMultiColumnSet (anonymous)",
+    ];
+    function paintInvalidationTest() {
+        var target = document.getElementById('target');
+        target.style.color = 'green';
+    }
+</script>
+<div id="target" style="-webkit-columns:2; -webkit-backface-visibility:hidden; width:630px; font:20px/1 Ahem; color:red;">
+    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce
+    varius, metus eu fringilla pulvinar, ipsum sapien ultricies arcu,
+    non condimentum quam est eu purus. Ut nisl libero, suscipit ut leo
+    eget, dapibus ultrices dolor.
+</div>
+<p>All text above should be green.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-relpos-with-abspos-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-relpos-with-abspos-expected.html
new file mode 100644
index 0000000..39caab9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-relpos-with-abspos-expected.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<div style="position:relative; -webkit-columns:4; -webkit-column-gap:10px; width:630px; height:40px; column-fill:auto;">
+    <div id="target" style="position:absolute; width:20px; height:20px; right:0; bottom:0; background:green;"></div>
+</div>
+<p>A green rectangle should be seen above.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-relpos-with-abspos.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-relpos-with-abspos.html
new file mode 100644
index 0000000..4d12a9d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-relpos-with-abspos.html
@@ -0,0 +1,17 @@
+<!-- Based on fast/repaint/multicol-relpos-with-abspos.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    onload = runPaintInvalidationTest;
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow (positioned) DIV id='target'",
+    ];
+    function paintInvalidationTest() {
+        var target = document.getElementById('target');
+        target.style.visibility = 'visible';
+    }
+</script>
+<div style="position:relative; -webkit-columns:4; -webkit-column-gap:10px; width:630px; height:40px; column-fill:auto;">
+    <div id="target" style="position:absolute; width:20px; height:20px; right:0; bottom:0; visibility:hidden; background:green;"></div>
+</div>
+<p>A green rectangle should be seen above.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-repaint-expected.html
new file mode 100644
index 0000000..fc930583
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-repaint-expected.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+
+<html lang="en">
+<head>
+  <style type="text/css" media="screen">
+
+    .container {
+      width: 400px;
+      height: 100px;
+      border: 1px solid black;
+      font-size: 50px;
+      -webkit-column-count: 2;
+      column-count: 2;
+      column-fill: auto;
+    }
+  </style>
+</head>
+<body">
+  
+  <div class="container">
+    &nbsp;<br>
+    <span id="a">XXXXXX</span>
+  </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-repaint.html
new file mode 100644
index 0000000..9e326a9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-repaint.html
@@ -0,0 +1,44 @@
+<!-- Based on fast/repaint/multicol-repaint.html -->
+<!DOCTYPE html>
+
+<html lang="en">
+<head>
+  <style type="text/css" media="screen">
+
+    .container {
+      width: 400px;
+      height: 100px;
+      border: 1px solid black;
+      font-size: 50px;
+      -webkit-column-count: 2;
+      column-count: 2;
+      column-fill: auto;
+    }
+
+  </style>
+  <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+  <script type="text/javascript">
+     window.expectedPaintInvalidationObjects = [
+         "RootInlineBox",
+         "RootInlineBox",
+         "InlineTextBox '\u00A0'",
+         "InlineTextBox '\n'",
+         "InlineTextBox ''",
+         "LayoutMultiColumnFlowThread (anonymous)",
+         "LayoutText #text",
+         "InlineTextBox 'XXXXXX'",
+     ];
+     function paintInvalidationTest()
+     {
+         document.getElementById('a').innerHTML = 'XXXXXX';
+     }
+  </script>
+</head>
+<body onload="runPaintInvalidationTest();">
+  
+  <div class="container">
+    &nbsp;<br>
+    <span id="a">x</span>
+  </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-abspos-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-abspos-expected.html
new file mode 100644
index 0000000..132fd0c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-abspos-expected.html
@@ -0,0 +1,3 @@
+<!DOCTYPE html>
+<p>A green PASS should be seen at the bottom-left corner.</p>
+<div id="target" style="position:absolute; left:0; bottom:0; color: green">PASS</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-abspos-in-relpos-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-abspos-in-relpos-expected.html
new file mode 100644
index 0000000..4ba53cb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-abspos-in-relpos-expected.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<div style="-webkit-columns:4; -webkit-column-gap:10px; column-fill:auto; width:630px; height:40px; color:green;">
+    <br>
+    <br>
+    <br>
+    <br>
+    <br>
+    <br>
+    <div style="position:relative;">
+        <br>
+        <br>
+        <div id="target" style="position:absolute; left:20px; top:20px">PASS</div>
+    </div>
+</div>
+<p>A green PASS should be seen above.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-abspos-in-relpos.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-abspos-in-relpos.html
new file mode 100644
index 0000000..ac4d45d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-abspos-in-relpos.html
@@ -0,0 +1,29 @@
+<!-- Based on fast/repaint/multicol-with-abspos-in-relpos.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    onload = runPaintInvalidationTest;
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow (positioned) DIV id='target'",
+        "LayoutText #text",
+        "InlineTextBox 'PASS'",
+    ];
+    function paintInvalidationTest() {
+        var target = document.getElementById('target');
+        target.style.visibility = 'visible';
+    }
+</script>
+<div style="-webkit-columns:4; -webkit-column-gap:10px; column-fill:auto; width:630px; height:40px; color:green;">
+    <br>
+    <br>
+    <br>
+    <br>
+    <br>
+    <br>
+    <div style="position:relative;">
+        <br>
+        <br>
+        <div id="target" style="position:absolute; left:20px; top:20px; visibility:hidden;">PASS</div>
+    </div>
+</div>
+<p>A green PASS should be seen above.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-abspos.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-abspos.html
new file mode 100644
index 0000000..a229af06
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-abspos.html
@@ -0,0 +1,27 @@
+<!-- Based on fast/repaint/multicol-with-abspos.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    onload = runPaintInvalidationTest;
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow (positioned) DIV id='target'",
+        "LayoutText #text",
+        "InlineTextBox 'PASS'",
+    ];
+    function paintInvalidationTest() {
+        var target = document.getElementById('target');
+        target.style.visibility = 'visible';
+    }
+</script>
+<p>A green PASS should be seen at the bottom-left corner.</p>
+<div style="-webkit-columns:4; -webkit-column-gap:10px; column-fill:auto; width:630px; height:40px; color:green;">
+    <br>
+    <br>
+    <br>
+    <br>
+    <br>
+    <br>
+    <!-- This absolutely positioned box is not part of the flow thread, since the nearest
+         non-statically positioned box is further up than that. -->
+    <div id="target" style="position:absolute; left:0; bottom:0; visibility:hidden;">PASS</div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-block-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-block-expected.html
new file mode 100644
index 0000000..652a857
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-block-expected.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<div style="-webkit-columns:4; -webkit-column-gap:10px; column-fill:auto; width:630px; height:20px; color:green;">
+    <br>
+    <br>
+    <br>
+    <div id="target">PASS</div>
+</div>
+<p>A green PASS should be seen above.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-block.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-block.html
new file mode 100644
index 0000000..61173d8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-block.html
@@ -0,0 +1,22 @@
+<!-- Based on fast/repaint/multicol-with-block.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    onload = runPaintInvalidationTest;
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow DIV id='target'",
+        "LayoutText #text",
+        "InlineTextBox 'PASS'",
+    ];
+    function paintInvalidationTest() {
+        var target = document.getElementById('target');
+        target.style.visibility = 'visible';
+    }
+</script>
+<div style="-webkit-columns:4; -webkit-column-gap:10px; column-fill:auto; width:630px; height:20px; color:green;">
+    <br>
+    <br>
+    <br>
+    <div id="target" style="visibility:hidden;">PASS</div>
+</div>
+<p>A green PASS should be seen above.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-inline-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-inline-expected.html
new file mode 100644
index 0000000..271ca1d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-inline-expected.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<div style="-webkit-columns:4; -webkit-column-gap:10px; column-fill:auto; width:630px; height:20px; color:green;">
+    <br>
+    <br>
+    <br>
+    <span id="target">PASS</span>
+</div>
+<p>A green PASS should be seen above.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-inline.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-inline.html
new file mode 100644
index 0000000..10297f8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-inline.html
@@ -0,0 +1,22 @@
+<!-- Based on fast/repaint/multicol-with-inline.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    onload = runPaintInvalidationTest;
+    window.expectedPaintInvalidationObjects = [
+        "LayoutInline SPAN id='target'",
+        "LayoutText #text",
+        "InlineTextBox 'PASS'",
+    ];
+    function paintInvalidationTest() {
+        var target = document.getElementById('target');
+        target.style.visibility = 'visible';
+    }
+</script>
+<div style="-webkit-columns:4; -webkit-column-gap:10px; column-fill:auto; width:630px; height:20px; color:green;">
+    <br>
+    <br>
+    <br>
+    <span id="target" style="visibility:hidden;">PASS</span>
+</div>
+<p>A green PASS should be seen above.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-overflowing-block-bt-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-overflowing-block-bt-expected.html
new file mode 100644
index 0000000..7ee8d70
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-overflowing-block-bt-expected.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<div id="container" style="-webkit-columns:3; -webkit-column-gap:0; column-fill:auto; width:500px; height:500px; -webkit-writing-mode:horizontal-bt;">
+    <div style="height:100px;">
+        <div id="elm" style="height:1500px; background:green;"></div>
+    </div>
+</div>
+<p>Test changing the background color of a big block that overflows the flow thread.</p>
+<p>A green square should be seen above.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-overflowing-block-bt.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-overflowing-block-bt.html
new file mode 100644
index 0000000..d3bc6a4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-overflowing-block-bt.html
@@ -0,0 +1,19 @@
+<!-- Based on fast/repaint/multicol-with-overflowing-block-bt.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    onload = runPaintInvalidationTest;
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow DIV id='elm'",
+    ];
+    function paintInvalidationTest() {
+        document.getElementById('elm').style.background = 'green';
+    }
+</script>
+<div id="container" style="-webkit-columns:3; -webkit-column-gap:0; column-fill:auto; width:500px; height:500px; -webkit-writing-mode:horizontal-bt;">
+    <div style="height:100px;">
+        <div id="elm" style="height:1500px; background:yellow;"></div>
+    </div>
+</div>
+<p>Test changing the background color of a big block that overflows the flow thread.</p>
+<p>A green square should be seen above.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-overflowing-block-rl-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-overflowing-block-rl-expected.html
new file mode 100644
index 0000000..4aa323f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-overflowing-block-rl-expected.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<div id="container" style="-webkit-columns:3; -webkit-column-gap:0; column-fill:auto; width:500px; height:500px; -webkit-writing-mode:vertical-rl;">
+    <div style="width:100px;">
+        <div id="elm" style="width:1500px; background:green;"></div>
+    </div>
+</div>
+<p>Test changing the background color of a big block that overflows the flow thread.</p>
+<p>A green square should be seen above.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-overflowing-block-rl.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-overflowing-block-rl.html
new file mode 100644
index 0000000..ad442f8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-overflowing-block-rl.html
@@ -0,0 +1,19 @@
+<!-- Based on fast/repaint/multicol-with-overflowing-block-rl.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    onload = runPaintInvalidationTest;
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow DIV id='elm'",
+    ];
+    function paintInvalidationTest() {
+        document.getElementById('elm').style.background = 'green';
+    }
+</script>
+<div id="container" style="-webkit-columns:3; -webkit-column-gap:0; column-fill:auto; width:500px; height:500px; -webkit-writing-mode:vertical-rl;">
+    <div style="width:100px;">
+        <div id="elm" style="width:1500px; background:yellow;"></div>
+    </div>
+</div>
+<p>Test changing the background color of a big block that overflows the flow thread.</p>
+<p>A green square should be seen above.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-relpos-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-relpos-expected.html
new file mode 100644
index 0000000..e31da10
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-relpos-expected.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<div style="-webkit-columns:4; -webkit-column-gap:10px; column-fill:auto; width:630px; height:40px; color:green;">
+    <br>
+    <br>
+    <br>
+    <br>
+    <br>
+    <br>
+    <div id="target" style="position:relative; left:20px; top:20px; height:20px; background:green;"></div>
+</div>
+<p>A green rectangle should be seen above.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-relpos.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-relpos.html
new file mode 100644
index 0000000..05a1492
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-relpos.html
@@ -0,0 +1,23 @@
+<!-- Based on fast/repaint/multicol-with-relpos.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    onload = runPaintInvalidationTest;
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow (relative positioned) DIV id='target'",
+    ];
+    function paintInvalidationTest() {
+        var target = document.getElementById('target');
+        target.style.visibility = 'visible';
+    }
+</script>
+<div style="-webkit-columns:4; -webkit-column-gap:10px; column-fill:auto; width:630px; height:40px; color:green;">
+    <br>
+    <br>
+    <br>
+    <br>
+    <br>
+    <br>
+    <div id="target" style="position:relative; left:20px; top:20px; height:20px; visibility:hidden; background:green;"></div>
+</div>
+<p>A green rectangle should be seen above.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-text-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-text-expected.html
new file mode 100644
index 0000000..6445b19
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-text-expected.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<div id="mc" style="-webkit-columns:4; -webkit-column-gap:10px; column-fill:auto; width:630px; height:20px; color:green;">
+    <br>
+    <br>
+    <br>
+    PASS
+</div>
+<p>A green PASS should be seen above.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-text.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-text.html
new file mode 100644
index 0000000..5ceea203
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/multicol-with-text.html
@@ -0,0 +1,27 @@
+<!-- Based on fast/repaint/multicol-with-text.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    onload = runPaintInvalidationTest;
+    window.expectedPaintInvalidationObjects = [
+        "RootInlineBox",
+        "RootInlineBox",
+        "RootInlineBox",
+        "InlineTextBox '\n'",
+        "InlineTextBox '\n'",
+        "InlineTextBox '\n'",
+        "LayoutMultiColumnFlowThread (anonymous)",
+        "LayoutText #text",
+        "InlineTextBox 'PASS'",
+    ];
+    function paintInvalidationTest() {
+        var mc = document.getElementById('mc');
+        mc.appendChild(document.createTextNode('PASS'));
+    }
+</script>
+<div id="mc" style="-webkit-columns:4; -webkit-column-gap:10px; column-fill:auto; width:630px; height:20px; color:green;">
+    <br>
+    <br>
+    <br>
+</div>
+<p>A green PASS should be seen above.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/negative-shadow-box-expand-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/negative-shadow-box-expand-expected.html
new file mode 100644
index 0000000..3d14147
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/negative-shadow-box-expand-expected.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<body style="margin: 100px">
+    <div id="outer" style="box-shadow: 40px -40px #F00;">
+        <div id="inner1" style="height: 100px; background-color: blue"></div>
+        <div id="inner2" style="height: 100px; background-color: green"></div>
+    </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/negative-shadow-box-expand.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/negative-shadow-box-expand.html
new file mode 100644
index 0000000..1d5bc40
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/negative-shadow-box-expand.html
@@ -0,0 +1,19 @@
+<!-- Based on fast/box-shadow/negative-shadow-box-expand.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow DIV id='outer'",
+        "LayoutBlockFlow DIV id='inner2'",
+    ];
+    function paintInvalidationTest()
+    {
+        document.getElementById('inner2').style.display = 'block';
+    }
+</script>
+<body style="margin: 100px" onload="runPaintInvalidationTest()">
+    <div id="outer" style="box-shadow: 40px -40px #F00;">
+        <div id="inner1" style="height: 100px; background-color: blue"></div>
+        <div id="inner2" style="display: none; height: 100px; background-color: green"></div>
+    </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/negative-shadow-box-shrink-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/negative-shadow-box-shrink-expected.html
new file mode 100644
index 0000000..4c1bf32
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/negative-shadow-box-shrink-expected.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<body style="margin: 100px">
+    <div id="outer" style="box-shadow: 40px -40px #F00;">
+        <div id="inner1" style="height: 100px; background-color: blue"></div>
+    </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/negative-shadow-box-shrink.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/negative-shadow-box-shrink.html
new file mode 100644
index 0000000..f50de19
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/negative-shadow-box-shrink.html
@@ -0,0 +1,19 @@
+<!-- Based on fast/box-shadow/negative-shadow-box-shrink.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow DIV id='inner2'",
+        "LayoutBlockFlow DIV id='outer'",
+    ];
+    function paintInvalidationTest()
+    {
+        document.getElementById('inner2').style.display = 'none';
+    }
+</script>
+<body style="margin: 100px" onload="runPaintInvalidationTest()">
+    <div id="outer" style="box-shadow: 40px -40px #F00;">
+        <div id="inner1" style="height: 100px; background-color: blue"></div>
+        <div id="inner2" style="height: 100px; background-color: green"></div>
+    </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/negative-text-indent-with-overflow-hidden-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/negative-text-indent-with-overflow-hidden-expected.html
new file mode 100644
index 0000000..36a4026e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/negative-text-indent-with-overflow-hidden-expected.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <style>
+    .container {
+        position: absolute;
+        left: 550px;
+        height: 200px;
+        width: 200px;
+        background-color: silver;
+    }
+    #target {
+        text-indent: -300px;
+        width: 200px;
+        height: 50px;
+        overflow: hidden;
+        background-color: blue;
+    }
+    </style>
+</head>
+<body">
+    <div class="container">
+        <div id="target"></div>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/negative-text-indent-with-overflow-hidden.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/negative-text-indent-with-overflow-hidden.html
new file mode 100644
index 0000000..065df93
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/negative-text-indent-with-overflow-hidden.html
@@ -0,0 +1,40 @@
+<!-- Based on fast/repaint/negative-text-indent-with-overflow-hidden.html -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <style>
+    .container {
+        position: absolute;
+        left: 550px;
+        height: 200px;
+        width: 200px;
+        background-color: silver;
+    }
+    #target {
+        text-indent: -300px;
+        width: 200px;
+        height: 50px;
+        overflow: hidden;
+        background-color: green;
+    }
+
+    #target.changed, #target:hover {
+        background-color: blue;
+    }
+    </style>
+    <script src="resources/paint-invalidation-test.js"></script>
+    <script>
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow DIV id='target' class='changed'",
+    ];
+    function paintInvalidationTest() {
+        document.getElementById('target').classList.add('changed');
+    }
+    </script>
+</head>
+<body onload="runPaintInvalidationTest();">
+    <div class="container">
+        <div id="target">Hidden Text</div>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/nested-fixed-iframe-scrolled-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/nested-fixed-iframe-scrolled-expected.html
new file mode 100644
index 0000000..0d266d3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/nested-fixed-iframe-scrolled-expected.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<script>
+onload = function() {
+  window.scrollTo(0, 400);
+};
+</script>
+<body style="height: 2000px">
+  Tests paint invalidation of contents of fixed-position iframe in another iframe after main frame is scrolled.
+  Passes if there is a 100x100 green rectangle and no red in the inner-most iframe.
+  <iframe style="position: absolute; top: 500px; left: 0" srcdoc="
+    <iframe style='position: fixed; top: 10px; left: 10px; width: 150px; height: 150px'
+      srcdoc='<div id=&quot;div&quot; style=&quot;width: 100px; height: 100px; background-color: green&quot;></div>'></iframe>">
+  </iframe>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/nested-fixed-iframe-scrolled.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/nested-fixed-iframe-scrolled.html
new file mode 100644
index 0000000..2094425
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/nested-fixed-iframe-scrolled.html
@@ -0,0 +1,23 @@
+<!-- Based on fast/repaint/nested-fixed-iframe-scrolled.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV id='div'",
+];
+function paintInvalidationTest() {
+  frames[0].frames[0].document.getElementById('div').style.backgroundColor = 'green';
+}
+onload = function() {
+  window.scrollTo(0, 400);
+  runPaintInvalidationTest();
+};
+</script>
+<body style="height: 2000px">
+  Tests paint invalidation of contents of fixed-position iframe in another iframe after main frame is scrolled.
+  Passes if there is a 100x100 green rectangle and no red in the inner-most iframe.
+  <iframe style="position: absolute; top: 500px; left: 0" srcdoc="
+    <iframe style='position: fixed; top: 10px; left: 10px; width: 150px; height: 150px'
+      srcdoc='<div id=&quot;div&quot; style=&quot;width: 100px; height: 100px; background-color: red&quot;></div>'></iframe>">
+  </iframe>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/no-caret-repaint-in-non-content-editable-element-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/no-caret-repaint-in-non-content-editable-element-expected.html
new file mode 100644
index 0000000..4c73cce
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/no-caret-repaint-in-non-content-editable-element-expected.html
@@ -0,0 +1,6 @@
+<html>
+<body>
+    <p>This tests that clicking on a non-content editable element does not cause a repaint of it in whole or in part.</p>
+    <p id="target">This element is not content editable.</p>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/no-caret-repaint-in-non-content-editable-element.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/no-caret-repaint-in-non-content-editable-element.html
new file mode 100644
index 0000000..a3429f6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/no-caret-repaint-in-non-content-editable-element.html
@@ -0,0 +1,32 @@
+<!-- Based on fast/repaint/no-caret-repaint-in-non-content-editable-element.html -->
+<html>
+<head>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+if (window.testRunner) {
+    // By definition, when caret browsing is enabled we always paint the caret.
+    // So, this test is only applicable when caret browsing is disabled because
+    // non-content-editable elements won't cause the caret to be drawn since they
+    // are not editable.
+    testRunner.overridePreference("WebKitEnableCaretBrowsing", false);
+}
+window.expectedPaintInvalidationObjects = [
+];
+function paintInvalidationTest()
+{
+    if (!window.eventSender)
+        return;
+
+    var target = document.getElementById("target");
+    eventSender.mouseMoveTo(target.offsetLeft, target.offsetTop);
+    eventSender.mouseDown();
+    eventSender.mouseUp();
+}
+window.onload = runPaintInvalidationTest;
+</script>
+</head>
+<body>
+    <p>This tests that clicking on a non-content editable element does not cause a repaint of it in whole or in part.</p>
+    <p id="target">This element is not content editable.</p>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/obscured-background-no-repaint-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/obscured-background-no-repaint-expected.txt
new file mode 100644
index 0000000..c0f53d7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/obscured-background-no-repaint-expected.txt
@@ -0,0 +1,3 @@
+
+ 
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/obscured-background-no-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/obscured-background-no-repaint.html
new file mode 100644
index 0000000..4b18cfb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/obscured-background-no-repaint.html
@@ -0,0 +1,99 @@
+<!-- Based on fast/repaint/obscured-background-no-repaint.html -->
+<html>
+<head>
+<script src="../../../fast/repaint/../../resources/run-after-layout-and-paint.js"></script>
+<script src="resources/paint-invalidation-test.js"></script>
+<style type="text/css">
+    #test1 div {
+        height: 100px;
+        width: 100px;
+    }
+    #test1 .parent {
+        background-image: url(../../../fast/repaint/resources/animated.gif)
+    }
+    #test1 .child {
+        background-color: green;
+    }
+
+    #test2 .parent {
+        position: relative;
+        height: 100px;
+        width: 100px;
+        background-image: url(../../../fast/repaint/resources/animated.gif);
+        background-repeat: no-repeat;
+        background-position: center;
+    }
+
+    #test2 .child {
+        background-color: green;
+        position: relative;
+        left: 25px;
+        top: 25px;
+        height: 50px;
+        width: 50px;
+    }
+    #test3 img {
+        background-image: url(../../../fast/repaint/resources/animated.gif)
+    }
+    #test4 .parent {
+        position: relative;
+        height: 100px;
+        width: 100px;
+        background-color: red;
+        background-repeat: no-repeat;
+        background-position: center;
+        background-image: url(../../../fast/repaint/resources/animated.gif)
+    }
+</style>
+<script>
+    // Test that obscured animated gif does not trigger repaints.
+    if (window.testRunner) {
+        testRunner.waitUntilDone();
+        testRunner.dumpAsText();
+    }
+    window.testIsAsync = true;
+    window.expectedPaintInvalidationObjects = [
+    ];
+    function paintInvalidationTest()
+    {
+        runAfterLayoutAndPaint(finishPaintInvalidationTest);
+    }
+
+    function start() {
+        if (!window.testRunner || !window.internals)
+            return;
+
+        var img = new Image();
+        img.onload = runPaintInvalidationTest;
+        img.src = "../../../fast/repaint/resources/animated.gif";
+    }
+</script>
+</head>
+<body onload="start()">
+<div id="test1">
+    <div class="parent">
+        <div class="child">
+        </div>
+    </div>
+</div>
+<div id="test2">
+    <div class="parent">
+        <div class="child">
+        </div>
+    </div>
+</div>
+<div id="test3">
+    <img src="../../../fast/repaint/resources/apple.jpg">
+</div>
+<div id="test4">
+    <div class="parent">
+        <a>
+            <div></div>
+            <div>
+                <img src="../../../fast/repaint/resources/apple.jpg">
+            </div>
+        </a>
+    </div>
+</div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/outline-change-offset-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/outline-change-offset-expected.html
new file mode 100644
index 0000000..88954c2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/outline-change-offset-expected.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<style>
+div {
+  position: absolute;
+  top: 50px;
+  left: 50px;
+  width: 100px;
+  height: 100px;
+  outline: green solid 5px;
+  outline-offset: 10px;
+}
+
+</style>
+
+Box should be repainted when outline-offset style changes. Passes if no red.
+<div id="target"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/outline-change-offset.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/outline-change-offset.html
new file mode 100644
index 0000000..65269cf
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/outline-change-offset.html
@@ -0,0 +1,37 @@
+<!-- Based on fast/repaint/outline-change-offset.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='indicator'",
+    "LayoutBlockFlow (positioned) DIV id='target'",
+];
+function paintInvalidationTest() {
+  document.getElementById('target').style.outlineOffset = '10px';
+}
+onload = runPaintInvalidationTest;
+</script>
+
+<style>
+div {
+  position: absolute;
+  top: 50px;
+  left: 50px;
+  width: 100px;
+  height: 100px;
+}
+
+#target {
+  outline: green solid 5px;
+  outline-offset: 5px;
+}
+
+#indicator {
+  outline: red solid 5px;
+  outline-offset: 10px;
+}
+</style>
+
+Box should be repainted when outline-offset style changes. Passes if no red.
+<div id="indicator"></div>
+<div id="target"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/outline-child-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/outline-child-repaint-expected.html
new file mode 100644
index 0000000..68657e0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/outline-child-repaint-expected.html
@@ -0,0 +1,31 @@
+<html>
+<head>
+    <style type="text/css" media="screen">
+      #container {
+        position: absolute;
+        left: 10px;
+        top: 250px;
+        width: 200px;
+        height: 50px;
+      }
+      .outlined {
+        outline: 10px solid green;
+        height: 30px;
+        background-color: #DDD;
+      }
+    </style>
+</head>
+<body">
+    <p>
+        This is a repaint test for <i><a href="https://bugs.webkit.org/show_bug.cgi?id=22159">https://bugs.webkit.org/show_bug.cgi?id=22159</a>
+        Repaint issue with outlines in child objects</i>.
+    </p>
+    <p>If the test passes, you should not see any red below</p>
+    <hr>
+
+    <div id="container">
+      <div class="outlined">
+      </div>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/outline-child-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/outline-child-repaint.html
new file mode 100644
index 0000000..b91f597
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/outline-child-repaint.html
@@ -0,0 +1,55 @@
+<!-- Based on fast/repaint/outline-child-repaint.html -->
+<html>
+<head>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (positioned) DIV id='container'",
+            "LayoutBlockFlow DIV class='outlined'",
+        ];
+        function paintInvalidationTest()
+        {
+            var container = document.getElementById('container');
+            container.style.top = "250px";
+        }
+    </script>
+    <style type="text/css" media="screen">
+      #container {
+        position: absolute;
+        left: 10px;
+        top: 150px;
+        width: 200px;
+        height: 50px;
+      }
+      .outlined {
+        outline: 10px solid green;
+        height: 30px;
+        background-color: #DDD;
+      }
+
+      #underlay {
+        position: absolute;
+        top: 240px;
+        left: 0px;
+        width: 200px;
+        height: 30px;
+        border: 10px solid red;
+      }
+    </style>
+</head>
+<body onload="runPaintInvalidationTest();">
+    <p>
+        This is a repaint test for <i><a href="https://bugs.webkit.org/show_bug.cgi?id=22159">https://bugs.webkit.org/show_bug.cgi?id=22159</a>
+        Repaint issue with outlines in child objects</i>.
+    </p>
+    <p>If the test passes, you should not see any red below</p>
+    <hr>
+
+    <div id="underlay">
+    </div>
+    <div id="container">
+      <div class="outlined">
+      </div>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-clip-subtree-layout-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-clip-subtree-layout-expected.html
new file mode 100644
index 0000000..111d1ac
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-clip-subtree-layout-expected.html
@@ -0,0 +1,10 @@
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=15015 rdar://problem/5420308</title>
+</head>
+<body>
+    <div style="width: 400px; height: 400px; border: solid;">
+        <div id="float" style="float: left; width: 200px; height: 200px; overflow: hidden;">
+            <div></div>
+        </div>
+    </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-clip-subtree-layout.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-clip-subtree-layout.html
new file mode 100644
index 0000000..70388c2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-clip-subtree-layout.html
@@ -0,0 +1,20 @@
+<!-- Based on fast/repaint/overflow-clip-subtree-layout.html -->
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=15015 rdar://problem/5420308</title>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script>
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow DIV",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById("float").appendChild(document.createElement("div"));
+        }
+    </script>
+</head>
+<body onload="runPaintInvalidationTest()">
+    <div style="width: 400px; height: 400px; border: solid;">
+        <div id="float" style="float: left; width: 200px; height: 200px; overflow: hidden;">
+        </div>
+    </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-flipped-writing-mode-block-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-flipped-writing-mode-block-expected.html
new file mode 100644
index 0000000..f9c3deb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-flipped-writing-mode-block-expected.html
@@ -0,0 +1,5 @@
+<div style="height: 100px; width: 100px; -webkit-writing-mode: horizontal-bt;">
+    <div style="height: 25px;">
+        <div style="height: 100px; background-color: green;"></div>
+    </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-flipped-writing-mode-block.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-flipped-writing-mode-block.html
new file mode 100644
index 0000000..242f848
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-flipped-writing-mode-block.html
@@ -0,0 +1,19 @@
+<!-- Based on fast/repaint/overflow-flipped-writing-mode-block.html -->
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    onload = runPaintInvalidationTest;
+
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow DIV id='target'",
+    ];
+    function paintInvalidationTest()
+    {
+        document.getElementById("target").style.visibility = "hidden";
+    }
+</script>
+<div style="height: 100px; width: 100px; background-color: red; -webkit-writing-mode: horizontal-bt;">
+    <div style="height: 25px;">
+        <div style="height: 100px; background-color: green;"></div>
+    </div>
+</div>
+<div id="target" style="height: 50px; width: 100px; background-color: red; margin-top: -100px;"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-flipped-writing-mode-table-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-flipped-writing-mode-table-expected.html
new file mode 100644
index 0000000..3df7bd5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-flipped-writing-mode-table-expected.html
@@ -0,0 +1,7 @@
+<div style="height: 100px; width: 100px; -webkit-writing-mode: horizontal-bt;">
+    <div style="display: table; width: 100px;">
+        <div style="height: 25px;">
+            <div style="height: 100px; background-color: green;"></div>
+        </div>
+    </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-flipped-writing-mode-table.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-flipped-writing-mode-table.html
new file mode 100644
index 0000000..8da7625
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-flipped-writing-mode-table.html
@@ -0,0 +1,21 @@
+<!-- Based on fast/repaint/overflow-flipped-writing-mode-table.html -->
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    onload = runPaintInvalidationTest;
+
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow DIV id='target'",
+    ];
+    function paintInvalidationTest()
+    {
+        document.getElementById("target").style.visibility = "hidden";
+    }
+</script>
+<div style="height: 100px; width: 100px; background-color: red; -webkit-writing-mode: horizontal-bt;">
+    <div style="display: table; width: 100px;">
+        <div style="height: 25px;">
+            <div style="height: 100px; background-color: green;"></div>
+        </div>
+    </div>
+</div>
+<div id="target" style="height: 50px; width: 100px; background-color: red; margin-top: -100px;"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-hidden-in-overflow-hidden-scrolled-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-hidden-in-overflow-hidden-scrolled-expected.html
new file mode 100644
index 0000000..e8339bb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-hidden-in-overflow-hidden-scrolled-expected.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <style>
+        #outer {
+            position: relative;
+            overflow: hidden;
+            height: 200px;
+        }
+
+        section {
+            padding: 192px 0 0 0;
+            width: 200px;
+        }
+
+        div {
+            height: 190px;
+        }
+
+        .innerWrapper {
+            overflow: hidden;
+        }
+
+        .red {
+            background-color: red;
+        }
+
+        .green {
+            background-color: green;
+        }
+    </style>
+    <script>
+        function runTest()
+        {
+            document.getElementById("outer").scrollTop = 1000;
+        }
+    </script>
+</head>
+<body onload="runTest()">
+    <!-- Bug 71550 - REGRESSION (r93614): Content remains despite parent element being scrolled off page using javascript. -->
+    <!-- For the test to pass you should not see any RED, only green -->
+    <div id="outer">
+        <section>
+            <div class="innerWrapper">
+                <div id="ucp" class="green"></div>
+            </div>
+        </section>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-hidden-in-overflow-hidden-scrolled.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-hidden-in-overflow-hidden-scrolled.html
new file mode 100644
index 0000000..3db0aef
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-hidden-in-overflow-hidden-scrolled.html
@@ -0,0 +1,65 @@
+<!-- Based on fast/repaint/overflow-hidden-in-overflow-hidden-scrolled.html -->
+<!DOCTYPE html>
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <style>
+        #outer {
+            position: relative;
+            overflow: hidden;
+            height: 200px;
+        }
+
+        section {
+            padding: 192px 0 0 0;
+            width: 200px;
+        }
+
+        div {
+            height: 190px;
+        }
+
+        .innerWrapper {
+            overflow: hidden;
+        }
+
+        .red {
+            background-color: red;
+        }
+
+        .green {
+            background-color: green;
+        }
+    </style>
+    <script src="resources/paint-invalidation-test.js"></script>
+    <script>
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow DIV class='innerWrapper'",
+            "LayoutBlockFlow DIV class='red'",
+            "LayoutBlockFlow DIV id='ucp' class='green'",
+        ];
+        function paintInvalidationTest()
+        {
+            window.location.hash = "#ucp";
+        }
+
+        function runTest()
+        {
+            document.getElementById("outer").scrollTop = 1000;
+            runPaintInvalidationTest();
+        }
+    </script>
+</head>
+<body onload="runTest()">
+    <!-- Bug 71550 - REGRESSION (r93614): Content remains despite parent element being scrolled off page using javascript. -->
+    <!-- For the test to pass you should not see any RED, only green -->
+    <div id="outer">
+        <section>
+            <div class="innerWrapper">
+                <div class="red"></div>
+                <div id="ucp" class="green"></div>
+            </div>
+        </section>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-hide-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-hide-expected.html
new file mode 100644
index 0000000..85f18b7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-hide-expected.html
@@ -0,0 +1,9 @@
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+</head>
+<body style="height:2000px;">
+    <!-- You should see one green rectangle sharing one corner in the output. -->
+    <div id="overflowParent" class="absolute green"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-hide.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-hide.html
new file mode 100644
index 0000000..cd3ee9e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-hide.html
@@ -0,0 +1,21 @@
+<!-- Based on fast/repaint/overflow-hide.html -->
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (positioned) DIV id='overflowParent' class='absolute green'",
+            "LayoutBlockFlow (relative positioned) DIV class='relative red'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById('overflowParent').style.overflow = "hidden";
+        }
+    </script>
+</head>
+<body style="height:2000px;" onload="runPaintInvalidationTest()">
+    <!-- You should see one green rectangle sharing one corner in the output. -->
+    <div id="overflowParent" class="absolute green"><div style="top:100px; left:100px;" class="relative red"></div></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-into-content-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-into-content-expected.html
new file mode 100644
index 0000000..5260fd4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-into-content-expected.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=12885</title>
+    <style type="text/css">
+        div.wide { width: 100px; height: 50px; }
+        div.narrow { width: 50px; }
+        div.tall { width: 50px; height: 100px; }
+        div.short { height: 50px; width: 50px; }
+        #main-content { float: left; width: 100px; height: 80px; }
+        #target3 { display: none; clear: both; height: 20px; background: green; }
+    </style>
+</head>
+<body">
+    <div style="position: absolute; border: medium solid green; top: 8px; height: 100px;">
+        <div class="narrow" id="target1">
+            <div class="wide"></div>
+        </div>
+    </div>
+
+    <div style="position: absolute; border: medium solid green; top: 158px; width: 100px;">
+        <div class="short" id="target2">
+            <div class="tall"></div>
+        </div>
+    </div>
+
+    <div style="position: absolute; top: 308px;">
+        <div style="background: green;">
+            <div style="position: relative;">
+                <div id="main-content">
+                </div>
+            </div>
+            <div id="target3"></div>
+        </div>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-into-content.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-into-content.html
new file mode 100644
index 0000000..8123887
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-into-content.html
@@ -0,0 +1,53 @@
+<!-- Based on fast/repaint/overflow-into-content.html -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=12885</title>
+    <style type="text/css">
+        div.wide { width: 100px; height: 50px; }
+        div.narrow { width: 50px; }
+        div.tall { width: 50px; height: 100px; }
+        div.short { height: 50px; width: 50px; }
+        #main-content { float: left; width: 100px; height: 80px; }
+        #target3 { display: none; clear: both; height: 20px; background: green; }
+    </style>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script>
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow DIV id='target3'",
+            "LayoutBlockFlow (positioned) DIV",
+            "LayoutBlockFlow (positioned) DIV",
+            "LayoutBlockFlow DIV",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById('target1').style.width = '';
+            document.getElementById('target2').style.height = '';
+            document.getElementById('target3').style.display = '';
+        }
+    </script>
+</head>
+<body onload="runPaintInvalidationTest();">
+    <div style="position: absolute; border: medium solid green; top: 8px; height: 100px;">
+        <div class="narrow" id="target1" style="width: auto;">
+            <div class="wide"></div>
+        </div>
+    </div>
+
+    <div style="position: absolute; border: medium solid green; top: 158px; width: 100px;">
+        <div class="short" id="target2" style="height: auto;">
+            <div class="tall"></div>
+        </div>
+    </div>
+
+    <div style="position: absolute; top: 308px;">
+        <div style="background: green;">
+            <div style="position: relative;">
+                <div id="main-content">
+                </div>
+            </div>
+            <div id="target3" style="display: block;"></div>
+        </div>
+    </div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-show-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-show-expected.html
new file mode 100644
index 0000000..09878ba
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-show-expected.html
@@ -0,0 +1,9 @@
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+</head>
+<body style="height:2000px;">
+    <!-- You should see 2 green rectangle sharing one corner in the output. -->
+    <div id="overflowParent" class="absolute green"><div style="top:100px; left:100px;" class="relative green"></div></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-show.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-show.html
new file mode 100644
index 0000000..0da3f70f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/overflow-show.html
@@ -0,0 +1,21 @@
+<!-- Based on fast/repaint/overflow-show.html -->
+<html>
+<head>
+    <link rel="stylesheet" href="../../../fast/repaint/resources/default.css">
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (positioned) DIV id='overflowParent' class='absolute green'",
+            "LayoutBlockFlow (relative positioned) DIV class='relative green'",
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById('overflowParent').style.overflow = "visible";
+        }
+    </script>
+</head>
+<body style="height:2000px;" onload="runPaintInvalidationTest()">
+    <!-- You should see 2 green rectangle sharing one corner in the output. -->
+    <div id="overflowParent" style="overflow: hidden" class="absolute green"><div style="top:100px; left:100px;" class="relative green"></div></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/padding-border-keeping-border-box-and-content-box-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/padding-border-keeping-border-box-and-content-box-expected.html
new file mode 100644
index 0000000..07c9f9b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/padding-border-keeping-border-box-and-content-box-expected.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<style>
+body {
+    margin: 0;
+}
+div {
+    width: 100px;
+    height: 100px;
+    padding: 20px;
+    position: absolute;
+    background-color: green;
+    border-color: blue;
+    border-style: solid;
+    border-width: 20px;
+}
+</style>
+<div id="target"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/padding-border-keeping-border-box-and-content-box.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/padding-border-keeping-border-box-and-content-box.html
new file mode 100644
index 0000000..fbb03b8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/padding-border-keeping-border-box-and-content-box.html
@@ -0,0 +1,33 @@
+<!-- Based on fast/repaint/padding-border-keeping-border-box-and-content-box.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='target'",
+];
+function paintInvalidationTest()
+{
+    // Though neither border box nor content box changes, should full repaint
+    // because the border width changes.
+    var target = document.getElementById('target');
+    target.style.padding = '20px';
+    target.style.borderWidth = '20px'; 
+}
+window.onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+    margin: 0;
+}
+div {
+    width: 100px;
+    height: 100px;
+    padding: 40px;
+    position: absolute;
+    background-color: green;
+    border-color: blue;
+    border-style: solid;
+    border-width: 0;
+}
+</style>
+<div id="target"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/padding-keeping-content-size-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/padding-keeping-content-size-expected.html
new file mode 100644
index 0000000..6511a7d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/padding-keeping-content-size-expected.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<style>
+body {
+    margin: 0;
+}
+.outer {
+    width: 100px;
+    height: 100px;
+    position: absolute;
+    background-color: green;
+    padding: 20px;
+}
+#target2 {
+    top: 200px;
+}
+.inner {
+    width: 100%;
+    height: 100%;
+    background-color: yellow;
+}
+</style>
+<div id="target1" class="outer"></div>
+<div id="target2" class="outer"><div class="inner"></div></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/padding-keeping-content-size.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/padding-keeping-content-size.html
new file mode 100644
index 0000000..c4c1365
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/padding-keeping-content-size.html
@@ -0,0 +1,38 @@
+<!-- Based on fast/repaint/padding-keeping-content-size.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='target1' class='outer'",
+    "LayoutBlockFlow (positioned) DIV id='target2' class='outer'",
+    "LayoutBlockFlow DIV class='inner'",
+];
+function paintInvalidationTest()
+{
+    // Both targets' visual size expand. Should full repaint.
+    document.getElementById('target1').style.padding = '20px';
+    document.getElementById('target2').style.padding = '20px';
+}
+window.onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+    margin: 0;
+}
+.outer {
+    width: 100px;
+    height: 100px;
+    position: absolute;
+    background-color: green;
+}
+#target2 {
+    top: 200px;
+}
+.inner {
+    width: 100%;
+    height: 100%;
+    background-color: yellow;
+}
+</style>
+<div id="target1" class="outer"></div>
+<div id="target2" class="outer"><div class="inner"></div></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/padding-keeping-visual-size-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/padding-keeping-visual-size-expected.html
new file mode 100644
index 0000000..e130d53
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/padding-keeping-visual-size-expected.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<style>
+body {
+    margin: 0;
+}
+.outer {
+    padding: 20px;
+    width: 60px;
+    height: 60px;
+    position: absolute;
+    background-color: green;
+}
+#target2 {
+    top: 200px;
+}
+.inner {
+    width: 100%;
+    height: 100%;
+    background-color: yellow;
+}
+</style>
+<div id="target1" class="outer"></div>
+<div id="target2" class="outer"><div class="inner"></div></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/padding-keeping-visual-size.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/padding-keeping-visual-size.html
new file mode 100644
index 0000000..2fabbbf
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/padding-keeping-visual-size.html
@@ -0,0 +1,45 @@
+<!-- Based on fast/repaint/padding-keeping-visual-size.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='target2' class='outer'",
+    "LayoutBlockFlow DIV class='inner'",
+];
+function paintInvalidationTest()
+{
+    // No visual change. Optimally, there should be no repaint.
+    var target1 = document.getElementById('target1');
+    target1.style.padding = '20px';
+    target1.style.width = '60px';
+    target1.style.height = '60px';
+
+    // Content will shrink. Should repaint at least the content.
+    var target2 = document.getElementById('target2');
+    target2.style.padding = '20px';
+    target2.style.width = '60px';
+    target2.style.height = '60px';
+}
+window.onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+    margin: 0;
+}
+.outer {
+    width: 100px;
+    height: 100px;
+    position: absolute;
+    background-color: green;
+}
+#target2 {
+    top: 200px;
+}
+.inner {
+    width: 100%;
+    height: 100%;
+    background-color: yellow;
+}
+</style>
+<div id="target1" class="outer"></div>
+<div id="target2" class="outer"><div class="inner"></div></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/paged-with-overflowing-block-rl-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/paged-with-overflowing-block-rl-expected.html
new file mode 100644
index 0000000..effdeca
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/paged-with-overflowing-block-rl-expected.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<div id="container" style="overflow:-webkit-paged-x; -webkit-column-gap:0; width:500px; height:500px; -webkit-writing-mode:vertical-rl;">
+    <div style="width:100px;">
+        <div id="elm" style="width:1000px; background:green;"></div>
+    </div>
+</div>
+<script>
+        document.getElementById("container").scrollLeft = 0;
+</script>
+<p>Test changing the background color of a big block that overflows the flow thread.</p>
+<p>A green square with a horizontal scrollbar should be seen above.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/paged-with-overflowing-block-rl.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/paged-with-overflowing-block-rl.html
new file mode 100644
index 0000000..d640ad7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/paged-with-overflowing-block-rl.html
@@ -0,0 +1,22 @@
+<!-- Based on fast/repaint/paged-with-overflowing-block-rl.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    onload = runPaintInvalidationTest;
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow DIV id='elm'",
+    ];
+    function paintInvalidationTest() {
+        document.getElementById('elm').style.background = 'green';
+    }
+</script>
+<div id="container" style="overflow:-webkit-paged-x; -webkit-column-gap:0; width:500px; height:500px; -webkit-writing-mode:vertical-rl;">
+    <div style="width:100px;">
+        <div id="elm" style="width:1000px; background:yellow;"></div>
+    </div>
+</div>
+<script>
+        document.getElementById("container").scrollLeft = 0;
+</script>
+<p>Test changing the background color of a big block that overflows the flow thread.</p>
+<p>A green square with a horizontal scrollbar should be seen above.</p>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/paint-caret-in-div-with-negative-indent-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/paint-caret-in-div-with-negative-indent-expected.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/paint-caret-in-div-with-negative-indent-expected.txt
@@ -0,0 +1 @@
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/paint-caret-in-div-with-negative-indent.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/paint-caret-in-div-with-negative-indent.html
new file mode 100644
index 0000000..0f91386
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/paint-caret-in-div-with-negative-indent.html
@@ -0,0 +1,32 @@
+<!-- Based on fast/repaint/paint-caret-in-div-with-negative-indent.html -->
+<!DOCTYPE html>
+<html>
+  <head>
+    <style>
+      #editable {
+        font: 20px/1 Ahem;
+        width: 50px;
+        height: 1em;
+        margin-left: 500px;
+        margin-top: 200px;
+        background: green;
+        text-indent: -150px;
+        outline: none;
+      }
+    </style>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script type="text/javascript">
+    if (window.testRunner)
+        testRunner.dumpAsTextWithPixelResults();
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow DIV id='editable'",
+    ];
+    function paintInvalidationTest() {
+        document.getElementById('editable').focus();
+    }
+    </script>
+</head>
+<body onload="runPaintInvalidationTest();">
+    <div id="editable" contenteditable="true"></div>
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/paint-invalidation-with-opacity-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/paint-invalidation-with-opacity-expected.html
new file mode 100644
index 0000000..af02371
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/paint-invalidation-with-opacity-expected.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div id="target" style="width: 100px; height: 100px; background: lightblue; opacity: 0.5"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/paint-invalidation-with-opacity.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/paint-invalidation-with-opacity.html
new file mode 100644
index 0000000..9d7abcf
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/paint-invalidation-with-opacity.html
@@ -0,0 +1,13 @@
+<!-- Based on fast/repaint/paint-invalidation-with-opacity.html -->
+<!DOCTYPE html>
+<div id="target" style="width: 100px; height: 100px; background: lightblue"></div>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV id='target'",
+];
+function paintInvalidationTest() {
+    document.getElementById('target').style.opacity = 0.5;
+}
+runPaintInvalidationTest();
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/percent-size-image-resize-container-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/percent-size-image-resize-container-expected.txt
new file mode 100644
index 0000000..2105abb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/percent-size-image-resize-container-expected.txt
@@ -0,0 +1 @@
+The percent-sized image should be fully repainted on container's resize. Passes if there is a whole apple after resize. 
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/percent-size-image-resize-container.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/percent-size-image-resize-container.html
new file mode 100644
index 0000000..2f2aaef
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/percent-size-image-resize-container.html
@@ -0,0 +1,36 @@
+<!-- Based on fast/repaint/percent-size-image-resize-container.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+if (window.testRunner)
+  testRunner.dumpAsText();
+
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV",
+    "LayoutImage (positioned) IMG",
+];
+function paintInvalidationTest() {
+  var div = document.getElementsByTagName('div')[0];
+  div.style.width = '100px';
+  div.style.height = '200px';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+div {
+  position: absolute;
+  top: 50px;
+  left: 0px;
+  width: 150px;
+  height: 150px;
+}
+img {
+  position: absolute;
+  width: 100%;
+  height: 100%;
+}
+</style>
+The percent-sized image should be fully repainted on container's resize. Passes if there is a whole apple after resize.
+<div>
+  <img src="../../../fast/repaint/resources/apple.jpg">
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/position-change-keeping-geometry-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/position-change-keeping-geometry-expected.html
new file mode 100644
index 0000000..e705749
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/position-change-keeping-geometry-expected.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<style>
+body {
+  margin: 0;
+}
+div {
+  width: 100px;
+  height: 100px;
+  top: 20px;
+  background-color: blue;
+}
+#target0 {
+  left: 20px;
+  position: relative;
+}
+#target1 {
+  left: 20px;
+  position: absolute;
+}
+#target2 {
+  left: 220px;
+  position: absolute;
+  z-index: 0;
+}
+#target3 {
+  left: 420px;
+  position: fixed;
+  z-index: 0;
+}
+</style>
+There should be no invalildations on change of position without actual change of position and size.
+<!-- target0 ensures we don't strip anonymous wrappers (and trigger a layout) when the other elements change position. -->
+<div id="target0"></div>
+<div id="target1"></div>
+<div id="target2"></div>
+<div id="target3"></div>
+<script>
+  target1.style.top = target0.offsetTop + target0.offsetHeight + 'px';
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/position-change-keeping-geometry.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/position-change-keeping-geometry.html
new file mode 100644
index 0000000..5b4c974
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/position-change-keeping-geometry.html
@@ -0,0 +1,60 @@
+<!-- Based on fast/repaint/position-change-keeping-geometry.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+function changePositionKeepingGeometry(id, newPosition) {
+  var target = document.getElementById(id);
+  var originalTop = target.offsetTop;
+  var originalLeft = target.offsetLeft;
+  target.style.position = newPosition;
+  target.style.top = originalTop + 'px';
+  target.style.left = originalLeft + 'px';
+}
+
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='target2'",
+    "LayoutBlockFlow (positioned) DIV id='target3'",
+];
+function paintInvalidationTest()
+{
+  changePositionKeepingGeometry('target1', 'absolute');
+  changePositionKeepingGeometry('target2', 'absolute');
+  changePositionKeepingGeometry('target3', 'fixed');
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin: 0;
+}
+div {
+  width: 100px;
+  height: 100px;
+  top: 20px;
+  background-color: blue;
+}
+#target0 {
+  left: 20px;
+  position: relative;
+}
+#target1 {
+  left: 20px;
+  position: relative;
+}
+#target2 {
+  left: 220px;
+  position: fixed;
+  z-index: 0;
+}
+#target3 {
+  left: 420px;
+  position: absolute;
+  z-index: 0;
+}
+</style>
+There should be no invalildations on change of position without actual change of position and size.
+<!-- target0 ensures we don't strip anonymous wrappers (and trigger a layout) when the other elements change position. -->
+<div id="target0"></div>
+<div id="target1"></div>
+<div id="target2"></div>
+<div id="target3"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/reflection-invalidation-after-display-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/reflection-invalidation-after-display-expected.html
new file mode 100644
index 0000000..f0337be
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/reflection-invalidation-after-display-expected.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<style>
+.green {
+  background-color: green;
+}
+.box {
+  width: 200px;
+  height: 200px;
+  position: absolute;
+  left: 300px;
+}
+</style>
+<!--
+    This test checks that we correctly invalidate reflection when they are removed.
+    There should be only one green box below.
+-->
+<div class="green box" id="box"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/reflection-invalidation-after-display.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/reflection-invalidation-after-display.html
new file mode 100644
index 0000000..3408414
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/reflection-invalidation-after-display.html
@@ -0,0 +1,33 @@
+<!-- Based on fast/repaint/reflection-invalidation-after-display.html -->
+<!DOCTYPE html>
+<style>
+.green {
+  background-color: green;
+}
+.box {
+  width: 200px;
+  height: 200px;
+  position: absolute;
+  left: 300px;
+}
+.reflected {
+  -webkit-box-reflect: right 50px;
+}
+</style>
+<!--
+    This test checks that we correctly invalidate reflection when they are removed.
+    There should be only one green box below.
+-->
+<div class="green reflected box" id="box"></div>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='box' class='green box'",
+    "LayoutBlockFlow (positioned) DIV id='box' class='green box'",
+];
+function paintInvalidationTest() {
+    var box = document.getElementById('box');
+    box.classList.toggle('reflected');
+}
+window.onload = runPaintInvalidationTest;
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/relative-margin-change-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/relative-margin-change-repaint-expected.html
new file mode 100644
index 0000000..4321553
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/relative-margin-change-repaint-expected.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<style>
+    body {
+        margin: 0;
+    }
+    #container {
+        position: relative;
+        top: 40px;
+        width: 200px;
+        height: 400px;
+    }
+    #test {
+        position: relative;
+        background-color: green;
+        width: 100px;
+        height: 100px;
+        margin-top: 20px;
+    }
+</style>
+<div id="container">
+    <div id="test"></div>
+</div>
+<!-- Tests the repainting of relative element when margin-top changes. -->
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/relative-margin-change-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/relative-margin-change-repaint.html
new file mode 100644
index 0000000..736e320
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/relative-margin-change-repaint.html
@@ -0,0 +1,36 @@
+<!-- Based on fast/repaint/relative-margin-change-repaint.html -->
+<!DOCTYPE HTML>
+<script src="resources/paint-invalidation-test.js"></script>
+<style>
+    body {
+        margin: 0;
+    }
+    #container {
+        position: relative;
+        top: 40px;
+        width: 200px;
+        height: 400px;
+    }
+    #test {
+        position: relative;
+        background-color: green;
+        width: 100px;
+        height: 100px;
+    }
+</style>
+<script>
+    window.expectedPaintInvalidationObjects = [
+        "LayoutBlockFlow BODY",
+        "LayoutBlockFlow (relative positioned) DIV id='container'",
+        "LayoutBlockFlow (relative positioned) DIV id='test'",
+    ];
+    function paintInvalidationTest()
+    {
+        document.getElementById("test").style['margin-top'] = '20px';
+    }
+    window.onload = runPaintInvalidationTest;
+</script>
+<div id="container">
+    <div id="test"></div>
+</div>
+<!-- Tests the repainting of relative element when margin-top changes. -->
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/relative-positioned-movement-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/relative-positioned-movement-repaint-expected.html
new file mode 100644
index 0000000..a213d9c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/relative-positioned-movement-repaint-expected.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<style>
+    #block {
+        display: block;
+        margin: 10px;
+        width: 400px;
+        height: 60px;
+        border: 1px solid black;
+        -webkit-backface-visibility: hidden;
+        position: relative;
+        left: 50px;
+    }
+</style>
+<div id="block">When this layer moves it shouldn't generate a repaint rect.</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/relative-positioned-movement-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/relative-positioned-movement-repaint.html
new file mode 100644
index 0000000..0e914e1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/relative-positioned-movement-repaint.html
@@ -0,0 +1,27 @@
+<!-- Based on fast/repaint/relative-positioned-movement-repaint.html -->
+<!DOCTYPE html>
+<style>
+    #block {
+        display: block;
+        margin: 10px;
+        width: 400px;
+        height: 60px;
+        border: 1px solid black;
+        -webkit-backface-visibility: hidden;
+        position: relative;
+        left: 10px;
+    }
+</style>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+    window.expectedPaintInvalidationObjects = [
+    ];
+    function paintInvalidationTest()
+    {
+        document.body.offsetTop;
+        var div = document.getElementById("block");
+        div.style.left = '50px';
+    }
+    window.onload = runPaintInvalidationTest;
+</script>
+<div id="block">When this layer moves it shouldn't generate a repaint rect.</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/remove-inline-block-descendant-of-flex-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/remove-inline-block-descendant-of-flex-expected.html
new file mode 100644
index 0000000..ca907cc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/remove-inline-block-descendant-of-flex-expected.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<style>
+body {
+  margin : 0;
+}
+.item {
+  display: inline-block;
+  height: 100px;
+  width: 100px;
+}
+</style>
+Tests paint invalidation of inline blocks following an inline-block that is removed.
+Passes if there is only one green square at the top-left corner of the window.
+<div style="display: flex; height: 300px; position: absolute; top: 100px">
+  <div style="display: flex">
+    <div style="width: 100px">
+      <div id="inline-block-2" class="item" style="background-color: green"><br></div>
+    </div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/remove-inline-block-descendant-of-flex.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/remove-inline-block-descendant-of-flex.html
new file mode 100644
index 0000000..a1f2de5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/remove-inline-block-descendant-of-flex.html
@@ -0,0 +1,46 @@
+<!-- Based on fast/repaint/remove-inline-block-descendant-of-flex.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "InlineTextBox '\n'",
+    "LayoutBR BR",
+    "RootInlineBox",
+    "LayoutBlockFlow DIV id='inline-block-1' class='item'",
+    "InlineBox",
+    "LayoutText #text",
+    "RootInlineBox",
+    "InlineBox",
+    "RootInlineBox",
+    "InlineBox",
+    "RootInlineBox",
+    "LayoutBlockFlow DIV",
+    "LayoutBlockFlow DIV id='inline-block-2' class='item'",
+    "LayoutBR BR",
+    "InlineTextBox '\n'",
+];
+function paintInvalidationTest() {
+  document.getElementById('inline-block-1').style.display = 'none';
+}
+onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+  margin : 0;
+}
+.item {
+  display: inline-block;
+  height: 100px;
+  width: 100px;
+}
+</style>
+Tests paint invalidation of inline blocks following an inline-block that is removed.
+Passes if there is only one green square at the top-left corner of the window.
+<div style="display: flex; height: 300px; position: absolute; top: 100px">
+  <div style="display: flex">
+    <div style="width: 100px">
+      <div id="inline-block-1" class="item" style="background-color: red"><br></div>
+      <div id="inline-block-2" class="item" style="background-color: green"><br></div>
+    </div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/remove-squashed-layer-plus-move-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/remove-squashed-layer-plus-move-expected.html
new file mode 100644
index 0000000..4e15d03
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/remove-squashed-layer-plus-move-expected.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<style>
+.mv-tile{
+    display:inline-block;
+    height:50px;
+    position:relative;
+    width:100px;
+    margin-right:410px;
+}
+</style>
+<div style="position: absolute; width: 1000px; height: 1000px; transform: translateZ(0)"></div>
+<div id="container">
+    <div class="mv-tile" style="background-color: lightblue;"></div>
+</div>
+<div class="mv-tile" style="width: 1000px"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/remove-squashed-layer-plus-move.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/remove-squashed-layer-plus-move.html
new file mode 100644
index 0000000..7c29ad2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/remove-squashed-layer-plus-move.html
@@ -0,0 +1,45 @@
+<!-- Based on compositing/squashing/remove-squashed-layer-plus-move.html -->
+<!DOCTYPE html>
+<style>
+.mv-tile{
+    display:inline-block;
+    height:50px;
+    position:relative;
+    width:100px;
+    margin-right:410px;
+}
+</style>
+<div style="position: absolute; width: 1000px; height: 1000px; transform: translateZ(0)"></div>
+<div id="container">
+    <div class="mv-tile" id="foo"></div>
+    <div class="mv-tile" style="background-color: lightblue;"></div>
+</div>
+<div class="mv-tile" style="width: 1000px"></div>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+// This test verifies that a paint invalidation is correctly issued for both the old and new location of
+// the mv-tile element which is *not* removed from the DOM, but nevertheless moves to the left as the other one
+// is removed.
+
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (relative positioned) DIV id='foo' class='mv-tile'",
+    "InlineBox",
+    "RootInlineBox",
+    "InlineBox",
+    "RootInlineBox",
+    "LayoutBlockFlow DIV id='container'",
+    "LayoutBlockFlow DIV id='container'",
+    "LayoutBlockFlow (relative positioned) DIV class='mv-tile'",
+    "LayoutBlockFlow (anonymous)",
+    "LayoutBlockFlow (relative positioned) DIV class='mv-tile'",
+    "LayoutText #text",
+    "LayoutText #text",
+    "LayoutText #text",
+];
+function paintInvalidationTest() {
+    document.querySelector("#foo").remove();
+}
+
+runPaintInvalidationTest();
+
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-in-iframe-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-in-iframe-expected.html
new file mode 100644
index 0000000..a382528
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-in-iframe-expected.html
@@ -0,0 +1,3 @@
+<!DOCTYPE html>
+<div style="height: 400px"></div>
+<iframe srcdoc="<div style='height: 50px; width: 50px; background-color: green;'></div>"></iframe>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-in-iframe.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-in-iframe.html
new file mode 100644
index 0000000..2bce94a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-in-iframe.html
@@ -0,0 +1,24 @@
+<!-- Based on fast/repaint/repaint-in-iframe.html -->
+<!DOCTYPE html>
+<html>
+<head>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.onload = function() {
+    runPaintInvalidationTest();
+};
+
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV",
+];
+function paintInvalidationTest() {
+    document.getElementsByTagName('iframe')[0]
+        .contentDocument
+        .getElementsByTagName('div')[0]
+        .style
+        .backgroundColor = 'green';
+}
+</script>
+</head>
+<div style="height: 400px"></div>
+<iframe srcdoc="<div style='height: 50px; width: 50px; background-color: red;'></div>"></iframe>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-on-style-change-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-on-style-change-expected.html
new file mode 100644
index 0000000..fbd4eaa
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-on-style-change-expected.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Test for repaint on style change</title>
+    <style>
+    div {
+        background-color: green;
+        height: 100px;
+        width: 100px;
+
+        position: absolute;
+        top: 260px;
+        left: 260px;
+    }
+    </style>
+</head>
+<body>
+    <div id='box'> </div>
+</body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-on-style-change.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-on-style-change.html
new file mode 100644
index 0000000..6c8257c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-on-style-change.html
@@ -0,0 +1,34 @@
+<!-- Based on fast/repaint/repaint-on-style-change.html -->
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Test for repaint on style change</title>
+    <script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+    <script>
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow (positioned) DIV id='box'",
+        ];
+        function paintInvalidationTest()
+        {
+            if (!window.testRunner)
+                return;
+            document.getElementById('box').style['background-color'] = 'green';
+        }
+    </script>
+    <style>
+    div {
+        background-color: magenta;
+        height: 100px;
+        width: 100px;
+
+        position: absolute;
+        top: 260px;
+        left: 260px;
+    }
+    </style>
+</head>
+<body onload="runPaintInvalidationTest()">
+    <div id='box'> </div>
+</body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-overflow-scrolled-squashed-content-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-overflow-scrolled-squashed-content-expected.html
new file mode 100644
index 0000000..de319e4d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-overflow-scrolled-squashed-content-expected.html
@@ -0,0 +1,5 @@
+<!doctype html>
+<div style="position: absolute; overflow:scroll; width:200px; height:200px">
+  <div id="foo2" style="height: 1000px; width: 150px;  background: lightblue; transform: translateZ(0) "></div>
+  <div id="foo" style="height: 1000px; width: 100px; position: absolute; top: 0px; left: 0px; background: red"></div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-overflow-scrolled-squashed-content.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-overflow-scrolled-squashed-content.html
new file mode 100644
index 0000000..1349b57
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-overflow-scrolled-squashed-content.html
@@ -0,0 +1,21 @@
+<!-- Based on compositing/squashing/repaint-overflow-scrolled-squashed-content.html -->
+<!doctype html>
+<div style="position: absolute; overflow:scroll; width:200px; height:200px">
+  <div id="foo2" style="height: 1000px; width: 150px;  background: lightblue; transform: translateZ(0) "></div>
+  <div id="foo" style="height: 1000px; width: 100px; position: absolute; top: 0px; left: 0px; background: lightgray"></div>
+</div>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+// This test verifies that a repaint request for a squashed layer that is inside of a scrolling container and much taller
+// than the viewport does not receive an incorrect paint invalidation rect when it is invalidated. In particular, the invalidation
+// rect should not be clipped to the visible viewport.
+
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV id='foo'",
+];
+function paintInvalidationTest() {
+    document.querySelector("#foo").style.background = 'red';
+}
+
+runPaintInvalidationTest();
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-squashed-layer-in-rect-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-squashed-layer-in-rect-expected.html
new file mode 100644
index 0000000..e2a8fec
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-squashed-layer-in-rect-expected.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<div style="height: 800px; width: 800px; background-color: lightgray">
+</div>
+<div style="position:absolute; top: 0px; height: 200px; width: 200px">
+</div>
+<div style="position:absolute; top: 400px; left: 400px; height: 200px; width: 200px; background-color: lightblue">
+  <div id="imgElement" style="height: 200px; width: 200px; background-image: url('data:image/gif;base64,R0lGODdhAgACAIABAAAAAP///ywAAAAAAgACAAACA0QCBQA7')">
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-squashed-layer-in-rect.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-squashed-layer-in-rect.html
new file mode 100644
index 0000000..78e6f9c9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-squashed-layer-in-rect.html
@@ -0,0 +1,23 @@
+<!-- Based on compositing/squashing/repaint-squashed-layer-in-rect.html -->
+<!doctype html>
+<div style="height: 800px; width: 800px; background-color: lightgray; transform:translateZ(0)">
+</div>
+<div style="position:absolute; top: 0px; height: 200px; width: 200px">
+</div>
+<div style="position:absolute; top: 400px; left: 400px; height: 200px; width: 200px; background-color: lightblue">
+  <div id="imgElement" style="height: 200px; width: 200px; background-color: lightblue">
+  </div>
+</div>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+// Test that a repaint for the rect containing the changed background image is issued in the coordinate space of the
+// squashing layer, *not* local to the div with the background image on it.
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow DIV id='imgElement'",
+];
+function paintInvalidationTest() {
+    var imgElement = document.querySelector("#imgElement");
+    imgElement.style.backgroundImage = "url('data:image/gif;base64,R0lGODdhAgACAIABAAAAAP///ywAAAAAAgACAAACA0QCBQA7')";
+}
+runPaintInvalidationTest();
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-table-row-in-composited-document-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-table-row-in-composited-document-expected.html
new file mode 100644
index 0000000..4eda419
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-table-row-in-composited-document-expected.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+td {
+  width: 200px;
+  height: 100px;
+}
+body {
+  margin: 50px;
+}
+</style>
+</head>
+<body">
+<table>
+  <tr>
+    <td id="target" style="height: 250px">
+    </td>
+  </tr>
+  <tr>
+    <td>
+    </td>
+    <td style="border: 1px solid black; background-color: green;">
+    </td>
+  </tr>
+</table>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-table-row-in-composited-document.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-table-row-in-composited-document.html
new file mode 100644
index 0000000..f5be754
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-table-row-in-composited-document.html
@@ -0,0 +1,46 @@
+<!-- Based on fast/repaint/repaint-table-row-in-composited-document.html -->
+<!DOCTYPE html>
+<html>
+<head>
+<script src="resources/paint-invalidation-test.js" type="text/javascript"></script>
+<style>
+td {
+  width: 200px;
+  height: 100px;
+}
+body {
+  margin: 50px;
+}
+</style>
+<script type="text/javascript">
+window.expectedPaintInvalidationObjects = [
+    "LayoutTableCell TD id='target'",
+    "LayoutTableRow TR",
+    "LayoutTableCell TD",
+    "LayoutTableCell TD",
+];
+function paintInvalidationTest()
+{
+  // The sizes on this test are deliberate to ensure that we don't trigger
+  // any repaints within the tile the green td starts in, otherwise the
+  // compositor's repaint algorithm hides the issue visually. The issue will
+  // still show up in the text results.
+  var target = document.getElementById('target');
+  target.style.height = '250px';
+}
+</script>
+</head>
+<body onload="runPaintInvalidationTest();">
+<table>
+  <tr>
+    <td id="target">
+    </td>
+  </tr>
+  <tr>
+    <td>
+    </td>
+    <td style="border: 1px solid black; background-color: green;">
+    </td>
+  </tr>
+</table>
+</body>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-tile-clipped-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-tile-clipped-expected.html
new file mode 100644
index 0000000..31cd3d6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-tile-clipped-expected.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<style>
+#ref {
+  display: block;
+  min-width: 20em;
+  height: 10em;
+  position: absolute;
+  bottom: 5px;
+  border: 1px solid;
+  background-color: #0f0;
+}
+.wrapper{
+  position: relative;
+}
+.spaced{
+  padding-top: 300px;
+  width: 10em;
+}
+</style>
+<p>
+  This tests that the repaint of absolutely positioned elements inside
+  relatively positioned inline blocks works correclty.
+  <a href="http://crbug.com/370945">crbug.com/370945</a>
+</p>
+<p>You should see a green rectangle without any missing pieces if this test passed. </p>
+
+<p class='spaced'>
+  <span class='wrapper'>
+   <span id="ref"></span>
+  </span>
+</p>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-tile-clipped.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-tile-clipped.html
new file mode 100644
index 0000000..8c190fb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-tile-clipped.html
@@ -0,0 +1,46 @@
+<!-- Based on fast/repaint/repaint-tile-clipped.html -->
+<!DOCTYPE html>
+<html>
+<head>
+    <script src="resources/paint-invalidation-test.js"></script>
+    <script>
+        window.expectedPaintInvalidationObjects = [
+        ];
+        function paintInvalidationTest()
+        {
+            document.getElementById('ref').style.display = 'block';
+        }
+        onload = runPaintInvalidationTest;
+    </script>
+</head>
+<style>
+#ref {
+  display: none;
+  min-width: 20em;
+  height: 10em;
+  position: absolute;
+  bottom: 5px;
+  border: 1px solid;
+  background-color: #0f0;
+}
+.wrapper{
+  position: relative;
+}
+.spaced{
+  padding-top: 300px;
+  width: 10em;
+}
+</style>
+<p>
+  This tests that the repaint of absolutely positioned elements inside
+  relatively positioned inline blocks works correclty.
+  <a href="http://crbug.com/370945">crbug.com/370945</a>
+</p>
+<p>You should see a green rectangle without any missing pieces if this test passed. </p>
+
+<p class='spaced'>
+  <span class='wrapper'>
+   <span id="ref"></span>
+  </span>
+</p>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-via-layout-offset-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-via-layout-offset-expected.html
new file mode 100644
index 0000000..6d416a3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-via-layout-offset-expected.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<style>
+#container {
+  position: absolute;
+  z-index: 0;
+  left: 50px;
+  top: 50px;
+}
+
+.child {
+  position: absolute;
+  width: 40px;
+  height: 40px;
+  background-color: red;
+}
+
+.embiggen {
+  width: 50px;
+  height: 50px;
+  background-color: green;
+}
+</style>
+<div style="width:200px; height:200px; background-color: lightblue"></div>
+<div id="container">
+  <span class="child embiggen"></span>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-via-layout-offset.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-via-layout-offset.html
new file mode 100644
index 0000000..43e1df9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/repaint-via-layout-offset.html
@@ -0,0 +1,38 @@
+<!-- Based on compositing/squashing/repaint-via-layout-offset.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<style>
+#container {
+  position: absolute;
+  z-index: 0;
+  left: 50px;
+  top: 50px;
+}
+
+.child {
+  position: absolute;
+  width: 40px;
+  height: 40px;
+  background-color: red;
+}
+
+.embiggen {
+  width: 50px;
+  height: 50px;
+  background-color: green;
+}
+</style>
+<div style="width:200px; height:200px; transform: translateZ(0px); background-color: lightblue"></div>
+<div id="container">
+  <span class="child"></span>
+  <span class="child"></span>
+</div>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) SPAN class='child embiggen'",
+];
+function paintInvalidationTest() {
+    document.querySelectorAll('.child')[1].classList.add('embiggen');
+}
+runPaintInvalidationTest();
+</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/resize-child-within-overflow-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/resize-child-within-overflow-expected.html
new file mode 100644
index 0000000..708e9ec
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/resize-child-within-overflow-expected.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<style>
+body {
+    margin: 0;
+}
+.container {
+    position: absolute;
+    height: 1000px;
+    background-color: blue;
+}
+#child {
+    width: 600px;
+}
+.overflow {
+    width: 800px;
+    height: 50px;
+}
+</style>
+<div class="container">
+    <div id="child">
+        <div class="overflow"></div>
+    </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/resize-child-within-overflow.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/resize-child-within-overflow.html
new file mode 100644
index 0000000..9dd083ee
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/resize-child-within-overflow.html
@@ -0,0 +1,35 @@
+<!-- Based on fast/repaint/resize-child-within-overflow.html -->
+<!DOCTYPE html>
+<script src="resources/paint-invalidation-test.js"></script>
+<script>
+window.expectedPaintInvalidationObjects = [
+    "LayoutBlockFlow (positioned) DIV class='container'",
+];
+function paintInvalidationTest()
+{
+    document.getElementById('child').style.width = '600px';
+}
+window.onload = runPaintInvalidationTest;
+</script>
+<style>
+body {
+    margin: 0;
+}
+.container {
+    position: absolute;
+    height: 1000px;
+    background-color: blue;
+}
+#child {
+    width: 400px;
+}
+.overflow {
+    width: 800px;
+    height: 50px;
+}
+</style>
+<div class="container">
+    <div id="child">
+        <div class="overflow"></div>
+    </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/resize-repaint-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/resize-repaint-expected.html
new file mode 100644
index 0000000..d6771bd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/resize-repaint-expected.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        #resizing {
+            width: 400px;
+            border: 1px solid black;
+        }
+
+        #resizing > div {
+            height: 50px;
+            margin: 1px;
+            background-color: silver;
+        }
+    </style>
+</head>
+<body>
+
+<div id="resizing">
+  <div></div>
+  <div></div>
+  <div></div>
+  <div></div>
+</div>
+
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/resize-repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/resize-repaint.html
new file mode 100644
index 0000000..fee3008
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/resize-repaint.html
@@ -0,0 +1,47 @@
+<!-- Based on compositing/repaint/resize-repaint.html -->
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        #resizing {
+            width: 400px;
+            border: 1px solid black;
+            transform: translateZ(0);
+        }
+
+        #resizing > div {
+            height: 50px;
+            margin: 1px;
+            background-color: silver;
+        }
+    </style>
+    <script src="resources/paint-invalidation-test.js"></script>
+    <script>
+        window.expectedPaintInvalidationObjects = [
+            "LayoutBlockFlow DIV id='resizing'",
+            "LayoutBlockFlow DIV",
+            "LayoutBlockFlow DIV",
+        ];
+        function paintInvalidationTest()
+        {
+            var resizingDiv = document.getElementById('resizing');
+            
+            for (var i = 0; i < 2; ++i) {
+                var newDiv = document.createElement('div');
+                resizingDiv.appendChild(newDiv);
+            }
+        }
+
+        window.onload = runPaintInvalidationTest;
+    </script>
+</head>
+<body>
+
+<div id="resizing">
+  <div></div>
+  <div></div>
+</div>
+
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/resize-scrollable-div-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/resize-scrollable-div-expected.html
new file mode 100644
index 0000000..4fe1d9bc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/spv2/resize-scrollable-div-expected.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<div style="height: 100px">
+Tests paint invalidation of scrollbars and scroll corner when a srollable div is resized.
+Passes if the scrollbars and scroll corner are repainted correctly, and no under-invalidation
+in slimming-paint mode (with slimmingPaintUnderInvalidationChecking enabled).
+</div>
+<div id="div" style="width: 300px; height: 300px; overflow: scroll"></div>
+
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/spv2/resize-scrollable-div.html