Start using more typed units in the compositor

Now that rust-layers is starting to support typed units, we can use
them more thoroughly in the compositor. This is a step toward removing
as many untyped units as possible.
Move the script type and language checks into HTMLScriptElement.

This is IMO a more sensible place for them to live, and prepares for the
demise of hubbub_html_parser.rs, as we move to html5ever.
Merge pull request #3196 from Ms2ger/script

Move the script type and language checks into HTMLScriptElement.
Merge pull request #3173 from mrobinson/typed-units-1

Start using more typed units in the compositor