Bug 232548 Element Properties should remove the properties with empty values

patch by f.qu@laposte.net r=db48x sr=neil

also rolling in a change from
Bug 240947 use content instead of _content
per neil w/ approval from mconnor


git-svn-id: svn://10.0.0.236/trunk@168439 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
timeless%mozdev.org 2005-01-28 15:43:22 +00:00
parent b730d75b20
commit 3531d977bd
2 changed files with 28 additions and 20 deletions

View File

@ -100,6 +100,11 @@ function showMetadataFor(elem)
// Each of them could be at a different level in the tree, so they each
// need their own boolean to tell us to stop looking.
while (elem && elem.nodeType == Node.ELEMENT_NODE) {
htmllocalname = "";
if (isHTMLElement(elem,"")) {
htmllocalname = elem.localName.toLowerCase();
}
if (!onLink) checkForLink(elem, htmllocalname);
if (!onInsDel) checkForInsDel(elem, htmllocalname);
if (!onQuote) checkForQuote(elem, htmllocalname);
@ -108,11 +113,6 @@ function showMetadataFor(elem)
if (!onLang) checkForLang(elem, htmllocalname);
elem = elem.parentNode;
htmllocalname = "";
if (isHTMLElement(elem,"")) {
htmllocalname = elem.localName.toLowerCase();
}
}
// Decide which sections to show
@ -245,15 +245,19 @@ function checkForLink(elem, htmllocalname)
break;
case "":
case "_self":
if (elem.ownerDocument != elem.ownerDocument.defaultView._content.document)
setInfo("link-target", gMetadataBundle.getString("sameFrameText"));
else
setInfo("link-target", gMetadataBundle.getString("sameWindowText"));
if (elem.ownerDocument.defaultView) {
if (elem.ownerDocument != elem.ownerDocument.defaultView.content.document)
setInfo("link-target", gMetadataBundle.getString("sameFrameText"));
else
setInfo("link-target", gMetadataBundle.getString("sameWindowText"));
} else {
hideNode("link-target");
}
break;
default:
setInfo("link-target", "\"" + target + "\"");
}
onLink = true;
}

View File

@ -105,6 +105,11 @@ function showMetadataFor(elem)
// Each of them could be at a different level in the tree, so they each
// need their own boolean to tell us to stop looking.
while (elem && elem.nodeType == Node.ELEMENT_NODE) {
htmllocalname = "";
if (isHTMLElement(elem,"")) {
htmllocalname = elem.localName.toLowerCase();
}
if (!onLink) checkForLink(elem, htmllocalname);
if (!onInsDel) checkForInsDel(elem, htmllocalname);
if (!onQuote) checkForQuote(elem, htmllocalname);
@ -113,13 +118,8 @@ function showMetadataFor(elem)
if (!onLang) checkForLang(elem, htmllocalname);
elem = elem.parentNode;
htmllocalname = "";
if (isHTMLElement(elem,"")) {
htmllocalname = elem.localName.toLowerCase();
}
}
// Decide which sections to show
var onMisc = onTable || onTitle || onLang;
if (!onMisc) hideNode("misc-sec");
@ -252,10 +252,14 @@ function checkForLink(elem, htmllocalname)
break;
case "":
case "_self":
if (elem.ownerDocument != elem.ownerDocument.defaultView.content.document)
setInfo("link-target", gMetadataBundle.getString("sameFrameText"));
else
setInfo("link-target", gMetadataBundle.getString("sameWindowText"));
if (elem.ownerDocument.defaultView) {
if (elem.ownerDocument != elem.ownerDocument.defaultView.content.document)
setInfo("link-target", gMetadataBundle.getString("sameFrameText"));
else
setInfo("link-target", gMetadataBundle.getString("sameWindowText"));
} else {
hideNode("link-target");
}
break;
default:
setInfo("link-target", "\"" + target + "\"");