From 02090ea4cc7d3950247b0d9271aed5089ef6be5b Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Sun, 13 Feb 2000 22:57:52 +0000 Subject: [PATCH] Fix for bug #23387. git-svn-id: svn://10.0.0.236/trunk@60662 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/xul/content/src/nsXULElement.cpp | 15 +++++++++++++-- mozilla/rdf/content/src/nsXULElement.cpp | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/mozilla/content/xul/content/src/nsXULElement.cpp b/mozilla/content/xul/content/src/nsXULElement.cpp index def603e958e..3fd9f1cf253 100644 --- a/mozilla/content/xul/content/src/nsXULElement.cpp +++ b/mozilla/content/xul/content/src/nsXULElement.cpp @@ -3505,7 +3505,12 @@ nsXULElement::GetContentStyleRules(nsISupportsArray* aRules) nsCOMPtr widthAtom = dont_AddRef(NS_NewAtom("width")); nsAutoString width; GetAttribute(kNameSpaceID_None, widthAtom, width); - if (width != "") { + + nsCOMPtr hiddenAtom = dont_AddRef(NS_NewAtom("hidden")); + nsAutoString hidden; + GetAttribute(kNameSpaceID_None, hiddenAtom, hidden); + + if (width != "" || hidden != "") { // XXX This should ultimately be factored out if we find that // a bunch of XUL widgets are implementing attributes that need // to be mapped into style. I'm hoping treecol will be the only @@ -3547,7 +3552,8 @@ nsXULElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, // Ok, we almost never map attributes to style. ;) // The width attribute of a treecol is an exception to this rule. nsCOMPtr widthAtom = dont_AddRef(NS_NewAtom("width")); - if (widthAtom == aAttribute) + nsCOMPtr hiddenAtom = dont_AddRef(NS_NewAtom("hidden")); + if (widthAtom == aAttribute || hiddenAtom == aAttribute) aHint = NS_STYLE_HINT_REFLOW; } return NS_OK; @@ -3839,7 +3845,12 @@ nsXULElement::MapStyleInto(nsIMutableStyleContext* aContext, nsIPresContext* aPr if (Tag() == kTreeColAtom) { // Should only get called if we had a width attribute set. Retrieve it. nsAutoString widthVal; + nsAutoString hiddenVal; GetAttribute("width", widthVal); + GetAttribute("hidden", hiddenVal); + if (hiddenVal != "") + widthVal = "0*"; + if (widthVal != "") { PRInt32 intVal; float floatVal; diff --git a/mozilla/rdf/content/src/nsXULElement.cpp b/mozilla/rdf/content/src/nsXULElement.cpp index def603e958e..3fd9f1cf253 100644 --- a/mozilla/rdf/content/src/nsXULElement.cpp +++ b/mozilla/rdf/content/src/nsXULElement.cpp @@ -3505,7 +3505,12 @@ nsXULElement::GetContentStyleRules(nsISupportsArray* aRules) nsCOMPtr widthAtom = dont_AddRef(NS_NewAtom("width")); nsAutoString width; GetAttribute(kNameSpaceID_None, widthAtom, width); - if (width != "") { + + nsCOMPtr hiddenAtom = dont_AddRef(NS_NewAtom("hidden")); + nsAutoString hidden; + GetAttribute(kNameSpaceID_None, hiddenAtom, hidden); + + if (width != "" || hidden != "") { // XXX This should ultimately be factored out if we find that // a bunch of XUL widgets are implementing attributes that need // to be mapped into style. I'm hoping treecol will be the only @@ -3547,7 +3552,8 @@ nsXULElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, // Ok, we almost never map attributes to style. ;) // The width attribute of a treecol is an exception to this rule. nsCOMPtr widthAtom = dont_AddRef(NS_NewAtom("width")); - if (widthAtom == aAttribute) + nsCOMPtr hiddenAtom = dont_AddRef(NS_NewAtom("hidden")); + if (widthAtom == aAttribute || hiddenAtom == aAttribute) aHint = NS_STYLE_HINT_REFLOW; } return NS_OK; @@ -3839,7 +3845,12 @@ nsXULElement::MapStyleInto(nsIMutableStyleContext* aContext, nsIPresContext* aPr if (Tag() == kTreeColAtom) { // Should only get called if we had a width attribute set. Retrieve it. nsAutoString widthVal; + nsAutoString hiddenVal; GetAttribute("width", widthVal); + GetAttribute("hidden", hiddenVal); + if (hiddenVal != "") + widthVal = "0*"; + if (widthVal != "") { PRInt32 intVal; float floatVal;