Optimizations to Element::getAttribute