Bug 888834 - Java sees no-explicit-codebase as . not baseURI. r=josh

This commit is contained in:
John Schoenick 2013-07-01 14:14:56 -07:00
parent 62a3b54ac9
commit fc33db660b

View File

@ -1459,12 +1459,15 @@ nsObjectLoadingContent::UpdateObjectParameters(bool aJavaURI)
} }
if (isJava && hasCodebase && codebaseStr.IsEmpty()) { if (isJava && hasCodebase && codebaseStr.IsEmpty()) {
// Java treats an empty codebase as the document codebase, but codebase="" // Java treats codebase="" as "/"
// as "/"
codebaseStr.AssignLiteral("/"); codebaseStr.AssignLiteral("/");
// XXX(johns): This doesn't cover the case of "https:" which java would // XXX(johns): This doesn't cover the case of "https:" which java would
// interpret as "https:///" but we interpret as this document's // interpret as "https:///" but we interpret as this document's
// URI but with a changed scheme. // URI but with a changed scheme.
} else if (isJava && !hasCodebase) {
// Java expects a directory as the codebase, or else it will construct
// relative URIs incorrectly :(
codebaseStr.AssignLiteral(".");
} }
if (!codebaseStr.IsEmpty()) { if (!codebaseStr.IsEmpty()) {