OBJECT being moved from HEAD into BODY

RESOLVED INVALID

Status

()

Core
HTML: Parser
RESOLVED INVALID
11 years ago
9 years ago

People

(Reporter: Jaroslav Zaruba, Assigned: mrbkap)

Tracking

1.8 Branch
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7

I have a document with OBJECT placed in HEAD. Though in resulting DOM the OBJECT ends up in BODY.
According to specs OBJECT within HEAD is perfectly legal.

Reproducible: Always

Actual Results:  
HTMLObjectElement within HTMLBodyElement in DOM

Expected Results:  
HTMLObjectElement within HTMLHeadElement in DOM
(Reporter)

Comment 1

11 years ago
Created attachment 241091 [details]
test-case

you can compare markup with resulting DOM

Updated

11 years ago
Assignee: nobody → mrbkap
Component: General → HTML: Parser
Product: Firefox → Core
QA Contact: general → parser
Version: unspecified → 1.8 Branch
(Reporter)

Comment 2

11 years ago
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a6pre) Gecko/20070602
Minefield/3.0a6pre
still present
(Reporter)

Comment 3

10 years ago
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a8pre) Gecko/2007080405 Minefield/3.0a8pre
still present :)

Comment 4

10 years ago
Having <object> imply <body> is correct per HTML 5.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → INVALID
(Reporter)

Comment 5

10 years ago
Does HTML5 say it is OK to generate HTML-4.01 documents with DOM-structure that doesn't respect its source markup?
(Reporter)

Comment 6

10 years ago
I'm still searching for such proclamation, if you could provide me with a link PLZ it would help. (I'm not sarcastic here.)
Otherwise I'd suggest to change status of this bug.

Comment 7

10 years ago
HTML 5 replaces HTML 4, yes.
(Reporter)

Comment 8

10 years ago
When a document is declared as HTML 4.01, IMO the parser should stick to its DTD (according to which an OBJECT-element is perfectly legal within HEAD)..
I believe HTML 5 is irrelevant for such a document.

Comment 9

10 years ago
That's not how HTML, or the Web works.
(Reporter)

Comment 10

10 years ago
(In reply to comment #9)
> That's not how HTML, or the Web works.

Thank you, Anne! That's what I call lossy compresion. ;))

So, because HTML5 is "replacement" for HTML4, UA should "fix" all HTML documents to conform to the new specs (which prohibits OBJECT within HEAD, doesn't it?) regardless of 1) source markup and 2) what docType is declared in the document?

Then what is the docType for?

If a markup violates specs let UA create a document that is not DTD-valid. But this is not the case.
Furthermore I'm yet to find a source that would support fixing of a document in favour of a _different_ DTD.
Could you, please Anne, point me to a proper document?
(Reporter)

Updated

10 years ago
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---

Comment 11

10 years ago
Dear Jaroslav, creating a DOM that isn't the (exact) representation of the source code is what every browser does. That's because the DOM can only represent code that contain's no errors.

HTML documents are able to contain code errors, but HTML4 doesn't define how to work with these errors. Result: browser inconsistency. HTML5 will define error reecovery.

You may be disappointed, but Anne is completly right. Doctypes never played a role on the web, they are completely useless. HTML5 only got one because of totally unrelated problems. XHTML doesn't need a doctype at all.

When HTML 4 appeared all existing HTML 3.2 documents automatically became HTML 4 documents. The same is happening with HTML 5. That's because user agents only know HTML documents (without version information).

This is explicitly stated on the top page of the HTML5 draft. See the last paragraph of http://www.whatwg.org/specs/web-apps/current-work/multipage/#status

All right, returning to the bug topic: object elements in head elements would only make sense if the declare attribute was implemented interoperable. This is impossible because HTML4 doesn't really define this attribute, so there's no harm in following HTML5's definition.

Dear Jaroslav, I'll close this bug. Please don't reopen it again. If there's further demand for discussion, please contact one of the many mailing list that are concerned with the future of HTML. http://www.whatwg.org/mailing-list should help you there.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 10 years ago10 years ago
Resolution: --- → INVALID
(Reporter)

Comment 12

10 years ago
Thanks for the effort, dear Daniel. Now that is what I call answer!

I am not disappointed by the fact that Anne is completely right (you are one funny guy, aren't you?); I just didn't find her answers very explaining (but you can see it for yourself), so I just didn't take those seriously...

Thanks again
  JZ

Comment 13

10 years ago
Jaroslav:

s/her/his/

See http://annevankesteren.nl/about for explanation.
(Reporter)

Comment 14

10 years ago
thanks, but I knew that

Updated

9 years ago
Duplicate of this bug: 456009
You need to log in before you can comment on or make changes to this bug.