Make more use of smart pointers in ScriptElement.cpp.
Pull request: https://github.com/WebKit/WebKit/pull/19359
Committed 269679@main (9abc7cc058f0): <https://commits.webkit.org/269679@main> Reviewed commits have been landed. Closing PR #19359 and removing active labels.
<rdar://problem/117378400>