Use the ID attribute (and not NAME) for FRAME/IFRAME/OBJECT in XHTML. b=183683 r+sr=bzbarsky

This commit is contained in:
mats.palmgren%bredband.net 2004-09-12 23:34:00 +00:00
Родитель b13ea1498b
Коммит 7dc10bb4c9
1 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -430,7 +430,15 @@ nsFrameLoader::EnsureDocShell()
nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(do_QueryInterface(mDocShell));
NS_ENSURE_TRUE(docShellAsItem, NS_ERROR_FAILURE);
nsAutoString frameName;
mOwnerContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::name, frameName);
// Don't use mOwnerContent->GetNameSpaceID() here since it returns
// kNameSpaceID_XHTML for both HTML and XHTML, see bug 183683.
nsINodeInfo* ni = mOwnerContent->GetNodeInfo();
if (ni && ni->NamespaceID() == kNameSpaceID_XHTML) {
mOwnerContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, frameName);
} else {
mOwnerContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::name, frameName);
}
if (!frameName.IsEmpty()) {
docShellAsItem->SetName(frameName.get());