author Phil Ringnalda <>
Sat, 13 Sep 2014 09:59:06 -0700
changeset 205205 d070787de8f7b56e32bf5800b30f143c4d02d474
parent 145463 45446ab0c72656eaa3afd505db47d94a686fa301
permissions -rw-r--r--
Merge b-i to m-c

<!-- Demonstrates that we are always counting MF's in a <frame> tag, and NEVER
     counting MF's in an <iframe> regardless of what the "frame recursion" bit
     is set to. -->
  <title>Testing Mixed Up Microformat APIs</title>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"></link>
<body id="contentbody">
  <pre id="test">
  <script class="testbody" type="text/javascript">

  // Start the test once the iFrame loads
  function onLoad() {

  function test_MicroformatsAPI() {
    var Microformats = SpecialPowers.Cu.import("resource://gre/modules/Microformats.js").Microformats;

    count = Microformats.count("geo",
                              {recurseExternalFrames: false},
    is(count, 1, "Only one geo - we don't count external frames");

    count = Microformats.count("geo",
                              {recurseExternalFrames: true});
    is(count, 2, "Two Geo's - one in frame and one in iframe");

    <frame id="frame1">
        <span class="notAMicroformat" id="notme">
          <abbr class="foo">I am not a microformat</abbr>
          <abbr class="title">Foolish title, not a format</abbr>
    <frame id="frame3">
      <span class="geo" id="02-geo-abbr-latlong" >
        <abbr class="latitude" title="75.77">Far Northern</abbr>
        <abbr class="longitude" title="-122.41">Canada</abbr>
    <frame id="frame2">
      <div class="stuff">
        <span>Testing is Fun!</span>

  <!-- Geo -->
  <iframe id="iframe" src="geo.html" onload="onLoad();">