Ensure ElementData exists before modifying when animating class attribute

This is a merge of http://trac.webkit.org/changeset/153835
by Rob Buis <rwlbuis@webkit.org>.

BUG=334194

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

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