author Robert Longson <>
Sat, 04 Feb 2023 15:41:48 +0000
changeset 651752 40237e7707f1928c84d09cdd2f1fd018a74ea784
parent 616557 918ef225713fa9fc188f42355a6cd4a2bfb3b64c
permissions -rw-r--r--
Bug 1814872 - Fix degenerate radial gradient handling r=emilio This is a change from SVG 1.1 where we only had to check for r=0 because fr did not exist. The SVG 2 behaviour was clarified in Differential Revision:

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Test for Bug 1638441</title>
  <script src="/tests/SimpleTest/paint_listener.js"></script>
  <script src="/tests/SimpleTest/EventUtils.js"></script>
  <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
  <script type="application/javascript" src="apz_test_utils.js"></script>
    #target {
      position: fixed;
      bottom: 50px;
      width: 100px;
      height: 100px;
  <div id="target">
  <script type="application/javascript">

async function test() {
  let utils = SpecialPowers.getDOMWindowUtils(window);

  // Do a large visual scroll to scroll the visual viewport to the bottom
  // of the layout viewport.
  let visualScrollPromise = new Promise(resolve => {
    window.visualViewport.addEventListener("scroll", resolve, { once: true });
  utils.scrollToVisual(0, 900, utils.UPDATE_TYPE_MAIN_THREAD,
  await visualScrollPromise;
  await promiseApzFlushedRepaints();

  // Tap the position-fixed element which is near the bottom of the
  // layout viewport (and therefore visible now that the visual
  // viewport is scrolled to the bottom of the layout viewport).
  // The intention is to test that the visual-to-layout transform
  // is applied correctly during the hit test.
  let target = document.getElementById("target");
  let mouseDownEvent = null;
  let mouseDownPromise = new Promise(resolve => {
    target.addEventListener("mousedown", function(e) {
      mouseDownEvent = e;

  await synthesizeNativeTap(target, 10, 10);
  await mouseDownPromise;

  is(, target, "mousedown event targeted the correct element");

.then(subtestDone, subtestFailed);