Fix buy 114943; prevent attribute changes of screenX, screenY, and sizemode on windows, dialogs and wizards from causing reflows. r=hyatt, sr=waterson

This commit is contained in:
sfraser%netscape.com 2001-12-19 00:28:40 +00:00
Родитель 21b53b29a8
Коммит dec7ea9f5b
2 изменённых файлов: 25 добавлений и 4 удалений

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

@ -306,3 +306,5 @@ XUL_ATOM(sortActive, "sortActive")
XUL_ATOM(selectedIndex, "selectedIndex")
XUL_ATOM(_star, "*")
XUL_ATOM(defaultz, "default")
XUL_ATOM(screenX, "screenX")
XUL_ATOM(screenY, "screenY")

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

@ -2573,6 +2573,24 @@ nsXULElement::SetAttr(nsINodeInfo* aNodeInfo,
nsresult rv;
nsXULAttribute* attr = FindLocalAttribute(aNodeInfo);
if (attr) {
nsAutoString oldValue;
attr->GetValue(oldValue);
if (oldValue.Equals(aValue))
{
nsAutoString attributeName;
aNodeInfo->GetName(attributeName);
nsCAutoString blurb("SetAttr called redundantly on ");
blurb.AppendWithConversion(attributeName);
blurb.Append(" with value ");
blurb.AppendWithConversion(aValue);
NS_WARNING(blurb.get());
}
}
nsCOMPtr<nsIAtom> attrName;
PRInt32 attrns;
@ -2635,7 +2653,6 @@ nsXULElement::SetAttr(nsINodeInfo* aNodeInfo,
// XXX need to check if they're changing an event handler: if so, then we need
// to unhook the old one.
nsXULAttribute* attr = FindLocalAttribute(aNodeInfo);
PRBool modification;
nsAutoString oldValue;
@ -3883,9 +3900,11 @@ nsXULElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModTy
NodeInfo()->Equals(nsXULAtoms::page) ||
NodeInfo()->Equals(nsXULAtoms::dialog) ||
NodeInfo()->Equals(nsXULAtoms::wizard)) {
// Ignore 'width' and 'height' on a <window>
if (nsXULAtoms::width == aAttribute || nsXULAtoms::height == aAttribute)
aHint = NS_STYLE_HINT_NONE;
// Ignore 'width', 'height', 'screenX', 'screenY' and 'sizemode' on a <window>
if (nsXULAtoms::width == aAttribute || nsXULAtoms::height == aAttribute ||
nsXULAtoms::screenX == aAttribute || nsXULAtoms::screenY == aAttribute ||
nsXULAtoms::sizemode == aAttribute)
aHint = NS_STYLE_HINT_NONE;
} else {
// if left or top changes we reflow. This will happen in xul containers that
// manage positioned children such as a bulletinboard.