Consistently cache ElementData::length() before loops

Consistently cache ElementData::length() before loops as this method is not
a simple getter (it contains a conditional branch) and we don't want to call
it for each iteration of the loop.

Previously, it was only cached before some of the loops. This CL makes this
consistent. Also, use length for the variable instead of len, as we prefer to
avoid abbreviations, as per coding style.

Same thing for Element::attributeCount() as it calls ElementData::length().

R=adamk, eseidel

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

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