Avoid calling hasAttribute() and then getAttribute() for performance

Avoid calling hasAttribute() and then getAttribute() for performance.
This causes the attribute to be looked up (linear search) twice instead
of once if we call getAttribute() directly and then check if the returned
AtomicString is null.

R=eseidel@chromium.org, eseidel, rwlbuis

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

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