зеркало из https://github.com/mozilla/gecko-dev.git
Added nsStylePosition
This commit is contained in:
Родитель
4366741d31
Коммит
55632fc7af
|
@ -41,6 +41,7 @@ static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID);
|
|||
static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID);
|
||||
static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID);
|
||||
static NS_DEFINE_IID(kStyleListSID, NS_STYLELIST_SID);
|
||||
static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID);
|
||||
static NS_DEFINE_IID(kStyleMoleculeSID, NS_STYLEMOLECULE_SID);
|
||||
|
||||
static NS_DEFINE_IID(kIStyleContextIID, NS_ISTYLECONTEXT_IID);
|
||||
|
@ -210,6 +211,42 @@ void StyleListImpl::InheritFrom(const nsStyleList& aCopy)
|
|||
mListStylePosition = aCopy.mListStylePosition;
|
||||
}
|
||||
|
||||
// --------------------
|
||||
// nsStylePosition
|
||||
//
|
||||
struct StylePositionImpl: public nsStylePosition {
|
||||
StylePositionImpl(void)
|
||||
{
|
||||
mPosition = NS_STYLE_POSITION_STATIC;
|
||||
mLeftOffsetFlags = NS_STYLE_POSITION_VALUE_AUTO;
|
||||
mLeftOffset = 0;
|
||||
mTopOffsetFlags = NS_STYLE_POSITION_VALUE_AUTO;
|
||||
mTopOffset = 0;
|
||||
mWidthFlags = NS_STYLE_POSITION_VALUE_AUTO;
|
||||
mWidth = 0;
|
||||
mHeightFlags = NS_STYLE_POSITION_VALUE_AUTO;
|
||||
mHeight = 0;
|
||||
}
|
||||
|
||||
~StylePositionImpl(void)
|
||||
{}
|
||||
|
||||
virtual const nsID& GetID(void)
|
||||
{ return kStylePositionSID; }
|
||||
|
||||
virtual void InheritFrom(const nsStylePosition& aCopy);
|
||||
|
||||
private: // These are not allowed
|
||||
StylePositionImpl(const StylePositionImpl& aOther);
|
||||
StylePositionImpl& operator=(const StylePositionImpl& aOther);
|
||||
};
|
||||
|
||||
void StylePositionImpl::InheritFrom(const nsStylePosition& aCopy)
|
||||
{
|
||||
// positioning values not inherited
|
||||
}
|
||||
|
||||
|
||||
// --------------------
|
||||
// nsStyleMolecule
|
||||
//
|
||||
|
@ -292,6 +329,7 @@ public:
|
|||
StyleSpacingImpl mSpacing;
|
||||
StyleBorderImpl mBorder;
|
||||
StyleListImpl mList;
|
||||
StylePositionImpl mPosition;
|
||||
// xxx backward support hack
|
||||
StyleMoleculeImpl mMolecule;
|
||||
};
|
||||
|
|
|
@ -49,6 +49,11 @@ class nsISupportsArray;
|
|||
#define NS_STYLELIST_SID \
|
||||
{0x4fb83b60, 0xcf27, 0x11d1, {0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}}
|
||||
|
||||
// SID AD5993F0-DA2B-11d1-80B9-00805F8A274D
|
||||
#define NS_STYLEPOSITION_SID \
|
||||
{0xad5993f0, 0xda2b, 0x11d1, {0x80, 0xb9, 0x00, 0x80, 0x5f, 0x8a, 0x27, 0x4d}}
|
||||
|
||||
|
||||
// Indicies into border/padding/margin arrays
|
||||
#define NS_SIDE_TOP 0
|
||||
#define NS_SIDE_RIGHT 1
|
||||
|
@ -109,6 +114,20 @@ struct nsStyleList : public nsStyleStruct {
|
|||
PRUint8 mListStylePosition;
|
||||
};
|
||||
|
||||
struct nsStylePosition : public nsStyleStruct {
|
||||
PRUint8 mPosition; // see nsStyleConsts.h
|
||||
|
||||
PRUint8 mLeftOffsetFlags; // see nsStyleConsts.h
|
||||
nscoord mLeftOffset;
|
||||
PRUint8 mTopOffsetFlags; // see nsStyleConsts.h
|
||||
nscoord mTopOffset;
|
||||
|
||||
PRUint8 mWidthFlags; // see nsStyleConsts.h
|
||||
nscoord mWidth;
|
||||
PRUint8 mHeightFlags; // see nsStyleConsts.h
|
||||
nscoord mHeight;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// XXX begin temporary doomed code
|
||||
|
||||
|
|
|
@ -112,6 +112,17 @@
|
|||
#define NS_STYLE_FONT_SIZE_LARGER 7
|
||||
#define NS_STYLE_FONT_SIZE_SMALLER 8
|
||||
|
||||
// See nsStylePosition
|
||||
#define NS_STYLE_POSITION_STATIC 0
|
||||
#define NS_STYLE_POSITION_RELATIVE 1
|
||||
#define NS_STYLE_POSITION_ABSOLUTE 2
|
||||
|
||||
// See nsStylePosition
|
||||
#define NS_STYLE_POSITION_VALUE_LENGTH 0
|
||||
#define NS_STYLE_POSITION_VALUE_PCT 1
|
||||
#define NS_STYLE_POSITION_VALUE_AUTO 2
|
||||
#define NS_STYLE_POSITION_VALUE_INHERIT 3
|
||||
|
||||
#define NS_STYLE_HEIGHT_AUTO 0
|
||||
|
||||
#define NS_STYLE_LEFT_AUTO 0
|
||||
|
@ -141,10 +152,6 @@
|
|||
#define NS_STYLE_OVERFLOW_SCROLL 2
|
||||
#define NS_STYLE_OVERFLOW_AUTO 3
|
||||
|
||||
#define NS_STYLE_POSITION_STATIC 0
|
||||
#define NS_STYLE_POSITION_RELATIVE 1
|
||||
#define NS_STYLE_POSITION_ABSOLUTE 2
|
||||
|
||||
#define NS_STYLE_SPACING_NORMAL 0
|
||||
|
||||
#define NS_STYLE_TEXT_ALIGN_LEFT 0
|
||||
|
|
|
@ -41,6 +41,7 @@ static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID);
|
|||
static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID);
|
||||
static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID);
|
||||
static NS_DEFINE_IID(kStyleListSID, NS_STYLELIST_SID);
|
||||
static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID);
|
||||
static NS_DEFINE_IID(kStyleMoleculeSID, NS_STYLEMOLECULE_SID);
|
||||
|
||||
static NS_DEFINE_IID(kIStyleContextIID, NS_ISTYLECONTEXT_IID);
|
||||
|
@ -210,6 +211,42 @@ void StyleListImpl::InheritFrom(const nsStyleList& aCopy)
|
|||
mListStylePosition = aCopy.mListStylePosition;
|
||||
}
|
||||
|
||||
// --------------------
|
||||
// nsStylePosition
|
||||
//
|
||||
struct StylePositionImpl: public nsStylePosition {
|
||||
StylePositionImpl(void)
|
||||
{
|
||||
mPosition = NS_STYLE_POSITION_STATIC;
|
||||
mLeftOffsetFlags = NS_STYLE_POSITION_VALUE_AUTO;
|
||||
mLeftOffset = 0;
|
||||
mTopOffsetFlags = NS_STYLE_POSITION_VALUE_AUTO;
|
||||
mTopOffset = 0;
|
||||
mWidthFlags = NS_STYLE_POSITION_VALUE_AUTO;
|
||||
mWidth = 0;
|
||||
mHeightFlags = NS_STYLE_POSITION_VALUE_AUTO;
|
||||
mHeight = 0;
|
||||
}
|
||||
|
||||
~StylePositionImpl(void)
|
||||
{}
|
||||
|
||||
virtual const nsID& GetID(void)
|
||||
{ return kStylePositionSID; }
|
||||
|
||||
virtual void InheritFrom(const nsStylePosition& aCopy);
|
||||
|
||||
private: // These are not allowed
|
||||
StylePositionImpl(const StylePositionImpl& aOther);
|
||||
StylePositionImpl& operator=(const StylePositionImpl& aOther);
|
||||
};
|
||||
|
||||
void StylePositionImpl::InheritFrom(const nsStylePosition& aCopy)
|
||||
{
|
||||
// positioning values not inherited
|
||||
}
|
||||
|
||||
|
||||
// --------------------
|
||||
// nsStyleMolecule
|
||||
//
|
||||
|
@ -292,6 +329,7 @@ public:
|
|||
StyleSpacingImpl mSpacing;
|
||||
StyleBorderImpl mBorder;
|
||||
StyleListImpl mList;
|
||||
StylePositionImpl mPosition;
|
||||
// xxx backward support hack
|
||||
StyleMoleculeImpl mMolecule;
|
||||
};
|
||||
|
|
|
@ -41,6 +41,7 @@ static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID);
|
|||
static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID);
|
||||
static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID);
|
||||
static NS_DEFINE_IID(kStyleListSID, NS_STYLELIST_SID);
|
||||
static NS_DEFINE_IID(kStylePositionSID, NS_STYLEPOSITION_SID);
|
||||
static NS_DEFINE_IID(kStyleMoleculeSID, NS_STYLEMOLECULE_SID);
|
||||
|
||||
static NS_DEFINE_IID(kIStyleContextIID, NS_ISTYLECONTEXT_IID);
|
||||
|
@ -210,6 +211,42 @@ void StyleListImpl::InheritFrom(const nsStyleList& aCopy)
|
|||
mListStylePosition = aCopy.mListStylePosition;
|
||||
}
|
||||
|
||||
// --------------------
|
||||
// nsStylePosition
|
||||
//
|
||||
struct StylePositionImpl: public nsStylePosition {
|
||||
StylePositionImpl(void)
|
||||
{
|
||||
mPosition = NS_STYLE_POSITION_STATIC;
|
||||
mLeftOffsetFlags = NS_STYLE_POSITION_VALUE_AUTO;
|
||||
mLeftOffset = 0;
|
||||
mTopOffsetFlags = NS_STYLE_POSITION_VALUE_AUTO;
|
||||
mTopOffset = 0;
|
||||
mWidthFlags = NS_STYLE_POSITION_VALUE_AUTO;
|
||||
mWidth = 0;
|
||||
mHeightFlags = NS_STYLE_POSITION_VALUE_AUTO;
|
||||
mHeight = 0;
|
||||
}
|
||||
|
||||
~StylePositionImpl(void)
|
||||
{}
|
||||
|
||||
virtual const nsID& GetID(void)
|
||||
{ return kStylePositionSID; }
|
||||
|
||||
virtual void InheritFrom(const nsStylePosition& aCopy);
|
||||
|
||||
private: // These are not allowed
|
||||
StylePositionImpl(const StylePositionImpl& aOther);
|
||||
StylePositionImpl& operator=(const StylePositionImpl& aOther);
|
||||
};
|
||||
|
||||
void StylePositionImpl::InheritFrom(const nsStylePosition& aCopy)
|
||||
{
|
||||
// positioning values not inherited
|
||||
}
|
||||
|
||||
|
||||
// --------------------
|
||||
// nsStyleMolecule
|
||||
//
|
||||
|
@ -292,6 +329,7 @@ public:
|
|||
StyleSpacingImpl mSpacing;
|
||||
StyleBorderImpl mBorder;
|
||||
StyleListImpl mList;
|
||||
StylePositionImpl mPosition;
|
||||
// xxx backward support hack
|
||||
StyleMoleculeImpl mMolecule;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче