зеркало из https://github.com/mozilla/pjs.git
Get correct url to open for script src=
This commit is contained in:
Родитель
6ca7071513
Коммит
a631b04db6
|
@ -1554,9 +1554,13 @@ nsresult HTMLContentSink::ProcessSCRIPTTag(const nsIParserNode& aNode)
|
||||||
if (nsnull != src) {
|
if (nsnull != src) {
|
||||||
// Use the SRC attribute value to open a blocking stream
|
// Use the SRC attribute value to open a blocking stream
|
||||||
nsIURL* url = nsnull;
|
nsIURL* url = nsnull;
|
||||||
char* spec = src->ToNewCString();
|
nsAutoString absURL, baseURL;/* XXX */
|
||||||
rv = NS_NewURL(&url, nsnull, spec);
|
nsIURL* docURL = mDocument->GetDocumentURL();
|
||||||
delete spec;
|
rv = NS_MakeAbsoluteURL(docURL, baseURL, *src, absURL);
|
||||||
|
if (NS_OK != rv) {
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
rv = NS_NewURL(&url, nsnull, absURL);
|
||||||
delete src;
|
delete src;
|
||||||
if (NS_OK != rv) {
|
if (NS_OK != rv) {
|
||||||
return rv;
|
return rv;
|
||||||
|
|
|
@ -1554,9 +1554,13 @@ nsresult HTMLContentSink::ProcessSCRIPTTag(const nsIParserNode& aNode)
|
||||||
if (nsnull != src) {
|
if (nsnull != src) {
|
||||||
// Use the SRC attribute value to open a blocking stream
|
// Use the SRC attribute value to open a blocking stream
|
||||||
nsIURL* url = nsnull;
|
nsIURL* url = nsnull;
|
||||||
char* spec = src->ToNewCString();
|
nsAutoString absURL, baseURL;/* XXX */
|
||||||
rv = NS_NewURL(&url, nsnull, spec);
|
nsIURL* docURL = mDocument->GetDocumentURL();
|
||||||
delete spec;
|
rv = NS_MakeAbsoluteURL(docURL, baseURL, *src, absURL);
|
||||||
|
if (NS_OK != rv) {
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
rv = NS_NewURL(&url, nsnull, absURL);
|
||||||
delete src;
|
delete src;
|
||||||
if (NS_OK != rv) {
|
if (NS_OK != rv) {
|
||||||
return rv;
|
return rv;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче