Refactoring: Use existing toHTMLFoo() functions.

 - toHTMLCanvasElement()
 - toHTMLDocument()
 - toHTMLPlugInElement()
 - toHTMLStyleElement()
 - toHTMLTemplateElement()

Also, update toHTMLTemplateElement() so that ASSERT_WITH_SECURITY_IMPLICATION
can be used in !NDEBUG.

BUG=none
TEST=none; no behavior change.

Review URL: https://chromiumcodereview.appspot.com/23604025

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