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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user