Closed Bug 835117 Opened 11 years ago Closed 11 months ago

Relative/base style sheet request malformed/404 when switching to tab from previous session

Categories

(Core :: CSS Parsing and Computation, defect)

17 Branch
x86_64
Windows Server 2003
defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: jab_creations, Unassigned)

Details

When I open Firefox tabs do not load until I open that tab. When the tab loads the style sheet fails to load, upon further investigation I found a repeating pattern in my access log which you can see below.

This seems to be a conjunction between relative URLs and the base element. This may or may not effect live URLs though feel free to test with my domain jabcreations.com if need be. I'm not  is this is dependent on localhost or not or if there is a dependent maximum/minimum range of time.

The lines of code I think are relevant...
/***
<base href="http://localhost/Version%203.0.0/www.jabcreations.com/" />
<link href="themes/classic/style.css" media="screen" rel="stylesheet" title="classic" type="text/css" />
***/

Full head element...
/***
<head>
<title>Browsers</title>
<meta name="description" content="Browser and rendering engine information including bugs and how well they handle my site." />
<meta name="keywords" content="John A. Bilicki III, web" />
<meta name="language" content="en" />
<meta name="robots" content="noarchive, index, follow" />
<base href="http://localhost/Version%203.0.0/www.jabcreations.com/" />
<link href="web/browsers/" rel="canonical" />
<link href="themes/classic/style.css" media="screen" rel="stylesheet" title="classic" type="text/css" />
<link href="themes/classic/style_cursors.css" media="screen" rel="stylesheet" title="classic" type="text/css" />
<link href="themes/style_user.css?1359276405" media="screen" rel="stylesheet" title="classic" type="text/css" />
<link href="opensearch.xml" rel="search" title="JAB Creations" type="application/opensearchdescription+xml" />
<link href="blog/rss/" rel="alternate" title="Blog RSS Feed" type="application/rss+xml" />
<link href="favicon.ico" rel="icon" />
<script defer="defer" src="scripts/index.js" type="application/javascript"></script>
<script defer="defer" src="scripts/members.js" type="application/javascript"></script>
<script defer="defer" src="scripts/admin.js" type="application/javascript"></script>
<script defer="defer" src="scripts/power_keys.js" type="application/javascript"></script>
<script defer="defer" src="scripts/onload.js?1359276405" type="application/javascript"></script>
</head>
***/

Searching for the string "style.css HTTP/1.1" 404 " in my localhost access log here is a sample of the URL requests that failed (user agents are not spoofed)...

127.0.0.1 - - [25/Nov/2012:15:37:03 -0500] "GET /Version%203.0.0/www.jabcreations.com/classicthemes/silver/style.css HTTP/1.1" 404 1342 "http://localhost/Version%203.0.0/www.jabcreations.com/blog/" "Mozilla/5.0 (Windows NT 5.2; WOW64; rv:10.0.11) Gecko/20100101 Firefox/10.0.11"
127.0.0.1 - - [25/Nov/2012:16:56:46 -0500] "GET /Version%203.0.0/www.jabcreations.com/classicthemes/silver/style.css HTTP/1.1" 404 1342 "http://localhost/Version%203.0.0/www.jabcreations.com/blog/" "Mozilla/5.0 (Windows NT 5.2; WOW64; rv:10.0.11) Gecko/20100101 Firefox/10.0.11"
127.0.0.1 - - [26/Nov/2012:14:00:38 -0500] "GET /Version%203.0.0/www.jabcreations.com/classicthemes/silver/style.css HTTP/1.1" 404 1388 "http://localhost/Version%203.0.0/www.jabcreations.com/blog/?prompt=options-basic" "Mozilla/5.0 (Windows NT 5.2; WOW64; rv:10.0.11) Gecko/20100101 Firefox/10.0.11"
127.0.0.1 - - [26/Nov/2012:17:13:19 -0500] "GET /Version%203.0.0/www.jabcreations.com/classicthemes/silver/style.css HTTP/1.1" 404 1342 "http://localhost/Version%203.0.0/www.jabcreations.com/blog/" "Mozilla/5.0 (Windows NT 5.2; WOW64; rv:10.0.11) Gecko/20100101 Firefox/10.0.11"
127.0.0.1 - - [26/Nov/2012:17:16:54 -0500] "GET /Version%203.0.0/www.jabcreations.com/greenthemes/classic/style.css HTTP/1.1" 404 1342 "http://localhost/Version%203.0.0/www.jabcreations.com/blog/" "Mozilla/5.0 (Windows NT 5.2; WOW64; rv:10.0.11) Gecko/20100101 Firefox/10.0.11"
127.0.0.1 - - [26/Nov/2012:17:18:10 -0500] "GET /Version%203.0.0/www.jabcreations.com/silverthemes/green/style.css HTTP/1.1" 404 1342 "http://localhost/Version%203.0.0/www.jabcreations.com/blog/" "Mozilla/5.0 (Windows NT 5.2; WOW64; rv:10.0.11) Gecko/20100101 Firefox/10.0.11"
127.0.0.1 - - [26/Nov/2012:17:19:34 -0500] "GET /Version%203.0.0/www.jabcreations.com/classicthemes/silver/style.css HTTP/1.1" 404 1342 "http://localhost/Version%203.0.0/www.jabcreations.com/blog/" "Mozilla/5.0 (Windows NT 5.2; WOW64; rv:10.0.11) Gecko/20100101 Firefox/10.0.11"
127.0.0.1 - - [26/Nov/2012:17:19:51 -0500] "GET /Version%203.0.0/www.jabcreations.com/silverthemes/classic/style.css HTTP/1.1" 404 1342 "http://localhost/Version%203.0.0/www.jabcreations.com/blog/" "Mozilla/5.0 (Windows NT 5.2; WOW64; rv:10.0.11) Gecko/20100101 Firefox/10.0.11"
127.0.0.1 - - [26/Nov/2012:17:20:01 -0500] "GET /Version%203.0.0/www.jabcreations.com/classicthemes/silver/style.css HTTP/1.1" 404 1342 "http://localhost/Version%203.0.0/www.jabcreations.com/blog/" "Mozilla/5.0 (Windows NT 5.2; WOW64; rv:10.0.11) Gecko/20100101 Firefox/10.0.11"
127.0.0.1 - - [26/Nov/2012:17:20:18 -0500] "GET /Version%203.0.0/www.jabcreations.com/silverthemes/classic/style.css HTTP/1.1" 404 1342 "http://localhost/Version%203.0.0/www.jabcreations.com/blog/" "Mozilla/5.0 (Windows NT 5.2; WOW64; rv:10.0.11) Gecko/20100101 Firefox/10.0.11"
127.0.0.1 - - [26/Nov/2012:17:23:36 -0500] "GET /Version%203.0.0/www.jabcreations.com/greenthemes/silver/style.css HTTP/1.1" 404 1342 "http://localhost/Version%203.0.0/www.jabcreations.com/blog/" "Mozilla/5.0 (Windows NT 5.2; WOW64; rv:10.0.11) Gecko/20100101 Firefox/10.0.11"
127.0.0.1 - - [26/Nov/2012:17:24:17 -0500] "GET /Version%203.0.0/www.jabcreations.com/classicthemes/green/style.css HTTP/1.1" 404 1342 "http://localhost/Version%203.0.0/www.jabcreations.com/blog/" "Mozilla/5.0 (Windows NT 5.2; WOW64; rv:10.0.11) Gecko/20100101 Firefox/10.0.11"
127.0.0.1 - - [26/Nov/2012:17:25:07 -0500] "GET /Version%203.0.0/www.jabcreations.com/greenthemes/classic/style.css HTTP/1.1" 404 1342 "http://localhost/Version%203.0.0/www.jabcreations.com/blog/" "Mozilla/5.0 (Windows NT 5.2; WOW64; rv:10.0.11) Gecko/20100101 Firefox/10.0.11"
127.0.0.1 - - [26/Nov/2012:17:25:42 -0500] "GET /Version%203.0.0/www.jabcreations.com/classicthemes/green/style.css HTTP/1.1" 404 1342 "http://localhost/Version%203.0.0/www.jabcreations.com/blog/" "Mozilla/5.0 (Windows NT 5.2; WOW64; rv:10.0.11) Gecko/20100101 Firefox/10.0.11"
127.0.0.1 - - [26/Nov/2012:17:26:43 -0500] "GET /Version%203.0.0/www.jabcreations.com/greenthemes/classic/style.css HTTP/1.1" 404 1342 "http://localhost/Version%203.0.0/www.jabcreations.com/blog/" "Mozilla/5.0 (Windows NT 5.2; WOW64; rv:10.0.11) Gecko/20100101 Firefox/10.0.11"
127.0.0.1 - - [26/Nov/2012:17:28:49 -0500] "GET /Version%203.0.0/www.jabcreations.com/classicthemes/green/style.css HTTP/1.1" 404 1342 "http://localhost/Version%203.0.0/www.jabcreations.com/blog/" "Mozilla/5.0 (Windows NT 5.2; WOW64; rv:10.0.11) Gecko/20100101 Firefox/10.0.11"
127.0.0.1 - - [26/Nov/2012:17:29:38 -0500] "GET /Version%203.0.0/www.jabcreations.com/classicthemes/silver/style.css HTTP/1.1" 404 1342 "http://localhost/Version%203.0.0/www.jabcreations.com/blog/" "Mozilla/5.0 (Windows NT 5.2; WOW64; rv:10.0.11) Gecko/20100101 Firefox/10.0.11"
127.0.0.1 - - [26/Nov/2012:17:30:23 -0500] "GET /Version%203.0.0/www.jabcreations.com/silverthemes/classic/style.css HTTP/1.1" 404 1342 "http://localhost/Version%203.0.0/www.jabcreations.com/blog/" "Mozilla/5.0 (Windows NT 5.2; WOW64; rv:10.0.11) Gecko/20100101 Firefox/10.0.11"
Did you check whether an old version of the page or style sheet was cached, based on HTTP caching semantics?  Did you compare the server requests to the network requests in inspector?

It's hard to figure out what's going on here without a way to reproduce the problem.
Component: DOM: CSS Object Model → Style System (CSS)
About 95% of the time I have cache disabled (via Chris Pederick's Web Developer toolbar extension). My software does not cache XHTML pages themselves, it caches pretty much everything else (CSS, JavaScript, images, etc) though.

Does this clarify enough, if not what else would help?
(In reply to John A. Bilicki III from comment #2)
> Developer toolbar extension). My software does not cache XHTML pages
> themselves, it caches pretty much everything else (CSS, JavaScript, images,
> etc) though.

What's "My software"?
"My software" is written entirely from scratch entirely by me. I'll be happy to clarify anything you need to help address the issue.
Is it a Web server?  A Firefox extension?  An intermediate cache between the server and the browser?  The pages being served by the Web server?

I don't think this bug contains enough information for somebody else to observe the problem, and therefore I don't think it's actionable.
Oh okay, my software is simply PHP/MySQL on my localhost Apache server (XAMPP). No extensions/addons or any caching mechanisms besides PHP for CSS/JavaScript and some Apache caching for images.

Here is the PHP cache code inside the style sheets...

---------------------------------------------------------------
<?php
$latest = getlastmod();
header('Cache-Control: max-age=600, public');
header('Last-Modified: '.gmdate('D, d M Y H:i:s',$latest).' GMT');

function cacheHeaders($lastModifiedDate)
{
 if ($lastModifiedDate)
 {
  if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $lastModifiedDate)
  {
   header('HTTP/1.1 304 Not Modified');
   die;
  }
  else
  {
   $gmtDate = gmdate('D, d M Y H:i:s\G\M\T',$lastModifiedDate);
   header('Last-Modified: '.$gmtDate);
  }
 }
}

cacheHeaders($latest);

header('Content-Type: text/css');
ob_start('ob_gzhandler');
?>
/* CSS here */
<?php ob_end_flush(); /*PHP Compression End*/ /**/?>
---------------------------------------------------------------

Does this help enough? If not I'll be happy to answer any other questions.
If I wanted to observe this bug happening, how would I do so?
To observe the bug open a page on my site and let the session expire (24 minute default I think); I guess it's more likely that the session needs to expire between opening/closing Firefox though activities may continue on other domains/tabs. When restarting Firefox the tab auto-load feature that was eventually added made no difference as this bug occurred in I think as far back as Firefox 3.6 if not further.

I used to send the HTTP style header "header('Content-Style-Type: text/css');" however that borked IE (of course) (adding this for clarification).

This bug does not always seem to occur and has been difficult for me to produce. However the <base /> element is always consistent and I've checked it using Firebug (as the view source makes a second request and would not reflect the initial/bugged request) and everything checks out.

Unfortunately the new host for the live version of my software/site isn't correctly logging file accesses; I think this has been an issue at least in the past on my live domain though it's certainly happening on http://localhost/.

I'm about to have a meal in a little bit, I can try to record a 1080p screen-capture video that demonstrates what is happening and explore the DOM a bit with Firebug after I return and the session expires.

I have separate profiles for Firefox 1.0, 1.5, 2.0, 3.0, 3.5, 3.6, 4.0 ~ 19.0 and can (if I wanted to) run all of them simultaneous so if you want me to test a few versions and even record them in the video let me know.

I've also considered the fact that the path is relative an issue. Also the folder "JAB Creations" has a space and that may or may not be a factor (PHP outputs the %20 encoding).

Offhand I'm not sure if the bug is triggered from restoring a tab after it's session has expired and that may also possibly trigger the bug.

Let me know what you think I should do and I'll try to get something with as much relevant information posted within the next few hours for you.
Take a step back: what URL do I load, what steps do I take, and how do I tell whether the behavior I've observed is what you're describing as this bug?
Please keep in mind that I have not been able to *reliably* determine how to replicate this bug so I'm giving you my best-guess.

1.) Most any URL from my site, e.g. www.jabcreations.com/blog/

2.) Leave it open for more than 24 minutes (I presume this may require the session to expire while the browser is still open though I could certainly be wrong). Do not switch to that tab and wander off and do other things for whatever reason without revisiting that tab until later in the directions.

3.) Make sure that Firefox's General/startup options restore previous tabs/windows.

4.) Close Firefox after the 24 minutes and then restart it.

5.) After Firefox restarts go to the tab with my site. It should be very clear whether or not the main style sheet has loaded or not.
I was able to reproduce it on localhost a few minutes ago. I wasn't at my desk for about an hour or two so the tab at the end with the style sheet that didn't load wasn't open/being looked at for roughly two hours.

Direct link...
https://cdn.anonfiles.com/1359315605538.avi

If that fails try this...
https://anonfiles.com/file/5f3f89093da9d741851568525a17148b

Let me know what else I can do to help and I'll be happy to do what I can.
I just confirmed the bug on my live site so it's definitely not limited to localhost.

1.) Had Firefox open and then went to play Skyrim for an hour or so.
2.) Switched to tab with my visitors log that was not previously loaded.
3.) Signed in.
4.) Switched to statistics page tab, no stylesheet loaded.
QA Whiteboard: qa-not-actionable

In the process of migrating remaining bugs to the new severity system, the severity for this bug cannot be automatically determined. Please retriage this bug using the new severity system.

Severity: major → --

Closing as INCOMPLETE since we didn't ever get reliable STR here, and the reporter's bugzilla account has since been deactivated.

Given that this went quiet and we haven't received similar bug reports that I'm aware of, hopefully it was a temporary/localized blip of some sort, or a bug that was fixed in Firefox or another piece of software that was involved here.

Status: UNCONFIRMED → RESOLVED
Closed: 11 months ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.