Avoid repainting non needs-self-layout container
The idea behind this change is that when an object is marked
because his descendant needs layout, we should be able to avoid
invalidation. This change is intentionally conservative as we
can iterate on the checks as we find new areas for improvement.
This change doesn't cause any changes in fast/repaint but
does improve the test case on the bug by not repainting
some anonymous wrappers.
BUG=
313447