#!/usr/bin/perl

$SIZE{'fh'} = ' height=400';
$SIZE{'ph'} = ' height=80%';
$SIZE{'fw'} = ' width=600';
$SIZE{'pw'} = ' width=80%';
$SIZE{''} = '';
$SRC = 'src=foo.html';
$FILELIST = 'file:///s|/mozilla/layout/html/tests/frameset/iframe/iframe_tst.html
file:///s|/mozilla/layout/html/tests/frameset/iframe/IphpwtphpwMC.html
';

foreach $height ('','fh','ph') {
 foreach $width ('','fw','pw') {
  &gentc($height,$width);
  foreach $theight ('','fh','ph') {
   foreach $twidth ('','fw','pw') {
    &gentc($height,$width,'t',$theight,$twidth);
   }
  }
 }
}
&genfilelist();

sub gentc {
  my ($height, $width, $table, $theight, $twidth) = @_;
  my $file = 'I'.$height.$width.$table.$theight.$twidth.'.html';
  $FILELIST .= 'file:///s|/mozilla/layout/html/tests/frameset/iframe/'.$file."\n";
  if (open (FILE, '>'.$file)) {
   if ($table) { print FILE '<table border'.$SIZE{$theight}.$SIZE{$twidth}."><tr><td>\n"; }
   print FILE "<iframe $SRC".$SIZE{$height}.$SIZE{$width}."></iframe>\n";
   if ($table) { print FILE "</td></tr></table>\n"; }
   close FILE;
  }
}

sub genfilelist {
  if (open (LISTFILE, '>file_list.txt')) {
   print LISTFILE $FILELIST;
   close LISTFILE;
  }
}