Cache the list of form controls, so loading a large page with lots of form

controls outside forms is not O(N^2).  Bug 336062, r+sr=sicking


git-svn-id: svn://10.0.0.236/trunk@199489 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2006-06-08 04:28:20 +00:00
parent 28bdd51cbc
commit 13b92c95bf
5 changed files with 27 additions and 27 deletions

View File

@@ -3542,6 +3542,21 @@ nsHTMLDocument::GetForms()
return mForms;
}
static PRBool MatchFormControls(nsIContent* aContent, PRInt32 aNamespaceID,
nsIAtom* aAtom, const nsAString& aData)
{
return aContent->IsNodeOfType(nsIContent::eHTML_FORM_CONTROL);
}
nsContentList*
nsHTMLDocument::GetFormControls()
{
if (!mFormControls) {
mFormControls = new nsContentList(this, MatchFormControls, EmptyString());
}
return mFormControls;
}
nsresult
nsHTMLDocument::CreateAndAddWyciwygChannel(void)