Introduce HTMLDataListOptionsCollection subclass for HTMLCollection

Introduce HTMLDataListOptionsCollection subclass for HTMLCollection to improve
code readability. This moves the element matching logic out of HTMLCollection
and allows for tighter typing since an HTMLDataListOptionsCollection can only
contain HTMLOptionElements.

This gets rid of a lot of casting at call sites.

R=adamk@chromium.org, haraken@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@180675 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Make it obvious an HTMLOptionsCollection can only contain HTMLOptionElements

Make it obvious an HTMLOptionsCollection can only contain HTMLOptionElements by
using tighter typing. This CL also moves the Element matching code from
HTMLCollection to the HTMLOptionsCollection subclass for consistency with other
HTMLCollection subclasses.

R=adamk@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@180676 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Use NodeTraversal instead of ElementTraversal in VisitedLinkState

Use NodeTraversal instead of ElementTraversal in VisitedLinkState to avoid
redundant Node::isElementNode() checks. Since isLink() is defined on Node, and
not on Element, we can simply iterate through all Nodes and then calls isLink()
on them (instead of isElementNode() && toElement(node).isLink()).

R=esprehn@chromium.org, adamk@chromium.org

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

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