Use return type to prevent slow children

This patch is a followup to [1] to use the return type from
{first,last}Child() to prevent calling slow{First,Last}Child when a
faster version is available.

[1] https://src.chromium.org/viewvc/blink?view=rev&revision=174655

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

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