Bug 129535 -- get filenames from the right places in some edge cases.

r=law, sr=alecf, a=asa
This commit is contained in:
bzbarsky%mit.edu 2006-07-29 05:39:56 +00:00
parent 0395071b0e
commit b3ed775d6a
2 changed files with 6 additions and 5 deletions

View File

@ -149,7 +149,7 @@
break;
}
if (linkNode) {
handleLinkClick(event, linkNode.href);
handleLinkClick(event, linkNode.href, linkNode);
return true;
} else {
// Try simple XLink
@ -164,7 +164,7 @@
}
if (href && href != "") {
href = makeURLAbsolute(target.baseURI,href);
handleLinkClick(event, href);
handleLinkClick(event, href, null);
return true;
}
}
@ -178,7 +178,7 @@
return true;
}
function handleLinkClick(event, href)
function handleLinkClick(event, href, linkNode)
{
var theTab, loadInBackground;
switch (event.button) {
@ -214,7 +214,7 @@
saveModifier = saveModifier ? event.shiftKey : event.altKey;
if (saveModifier) { // if saveModifier is down
saveURL(href, gatherTextUnder(event.target));
saveURL(href, linkNode ? gatherTextUnder(linkNode) : "");
return true;
}
if (event.altKey) // if alt is down

View File

@ -258,7 +258,8 @@ function foundHeaderInfo(aSniffer, aData)
// should be.
var defaultFileName = getDefaultFileName(aData.fileName,
aSniffer.suggestedFileName,
aSniffer.uri);
aSniffer.uri,
aData.document);
var defaultExtension = getDefaultExtension(defaultFileName, aSniffer.uri, contentType);
fp.defaultExtension = defaultExtension;
fp.defaultString = getNormalizedLeafName(defaultFileName, defaultExtension);