<LINK> should never load when emebedded into the <BODY> element.




HTML: Parser
10 years ago
10 years ago


(Reporter: F. REMY, Unassigned)


Firefox Tracking Flags

(Not tracked)



(3 attachments)



10 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 3.0.04506.30; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
Build Identifier:

        <!-- Should be ignored -->
          href="data:text/css,html{color: red}"
        <!-- Content of the document -->
        <div>This should be black.</div>

Reproducible: Always

Steps to Reproduce:
1. Create an HTML page with a LINK in the BODY
2. Run the page
3. See that the LINK were applied
Actual Results:  
The LINK is applied as it was in the HEAD section, which is not true.
In fact, the LINK is moved to the HEAD section (you can see through the DOM).

The LINK tag should not move and should be ignored.

Expected Results:  
"Unlike A, it [[ the LINK tag ]] may only appear in the HEAD section of a document." (HTM4)

"Where this tag [[LINK]] may be used :
- Where metadata content is expected. [[And thus not in the BODY]]
- In a noscript element that is a child of a head element. " (html5)

==> Both specify that LINK can't be in the BODY tag, and should thus be ignored (as the BASE tag is when putted in the BODY tag)


Comment 1

10 years ago
Creating independent test case in HTML 4.01, and XHTML 1.0.

Comment 2

10 years ago
Created attachment 330107 [details]
HTML 4.01 testcase

Here is the HTML 4.01 Test Case for this bug.

Comment 3

10 years ago
Created attachment 330109 [details]
XHTML 1.0 testcase

XHTML 1.0 DOCTYPE testcase

Comment 4

10 years ago
Created attachment 330110 [details]
No DOCTYPE testcase

This testcase has no DOCTYPE.

Comment 5

10 years ago
All of these test cases show the text as red in Firefox 3.0 on XP, and in Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1a1pre) Gecko/2008071703 Minefield/3.1a1pre on Vista. However, they show as black (correct) in IE7 and IE8 B1, so it is a FF issue.

Comment 6

10 years ago
Don't stop reading specs as soon as you find something you like.

From the HTML5 draft cited in comment 0:

For HTML documents, user agents must use the parsing rules described in this section to generate the DOM trees. Together, these rules define what is referred to as the HTML parser.
This specification defines the parsing rules for HTML documents, whether they are syntactically correct or not. 
(...) The "in body" insertion mode
A start tag token whose tag name is one of: "base", "command", "eventsource", "link", "meta", "noframes", "script", "style", "title"

    Process the token using the rules for the "in head" insertion mode.

In summary, moving the element to the head is the correct behavior.
Last Resolved: 10 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.