isSelfCollapsingBlock() is O(n + (n - 1) + (n - 2) + .. + (n-n)) in nested self-collapsing blocks

Rather than grovel through the descendants from every descendant in a tree of nested self-collapsing blocks use the result from the first grovel performed when laying out from ancestor of the self-collapsing blocks.

A block decides if it's self-collapsing after it has been laid out, and a nest of self-collapsing blocks gets laid out from the bottom up; so we reset the flag that tells us if a block has nothing but self-collapsing children directly after layout. That way the first grovel will tell us if a block has nothing but self-collapsing children. That allows subsequent calls to isSelfCollapsingBlock() to avoid the same journey through descendants, and more importantly when we layout a self-collapsing parent it does not have to descend below its children to learn if all of its descendants are self-collapsing. 

BUG=328440

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

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