Fix ASSERT in isSelfCollapsingBlock

If margin collapsing results in a float intruding into a box then
we mark it for another layout. If we check whether the block is
self-collapsing before that layout happens ASSERT(!needsLayout())
will fail. The ASSERT is worth keeping, and isSelfCollapsingBlock()
does quite a bit of work, so we should cache the result of our first
call rather than calling it repeatedly on the same child. The result
is less work overall.

BUG=339747

Review URL: https://codereview.chromium.org/152343002

git-svn-id: svn://svn.chromium.org/blink/trunk@166459 bbb929c8-8fbe-4397-9dbb-9b2b20218538