2008-06-25 18:59:30 -07:00
|
|
|
<!-- 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. -->
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Testing Mixed Up Microformat APIs</title>
|
2009-05-06 13:46:04 -07:00
|
|
|
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
2008-06-25 18:59:30 -07:00
|
|
|
<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>
|
|
|
|
</head>
|
|
|
|
<body id="contentbody">
|
2010-11-22 00:13:37 -08:00
|
|
|
<pre id="test">
|
|
|
|
<script class="testbody" type="text/javascript">
|
|
|
|
|
|
|
|
// Start the test once the iFrame loads
|
|
|
|
function onLoad() {
|
|
|
|
test_MicroformatsAPI();
|
|
|
|
}
|
|
|
|
|
|
|
|
function test_MicroformatsAPI() {
|
|
|
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
|
|
|
Components.utils.import("resource://gre/modules/Microformats.js");
|
|
|
|
|
|
|
|
count = Microformats.count("geo",
|
|
|
|
document.getElementById("contentbody"),
|
|
|
|
{recurseExternalFrames: false},
|
|
|
|
0);
|
|
|
|
is(count, 1, "Only one geo - we don't count external frames");
|
|
|
|
|
|
|
|
count = Microformats.count("geo",
|
|
|
|
document.getElementById("contentbody"),
|
|
|
|
{recurseExternalFrames: true});
|
|
|
|
is(count, 2, "Two Geo's - one in frame and one in iframe");
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</pre>
|
2008-06-25 18:59:30 -07:00
|
|
|
|
|
|
|
<frameset>
|
|
|
|
<frame id="frame1">
|
|
|
|
<div>
|
|
|
|
<span class="notAMicroformat" id="notme">
|
|
|
|
<abbr class="foo">I am not a microformat</abbr>
|
|
|
|
<abbr class="title">Foolish title, not a format</abbr>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</frame>
|
|
|
|
<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>
|
|
|
|
</span>
|
|
|
|
</frame>
|
|
|
|
<frame id="frame2">
|
|
|
|
<div class="stuff">
|
|
|
|
<span>Testing is Fun!</span>
|
|
|
|
</div>
|
|
|
|
</frame>
|
|
|
|
</frameset>
|
|
|
|
|
|
|
|
<!-- Geo -->
|
|
|
|
<iframe id="iframe" src="geo.html" onload="onLoad();">
|
|
|
|
</iframe>
|
|
|
|
</body>
|
|
|
|
</html>
|