This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 13746 - CONTENT_FORMAT_SUPPORT-10: Using the "correct" X(HT)ML method of referring to inline stylesheets causes problems
Summary: CONTENT_FORMAT_SUPPORT-10: Using the "correct" X(HT)ML method of referring to...
Status: RESOLVED FIXED
Alias: None
Product: mobileOK Basic checker
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: fd
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-10 10:00 UTC by theimp
Modified: 2011-09-02 16:59 UTC (History)
0 users

See Also:


Attachments

Description theimp 2011-08-10 10:00:34 UTC
If an X(HT)ML file includes a document-internal Processing Instruction to a style element in the head; as per
Associating Style Sheets with XML documents 1.0 Recommendation
(see also http://www.w3.org/TR/2002/REC-xhtml1-20020801/#C_14)

The user agent, in this case the mobileOK checker, will fetch the source document again, while it should process the referred element.

This will almost certainly result in the above error, because it will fetch the entire parent again, but as the page was some kind of XHTML, the server is highly unlikely to be able to sensibly provide the exact same resource in text/css format.

It will also typically trigger PAGE_SIZE_LIMIT because it counts the original page size twice; once as the page, and once as a stylesheet.

There was some discussion of this issue in the Mozilla Firefox browser at https://bugzilla.mozilla.org/show_bug.cgi?id=676740 which indicated that the published correct method of referencing inline stylesheets with XML Processing Instructions was the culprit, and that it would (probably) never be fixed correctly by anyone, with the illusion of correct behavior being due to capricious hacks.
Comment 1 fd 2011-08-16 08:02:55 UTC
OK, that's indeed a possibility we had overlooked.

It seems the right behavior for the mobileOK Checker would be to ignore document-internal processing instructions as there's nothing it needs to do with it: style elements referenced by these instructions are already checked by the mobileOK Checker since they appear in the HTML content.
Comment 2 theimp 2011-08-16 12:28:58 UTC
Yes, in 99% of cases that will work for any user agent that processes the style element specially.

However, the Mozilla developers considered that to be a hack, because something like a base element or header would make the fragment refer to another URI.

They contend that fixing it properly, taking everything into account, is functionally impossible (without breaking the entire web). I'm not so sure, but I'm much less of an expert than most of them.

On the other hand, I think that this will always be the author-intended result, regardless of what the specifications say, so I agree that it's probably the best (at least, the most practical) solution.

(The Mozilla developers, on the other hand, recommend simply not using the document-internal reference in an XML Processing Instruction.)
Comment 3 fd 2011-09-02 16:59:50 UTC
CSS Resource extractor updated to ignore Processing Instructions that contain document-internal reference.

Regression test added (CONTENT_FORMAT_SUPPORT 29).

(note updated code has not been deployed on production yet)