HTMLDirectoryElement should be 'dir'. Fix #1159