Make the existing algorithm recursive, accounting for boxes which contain line boxes indirectly. Fixes some button alignment issues on Wikipedia.