chromium/third_party/blink/web_tests/editing/execCommand/outdent/outdent_nested_lists.html

<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<div id="log"></div>
<script>
test(() => assert_selection(
    [
        '<ol contenteditable>',
          '<li>one</li>',
          '<ol>',
              '<li>two</li>',
              '<li>^three|</li>',
          '</ol>',
          '<li>four</li>',
        '</ol>',
    ].join(''),
    'Outdent',
    [
        '<ol contenteditable>',
          '<li>one</li>',
          '<ol><li>two</li></ol>',
          '<li>^three|</li>',
          '<li>four</li>',
        '</ol>',
    ].join('')), 'Nested list at two');

test(() => assert_selection(
    [
        '<ol contenteditable>',
          '<ol><li>^one|</li></ol>',
          '<li>two</li>',
          '<li>three</li>',
          '<li>four</li>',
        '</ol>',
    ].join(''),
    'Outdent',
    [
        '<ol contenteditable>',
          '<li>^one|</li>',
          '<li>two</li>',
          '<li>three</li>',
          '<li>four</li>',
        '</ol>',
    ].join('')), 'Nested list at one');

test(() => assert_selection(
    [
        '<ol contenteditable>',
          '<ol>',
              '<li>one</li>',
              '<li>^two|</li>',
              '<li>three</li>',
          '</ol>',
          '<li>four</li>',
        '</ol>',
    ].join(''),
    'Outdent',
    [
        '<ol contenteditable>',
          '<ol><li>one</li></ol>',
          '<li>^two|</li>',
          '<ol>',
              '<li>three</li>',
          '</ol>',
          '<li>four</li>',
        '</ol>',
    ].join('')), 'Nested list at one to three');

test(() => assert_selection(
    [
        '<ol contenteditable>',
          '<ol><li>one</li><li>^two</li></ol>',
          '<ul><li>three</li></ul>',
          '<ol><li>four|</li></ol>',
        '</ol>',
    ].join(''),
    'Outdent',
    [
        '<ol contenteditable>',
          '<ol><li>one</li></ol>',
          '<li>^two</li>',
          '<li>three</li>',
          '<li>four|</li>',
        '</ol>',
    ].join('')), 'Nested list at one to two, three(ul), and four');

test(() => assert_selection(
    [
        '<ol contenteditable>',
          '<ol>',
            '<li>^one</li>',
            '<li>',
              'two',
              '<div>two-1</div>',
              '<div>two-2</div>',
            '</li>',
            '<li>three|</li>',
          '</ol>',
        '</ol>',
    ].join(''),
    'Outdent',
    [
        '<ol contenteditable>',
          '<li>^one</li>',
          '<li>',
            'two',
            '<div>two-1</div>',
            '<div>two-2</div>',
          '</li>',
          '<li>three|</li>',
        '</ol>',
    ].join('')), 'Nested list and `two` has children');
</script>