Skip to main content

Bug Tracker

Side navigation

#9093 closed bug (worksforme)

Opened May 04, 2011 10:51AM UTC

Closed May 04, 2011 12:28PM UTC

Last modified March 14, 2012 05:16AM UTC

Css Body Background will disappear in old Opera

Reported by: alistair.potts@gmail.com Owned by:
Priority: low Milestone: 1.next
Component: misc Version: 1.6
Keywords: needsreview Cc:
Blocked by: Blocking:
Description

I realise that there's no support for Opera < 10.6, but jquery makes any body background image vanish in older Opera versions, which isn't good.

Happens when jquery is in the body. Failure verified to occur on Opera 9.64 on Windows.


<!DOCTYPE html>

<style>
  body{ background-image: url("/whatever.png"); }
</style>

<body>
<script src="/jquery.js"></script>

Attachments (0)
Change History (9)

Changed May 04, 2011 11:02AM UTC by alistair.potts@gmail.com comment:1

The reason is that jquery1.6 is now creating a magic disconnected body element, and setting the background to none (line 1281). In old opera, this makes the background of the real body disappear too.

Apparently, the background needs to be set to "none" because of bug #9028 (IE crash).

Possible solution is only to set the background to "none" if it's IE.

Changed May 04, 2011 12:28PM UTC by addyosmani comment:2

component: unfiledmisc
priority: undecidedlow
resolution: → worksforme
status: newclosed

I've tested http://jsfiddle.net/df9nM/1/show/ (a working reproduction of your test case, pardon the image) with all versions of Opera I have back to 9.64 (9.64,10,10.6) using jQuery 1.6 and haven't been able to reproduce this issue at all. The body background is completely visible. Please note that #9028 has been fixed.

If anyone is able to reproduce the issue in Opera < 10.6 (or provide an alternative test case that does reproduce) please feel free to re-open this ticket.

Changed May 04, 2011 02:03PM UTC by anonymous comment:3

Hello, not sure if my previous comment went through, anyway:

http://jsfiddle.net/prhf4/

is the test case I've made. In Opera 9.64 / win32 you'll see that nothing shows in the bottom right pane. The problem is the _fix_ that was made in #9028, which sets the background to "none" on the disconnected body element.

Changed May 04, 2011 02:29PM UTC by timmywil comment:4

I don't see how that fix could be related as it only sets background to none on our mock body. No browser confuses setting it's style with a css rule that would affect all body elements...right?

Changed May 04, 2011 03:13PM UTC by alistair.potts@gmail.com comment:5

Well, you'd think so. But apparently not in Opera. Line 1281 is definitely what's causing it, just commenting it out is an immediate fix (but obviously not satisfactory).

Changed May 05, 2011 12:07PM UTC by ajpotts77 comment:6

Replying to [comment:2 addyosmani]:

I've tested http://jsfiddle.net/df9nM/1/show/ (a working reproduction of your test case, pardon the image) with all versions of Opera I have back to 9.64 (9.64,10,10.6) using jQuery 1.6 and haven't been able to reproduce this issue at all. The body background is completely visible. Please note that #9028 has been fixed. If anyone is able to reproduce the issue in Opera < 10.6 (or provide an alternative test case that does reproduce) please feel free to re-open this ticket.

I've tried a few more tests and you don't need a body tag at all, you just need the jquery script to load after the style.

http://jsfiddle.net/prhf4/1/

Changed May 06, 2011 06:28AM UTC by addyosmani comment:7

keywords: → needsreview

Changed August 10, 2011 01:28AM UTC by xrstf comment:8

I'm seeing the same problem using Opera 11.50 and jQuery 1.6.2. Putting jQuery at the end of the page cuts off the background.

Changed August 10, 2011 01:33AM UTC by xrstf comment:9

Oops, never mind, was using 1.6.1 -- 1.6.2 fixes the problem.