From 7f078398f2d007fad1a90f224db9ce082b5f7232 Mon Sep 17 00:00:00 2001 From: "buster%netscape.com" Date: Thu, 12 Oct 2000 20:43:18 +0000 Subject: [PATCH] bug 55250 (crash when align attribute is changed) r=karanze a=waterson --- content/html/content/src/nsGenericHTMLElement.cpp | 2 +- content/html/content/src/nsHTMLIFrameElement.cpp | 2 +- content/html/content/src/nsHTMLImageElement.cpp | 6 ++---- content/html/content/src/nsHTMLInputElement.cpp | 4 ++-- content/html/content/src/nsHTMLTableElement.cpp | 6 ++++-- layout/html/content/src/nsGenericHTMLElement.cpp | 2 +- layout/html/content/src/nsHTMLIFrameElement.cpp | 2 +- layout/html/content/src/nsHTMLImageElement.cpp | 6 ++---- layout/html/content/src/nsHTMLInputElement.cpp | 4 ++-- layout/html/content/src/nsHTMLTableElement.cpp | 6 ++++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index 381fb0c4d07..239ed5086a6 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -2989,7 +2989,7 @@ nsGenericHTMLElement::GetImageAlignAttributeImpact(const nsIAtom* aAttribute, PRInt32& aHint) { if ((nsHTMLAtoms::align == aAttribute)) { - aHint = NS_STYLE_HINT_REFLOW; + aHint = NS_STYLE_HINT_FRAMECHANGE; return PR_TRUE; } return PR_FALSE; diff --git a/content/html/content/src/nsHTMLIFrameElement.cpp b/content/html/content/src/nsHTMLIFrameElement.cpp index b3b2e6d3bf9..c225a94af85 100644 --- a/content/html/content/src/nsHTMLIFrameElement.cpp +++ b/content/html/content/src/nsHTMLIFrameElement.cpp @@ -327,7 +327,7 @@ nsHTMLIFrameElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, aHint = NS_STYLE_HINT_REFLOW; } else if (aAttribute == nsHTMLAtoms::align) { - aHint = NS_STYLE_HINT_REFLOW; + aHint = NS_STYLE_HINT_FRAMECHANGE; } else if (aAttribute == nsHTMLAtoms::frameborder) { aHint = NS_STYLE_HINT_REFLOW; diff --git a/content/html/content/src/nsHTMLImageElement.cpp b/content/html/content/src/nsHTMLImageElement.cpp index 18bd346d0d9..ad8c83ee0dd 100644 --- a/content/html/content/src/nsHTMLImageElement.cpp +++ b/content/html/content/src/nsHTMLImageElement.cpp @@ -541,12 +541,10 @@ nsHTMLImageElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32& aHint) const { if ((aAttribute == nsHTMLAtoms::usemap) || - (aAttribute == nsHTMLAtoms::ismap)) { + (aAttribute == nsHTMLAtoms::ismap) || + (aAttribute == nsHTMLAtoms::align)) { aHint = NS_STYLE_HINT_FRAMECHANGE; } - else if (aAttribute == nsHTMLAtoms::align) { - aHint = NS_STYLE_HINT_REFLOW; - } else if (! nsGenericHTMLElement::GetCommonMappedAttributesImpact(aAttribute, aHint)) { if (! nsGenericHTMLElement::GetImageMappedAttributesImpact(aAttribute, aHint)) { if (! nsGenericHTMLElement::GetImageBorderAttributeImpact(aAttribute, aHint)) { diff --git a/content/html/content/src/nsHTMLInputElement.cpp b/content/html/content/src/nsHTMLInputElement.cpp index a5689e76ff1..1c4bde892a5 100644 --- a/content/html/content/src/nsHTMLInputElement.cpp +++ b/content/html/content/src/nsHTMLInputElement.cpp @@ -1225,10 +1225,10 @@ NS_IMETHODIMP nsHTMLInputElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32& aHint) const { - if ((aAttribute == nsHTMLAtoms::align) || (aAttribute == nsHTMLAtoms::value)) { + if (aAttribute == nsHTMLAtoms::value) { aHint = NS_STYLE_HINT_REFLOW; } - else if ((aAttribute == nsHTMLAtoms::type)) { + else if ((aAttribute == nsHTMLAtoms::align) || (aAttribute == nsHTMLAtoms::type)) { aHint = NS_STYLE_HINT_FRAMECHANGE; } else if (! nsGenericHTMLElement::GetCommonMappedAttributesImpact(aAttribute, aHint)) { diff --git a/content/html/content/src/nsHTMLTableElement.cpp b/content/html/content/src/nsHTMLTableElement.cpp index fa61824eb4c..2012489ce9c 100644 --- a/content/html/content/src/nsHTMLTableElement.cpp +++ b/content/html/content/src/nsHTMLTableElement.cpp @@ -1296,8 +1296,7 @@ NS_IMETHODIMP nsHTMLTableElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32& aHint) const { - if ((aAttribute == nsHTMLAtoms::align) || - (aAttribute == nsHTMLAtoms::layout) || + if ((aAttribute == nsHTMLAtoms::layout) || (aAttribute == nsHTMLAtoms::cellpadding) || (aAttribute == nsHTMLAtoms::cellspacing) || (aAttribute == nsHTMLAtoms::cols) || @@ -1313,6 +1312,9 @@ nsHTMLTableElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, else if (aAttribute == nsHTMLAtoms::bordercolor) { aHint = NS_STYLE_HINT_VISUAL; } + else if (aAttribute == nsHTMLAtoms::align) { + aHint = NS_STYLE_HINT_FRAMECHANGE; + } else if (! nsGenericHTMLElement::GetCommonMappedAttributesImpact(aAttribute, aHint)) { if (! nsGenericHTMLElement::GetBackgroundAttributesImpact(aAttribute, aHint)) { aHint = NS_STYLE_HINT_CONTENT; diff --git a/layout/html/content/src/nsGenericHTMLElement.cpp b/layout/html/content/src/nsGenericHTMLElement.cpp index 381fb0c4d07..239ed5086a6 100644 --- a/layout/html/content/src/nsGenericHTMLElement.cpp +++ b/layout/html/content/src/nsGenericHTMLElement.cpp @@ -2989,7 +2989,7 @@ nsGenericHTMLElement::GetImageAlignAttributeImpact(const nsIAtom* aAttribute, PRInt32& aHint) { if ((nsHTMLAtoms::align == aAttribute)) { - aHint = NS_STYLE_HINT_REFLOW; + aHint = NS_STYLE_HINT_FRAMECHANGE; return PR_TRUE; } return PR_FALSE; diff --git a/layout/html/content/src/nsHTMLIFrameElement.cpp b/layout/html/content/src/nsHTMLIFrameElement.cpp index b3b2e6d3bf9..c225a94af85 100644 --- a/layout/html/content/src/nsHTMLIFrameElement.cpp +++ b/layout/html/content/src/nsHTMLIFrameElement.cpp @@ -327,7 +327,7 @@ nsHTMLIFrameElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, aHint = NS_STYLE_HINT_REFLOW; } else if (aAttribute == nsHTMLAtoms::align) { - aHint = NS_STYLE_HINT_REFLOW; + aHint = NS_STYLE_HINT_FRAMECHANGE; } else if (aAttribute == nsHTMLAtoms::frameborder) { aHint = NS_STYLE_HINT_REFLOW; diff --git a/layout/html/content/src/nsHTMLImageElement.cpp b/layout/html/content/src/nsHTMLImageElement.cpp index 18bd346d0d9..ad8c83ee0dd 100644 --- a/layout/html/content/src/nsHTMLImageElement.cpp +++ b/layout/html/content/src/nsHTMLImageElement.cpp @@ -541,12 +541,10 @@ nsHTMLImageElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32& aHint) const { if ((aAttribute == nsHTMLAtoms::usemap) || - (aAttribute == nsHTMLAtoms::ismap)) { + (aAttribute == nsHTMLAtoms::ismap) || + (aAttribute == nsHTMLAtoms::align)) { aHint = NS_STYLE_HINT_FRAMECHANGE; } - else if (aAttribute == nsHTMLAtoms::align) { - aHint = NS_STYLE_HINT_REFLOW; - } else if (! nsGenericHTMLElement::GetCommonMappedAttributesImpact(aAttribute, aHint)) { if (! nsGenericHTMLElement::GetImageMappedAttributesImpact(aAttribute, aHint)) { if (! nsGenericHTMLElement::GetImageBorderAttributeImpact(aAttribute, aHint)) { diff --git a/layout/html/content/src/nsHTMLInputElement.cpp b/layout/html/content/src/nsHTMLInputElement.cpp index a5689e76ff1..1c4bde892a5 100644 --- a/layout/html/content/src/nsHTMLInputElement.cpp +++ b/layout/html/content/src/nsHTMLInputElement.cpp @@ -1225,10 +1225,10 @@ NS_IMETHODIMP nsHTMLInputElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32& aHint) const { - if ((aAttribute == nsHTMLAtoms::align) || (aAttribute == nsHTMLAtoms::value)) { + if (aAttribute == nsHTMLAtoms::value) { aHint = NS_STYLE_HINT_REFLOW; } - else if ((aAttribute == nsHTMLAtoms::type)) { + else if ((aAttribute == nsHTMLAtoms::align) || (aAttribute == nsHTMLAtoms::type)) { aHint = NS_STYLE_HINT_FRAMECHANGE; } else if (! nsGenericHTMLElement::GetCommonMappedAttributesImpact(aAttribute, aHint)) { diff --git a/layout/html/content/src/nsHTMLTableElement.cpp b/layout/html/content/src/nsHTMLTableElement.cpp index fa61824eb4c..2012489ce9c 100644 --- a/layout/html/content/src/nsHTMLTableElement.cpp +++ b/layout/html/content/src/nsHTMLTableElement.cpp @@ -1296,8 +1296,7 @@ NS_IMETHODIMP nsHTMLTableElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32& aHint) const { - if ((aAttribute == nsHTMLAtoms::align) || - (aAttribute == nsHTMLAtoms::layout) || + if ((aAttribute == nsHTMLAtoms::layout) || (aAttribute == nsHTMLAtoms::cellpadding) || (aAttribute == nsHTMLAtoms::cellspacing) || (aAttribute == nsHTMLAtoms::cols) || @@ -1313,6 +1312,9 @@ nsHTMLTableElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, else if (aAttribute == nsHTMLAtoms::bordercolor) { aHint = NS_STYLE_HINT_VISUAL; } + else if (aAttribute == nsHTMLAtoms::align) { + aHint = NS_STYLE_HINT_FRAMECHANGE; + } else if (! nsGenericHTMLElement::GetCommonMappedAttributesImpact(aAttribute, aHint)) { if (! nsGenericHTMLElement::GetBackgroundAttributesImpact(aAttribute, aHint)) { aHint = NS_STYLE_HINT_CONTENT;