A Performance bug quite similar to Mozilla bug 267506

RESOLVED DUPLICATE of bug 635572

Status

()

RESOLVED DUPLICATE of bug 635572
8 years ago
8 years ago

People

(Reporter: songlinhai0543, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13
Build Identifier: mozilla-source-1.6

RCS file: /cvsroot/mozilla/content/base/src/nsContentUtils.cpp,v
retrieving revision 1.86
diff -u -p -r1.86 nsContentUtils.cpp
--- base/src/nsContentUtils.cpp    15 Oct 2004 16:34:58 -0000    1.86
+++ base/src/nsContentUtils.cpp    3 Nov 2004 18:58:56 -0000
@@ -1538,11 +1538,8 @@ nsContentUtils::NewURIWithDocumentCharse
                                           nsIDocument* aDocument,
                                           nsIURI* aBaseURI)
 {
-  nsCAutoString originCharset;
-  if (aDocument)
-    originCharset = aDocument->GetDocumentCharacterSet();
-
-  return NS_NewURI(aResult, NS_ConvertUCS2toUTF8(aSpec), originCharset.get(),
+  return NS_NewURI(aResult, aSpec,
+                   aDocument ? aDocument->GetDocumentCharacterSet().get() :
nsnull,
                    aBaseURI, sIOService);
 }

This is a patch for Mozilla Bug 267506. 

I find three code fragments:

/firefox-4.0b11.source/dom/base/nsGlobalWindow.cpp:9593

 if (sourceWindow) {
    nsCOMPtr<nsIDOMDocument> domDoc;
    sourceWindow->GetDocument(getter_AddRefs(domDoc));
    nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
    if (doc) {
     baseURI = doc->GetDocBaseURI();
     charset = doc->GetDocumentCharacterSet();
    }
 }

 if (aCXused)
    *aCXused = cx;
 return NS_NewURI(aBuiltURI, nsDependentCString(aURL), charset.get(), baseURI);
}

===============================================================================
/firefox-4.0b11.source/content/xml/document/src/nsXMLDocument.cpp:350
 if (callingDoc) {
    baseURI = callingDoc->GetDocBaseURI();
    charset = callingDoc->GetDocumentCharacterSet();
 }

 // Create a new URI
 nsCOMPtr<nsIURI> uri;
 nsresult rv = NS_NewURI(getter_AddRefs(uri), aUrl, charset.get(), baseURI);

===============================================================================
/firefox-4.0b11.source/content/xml/content/src/nsXMLStylesheetPI.cpp:187

 if (document) {
    baseURL = mOverriddenBaseURI ?
             mOverriddenBaseURI.get() :
             document->GetDocBaseURI();
    charset = document->GetDocumentCharacterSet();
 } else {
    baseURL = mOverriddenBaseURI;
 }

 nsCOMPtr<nsIURI> aURI;
 NS_NewURI(getter_AddRefs(aURI), href, charset.get(), baseURL);


I think these three code fragments have similar problem with mozillabug267506, and they should be patched in a similar method. 

Reproducible: Always
When I said that you could reopen the bug, I meant that you could change the status of the bug, not open a new bug. And if you think that I was wrong to mark your previous bug INVALID, please, provide an explanation.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 635572
You need to log in before you can comment on or make changes to this bug.