changed the way map attributes into is connected

This commit is contained in:
peterl@netscape.com
1998-09-05 04:00:06 +00:00
parent 4f88cafa09
commit ee52a0c367
171 changed files with 2579 additions and 1251 deletions
@@ -26,6 +26,7 @@
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsIHTMLAttributes.h"
// XXX missing nav attributes
@@ -153,22 +154,32 @@ nsHTMLParagraphElement::AttributeToString(nsIAtom* aAttribute,
return mInner.AttributeToString(aAttribute, aValue, aResult);
}
NS_IMETHODIMP
nsHTMLParagraphElement::MapAttributesInto(nsIStyleContext* aContext,
nsIPresContext* aPresContext)
static void
MapAttributesInto(nsIHTMLAttributes* aAttributes,
nsIStyleContext* aContext,
nsIPresContext* aPresContext)
{
if (nsnull != mInner.mAttributes) {
if (nsnull != aAttributes) {
nsHTMLValue value;
GetAttribute(nsHTMLAtoms::align, value);
aAttributes->GetAttribute(nsHTMLAtoms::align, value);
if (value.GetUnit() == eHTMLUnit_Enumerated) {
nsStyleText* text = (nsStyleText*)
aContext->GetMutableStyleData(eStyleStruct_Text);
text->mTextAlign = value.GetIntValue();
}
}
return mInner.MapAttributesInto(aContext, aPresContext);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aContext, aPresContext);
}
NS_IMETHODIMP
nsHTMLParagraphElement::GetAttributeMappingFunction(nsMapAttributesFunc& aMapFunc) const
{
aMapFunc = &MapAttributesInto;
return NS_OK;
}
NS_IMETHODIMP
nsHTMLParagraphElement::HandleDOMEvent(nsIPresContext& aPresContext,
nsEvent* aEvent,