Closed Bug 133112 Opened 24 years ago Closed 24 years ago

untitled alternate style sheet (<link rel="alternate stylesheet">) is not loaded

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

VERIFIED WONTFIX

People

(Reporter: martin.honnen, Assigned: dbaron)

Details

(Keywords: testcase, Whiteboard: WONTFIX?)

Attachments

(2 files)

When I include a style sheet with <link rel="alternate stylesheet" without a title attribute the style sheet doesn't appear in document.styleSheets nor does the HTMLLinkElement a sheet property allowing me to script the style sheet. Thus there is no way to enable that style sheet with script. I don't see any reason why a style sheet linked in without a title should not be accessible to script. Indeed it is linked in without a title to not appear in the user agents style sheet menu but to be solely enabled by script.
The test case works as intended with IE6, that is it shows document.styleSheets.length: 2 and the text is colored green. With Mozilla document.styleSheets.length: 1 and as the style sheet can't be scripted and enabled the text is colored blue. Note that the test case works with Mozilla if a title attribute is added to the link element.
Keywords: testcase
Per the HTML spec the bahavior of a sheet which is an alternate and has no title is completely undefined (an alternate stylesheet _must_ have a title set per that): To specify an alternate style sheet, set the rel attribute to "alternate stylesheet" and name the style sheet with the title attribute. In fact, the HTML Content sink code has: if (-1 != linkTypes.IndexOf(NS_LITERAL_STRING("stylesheet"))) { // is it a stylesheet link? if (-1 != linkTypes.IndexOf(NS_LITERAL_STRING("alternate"))) { // if alternate, does it have title? if (0 == aTitle.Length()) { // alternates must have title return NS_OK; //return without error, for now } else { isAlternate = PR_TRUE; } } So we simple never load the sheet.
Assignee: jst → dbaron
Component: DOM Style → Style System
OS: Windows XP → All
Hardware: PC → All
Summary: untitled alternate style sheet (<link rel="alternate stylesheet">) doesn't appear in document.styleSheets → untitled alternate style sheet (<link rel="alternate stylesheet">) is not loaded
I think our current behaviour is correct. Untitled alternate stylesheets are not stylesheets per HTML. I think this is a WONTFIX.
Status: NEW → ASSIGNED
Whiteboard: WONTFIX?
(er. Accidentally marked bug ASSIGNED.)
Status: ASSIGNED → NEW
I'll agree with Ian here. It's better not to create a quirky behavior that other implementations will have to imitate, since we're the first implementation of the HTML spec's alternate stylesheet rules.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → WONTFIX
VERIFIED pep comments
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: