Not quite correct. The #mainArea background does indeed extend into sidebar, or it would not have extended as far right as it actually does, but #sidebar's height does NOT affect the height of #content (remember it's float: right)
As such, the height of #mainArea is ONLY dependent on the height of #content.
See what happens if you move all your <br/> tags from #sidebar to #content.
Adding a <div style="clear: right"></div>, after #content, will force the height of #mainArea to be whichever is higher of #sidebar and #content.
I recommend using a browser that allows you to inspect elements, such as Firefox with the Firebug addon. Finding such problems as this would take you no less than a few seconds that way.
Another way to see what happens is adding borders to #mainArea, #content and #sideBar, but they can also screw up layout since borders take up space.