Don't pixel-snap box size before applying percentage transform to it.
Otherwise we'll end up with error that gets larger according to the percentage.
Note that subpixel accumulation is already plumbed through for transforms in
other ways.
BUG=627588
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Review-Url: https://codereview.chromium.org/2386263002
Cr-Commit-Position: refs/heads/master@{#422680}
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations
index f6352fd..43e1c2a 100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -358,6 +358,12 @@
crbug.com/542660 fast/css/absolute-inline-alignment-2.html [ Failure ]
+crbug.com/627588 compositing/gestures/gesture-tapHighlight-pixel-rotated-link.html [ NeedsRebaseline ]
+crbug.com/627588 paint/invalidation/invalidation-with-scale-transform.html [ NeedsRebaseline ]
+crbug.com/627588 fast/backgrounds/background-with-sub-pixel-offset-positioning.html [ NeedsRebaseline ]
+crbug.com/627588 compositing/geometry/fixed-position-transform-composited-page-scale.html [ NeedsRebaseline ]
+crbug.com/627588 fast/transforms/transform-on-inline.html [ NeedsRebaseline ]
+
# Ref tests that needs investigation.
crbug.com/404597 [ Mac ] fast/css3-text/css3-text-justify/text-justify-crash.html [ Failure ]
crbug.com/404597 fast/forms/long-text-in-input.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/fast/backgrounds/background-with-sub-pixel-offset-positioning-expected.html b/third_party/WebKit/LayoutTests/fast/backgrounds/background-with-sub-pixel-offset-positioning-expected.html
deleted file mode 100644
index 007a8a5..0000000
--- a/third_party/WebKit/LayoutTests/fast/backgrounds/background-with-sub-pixel-offset-positioning-expected.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE html>
-<style>
-#float {
- background: url('resources/bgimg1x50.png') 100% 0px no-repeat #FFF;
- height: 1px;
- width: 1px;
- transform: scale(50);
-}
-#container {
- margin-left: 3px;
- overflow: hidden;
- width: 9px;
- height: 10px;
-}
-</style>
-<div id="container">
- <div id="float"></div>
-</div>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/fast/backgrounds/background-with-sub-pixel-offset-positioning-expected.png b/third_party/WebKit/LayoutTests/fast/backgrounds/background-with-sub-pixel-offset-positioning-expected.png
new file mode 100644
index 0000000..0d66d99
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/backgrounds/background-with-sub-pixel-offset-positioning-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/backgrounds/background-with-sub-pixel-offset-positioning-expected.txt b/third_party/WebKit/LayoutTests/fast/backgrounds/background-with-sub-pixel-offset-positioning-expected.txt
new file mode 100644
index 0000000..9d58fb4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/backgrounds/background-with-sub-pixel-offset-positioning-expected.txt
@@ -0,0 +1,9 @@
+layer at (0,0) size 800x600
+ LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x26
+ LayoutBlockFlow {HTML} at (0,0) size 800x26
+ LayoutBlockFlow {BODY} at (8,8) size 784x10
+layer at (10,8) size 10x10 scrollWidth 63 scrollHeight 26
+ LayoutBlockFlow {DIV} at (1.50,0) size 10x10
+layer at (35,8) size 2x1 backgroundClip at (10,8) size 10x10 clip at (10,8) size 10x10
+ LayoutBlockFlow (relative positioned) {DIV} at (0,0) size 1.50x1 [bgcolor=#FFFFFF]
diff --git a/third_party/WebKit/LayoutTests/fast/backgrounds/background-with-sub-pixel-offset-positioning.html b/third_party/WebKit/LayoutTests/fast/backgrounds/background-with-sub-pixel-offset-positioning.html
index 73572e4..9baa8a8 100644
--- a/third_party/WebKit/LayoutTests/fast/backgrounds/background-with-sub-pixel-offset-positioning.html
+++ b/third_party/WebKit/LayoutTests/fast/backgrounds/background-with-sub-pixel-offset-positioning.html
@@ -5,7 +5,7 @@
height: 1px;
width: 1.5px;
position: relative;
- left: 50px;
+ left: 25px;
transform: scale(50);
}
#container {
@@ -17,4 +17,4 @@
</style>
<div id="container">
<div id="float"></div>
-</div>
\ No newline at end of file
+</div>
diff --git a/third_party/WebKit/LayoutTests/paint/transforms/percentage-transform-fractional-box-size-expected.png b/third_party/WebKit/LayoutTests/paint/transforms/percentage-transform-fractional-box-size-expected.png
new file mode 100644
index 0000000..d58ce40
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/transforms/percentage-transform-fractional-box-size-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/paint/transforms/percentage-transform-fractional-box-size-expected.txt b/third_party/WebKit/LayoutTests/paint/transforms/percentage-transform-fractional-box-size-expected.txt
new file mode 100644
index 0000000..e21c54e3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/transforms/percentage-transform-fractional-box-size-expected.txt
@@ -0,0 +1,9 @@
+layer at (0,0) size 800x600
+ LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x8
+ LayoutBlockFlow {HTML} at (0,0) size 800x8
+ LayoutBlockFlow {BODY} at (8,8) size 784x0
+layer at (0,0) size 303x303
+ LayoutBlockFlow (positioned) {DIV} at (0,0) size 303x303 [bgcolor=#CCCCCC]
+layer at (0,0) size 30x30
+ LayoutBlockFlow {DIV} at (0,0) size 30.30x30.30 [bgcolor=#333333]
diff --git a/third_party/WebKit/LayoutTests/paint/transforms/percentage-transform-fractional-box-size.html b/third_party/WebKit/LayoutTests/paint/transforms/percentage-transform-fractional-box-size.html
new file mode 100644
index 0000000..66b1211
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/transforms/percentage-transform-fractional-box-size.html
@@ -0,0 +1,21 @@
+<!doctype HTML>
+<style>
+.container {
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 303px;
+ height: 303px;
+ background-color: #ccc;
+}
+
+.child {
+ width: 10%;
+ height: 10%;
+ background-color: #333;
+ transform: translate(900%, 900%);
+}
+</style>
+<div class="container">
+ <div class="child"></div>
+</div>
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index 2fd2ccd..ece8835 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -393,8 +393,8 @@
ASSERT(box);
transform->makeIdentity();
box->style()->applyTransform(
- *transform, LayoutSize(box->pixelSnappedSize()),
- ComputedStyle::IncludeTransformOrigin, ComputedStyle::IncludeMotionPath,
+ *transform, box->size(), ComputedStyle::IncludeTransformOrigin,
+ ComputedStyle::IncludeMotionPath,
ComputedStyle::IncludeIndependentTransformProperties);
makeMatrixRenderable(*transform, compositor()->hasAcceleratedCompositing());
}