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.
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.
Created attachment 525648 [details] [diff] [review] Patch v1 I don't care much either way, but might as well post a patch.
Comment on attachment 525648 [details] [diff] [review] Patch v1 Sure.
Documentation updated: https://developer.mozilla.org/en/DOM/HTMLBodyElement https://developer.mozilla.org/en/HTML/Element/body And mentioned on Firefox 7 for developers.
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