<commit_before><!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="width=device-width">
    <style>
      html {
        overflow-x: hidden;
      }

      body {
        height: 110vh;
      }

      div {
        margin-top: 10px;
      }

      #log {
        width: 80%;
        height: 40%;
        font-size: xx-small;
      }

      .blockOverscroll {
        overscroll-behavior: none;
      }
    </style>
    <script>
      let boxTouchmoves;
      let boxOverscrollBehavior;
      let log;
      let numTouchmoves = 0;

      function logEvent(event, canceled) {
        let line = `${numTouchmoves} move preventDefaulted[${canceled}] isCancellable[${event.cancelable}]`
        let curLog = log.value;
        log.value = line + '\n' + curLog;
      }

      function moveHandler(event) {
        if (event.target == log)
          return;

        ++numTouchmoves;
        let canceled = false;

        if (boxTouchmoves.checked) {
          if (numTouchmoves > 10) {
            event.preventDefault();
            canceled = true;
          }
        }

        logEvent(event, canceled);
      }

      function startHandler(event) {
        if (event.target == log)
          return;

        numTouchmoves = 0;
        log.value = '';
      }

      function reset() {
        document.documentElement.classList.remove('blockOverscroll');

        if (boxOverscrollBehavior.checked) {
          document.documentElement.classList.add('blockOverscroll');
        }
      }

      onload = () => {
        boxTouchmoves = document.getElementById("checkboxTouchmoves");
        boxOverscrollBehavior = document.getElementById("checkboxOverscrollBehavior");
        log = document.getElementById("log");

        boxTouchmoves.addEventListener('click', reset);
        boxOverscrollBehavior.addEventListener('click', reset);

        document.documentElement.addEventListener('touchstart',
                                                  startHandler,
                                                  {passive: false});
        document.documentElement.addEventListener('touchmove',
                                                  moveHandler,
                                                  {passive: false});
      };
    </script>
  </head>

  <body>
    <p>
      Use this page to test the effect of overscrolling on cancellability of touchmoves.
    </p>

    <p>
      The first checkbox will add a touchmove handler that allows the first 10
      touchmoves to be scrolled and then starts calling preventDefault on the
      remaining events until the touch gesture ends. Note that scrolling cannot
      be blocked once started unless you start to overscroll.
    </p>

    <p>
      The second checkbox adds |overscroll-behavior:none| on the<commit_msg>Modify block-overscroll.html<commit_after><!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="width=device-width">
    <style>
      html {
        overflow-x: hidden;
      }

      body {
        height: 110vh;
      }

      div {
        margin-top: 10px;
      }

      #log {
        width: 90%;
        height: 40%;
        font-size: xx-small;
      }

      .blockOverscroll {
        overscroll-behavior: none;
      }
    </style>
    <script>
      let boxTouchmoves;
      let boxOverscrollBehavior;
      let log;
      let numTouchmoves = 0;

      function logEvent(event, canceled) {
        let line = `${numTouchmoves} move prevented[${canceled}] cancelable[${event.cancelable}]`
        let curLog = log.value;
        log.value = line + '\n' + curLog;
      }

      function moveHandler(event) {
        if (event.target == log)
          return;

        ++numTouchmoves;
        let canceled = false;

        if (boxTouchmoves.checked) {
          if (numTouchmoves > 10) {
            event.preventDefault();
            canceled = true;
          }
        }

        logEvent(event, canceled);
      }

      function startHandler(event) {
        if (event.target == log)
          return;

        numTouchmoves = 0;
        log.value = '';
      }

      function reset() {
        document.documentElement.classList.remove('blockOverscroll');

        if (boxOverscrollBehavior.checked) {
          document.documentElement.classList.add('blockOverscroll');
        }
      }

      onload = () => {
        boxTouchmoves = document.getElementById("checkboxTouchmoves");
        boxOverscrollBehavior = document.getElementById("checkboxOverscrollBehavior");
        log = document.getElementById("log");

        boxTouchmoves.addEventListener('click', reset);
        boxOverscrollBehavior.addEventListener('click', reset);

        document.documentElement.addEventListener('touchstart',
                                                  startHandler,
                                                  {passive: false});
        document.documentElement.addEventListener('touchmove',
                                                  moveHandler,
                                                  {passive: false});
      };
    </script>
  </head>

  <body>
    <p>
      Use this page to test the effect of overscrolling on cancellability of touchmoves.
    </p>

    <p>
      The first checkbox will add a touchmove handler that allows the first 10
      touchmoves to be scrolled and then starts calling preventDefault on the
      remaining events until the touch gesture ends. Note that scrolling cannot
      be blocked once started unless you start to overscroll. (e.g. try
      scrolling until the 10+ touch move, then hit the extent). preventDefault
      on an overscrolling touchmove will block overscroll glow and
      pull-to-refresh effects.
    </p>

    <p>
      The second checkbox adds |overscroll-behavior:none| on the
{'fraction_non_alphanumeric': 0.09499136442141623, 'fraction_numerical': 0.005526770293609672, 'mean_word_length': 1.7761265580057526, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5792008', 'n_tokens_mistral': 1589, 'n_tokens_neox': 1502, 'n_words': 386}