Optimize rect invalidation by examining style differences

Style differences are grouped in Visual and Layout differences. On
visual differences, a raw invalidate() call occurs; on Layout
differences, realignment is requested and otherwise invalidation only
happens if the rects actually change.