Automatic update from web-platform-tests Round scroll offsets in Blink In CC ScrollTree::PullDeltaForMainThread() is rounding the scroll offsets, while in SnapScrollOffsetToPhysicalPixels() we are flooring them. This patch rounds the scroll offsets in Blink, to avoid situations where we have a 1 pixel difference. Bug: 352722599 Test: external/wpt/css/cssom-view/scrollTo-zoom.html Change-Id: I10ae5136b183d80d6b5d1db8af37c92d1714f79b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6328500 Reviewed-by: David Bokan <bokan@chromium.org> Auto-Submit: Manuel Rego <rego@igalia.com> Reviewed-by: Alex Moshchuk <alexmos@chromium.org> Commit-Queue: Manuel Rego <rego@igalia.com> Reviewed-by: Robert Flack <flackr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1429089} -- wpt-commits: ccbb42938d1377473b636aeae838af627a382b77 wpt-pr: 51176
46 lines
1.2 KiB
HTML
46 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
|
|
<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scrollto">
|
|
<link rel="match" href="../reference/ref-nothing-below.xht" />
|
|
<meta name="assert" content="This test checks scrollTo() with different zoom levels.">
|
|
<style>
|
|
.container {
|
|
position: relative;
|
|
width: 100px;
|
|
height: 100px;
|
|
overflow: scroll;
|
|
background: red;
|
|
scrollbar-width: none;
|
|
}
|
|
.container > div {
|
|
position: absolute;
|
|
left: 13px;
|
|
top: 27px;
|
|
width: 100px;
|
|
height: 100px;
|
|
background: white;
|
|
}
|
|
</style>
|
|
<body style="background: white;">
|
|
<p>Test passes if there is nothing below.</p>
|
|
<div class="container" style="zoom: 0.9;">
|
|
<div></div>
|
|
</div>
|
|
<div class="container" style="zoom: 1;">
|
|
<div></div>
|
|
</div>
|
|
<div class="container" style="zoom: 1.11;">
|
|
<div></div>
|
|
</div>
|
|
<div class="container" style="zoom: 1.5;">
|
|
<div></div>
|
|
</div>
|
|
<script>
|
|
Array.prototype.forEach.call(document.getElementsByClassName("container"), (el) => {
|
|
el.scrollTo(13, 27);
|
|
});
|
|
</script>
|
|
</body>
|