#9239 closed bug (fixed)
Version 1.6.0 breaks the background behavior on body element
Reported by: | Golmote | Owned by: | |
---|---|---|---|
Priority: | blocker | Milestone: | 1.6.2 |
Component: | support | Version: | 1.6 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I encounter a really weird bug with version 1.6.0 on Opera 11.01 on Mac OS X
Just compare these two code snippets :
<!DOCTYPE HTML> <html lang="fr"> <head> <style type="text/css"> body { background: red; } </style> </head> <body> <div>Some content</div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script> </body> </html>
<!DOCTYPE HTML> <html lang="fr"> <head> <style type="text/css"> body { background: red; } </style> </head> <body> <div>Some content</div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script> </body> </html>
In the second case, the background color is strangely limited to the content...
Change History (25)
comment:1 Changed 12 years ago by
Component: | unfiled → misc |
---|---|
Priority: | undecided → low |
Resolution: | → worksforme |
Status: | new → closed |
comment:2 Changed 12 years ago by
Thanks for your answer.
I couldn't see any differences between the two jsFiddle test cases... So I compared my local code with the code generated by jsFiddle, and the bug gets weirder... it seems to happen only when the jQuery script is included in the <body>. Included in the <head> element, the problem doesn't occur.
I can't find any option to force jsFiddle so that it puts the JS at the end of the body... =/
Here are two test cases :
http://golmote.free.fr/jq6opera-head.html <-- This one works great
http://golmote.free.fr/jq6opera-body.html <-- This one doesn't
Again, I'm seeing the bug with Opera 11.01 on Mac OSX.
Thanks.
comment:3 Changed 12 years ago by
Component: | misc → support |
---|---|
Milestone: | 1.next → 1.6.2 |
Priority: | low → blocker |
Resolution: | worksforme |
Status: | closed → reopened |
This probably has something to do with the support mock body: http://jsfiddle.net/timmywil/9vAFE/4/show/
comment:4 Changed 12 years ago by
Status: | reopened → open |
---|
comment:7 Changed 12 years ago by
Summary: | Version 1.6.0 breaks the background-color behavior on body element → Version 1.6.0 breaks the background behavior on body element |
---|
IE8 as well
comment:8 Changed 12 years ago by
Same problem on version 1.6.1
The bug can be resolved on ligne 1288 from jquery-1.6.1.js.
Replace :
"documentElement.insertBefore( body, documentElement.firstChild );"
by
"documentElement.appendChild( body );"
comment:9 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
Fixes #9239. If the body is already present in the DOM, use a div within it to perform boxModel-related support tests. Unit test added.
Changeset: ceba855c010c792aad8fc15edc06b86285f71142
comment:14 Changed 12 years ago by
comment:15 Changed 12 years ago by
I also can confirm this bug is still present in 1.6.1 with IE8 standard mode.
comment:16 Changed 12 years ago by
The commit was made on May 13, but jQuery 1.6.1 was released on May 12. So yes, this problem is in 1.6.1 but should be fixed in 1.6.2 when it is released. The release will be announced in the blog.
comment:23 Changed 12 years ago by
Problem still appears to be present in 1.6.4 with Opera 9.5 on Windows Mobile 6.5.
If jquery is included in the <head> then no css background color is applied to the body. However if jquery is included in the <body> then css background color is applied to the body as expected.
In 1.6.4 replacing line 1299:
testElement = document.createElement( body ? "div" : "body" );
with
testElement = document.createElement( body ? "div" : "div" );
fixes this behavior, but it's hardly a fix.
Not sure on your policy for supporting older browsers so I understand that this may not get addressed, but thought it worth letting you know since it's taken me a while to track this down (javascript is not one of my strengths).
comment:24 Changed 12 years ago by
jQuery 1.6.4 still has this issue. I can reproduce the bug using the last Opera version. The proposed workaround from comment:23 seems to have side effects.
comment:25 Changed 11 years ago by
Use http://bugs.jquery.com/ticket/9239#comment:23 to fix this. Works without side effects.
Thanks for submitting a ticket to the jQuery Project. I've recreated your test cases here: http://jsfiddle.net/9vAFE/show/ (1.6) and http://jsfiddle.net/9vAFE/show/1 (for 1.5.2) and tested using Opera 11.01 on OSX. Both tests result in the same output with no visible differences. We will be closing this ticket but if this issue persists, please feel free to supply an additional test case that reproduces the issue and we'll re-evaluate.