bug 844496 - handle the case of optgroup accessible's parent being a document with no content r=surkov