Refactor frame property code so it can be used as a generic object-property mechanism for content nodes and frames. Add an interface for manipulating content node properties, for now just on elements. Bug 253888, r=jst, sr=dbaron. (This will land on the trunk once it reopens)
git-svn-id: svn://10.0.0.236/branches/FORMS_20040722_BRANCH@160690 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -116,10 +116,10 @@ struct nsValueList
|
||||
// The code doesn't include hooks for AttributeChanged() notifications.
|
||||
|
||||
static void
|
||||
DestroyValueListFunc(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
DestroyValueListFunc(void* aFrame,
|
||||
nsIAtom* aPropertyName,
|
||||
void* aPropertyValue)
|
||||
void* aPropertyValue,
|
||||
void* aDtorData)
|
||||
{
|
||||
delete NS_STATIC_CAST(nsValueList*, aPropertyValue);
|
||||
}
|
||||
@@ -133,9 +133,8 @@ GetValueAt(nsIPresContext* aPresContext,
|
||||
PRUnichar* result = nsnull;
|
||||
nsValueList* valueList;
|
||||
|
||||
nsFrameManager *frameManager = aPresContext->FrameManager();
|
||||
valueList = NS_STATIC_CAST(nsValueList*,
|
||||
frameManager->GetFrameProperty(aTableOrRowFrame, aAttributeAtom, 0));
|
||||
aTableOrRowFrame->GetProperty(aAttributeAtom));
|
||||
|
||||
if (!valueList) {
|
||||
// The property isn't there yet, so set it
|
||||
@@ -144,8 +143,8 @@ GetValueAt(nsIPresContext* aPresContext,
|
||||
aTableOrRowFrame->GetContent()->GetAttr(kNameSpaceID_None, aAttributeAtom, values)) {
|
||||
valueList = new nsValueList(values);
|
||||
if (valueList) {
|
||||
frameManager->SetFrameProperty(aTableOrRowFrame, aAttributeAtom,
|
||||
valueList, DestroyValueListFunc);
|
||||
aTableOrRowFrame->SetProperty(aAttributeAtom,
|
||||
valueList, DestroyValueListFunc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user