Bug 16725: Enable align attribute for iframe; r=harishd

This commit is contained in:
pollmann%netscape.com 1999-10-19 19:01:49 +00:00
Родитель 98c2829864
Коммит 312e7468d9
2 изменённых файлов: 10 добавлений и 18 удалений

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

@ -31,13 +31,6 @@
static NS_DEFINE_IID(kIDOMHTMLIFrameElementIID, NS_IDOMHTMLIFRAMEELEMENT_IID);
static nsGenericHTMLElement::EnumTable kAlignTable[] = {
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },
{ "right", NS_STYLE_TEXT_ALIGN_RIGHT },
{ "center", NS_STYLE_TEXT_ALIGN_CENTER },
{ 0 }
};
class nsHTMLIFrameElement : public nsIDOMHTMLIFrameElement,
public nsIScriptObjectOwner,
public nsIDOMEventReceiver,
@ -201,7 +194,7 @@ nsHTMLIFrameElement::StringToAttribute(nsIAtom* aAttribute,
}
}
else if (aAttribute == nsHTMLAtoms::align) {
if (nsGenericHTMLElement::ParseEnumValue(aValue, kAlignTable, aResult)) {
if (nsGenericHTMLElement::ParseAlignValue(aValue, aResult)) {
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
@ -223,7 +216,7 @@ nsHTMLIFrameElement::AttributeToString(nsIAtom* aAttribute,
}
else if (aAttribute == nsHTMLAtoms::align) {
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
nsGenericHTMLElement::EnumValueToString(aValue, kAlignTable, aResult);
nsGenericHTMLElement::AlignValueToString(aValue, aResult);
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
@ -276,6 +269,9 @@ nsHTMLIFrameElement::GetMappedAttributeImpact(const nsIAtom* aAttribute,
(aAttribute == nsHTMLAtoms::height)) {
aHint = NS_STYLE_HINT_REFLOW;
}
else if (aAttribute == nsHTMLAtoms::align) {
aHint = NS_STYLE_HINT_REFLOW;
}
else if (! nsGenericHTMLElement::GetCommonMappedAttributesImpact(aAttribute, aHint)) {
aHint = NS_STYLE_HINT_CONTENT;
}

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

@ -31,13 +31,6 @@
static NS_DEFINE_IID(kIDOMHTMLIFrameElementIID, NS_IDOMHTMLIFRAMEELEMENT_IID);
static nsGenericHTMLElement::EnumTable kAlignTable[] = {
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },
{ "right", NS_STYLE_TEXT_ALIGN_RIGHT },
{ "center", NS_STYLE_TEXT_ALIGN_CENTER },
{ 0 }
};
class nsHTMLIFrameElement : public nsIDOMHTMLIFrameElement,
public nsIScriptObjectOwner,
public nsIDOMEventReceiver,
@ -201,7 +194,7 @@ nsHTMLIFrameElement::StringToAttribute(nsIAtom* aAttribute,
}
}
else if (aAttribute == nsHTMLAtoms::align) {
if (nsGenericHTMLElement::ParseEnumValue(aValue, kAlignTable, aResult)) {
if (nsGenericHTMLElement::ParseAlignValue(aValue, aResult)) {
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
@ -223,7 +216,7 @@ nsHTMLIFrameElement::AttributeToString(nsIAtom* aAttribute,
}
else if (aAttribute == nsHTMLAtoms::align) {
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
nsGenericHTMLElement::EnumValueToString(aValue, kAlignTable, aResult);
nsGenericHTMLElement::AlignValueToString(aValue, aResult);
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
@ -276,6 +269,9 @@ nsHTMLIFrameElement::GetMappedAttributeImpact(const nsIAtom* aAttribute,
(aAttribute == nsHTMLAtoms::height)) {
aHint = NS_STYLE_HINT_REFLOW;
}
else if (aAttribute == nsHTMLAtoms::align) {
aHint = NS_STYLE_HINT_REFLOW;
}
else if (! nsGenericHTMLElement::GetCommonMappedAttributesImpact(aAttribute, aHint)) {
aHint = NS_STYLE_HINT_CONTENT;
}