Empty stylesheet links causing multiple page loads

RESOLVED DUPLICATE of bug 225554

Status

()

Firefox
General
RESOLVED DUPLICATE of bug 225554
10 years ago
10 years ago

People

(Reporter: Trevor Oxborrow, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

10 years ago
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>

Updated

10 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 225554
You need to log in before you can comment on or make changes to this bug.