From 0d92f13f7dc825d7284d72054137937cb21c8f05 Mon Sep 17 00:00:00 2001 From: "jkeiser%netscape.com" Date: Fri, 27 Dec 2002 00:41:52 +0000 Subject: [PATCH] Make align=right only float right for input type=image (bug 170781), r=peterl@netscape.cm, sr=bzbarsky@mit.edu git-svn-id: svn://10.0.0.236/trunk@135644 18797224-902f-48f8-a5cc-f745e15eee43 --- .../html/content/src/nsHTMLInputElement.cpp | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/mozilla/content/html/content/src/nsHTMLInputElement.cpp b/mozilla/content/html/content/src/nsHTMLInputElement.cpp index 558e07db8ff..4b3948210b3 100644 --- a/mozilla/content/html/content/src/nsHTMLInputElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLInputElement.cpp @@ -1978,26 +1978,17 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsHTMLValue value; aAttributes->GetAttribute(nsHTMLAtoms::type, value); - if (eHTMLUnit_Enumerated == value.GetUnit()) { - switch (value.GetIntValue()) { - case NS_FORM_INPUT_TEXT: - case NS_FORM_INPUT_PASSWORD: - case NS_FORM_INPUT_FILE: - nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aData); - break; - case NS_FORM_INPUT_IMAGE: - nsGenericHTMLElement::MapImageBorderAttributeInto(aAttributes, aData); - nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aData); - nsGenericHTMLElement::MapImagePositionAttributeInto(aAttributes, aData); - // fall through - default: - nsGenericHTMLElement::MapAlignAttributeInto(aAttributes, aData); - break; - } + if (value.GetUnit() == eHTMLUnit_Enumerated && + value.GetIntValue() == NS_FORM_INPUT_IMAGE) { + nsGenericHTMLElement::MapImageBorderAttributeInto(aAttributes, aData); + nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aData); + nsGenericHTMLElement::MapImagePositionAttributeInto(aAttributes, aData); + // Images treat align as "float" + nsGenericHTMLElement::MapAlignAttributeInto(aAttributes, aData); } else { - // No type attr means this is a text input + // Everything else treats align as "text-align" nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aData); - } + } nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData); }