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
: 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]
Depends on:
  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:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

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

Description User image 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.)"

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
Actual Results:  
body.background is resolved.

Expected Results:  
body.background should not be resolved.
Comment 1 User image 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 User image :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 User image Boris Zbarsky [:bz] (still a bit busy) 2011-04-14 22:23:10 PDT
Comment on attachment 525648 [details] [diff] [review]
Patch v1

Comment 4 User image :Ms2ger (⌚ UTC+1/+2) 2011-06-04 03:57:05 PDT
Comment 5 User image Eric Shepherd [:sheppy] 2011-08-04 10:41:40 PDT
Documentation updated:

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