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

This commit is contained in:
kipp%netscape.com 1999-02-04 16:28:16 +00:00
Родитель 2e48b11493
Коммит dfca76d3e6
2 изменённых файлов: 20 добавлений и 10 удалений

Просмотреть файл

@ -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);

Просмотреть файл

@ -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);