script: Avoid an allocation when getting attribute data.

15% improvement in selector matching performance on the rainbow page.

r? @SimonSapin