Last Comment Bug 635194 - body.background should not be resolved according to the HTML spec
: body.background should not be resolved according to the HTML spec
Status: VERIFIED FIXED
: dev-doc-complete
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla7
Assigned To: :Ms2ger (⌚ UTC+1/+2)
:
: Andrew Overholt [:overholt]
Mentors:
http://software.hixie.ch/utilities/js...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-18 03:07 PST by Simon Pieters
Modified: 2011-09-13 05:23 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (3.37 KB, patch)
2011-04-13 02:46 PDT, :Ms2ger (⌚ UTC+1/+2)
bzbarsky: review+
Details | Diff | Splinter Review

Description Simon Pieters 2011-02-18 03:07:51 PST
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.
Comment 1 Boris Zbarsky [:bz] (still a bit busy) 2011-02-18 08:57:39 PST
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.
Comment 2 :Ms2ger (⌚ UTC+1/+2) 2011-04-13 02:46:18 PDT
Created attachment 525648 [details] [diff] [review]
Patch v1

I don't care much either way, but might as well post a patch.
Comment 3 Boris Zbarsky [:bz] (still a bit busy) 2011-04-14 22:23:10 PDT
Comment on attachment 525648 [details] [diff] [review]
Patch v1

Sure.
Comment 4 :Ms2ger (⌚ UTC+1/+2) 2011-06-04 03:57:05 PDT
http://hg.mozilla.org/mozilla-central/rev/b9f7b9d2f09e
Comment 5 Eric Shepherd [:sheppy] 2011-08-04 10:41:40 PDT
Documentation updated:

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

And mentioned on Firefox 7 for developers.
Comment 6 Ioana (away) 2011-09-13 05:23:28 PDT
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

Note You need to log in before you can comment on or make changes to this bug.