tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

elements-sections.js (2058B)


      1 var sectionElements = {
      2  body: {
      3    // Obsolete
      4    text: {type: "string", treatNullAsEmptyString: true},
      5    link: {type: "string", treatNullAsEmptyString: true},
      6    vLink: {type: "string", treatNullAsEmptyString: true},
      7    aLink: {type: "string", treatNullAsEmptyString: true},
      8    bgColor: {type: "string", treatNullAsEmptyString: true},
      9    background: "string",
     10  },
     11  article: {},
     12  section: {},
     13  nav: {},
     14  aside: {},
     15  h1: {
     16    // Obsolete
     17    align: "string",
     18  },
     19  h2: {
     20    // Obsolete
     21    align: "string",
     22  },
     23  h3: {
     24    // Obsolete
     25    align: "string",
     26  },
     27  h4: {
     28    // Obsolete
     29    align: "string",
     30  },
     31  h5: {
     32    // Obsolete
     33    align: "string",
     34  },
     35  h6: {
     36    // Obsolete
     37    align: "string",
     38  },
     39  hgroup: {},
     40  header: {},
     41  footer: {},
     42  address: {},
     43 };
     44 
     45 mergeElements(sectionElements);
     46 
     47 extraTests.push(function() {
     48  ReflectionTests.reflects({type: "enum", keywords: ["ltr", "rtl", "auto"]}, "dir", document, "dir", document.documentElement);
     49  // TODO: these behave differently if the body element is a frameset.  Also
     50  // should probably test with multiple bodies.
     51  ReflectionTests.reflects({type: "string", treatNullAsEmptyString: true}, "fgColor", document, "text", document.body);
     52  ReflectionTests.reflects({type: "string", treatNullAsEmptyString: true}, "linkColor", document, "link", document.body);
     53  ReflectionTests.reflects({type: "string", treatNullAsEmptyString: true}, "vlinkColor", document, "vlink", document.body);
     54  ReflectionTests.reflects({type: "string", treatNullAsEmptyString: true}, "alinkColor", document, "alink", document.body);
     55  ReflectionTests.reflects({type: "string", treatNullAsEmptyString: true}, "bgColor", document, "bgcolor", document.body);
     56  // Edge remains RTL if we don't do this, despite removing the attribute
     57  document.dir = "ltr";
     58  // Don't mess up the colors :)
     59  document.documentElement.removeAttribute("dir");
     60  var attrs = ["text", "bgcolor", "link", "alink", "vlink"];
     61  for (var i = 0; i < attrs.length; i++) {
     62    document.body.removeAttribute(attrs[i]);
     63  }
     64 });