Proper support for border-box and improved style matching.