<!-- quirks mode -->
<html>
  <head>
    <title>Quirks mode elements with class names should remain queriable regardless of sibling adoption into standards mode documents</title>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
  </head>
  <body>
    <div>
      <button class="Foo"></button>
      <button class="Foo"></button>
    </div>
    <template><div class="Bar"></div></template>
    <script>
    test(function () {
      var templateDocu