Use nsIHTMLContent attribute api's to avoid attribute changed notification during document loads

git-svn-id: svn://10.0.0.236/trunk@19697 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kipp%netscape.com
1999-02-04 16:28:16 +00:00
parent 01519f58e2
commit e499b1961f
2 changed files with 20 additions and 10 deletions

View File

@@ -432,7 +432,7 @@ GetAttributeValueAt(const nsIParserNode& aNode,
// Strip quotes if present
PRUnichar first = aResult.First();
if ((first == '"') || (first == '\'')) {
if ((first == '\"') || (first == '\'')) {
if (aResult.Last() == first) {
aResult.Cut(0, 1);
PRInt32 pos = aResult.Length() - 1;
@@ -1840,10 +1840,15 @@ HTMLContentSink::OpenMap(const nsIParserNode& aNode)
// Strip out whitespace in the name for navigator compatability
// XXX NAV QUIRK
nsAutoString name;
domMap->GetName(name);
name.StripWhitespace();
domMap->SetName(name);
nsHTMLValue name;
map->GetHTMLAttribute(nsHTMLAtoms::name, name);
if (eHTMLUnit_String == name.GetUnit()) {
nsAutoString tmp;
name.GetStringValue(tmp);
tmp.StripWhitespace();
name.SetStringValue(tmp);
map->SetHTMLAttribute(nsHTMLAtoms::name, name, PR_FALSE);
}
// Add the map to the document
mHTMLDocument->AddImageMap(domMap);

View File

@@ -432,7 +432,7 @@ GetAttributeValueAt(const nsIParserNode& aNode,
// Strip quotes if present
PRUnichar first = aResult.First();
if ((first == '"') || (first == '\'')) {
if ((first == '\"') || (first == '\'')) {
if (aResult.Last() == first) {
aResult.Cut(0, 1);
PRInt32 pos = aResult.Length() - 1;
@@ -1840,10 +1840,15 @@ HTMLContentSink::OpenMap(const nsIParserNode& aNode)
// Strip out whitespace in the name for navigator compatability
// XXX NAV QUIRK
nsAutoString name;
domMap->GetName(name);
name.StripWhitespace();
domMap->SetName(name);
nsHTMLValue name;
map->GetHTMLAttribute(nsHTMLAtoms::name, name);
if (eHTMLUnit_String == name.GetUnit()) {
nsAutoString tmp;
name.GetStringValue(tmp);
tmp.StripWhitespace();
name.SetStringValue(tmp);
map->SetHTMLAttribute(nsHTMLAtoms::name, name, PR_FALSE);
}
// Add the map to the document
mHTMLDocument->AddImageMap(domMap);