fix for 'tracing a path'

Integrate of
git-svn-id: http://svn.whatwg.org/webapps@8314 340c8d12-0b0e-0410-8428-c7bf67bfef74
and
git-svn-id: http://svn.whatwg.org/webapps@8225 340c8d12-0b0e-0410-8428-c7bf67bfef74
for https://www.w3.org/Bugs/Public/show_bug.cgi?id=23527