Skip to content
This repository has been archived by the owner on Aug 10, 2020. It is now read-only.

Minor js things #31

Closed
jdalton opened this issue Nov 30, 2011 · 3 comments · Fixed by #61
Closed

Minor js things #31

jdalton opened this issue Nov 30, 2011 · 3 comments · Fixed by #61

Comments

@jdalton
Copy link
Contributor

jdalton commented Nov 30, 2011

I was browsing the js and noticed in controler.js

head = doc.head || doc.getElementsByTagName( "head" )[0] || docElem

is more weight than

head = doc.getElementsByTagName( "head" )[0] || docElem

for something that's executing once and being stored in a var it seems silly to html5 fork it.

Also curious about

//might need to wait until DOMReady in IE...
if( lastlink.nextSibling ){
  head.insertBefore(lk, lastlink.nextSibling );
} else {
  head.appendChild( lk );
}

I'm not sure of the lastlink.nextSibling check, is order really important?
Can't it all be done via the head.insertBefore(lk, lastlink.nextSibling ); without forking for appendChild?

@Wilto
Copy link
Member

Wilto commented Nov 30, 2011

As explanation for the first thing: if it weren’t for over-, I’m not sure I’d do any engineering at all.

For the second, yeah, you might be right—I’m not sure why order would matter there. I’ll swap that later on today.

@mathiasbynens
Copy link
Member

@jdalton Gah, you and your love/hate relationship with document.head! ;)

@Wilto
Copy link
Member

Wilto commented Dec 1, 2011

I get it, man. I still lay awake at night thinking about <dialog>, and that’s not even a thing anymore.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants