author Paul Adenot <>
Tue, 04 Sep 2012 16:22:34 -0700
changeset 104356 a027c9d63d20d697f61832f324077eb0c8cbef7c
parent 74347 1188456710819d4606e74396be333ead9fe63261
child 145463 45446ab0c72656eaa3afd505db47d94a686fa301
permissions -rw-r--r--
Bug 567077 - Sniff types of media files that are served with no Content-Type. r=cpearce

<!-- 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() {"UniversalXPConnect");

    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();">