layout/reftests/scrolling/scroll-behavior-9.html
author Xianzhu Wang <wangxianzhu@chromium.org>
Tue, 05 Mar 2019 12:18:01 +0000
changeset 464575 4325ba7b38576495a78289c2a8f4dff391922e66
parent 329664 7b434711753b98a87603453caaa0945791ffe12b
child 480241 9b96152c5e6ecf97af63865f357e8106e0763ea4
permissions -rw-r--r--
Bug 1529059 [wpt PR 15420] - [BlinkGenPropertyTrees] Initiailize double_sided of synthetic effect, a=testonly Automatic update from web-platform-tests [BlinkGenPropertyTrees] Initiailize double_sided of synthetic effect Previously synthetic effects always had double_sided==false, causing the layer disappear when the backface was facing forward. Bug: 928190 Change-Id: I35534b40346d5c5918bc99c00a4ca6b4e3b68796 Reviewed-on: https://chromium-review.googlesource.com/c/1475815 Reviewed-by: Philip Rogers <pdr@chromium.org> Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> Cr-Commit-Position: refs/heads/master@{#632764} -- wpt-commits: a89467050deaf1dcbd9140a2f0670b1b85e518ee wpt-pr: 15420

<!DOCTYPE HTML>
<html class="reftest-wait">
<head>
    <meta charset="utf-8">
    <title>Testcase for bug 1082098, smooth scrolling expected after dynamically setting scroll-behavior on body</title>
    <style type="text/css">

        html,body {
            color: black;
            background-color: white;
            font-size: 16px;
            padding: 0;
            margin: 0;
        }

        #a_box {
            position: relative;
            left: 10px;
            top: 10px;
            width: 20px;
            height: 20px;
            background: blue;
        }

        #another_box {
            position: relative;
            left: 2000px;
            top: 2000px;
            width: 20px;
            height: 20px;
            background: green;
        }

    </style>
</head>
<body>
  <div id="a_box"></div>
  <div id="another_box"></div>
<script>
  function doTest() {
    if (document.location.search != '?ref') {
      // Scroll - expected to be smooth
      window.scrollTo({left: 500, top: 500});
      // Interrupt smooth scrolling
      window.scrollTo({left: window.scrollX, top: window.scrollY});
      // If scroll was not performed smoothly, we would be at 500,500 now
    }
    document.documentElement.removeAttribute("class");
  }
  window.scrollTo({left: 0, top: 0, behavior: "instant"});
  document.body.style.scrollBehavior = "smooth";
  window.addEventListener("MozReftestInvalidate", doTest);
</script>
</body>
</html>