Partial fix for background images on wikipedia pages.

This fixes the visual artifacts seen at the top of wikipedia pages by:
 - Setting clipping rect to avoid images going outside their bounds.
 - Handling case of background-position being >= 100% such that wrapping is required.

However, the gradient is not currently visible on wikipedia. This relies on bug #1997 being fixed.
Fix reftest now that the background image code clips correctly.
Merge pull request #3283 from glennw/bg-image

Partial fix for background images on wikipedia pages.
Make use of the list of Atoms in ClassSelector

Make use of the list of Atoms in the class attribute selector
(ClassSelector) in selector_matching.

Fixes #3111