body.background should not be resolved according to the HTML spec

VERIFIED FIXED in mozilla7

Status

()

Core
DOM: Core & HTML
VERIFIED FIXED
6 years ago
6 years ago

People

(Reporter: Simon Pieters, Assigned: Ms2ger)

Tracking

({dev-doc-complete})

Trunk
mozilla7
dev-doc-complete
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
User-Agent:       Opera/9.80 (Macintosh; Intel Mac OS X 10.5.8; U; en) Presto/2.7.62 Version/11.01
Build Identifier: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:2.0b12pre) Gecko/20110216 Firefox/4.0b12pre

Firefox resolves body.background. HTML says it should not be resolved.

"The background IDL attribute of the body element must reflect the element's background content attribute. (The background content is not defined to contain a URL, despite rules regarding its handling in the rendering section above.)"
http://www.whatwg.org/specs/web-apps/current-work/complete/obsolete.html#dom-body-background

IE and WebKit match the spec. Opera has had both behaviors without noticing Web compat problems. Opera recently changed to resolve like Firefox, however we don't want to change back until we're certain that the spec will stay as is, which means we will wait until this bug is fixed in Firefox.

If you find a Web compat problem, that would be a good reason to change the spec.

Reproducible: Always

Steps to Reproduce:
1. Use <body background=foo>
2. Evaluate document.body.background
3.
Actual Results:  
body.background is resolved.

Expected Results:  
body.background should not be resolved.
(Assignee)

Updated

6 years ago
Component: DOM → DOM: Core & HTML
OS: Mac OS X → All
Hardware: x86 → All
Version: unspecified → Trunk
(Assignee)

Updated

6 years ago
Assignee: nobody → Ms2ger
(Assignee)

Updated

6 years ago
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
I think the main reason we resolve it is that DOM 2 HTML says to do so.  And we've done this since about 2003, fwiw...

It's simple enough to change; the only question is the compat one.

Fwiw, I would guess compat issues are more likely to arise when going from resolving to non-resolving than the other direction.
(Assignee)

Comment 2

6 years ago
Created attachment 525648 [details] [diff] [review]
Patch v1

I don't care much either way, but might as well post a patch.
Attachment #525648 - Flags: review?(bzbarsky)
Comment on attachment 525648 [details] [diff] [review]
Patch v1

Sure.
Attachment #525648 - Flags: review?(bzbarsky) → review+
(Assignee)

Comment 4

6 years ago
http://hg.mozilla.org/mozilla-central/rev/b9f7b9d2f09e
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Keywords: dev-doc-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
Documentation updated:

https://developer.mozilla.org/en/DOM/HTMLBodyElement
https://developer.mozilla.org/en/HTML/Element/body

And mentioned on Firefox 7 for developers.
Keywords: dev-doc-needed → dev-doc-complete

Comment 6

6 years ago
As visible here:
https://tbpl.mozilla.org/php/getParsedLog.php?id=6360833&full=1
'dom/tests/mochitest/dom-level2-html/test_HTMLBodyElement02.html' has passed:

132 INFO TEST-START | /tests/dom/tests/mochitest/dom-level2-html/test_HTMLBodyElement02.html
before 491520, after 487424, break 00000000
before 491520, after 487424, break 00000000
before 491520, after 487424, break 00000000
133 INFO TEST-PASS | Asize
134 INFO TEST-PASS | Asize
135 INFO TEST-PASS | backgroundLink
136 INFO TEST-END | /tests/dom/tests/mochitest/dom-level2-html/test_HTMLBodyElement02.html | finished in 126ms
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.