Closed Bug 444936 Opened 16 years ago Closed 16 years ago

Empty stylesheet links causing multiple page loads

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 225554

People

(Reporter: trevox, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9) Gecko/2008052906 Firefox/3.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9) Gecko/2008052906 Firefox/3.0

Leaving hrefs empty in stylesheet links of html <head> apparently 
causes Firefox to reload the page at least once. This results in a larger
pagecount than expected. IE6, IE7 and Opera do not display the problem. In Firefox 2.0.0.14 there were more extra page loads (one per empty link) than there are in Firefox 3 (one extra in total).

Reproducible: Always

Steps to Reproduce:
1. Load any page which programatically counts page loads.
2. Observe the page count increment - it will be more than 1.
3. 
Actual Results:  
Page count increments by at least 2 following page load.

Expected Results:  
Page count should increment by 1 following page load.

Discovered whilst using PHP in html page. Test code extract below:
<head>
<!-- stuff cut -->
<link href="" rel="stylesheet" type="text/css" media="print"> 
<link href="" rel="stylesheet" type="text/css" media="screen"> 
</head>

<body>
<!-- stuff cut -->

<?php

// if neither page has been visited this session
if (!isset($_SESSION['pagecounters']))
    {
    // initialise counter array
    $_SESSION['pagecounters'] = array( 
    'page1' => 0, 
    'page2' => 0 
    ); 
    }
    
else // (one page has been visited this session)
    // increment count for this page (page1)
    {
    $_SESSION[pagecounters][page1]++;
    }

// display counter values
print_r ($_SESSION);
echo "<br>\n";
echo ("Value in array for page1: {$_SESSION[pagecounters][page1]}<br>\n") ;
echo ("Value in array for page2: {$_SESSION[pagecounters][page2]}<br>\n") ;
?>

</body>
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.