Bug Tracker

Ticket #9093 (closed bug: worksforme)

Opened 3 years ago

Last modified 3 years ago

Css Body Background will disappear in old Opera

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

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>

Change History

comment:1 Changed 3 years ago by alistair.potts@…

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.

comment:2 follow-up: ↓ 6 Changed 3 years ago by addyosmani

  • Priority changed from undecided to low
  • Resolution set to worksforme
  • Status changed from new to closed
  • Component changed from unfiled to misc

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.

comment:3 Changed 3 years ago by anonymous

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.

comment:4 Changed 3 years ago by timmywil

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?

comment:5 Changed 3 years ago by alistair.potts@…

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).

comment:6 in reply to: ↑ 2 Changed 3 years ago by ajpotts77

Replying to 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/

comment:7 Changed 3 years ago by addyosmani

  • Keywords needsreview added

comment:8 Changed 3 years ago by xrstf

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.

comment:9 Changed 3 years ago by xrstf

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

Note: See TracTickets for help on using tickets.