Monday, August 24, 2009

Background Images Not Showing Up in Safari

Background images were not showing up in Safari for a particular web site.

Further testing indicated that putting content in the cell would make the background image show up to the point the cell was populated. In other words if I typed a bunch of lines of the word test with a break after each one, the background image would show up as far as the test list went down the page. I thought we could solve the problem by inserting an image of the particular size and shape we wanted to force the background to show up, however since the content on the page would grow and shrink we didn't have a specific height, and apparently height = 100% wasn't going to work either.

Further investigation seemed to indicate the problem had something to do with row spans where perhaps the browser has a problem calculating the height that the background image needs to be if the column it is in spans multiple rows. That's just a guess because I didn't spend time testing this out. Basically I just redesigned the page to eliminate the row spans and made the layout of the code a lot simpler and cleaner and the problem went away.

If someone had more time than I do right now some testing could probably further pinpoint the issue.

Saturday, August 15, 2009

Java Generics List Iterator

Example of using Java generics list iterator

List<Element> l;

for (ListIterator<Element> it = l.listIterator(); it.hasNext(); )
{
Element e = it.next();
.....
}