#!/usr/bin/perl
#
# Generate torture-test for Bug #58917 in bugzilla.mozilla.org
#
# http://bugzilla.mozilla.org/show_bug.cgi?id=58917
#
# Usage:
#
#   ./torture.pl N > tortureN.html
#
#   where "N" is the number of nested FONT tags desired

use strict;


my $level = 400;

if (scalar(@ARGV) > 0) {
    my $new_level = int(shift @ARGV);
    $level = $new_level if ($new_level > 0);
}

print <<EOHTML;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Torture Test for Bug #58917</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
EOHTML

print <<EOHTML;
<p>1..$level</p>
<p>
EOHTML

for my $i (1..$level) {
    print <<EOHTML;
<font size="1" face="Arial">$i
EOHTML
}

for my $i (1..$level) {
    print <<EOHTML;
</font>
EOHTML
}

print <<EOHTML;
</p>
</body>
</html>
EOHTML

exit 0;
