From 0860c0c05ea1dbb59feaffc13530e18d15a0aa3d Mon Sep 17 00:00:00 2001 From: "neil%parkwaycc.co.uk" Date: Tue, 20 Apr 2004 14:44:46 +0000 Subject: [PATCH] Bug 237138 Disabled form controls are not always greyed out r/sr=bz git-svn-id: svn://10.0.0.236/trunk@155216 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/src/shared/nsNativeTheme.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/mozilla/gfx/src/shared/nsNativeTheme.cpp b/mozilla/gfx/src/shared/nsNativeTheme.cpp index f6e6241c932..860e2c5af50 100644 --- a/mozilla/gfx/src/shared/nsNativeTheme.cpp +++ b/mozilla/gfx/src/shared/nsNativeTheme.cpp @@ -125,23 +125,17 @@ nsNativeTheme::CheckBooleanAttr(nsIFrame* aFrame, nsIAtom* aAtom) return PR_FALSE; nsIContent* content = aFrame->GetContent(); - nsAutoString attr; - nsresult res = content->GetAttr(kNameSpaceID_None, aAtom, attr); + if (content->IsContentOfType(nsIContent::eHTML)) + return content->HasAttr(kNameSpaceID_None, aAtom); - // For HTML elements, boolean attributes will return NOT_THERE if they - // are not present and HAS_VALUE + a string (possibly empty) - // if they are present. + nsAutoString attr; + content->GetAttr(kNameSpaceID_None, aAtom, attr); // For XML/XUL elements, an attribute must be equal to the literal // string "true" to be counted as true. An empty string should _not_ // be counted as true. - PRBool isHTML = content->IsContentOfType(nsIContent::eHTML); - if (isHTML && (res == NS_CONTENT_ATTR_NO_VALUE || - res != NS_CONTENT_ATTR_NOT_THERE && attr.IsEmpty())) - return PR_TRUE; - - return attr.EqualsIgnoreCase("true"); + return attr.Equals(NS_LITERAL_STRING("true")); } PRInt32