Bug 500882 part 1. Give nsIContent an nsIFrame member. r=smaug, sr=roc

This commit is contained in:
Boris Zbarsky 2009-12-24 16:20:05 -05:00
Родитель 5c2887c20a
Коммит 78cf162db9
1 изменённых файлов: 22 добавлений и 1 удалений

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

@ -57,6 +57,7 @@ class nsAttrValue;
class nsAttrName;
class nsTextFragment;
class nsIDocShell;
class nsIFrame;
#ifdef MOZ_SMIL
class nsISMILAttr;
class nsIDOMCSSStyleDeclaration;
@ -86,7 +87,8 @@ public:
// nsIContent is that it exists with an IID
nsIContent(nsINodeInfo *aNodeInfo)
: nsINode(aNodeInfo)
: nsINode(aNodeInfo),
mPrimaryFrame(nsnull)
{
NS_ASSERTION(aNodeInfo,
"No nsINodeInfo passed to nsIContent, PREPARE TO CRASH!!!");
@ -870,6 +872,20 @@ public:
*/
virtual void SaveSubtreeState() = 0;
/**
* Getter and setter for our primary frame pointer. This is the frame that
* is most closely associated with the content. A frame is more closely
* associated with the content than another frame if the one frame contains
* directly or indirectly the other frame (e.g., when a frame is scrolled
* there is a scroll frame that contains the frame being scrolled). This
* frame is always the first continuation.
*
* In the case of absolutely positioned elements and floated elements, this
* frame is the out of flow frame, not the placeholder.
*/
nsIFrame* GetPrimaryFrame() const { return mPrimaryFrame; }
void SetPrimaryFrame(nsIFrame* aFrame) { mPrimaryFrame = aFrame; }
#ifdef MOZ_SMIL
/*
* Returns a new nsISMILAttr that allows the caller to animate the given
@ -912,6 +928,11 @@ private:
*/
virtual const nsAttrValue* DoGetClasses() const = 0;
/**
* Pointer to our primary frame. Might be null.
*/
nsIFrame* mPrimaryFrame;
public:
#ifdef DEBUG
/**