public static HeadElement getHead() {
return getHead(getDocument());
}
public static HeadElement getHead(Document document) {
HeadElement result = document.getHead();
if (result == null) {
// Some versions of Firefox return undefined for the document.head.
result = (HeadElement) document.getElementsByTagName("head").item(0);
}
return result;