document.body returns last <body> element when it should return the first

RESOLVED FIXED

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: roc, Assigned: roc)

Tracking

(Blocks: 1 bug, {regression, testcase})

Trunk
regression, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

Created attachment 324894 [details]
testcase

The HTML5 spec is clear that "the body element" is the first body element. We use the last. See attached testcase, which tests document.body as well as propagation of the body's background to the viewport.
Created attachment 324896 [details] [diff] [review]
fix

I think GetHtmlContent could be useful in various places but I've refrained from refactoring all those here.
Attachment #324896 - Flags: superreview?(jonas)
Attachment #324896 - Flags: review?(jonas)
Comment on attachment 324894 [details]
testcase

per roc, changing content-type to application/xml
Attachment #324894 - Attachment mime type: text/html → application/xml
Comment on attachment 324894 [details]
testcase

trying again with application/xhtml+xml, so HTML DOM applies
Attachment #324894 - Attachment mime type: application/xml → application/xhtml+xml
WFM Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/2008040413 Firefox/2.0.0.14
Busted Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008061216 Minefield/3.0 (RC3)
Keywords: regression, testcase
Attachment #324896 - Flags: superreview?(jonas)
Attachment #324896 - Flags: superreview+
Attachment #324896 - Flags: review?(jonas)
Attachment #324896 - Flags: review+
checked in.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED

Updated

10 years ago
Component: DOM: HTML → DOM: Core & HTML
Summary: document.body returns wrong element → document.body returns last <body> element when it should return the first
You need to log in before you can comment on or make changes to this bug.