Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Firefox CSS parser does not support multipart responses properly

10 views
Skip to first unread message

Christoph Dorn

unread,
Feb 24, 2007, 8:05:12 PM2/24/07
to
Does and/or should the CSS parsing engine that loads text/css server
responses support multipart/mixed response content?

I am working on the FirePHP project (http://www.firephp.org/) which
sends multipart responses in order to embed debug information into the
response without affecting how Firefox renders the page.

A sample response body for a text/css file looks like this:


--dc4b00ada3c698a5267b44d58caca336
Content-type: text/css

HTML, BODY {
PADDING: 2px;
background-color: #EEEEEE;
}

HTML, BODY, P {
FONT-FAMILY: verdana;
FONT-SIZE: 10px;
}
--dc4b00ada3c698a5267b44d58caca336
Content-type: text/firephp

DEBUG INFO

--dc4b00ada3c698a5267b44d58caca336--


When Firefox loads this page as a standard stylesheet include:

<link href="Multipart.php?File=Style" rel="stylesheet"></link>

I get the following warnings and not all directives are loaded. If I
access the CSS file with the multipart response directly in the
browser only the text/css section is displayed as expected.

* Warning: The stylesheet .../Multipart.php?File=Style was loaded as
CSS even though its MIME type, "multipart/firephp", is not "text/css".
* Warning: Selector expected. Ruleset ignored due to bad selector.
* Warning: Unexpected end of file while searching for closing } of
invalid rule set.

You can see a live example here: http://www.firephp.org/Demo/Tests.htm
NOTE: You must have the Firebug and FirePHP extension installed to see
the warning.

Is there any way I can specify an additional header to make this work
properly or is this a limitation of the CSS content handler in
Firefox?

Any suggestions on how this could be implemented/fixed?

Thanks
Christoph

Boris Zbarsky

unread,
Feb 25, 2007, 2:42:00 PM2/25/07
to
Christoph Dorn wrote:
> Does and/or should the CSS parsing engine that loads text/css server
> responses support multipart/mixed response content?

It doesn't. Whether it should is pretty unclear.

> * Warning: The stylesheet .../Multipart.php?File=Style was loaded as
> CSS even though its MIME type, "multipart/firephp", is not "text/css".

I should note that that type is not multipart/mixed. And the fact that you got
that warning means the page is in quirks mode; at that point we'll just assume
that you're serving up CSS.

> Is there any way I can specify an additional header to make this work
> properly

No. But in fact, it won't work in any existing UA, so....

-Boris

Christoph Dorn

unread,
Feb 25, 2007, 4:12:25 PM2/25/07
to
A multipart/mixed response with a text/css section and another section
which is handled by a custom handler via a Firefox extension that
returns no data displays properly in the browser as a text/css file. I
was hoping the CSS parser would treat the response in the same way but
I guess it looks at the response at a lower level.

This is the same situation as discussed here:
http://groups.google.com/group/mozilla.dev.tech.xml/browse_thread/thread/e1599de6fc31f2e8/a03c065ba21f71ac#a03c065ba21f71ac

I'll find another way to send debug information.

Thanks!
-Christoph

Boris Zbarsky

unread,
Feb 25, 2007, 4:44:57 PM2/25/07
to
Christoph Dorn wrote:
> A multipart/mixed response with a text/css section and another section
> which is handled by a custom handler via a Firefox extension that
> returns no data displays properly in the browser as a text/css file.

Yes. The generic content-dispatch code dispatches it to the multipart/mixed
handler (because the browser itself does not support multipart/mixed), which
breaks it up into multiple pieces. The browser never sees the multipart/mixed data.

> I was hoping the CSS parser would treat the response in the same way but
> I guess it looks at the response at a lower level.

That's correct. The CSS parser sees the HTTP response as it comes from the server.

-Boris

0 new messages