DXR will be turned off on Tuesday, December 29th. It will redirect to Searchfox.
See the announcement on Discourse.

DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (c68fe15a81fc)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
<!DOCTYPE html>
<html>
<head>
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
  <script src="support/helper.sub.js"></script>
</head>
<body>
<div id="container"></div>
<script>
  const container = document.querySelector("#container");
  const policy = window.trustedTypes.createPolicy("policy", {
    createScript: t => t,
  });
  function stringify(arg) {
    return "textContent" in arg.__proto__ ? arg.textContent : arg.toString()
  }

  // This test case mirrors the block-Node-multiple-arguments case except
  // that, because Trusted Types is not enabled, no exceptions should be
  // thrown anyhwere.
  const targets = ["div", "script"];
  const all_args = [
    [ policy.createScript("'createScript';") ],
    [ policy.createScript("'cresteScript #1';"), policy.createScript("'#2;'") ],
    [ "'plain text';" ],
    [ "'plain text #1';", "'plain text #2';" ],
    [ document.createTextNode("'node';") ],
    [ document.createTextNode("'node #1';"),
      document.createTextNode("'node #2';") ],
    [ "'mixed';", document.createTextNode("'node';") ],
    [ "'mixed';", policy.createScript("'script';") ],
    [ document.createTextNode("'node';"),
      policy.createScript("'script';") ],
  ];

  for (target of targets) {
    for (args of all_args) {

      for (setter of [container.replaceWith, container.after, container.before]) {
        test(t => {
          var outer = document.createElement(target);
          container.appendChild(outer);
          var inner = document.createElement("p");
          outer.appendChild(inner);
          setter.apply(inner, args);
          assert_equals(outer.textContent, args.map(stringify).join(""));

        }, `${setter.name}(${args.toString()}) on <${target}> should pass`);
      }

      for (setter of [container.append, container.prepend]) {
        test(t => {
          let outer = document.createElement(target);
          container.appendChild(outer);
          setter.apply(outer, args);
          assert_equals(outer.textContent, args.map(stringify).join(""));
        }, `${setter.name}(${args.toString()}) on <${target}> should pass`);
      }

    }
  }
</script>
</body>
</html>