Only allocate and copy a string in CAttributeToken::GetStringValue if the string spans multiple buffers. Otherwise, just wrap it with a nsDependentSubstring. Bug 268932, r=bzbarsky, sr=darin.

git-svn-id: svn://10.0.0.236/trunk@165246 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bryner%brianryner.com
2004-11-11 03:46:51 +00:00
parent 2d1d00b7e3
commit 0da729e8f7
6 changed files with 49 additions and 37 deletions

View File

@@ -646,7 +646,7 @@ nsresult nsHTMLTokenizer::ConsumeAttributes(PRUnichar aChar,
//start token it was empty.
if(NS_SUCCEEDED(result)) {
PRBool isUsableAttr = PR_TRUE;
const nsAString& key=theToken->GetKey();
const nsSubstring& key=theToken->GetKey();
const nsAString& text=theToken->GetValue();
// support XML like syntax to fix bugs like 44186