changed the way map attributes into is connected

git-svn-id: svn://10.0.0.236/trunk@9412 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
peterl%netscape.com
1998-09-05 04:00:06 +00:00
parent c053a8b481
commit c728b9f01f
171 changed files with 2579 additions and 1251 deletions

View File

@@ -26,6 +26,7 @@
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsIHTMLAttributes.h"
// XXX wrap, variable, cols, tabstop
@@ -167,21 +168,22 @@ nsHTMLPreElement::AttributeToString(nsIAtom* aAttribute,
return mInner.AttributeToString(aAttribute, aValue, aResult);
}
NS_IMETHODIMP
nsHTMLPreElement::MapAttributesInto(nsIStyleContext* aContext,
nsIPresContext* aPresContext)
static void
MapAttributesInto(nsIHTMLAttributes* aAttributes,
nsIStyleContext* aContext,
nsIPresContext* aPresContext)
{
if (nsnull != mInner.mAttributes) {
if (nsnull != aAttributes) {
nsHTMLValue value;
// wrap: empty
GetAttribute(nsHTMLAtoms::wrap, value);
aAttributes->GetAttribute(nsHTMLAtoms::wrap, value);
if (value.GetUnit() == eHTMLUnit_Empty) {
// XXX set
}
// variable: empty
GetAttribute(nsHTMLAtoms::variable, value);
aAttributes->GetAttribute(nsHTMLAtoms::variable, value);
if (value.GetUnit() == eHTMLUnit_Empty) {
nsStyleFont* font = (nsStyleFont*)
aContext->GetMutableStyleData(eStyleStruct_Font);
@@ -189,19 +191,28 @@ nsHTMLPreElement::MapAttributesInto(nsIStyleContext* aContext,
}
// cols: int
GetAttribute(nsHTMLAtoms::cols, value);
aAttributes->GetAttribute(nsHTMLAtoms::cols, value);
if (value.GetUnit() == eHTMLUnit_Integer) {
// XXX set
}
// tabstop: int
aAttributes->GetAttribute(nsHTMLAtoms::tabstop, value);
if (value.GetUnit() == eHTMLUnit_Integer) {
// XXX set
}
}
return mInner.MapAttributesInto(aContext, aPresContext);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aContext, aPresContext);
}
NS_IMETHODIMP
nsHTMLPreElement::GetAttributeMappingFunction(nsMapAttributesFunc& aMapFunc) const
{
aMapFunc = &MapAttributesInto;
return NS_OK;
}
NS_IMETHODIMP
nsHTMLPreElement::HandleDOMEvent(nsIPresContext& aPresContext,
nsEvent* aEvent,