Commit b30b05e3 authored by jbroman@chromium.org's avatar jbroman@chromium.org

Remove pixelSnappedIntRect from BoxPainter::boundsForDrawingRecorder.

BUG=525702

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

git-svn-id: svn://svn.chromium.org/blink/trunk@201342 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 99399d39
...@@ -991,6 +991,8 @@ crbug.com/479533 accessibility/show-context-menu.html [ Skip ] ...@@ -991,6 +991,8 @@ crbug.com/479533 accessibility/show-context-menu.html [ Skip ]
crbug.com/479533 accessibility/show-context-menu-shadowdom.html [ Skip ] crbug.com/479533 accessibility/show-context-menu-shadowdom.html [ Skip ]
crbug.com/483653 accessibility/scroll-containers.html [ Skip ] crbug.com/483653 accessibility/scroll-containers.html [ Skip ]
crbug.com/525702 [ Mac ] fast/forms/color/input-appearance-color.html [ NeedsRebaseline ]
crbug.com/491764 http/tests/inspector/service-workers/user-agent-override.html [ Timeout ] crbug.com/491764 http/tests/inspector/service-workers/user-agent-override.html [ Timeout ]
crbug.com/474798 fast/repaint/align-self-change-keeping-geometry-grid.html [ Failure ] crbug.com/474798 fast/repaint/align-self-change-keeping-geometry-grid.html [ Failure ]
crbug.com/474798 fast/repaint/justify-self-change-keeping-geometry.html [ Failure ] crbug.com/474798 fast/repaint/justify-self-change-keeping-geometry.html [ Failure ]
......
Tests whether a repaint rect encompasses box-shadow with subpixel offset when the shadow changes.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
FAIL Subpixel shadow [1.4,1.4,100,100] was not repainted. Repaint rects were [[0,0,101,101],[0,0,100,100]].
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE html>
<style>
#box {
position: absolute;
left: 0;
top: 0;
width: 100px;
height: 100px;
background: green;
box-shadow: 1.4px 1.4px blue;
}
</style>
<div id="box"></div>
<script src="../../resources/js-test.js"></script>
<script src="../../resources/run-after-layout-and-paint.js"></script>
<script>
var jsTestIsAsync = true;
description('Tests whether a repaint rect encompasses box-shadow with subpixel offset when the shadow changes.');
// Accepts [x, y, width, height] rects. Checks if the first argument contains the second.
function rectContainsRect(outer, inner) {
return outer[0] <= inner[0]
&& outer[1] <= inner[1]
&& outer[0] + outer[2] >= inner[0] + inner[2]
&& outer[1] + outer[3] >= inner[1] + inner[3];
}
if (!window.internals) {
testFailed('Test requires window.internals.');
finishJSTest();
} else {
var box = document.getElementById('box');
runAfterLayoutAndPaint(function() {
internals.startTrackingRepaints(document);
box.style.boxShadow = 'none';
runAfterLayoutAndPaint(function() {
var layerTree = JSON.parse(internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS));
var repaintRects = layerTree.children[0].repaintRects;
var shadowRect = [1.4, 1.4, 100, 100];
if (repaintRects.some(repaintRect => rectContainsRect(repaintRect, shadowRect)))
testPassed('Subpixel shadow was repainted.');
else
testFailed('Subpixel shadow ' + JSON.stringify(shadowRect) + ' was not repainted. Repaint rects were ' + JSON.stringify(repaintRects) + '.');
internals.stopTrackingRepaints(document);
box.remove();
finishJSTest();
});
});
}
</script>
...@@ -64,7 +64,7 @@ LayoutRect BoxPainter::boundsForDrawingRecorder(const LayoutPoint& paintOffset) ...@@ -64,7 +64,7 @@ LayoutRect BoxPainter::boundsForDrawingRecorder(const LayoutPoint& paintOffset)
// Use the visual overflow rect here, because it will include overflow introduced by the theme. // Use the visual overflow rect here, because it will include overflow introduced by the theme.
LayoutRect bounds = m_layoutBox.visualOverflowRect(); LayoutRect bounds = m_layoutBox.visualOverflowRect();
bounds.moveBy(paintOffset); bounds.moveBy(paintOffset);
return LayoutRect(pixelSnappedIntRect(bounds)); return bounds;
} }
namespace { namespace {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment