More nsIPresContext deCOMtamination (bug 229371). r+sr=roc.

This commit is contained in:
bryner%brianryner.com 2004-04-13 00:28:44 +00:00
Родитель 9850f8d3b8
Коммит 0af1a79c51
47 изменённых файлов: 291 добавлений и 516 удалений

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

@ -68,9 +68,7 @@ struct RuleProcessorData {
~RuleProcessorData();
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~RuleProcessorData();

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

@ -79,9 +79,7 @@ public:
}
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
};
void operator delete(void* aPtr) {} // Does nothing. The arena will free us up when the rule tree
// dies.
@ -369,9 +367,7 @@ void*
nsRuleNode::operator new(size_t sz, nsIPresContext* aPresContext) CPP_THROW_NEW
{
// Check the recycle list first.
void* result = nsnull;
aPresContext->AllocateFromShell(sz, &result);
return result;
return aPresContext->AllocateFromShell(sz);
}
// Overridden to prevent the global delete from being called, since the memory
@ -1385,8 +1381,9 @@ nsRuleNode::SetDefaultOnRoot(const nsStyleStructID aSID, nsStyleContext* aContex
{
nsStyleFont* fontData = new (mPresContext) nsStyleFont(mPresContext);
nscoord minimumFontSize = 0;
mPresContext->GetCachedIntPref(kPresContext_MinimumFontSize, minimumFontSize);
nscoord minimumFontSize =
mPresContext->GetCachedIntPref(kPresContext_MinimumFontSize);
if (minimumFontSize > 0 && !IsChrome(mPresContext)) {
fontData->mFont.size = PR_MAX(fontData->mSize, minimumFontSize);
}
@ -1976,8 +1973,9 @@ nsRuleNode::ComputeFontData(nsStyleStruct* aStartStruct,
parentFont = font;
// See if there is a minimum font-size constraint to honor
nscoord minimumFontSize = 0; // unconstrained by default
mPresContext->GetCachedIntPref(kPresContext_MinimumFontSize, minimumFontSize);
nscoord minimumFontSize =
mPresContext->GetCachedIntPref(kPresContext_MinimumFontSize);
if (minimumFontSize < 0)
minimumFontSize = 0;
@ -2114,9 +2112,9 @@ nsRuleNode::ComputeTextData(nsStyleStruct* aStartStruct,
textData.mLineHeight.GetUnit() == eCSSUnit_Pixel) {
nscoord lh = nsStyleFont::ZoomText(mPresContext,
text->mLineHeight.GetCoordValue());
nscoord minimumFontSize = 0;
mPresContext->GetCachedIntPref(kPresContext_MinimumFontSize,
minimumFontSize);
nscoord minimumFontSize =
mPresContext->GetCachedIntPref(kPresContext_MinimumFontSize);
if (minimumFontSize > 0 && !IsChrome(mPresContext)) {
// If we applied a minimum font size, scale the line height by
// the same ratio. (If we *might* have applied a minimum font

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

@ -1510,9 +1510,7 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA
if (NS_SUCCEEDED(result) && NS_SUCCEEDED(result = frame->PeekOffset(context, &pos)) && pos.mResultContent)
{
tHint = (HINT)pos.mPreferLeft;
PRBool bidiEnabled = PR_FALSE;
context->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled)
if (context->BidiEnabled())
{
nsIFrame *theFrame;
PRInt32 currentOffset, frameStart, frameEnd;
@ -2596,9 +2594,7 @@ nsSelection::HandleDrag(nsIPresContext *aPresContext, nsIFrame *aFrame, nsPoint&
if (NS_SUCCEEDED(result))
{
#ifdef VISUALSELECTION
PRBool bidiEnabled = PR_FALSE;
aPresContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled) {
if (aPresContext->BidiEnabled()) {
PRUint8 level;
nsPeekOffsetStruct pos;
//set data using mLimiter to stop on scroll views. If we have a limiter then we stop peeking

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

@ -859,9 +859,7 @@ void*
nsStyleContext::operator new(size_t sz, nsIPresContext* aPresContext) CPP_THROW_NEW
{
// Check the recycle list first.
void* result = nsnull;
aPresContext->AllocateFromShell(sz, &result);
return result;
return aPresContext->AllocateFromShell(sz);
}
// Overridden to prevent the global delete from being called, since the memory

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

@ -67,9 +67,7 @@ struct nsInheritedStyleData
#undef STYLE_STRUCT_RESET
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
};
void ClearInheritedData(PRUint32 aBits) {
@ -126,9 +124,7 @@ struct nsResetStyleData
};
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void ClearInheritedData(PRUint32 aBits) {

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

@ -131,9 +131,7 @@ struct nsStyleColor : public nsStyleStruct {
nsChangeHint CalcDifference(const nsStyleColor& aOther) const;
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleColor();
@ -153,9 +151,7 @@ struct nsStyleBackground : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Background)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleBackground();
@ -489,9 +485,7 @@ struct nsStyleOutline: public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Outline)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleOutline();
@ -574,9 +568,7 @@ struct nsStyleList : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_List)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleList();
@ -599,9 +591,7 @@ struct nsStylePosition : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Position)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStylePosition();
@ -629,9 +619,7 @@ struct nsStyleTextReset : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_TextReset)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleTextReset();
@ -654,9 +642,7 @@ struct nsStyleText : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Text)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleText();
@ -688,9 +674,7 @@ struct nsStyleVisibility : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Visibility)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleVisibility();
@ -721,9 +705,7 @@ struct nsStyleDisplay : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Display)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleDisplay();
@ -776,9 +758,7 @@ struct nsStyleTable: public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Table)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleTable();
@ -802,9 +782,7 @@ struct nsStyleTableBorder: public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_TableBorder)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleTableBorder();
@ -897,9 +875,7 @@ struct nsStyleQuotes : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Quotes)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleQuotes();
@ -969,9 +945,7 @@ struct nsStyleContent: public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Content)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleContent();
@ -1096,9 +1070,7 @@ struct nsStyleUIReset: public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_UIReset)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleUIReset();
@ -1121,9 +1093,7 @@ struct nsStyleUserInterface: public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_UserInterface)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleUserInterface();
@ -1147,9 +1117,7 @@ struct nsStyleXUL : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_XUL)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleXUL();
@ -1187,9 +1155,7 @@ struct nsStyleSVG : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_SVG)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleSVG();
@ -1223,9 +1189,7 @@ struct nsStyleSVGReset : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_SVGReset)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleSVGReset();

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

@ -212,10 +212,9 @@ nsStyleFont::nsStyleFont(nsIPresContext* aPresContext)
void*
nsStyleFont::operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
void* result = aContext->AllocateFromShell(sz);
if (result)
memset(result, 0, sz);
memset(result, 0, sz);
return result;
}
@ -319,10 +318,9 @@ nsStyleMargin::nsStyleMargin(const nsStyleMargin& aSrc) {
void*
nsStyleMargin::operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
void* result = aContext->AllocateFromShell(sz);
if (result)
memset(result, 0, sz);
memset(result, 0, sz);
return result;
}
@ -377,10 +375,9 @@ nsStylePadding::nsStylePadding(const nsStylePadding& aSrc) {
void*
nsStylePadding::operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
void* result = aContext->AllocateFromShell(sz);
if (result)
memset(result, 0, sz);
memset(result, 0, sz);
return result;
}
@ -476,10 +473,9 @@ nsStyleBorder::nsStyleBorder(const nsStyleBorder& aSrc)
void*
nsStyleBorder::operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
void* result = aContext->AllocateFromShell(sz);
if (result)
memset(result, 0, sz);
memset(result, 0, sz);
return result;
}

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

@ -68,9 +68,7 @@ nsTextEditRules::CheckBidiLevelForDeletion(nsIDOMNode *aSelNode,
if (!context)
return NS_ERROR_NULL_POINTER;
PRBool bidiEnabled;
context->GetBidiEnabled(&bidiEnabled);
if (!bidiEnabled)
if (!context->BidiEnabled())
return NS_OK;
nsCOMPtr<nsIContent> content = do_QueryInterface(aSelNode);

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

@ -565,11 +565,7 @@ PRBool nsCaret::SetupDrawingFrameAndOffset(nsIDOMNode* aNode, PRInt32 aOffset, n
nsCOMPtr<nsIPresContext> presContext;
rv = presShell->GetPresContext(getter_AddRefs(presContext));
PRBool bidiEnabled = PR_FALSE;
if (presContext)
presContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled)
if (presContext && presContext->BidiEnabled())
{
presShell->GetCaretBidiLevel(&bidiLevel);
if (bidiLevel & BIDI_LEVEL_UNDEFINED)
@ -1088,7 +1084,7 @@ void nsCaret::GetCaretRectAndInvert()
presContext->SetBidiEnabled(bidiEnabled);
}
else
presContext->GetBidiEnabled(&bidiEnabled);
bidiEnabled = presContext->BidiEnabled();
if (bidiEnabled)
{
if (bidiLevel != mKeyboardRTL)

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

@ -140,8 +140,8 @@ public:
// All frames owned by the shell are allocated from an arena. They are also recycled
// using free lists (separate free lists being maintained for each size_t).
// Methods for recycling frames.
NS_IMETHOD AllocateFrame(size_t aSize, void** aResult) = 0;
NS_IMETHOD FreeFrame(size_t aSize, void* aFreeChunk) = 0;
virtual void* AllocateFrame(size_t aSize) = 0;
virtual void FreeFrame(size_t aSize, void* aFreeChunk) = 0;
// Dynamic stack memory allocation
NS_IMETHOD PushStackMemory() = 0;

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

@ -107,7 +107,7 @@ nsPresContext::PrefChangedCallback(const char* aPrefName, void* instance_data)
}
#ifdef IBMBIDI
PRBool
static PRBool
IsVisualCharset(const nsCAutoString& aCharset)
{
if (aCharset.EqualsIgnoreCase("ibm864") // Arabic//ahmed
@ -532,21 +532,6 @@ nsPresContext::GetUserPreferences()
#endif
}
NS_IMETHODIMP
nsPresContext::GetCachedIntPref(PRUint32 aPrefType, PRInt32& aValue)
{
nsresult rv = NS_OK;
switch (aPrefType) {
case kPresContext_MinimumFontSize:
aValue = mMinimumFontSize;
break;
default:
rv = NS_ERROR_INVALID_ARG;
NS_ERROR("invalid arg");
}
return rv;
}
void
nsPresContext::ClearStyleDataAndReflow()
{
@ -831,22 +816,6 @@ nsPresContext::GetXBLBindingURL(nsIContent* aContent, nsIURI** aResult)
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::AllocateFromShell(size_t aSize, void** aResult)
{
if (mShell)
return mShell->AllocateFrame(aSize, aResult);
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::FreeToShell(size_t aSize, void* aFreeChunk)
{
if (mShell)
return mShell->FreeFrame(aSize, aFreeChunk);
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::GetMetricsFor(const nsFont& aFont, nsIFontMetrics** aResult)
{
@ -1031,24 +1000,23 @@ nsPresContext::IsVisRTL(PRBool& aResult) const
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::GetBidiEnabled(PRBool* aBidiEnabled) const
PRBool
nsPresContext::BidiEnabled() const
{
NS_ENSURE_ARG_POINTER(aBidiEnabled);
*aBidiEnabled = PR_FALSE;
PRBool bidiEnabled = PR_FALSE;
NS_ASSERTION(mShell, "PresShell must be set on PresContext before calling nsPresContext::GetBidiEnabled");
if (mShell) {
nsCOMPtr<nsIDocument> doc;
mShell->GetDocument(getter_AddRefs(doc) );
NS_ASSERTION(doc, "PresShell has no document in nsPresContext::GetBidiEnabled");
if (doc) {
*aBidiEnabled = doc->GetBidiEnabled();
bidiEnabled = doc->GetBidiEnabled();
}
}
return NS_OK;
return bidiEnabled;
}
NS_IMETHODIMP
void
nsPresContext::SetBidiEnabled(PRBool aBidiEnabled) const
{
if (mShell) {
@ -1058,7 +1026,6 @@ nsPresContext::SetBidiEnabled(PRBool aBidiEnabled) const
doc->SetBidiEnabled(aBidiEnabled);
}
}
return NS_OK;
}
NS_IMETHODIMP
@ -1115,16 +1082,6 @@ nsPresContext::GetBidiCharset(nsACString &aCharSet) const
#endif //IBMBIDI
NS_IMETHODIMP
nsPresContext::GetLanguageSpecificTransformType(
nsLanguageSpecificTransformType* aType)
{
NS_PRECONDITION(aType, "null out param");
*aType = mLanguageSpecificTransformType;
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::GetTheme(nsITheme** aResult)
{

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

@ -83,8 +83,8 @@ class nsIRenderingContext;
#endif
#define NS_IPRESCONTEXT_IID \
{ 0x0a5d12e0, 0x944e, 0x11d1, \
{0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} }
{ 0xfaf7c34a, 0x347c, 0x48f6, \
{0x81, 0x76, 0xc0, 0xf6, 0xd4, 0xe5, 0x74, 0x2e} }
enum nsWidgetType {
eWidgetType_Button = 1,
@ -188,8 +188,18 @@ public:
virtual nsresult GetXBLBindingURL(nsIContent* aContent,
nsIURI** aResult) = 0;
NS_IMETHOD AllocateFromShell(size_t aSize, void** aResult) = 0;
NS_IMETHOD FreeToShell(size_t aSize, void* aFreeChunk) = 0;
void* AllocateFromShell(size_t aSize)
{
if (mShell)
return mShell->AllocateFrame(aSize);
return nsnull;
}
void FreeToShell(size_t aSize, void* aFreeChunk)
{
if (mShell)
mShell->FreeFrame(aSize, aFreeChunk);
}
/**
* Get the font metrics for a given font.
@ -202,10 +212,7 @@ public:
*/
virtual const nsFont* GetDefaultFont(PRUint8 aFontID) const = 0;
/** Get a cached boolean pref, by its type
if the type is not supported, then NS_ERROR_INVALID_ARG is returned
and the aValue argument is undefined, otherwise aValue is set
to the value of the boolean pref */
/** Get a cached boolean pref, by its type */
// * - initially created for bugs 31816, 20760, 22963
PRBool GetCachedBoolPref(PRUint32 aPrefType) const
{
@ -225,12 +232,21 @@ public:
return PR_FALSE;
}
/** Get a cached integer pref, by its type
if the type is not supported, then NS_ERROR_INVALID_ARG is returned
and the aValue argument is undefined, otherwise aValue is set
to the value of the integer pref */
/** Get a cached integer pref, by its type */
// * - initially created for bugs 30910, 61883, 74186, 84398
NS_IMETHOD GetCachedIntPref(PRUint32 aPrefType, PRInt32& aValue) = 0;
PRInt32 GetCachedIntPref(PRUint32 aPrefType) const
{
// If called with a constant parameter, the compiler should optimize
// this switch statement away.
switch (aPrefType) {
case kPresContext_MinimumFontSize:
return mMinimumFontSize;
default:
NS_ERROR("invalid arg passed to GetCachedIntPref");
}
return PR_FALSE;
}
/**
* Access Nav's magic font scaler value
@ -355,8 +371,10 @@ public:
*
* @param aType returns type, must be non-NULL
*/
NS_IMETHOD GetLanguageSpecificTransformType(
nsLanguageSpecificTransformType* aType) = 0;
nsLanguageSpecificTransformType LanguageSpecificTransformType() const
{
return mLanguageSpecificTransformType;
}
/**
* Set and get methods for controling the background drawing
@ -383,14 +401,14 @@ public:
*
* @lina 07/12/2000
*/
NS_IMETHOD GetBidiEnabled(PRBool* aBidiEnabled) const = 0;
virtual PRBool BidiEnabled() const = 0;
/**
* Set bidi enabled. This means we should apply the Unicode Bidi Algorithm
*
* @lina 07/12/2000
*/
NS_IMETHOD SetBidiEnabled(PRBool aBidiEnabled) const = 0;
virtual void SetBidiEnabled(PRBool aBidiEnabled) const = 0;
/**
* Set visual or implicit mode into the pres context.
@ -526,7 +544,9 @@ protected:
nsILinkHandler* mLinkHandler; // [WEAK]
nsILanguageAtom* mLanguage; // [STRONG]
nsLanguageSpecificTransformType mLanguageSpecificTransformType;
PRInt32 mFontScaler;
nscoord mMinimumFontSize;
nsRect mVisibleArea;
@ -540,10 +560,9 @@ protected:
nscolor mFocusBackgroundColor;
nscolor mFocusTextColor;
PRUint8 mFocusRingWidth;
nsCompatibility mCompatibilityMode;
PRUint16 mImageAnimationMode;
PRUint8 mFocusRingWidth;
unsigned mUseDocumentFonts : 1;
unsigned mUseDocumentColors : 1;

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

@ -578,8 +578,8 @@ public:
~FrameArena();
// Memory management functions
nsresult AllocateFrame(size_t aSize, void** aResult);
nsresult FreeFrame(size_t aSize, void* aPtr);
NS_HIDDEN_(void*) AllocateFrame(size_t aSize);
NS_HIDDEN_(void) FreeFrame(size_t aSize, void* aPtr);
private:
#if !defined(DEBUG_TRACEMALLOC_FRAMEARENA)
@ -611,11 +611,11 @@ FrameArena::~FrameArena()
#endif
}
nsresult
FrameArena::AllocateFrame(size_t aSize, void** aResult)
void*
FrameArena::AllocateFrame(size_t aSize)
{
#if defined(DEBUG_TRACEMALLOC_FRAMEARENA)
*aResult = PR_Malloc(aSize);
return PR_Malloc(aSize);
#else
void* result = nsnull;
@ -639,12 +639,11 @@ FrameArena::AllocateFrame(size_t aSize, void** aResult)
PL_ARENA_ALLOCATE(result, &mPool, aSize);
}
*aResult = result;
return result;
#endif
return NS_OK;
}
nsresult
void
FrameArena::FreeFrame(size_t aSize, void* aPtr)
{
#ifdef DEBUG
@ -673,7 +672,6 @@ FrameArena::FreeFrame(size_t aSize, void* aPtr)
}
#endif
#endif
return NS_OK;
}
class PresShellViewEventListener : public nsIScrollPositionListener,
@ -1020,8 +1018,8 @@ public:
nsCompatibility aCompatMode);
NS_IMETHOD Destroy();
NS_IMETHOD AllocateFrame(size_t aSize, void** aResult);
NS_IMETHOD FreeFrame(size_t aSize, void* aFreeChunk);
virtual NS_HIDDEN_(void*) AllocateFrame(size_t aSize);
virtual NS_HIDDEN_(void) FreeFrame(size_t aSize, void* aFreeChunk);
// Dynamic stack memory allocation
NS_IMETHOD PushStackMemory();
@ -1959,17 +1957,16 @@ PresShell::FreeDynamicStack()
}
NS_IMETHODIMP
void
PresShell::FreeFrame(size_t aSize, void* aPtr)
{
mFrameArena.FreeFrame(aSize, aPtr);
return NS_OK;
}
NS_IMETHODIMP
PresShell::AllocateFrame(size_t aSize, void** aResult)
void*
PresShell::AllocateFrame(size_t aSize)
{
return mFrameArena.AllocateFrame(aSize, aResult);
return mFrameArena.AllocateFrame(aSize);
}
NS_IMETHODIMP
@ -4886,8 +4883,7 @@ NS_IMETHODIMP
PresShell::PostReflowCallback(nsIReflowCallback* aCallback)
{
nsCallbackEventRequest* request = nsnull;
void* result = nsnull;
AllocateFrame(sizeof(nsCallbackEventRequest), &result);
void* result = AllocateFrame(sizeof(nsCallbackEventRequest));
request = (nsCallbackEventRequest*)result;
request->callback = aCallback;
@ -4950,8 +4946,7 @@ PresShell::PostDOMEvent(nsIContent* aContent, nsEvent* aEvent)
// ok we have a list of events to handle. Queue them up and handle them
// after we finish reflow.
nsDOMEventRequest* request = nsnull;
void* result = nsnull;
AllocateFrame(sizeof(nsDOMEventRequest), &result);
void* result = AllocateFrame(sizeof(nsDOMEventRequest));
request = (nsDOMEventRequest*)result;
request->content = aContent;
@ -4986,8 +4981,7 @@ PresShell::PostAttributeChange(nsIContent* aContent,
// after we finish reflow.
nsAttributeChangeRequest* request = nsnull;
void* result = nsnull;
AllocateFrame(sizeof(nsAttributeChangeRequest), &result);
void* result = AllocateFrame(sizeof(nsAttributeChangeRequest));
request = (nsAttributeChangeRequest*)result;
request->content = aContent;

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

@ -83,8 +83,8 @@ class nsIRenderingContext;
#endif
#define NS_IPRESCONTEXT_IID \
{ 0x0a5d12e0, 0x944e, 0x11d1, \
{0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} }
{ 0xfaf7c34a, 0x347c, 0x48f6, \
{0x81, 0x76, 0xc0, 0xf6, 0xd4, 0xe5, 0x74, 0x2e} }
enum nsWidgetType {
eWidgetType_Button = 1,
@ -188,8 +188,18 @@ public:
virtual nsresult GetXBLBindingURL(nsIContent* aContent,
nsIURI** aResult) = 0;
NS_IMETHOD AllocateFromShell(size_t aSize, void** aResult) = 0;
NS_IMETHOD FreeToShell(size_t aSize, void* aFreeChunk) = 0;
void* AllocateFromShell(size_t aSize)
{
if (mShell)
return mShell->AllocateFrame(aSize);
return nsnull;
}
void FreeToShell(size_t aSize, void* aFreeChunk)
{
if (mShell)
mShell->FreeFrame(aSize, aFreeChunk);
}
/**
* Get the font metrics for a given font.
@ -202,10 +212,7 @@ public:
*/
virtual const nsFont* GetDefaultFont(PRUint8 aFontID) const = 0;
/** Get a cached boolean pref, by its type
if the type is not supported, then NS_ERROR_INVALID_ARG is returned
and the aValue argument is undefined, otherwise aValue is set
to the value of the boolean pref */
/** Get a cached boolean pref, by its type */
// * - initially created for bugs 31816, 20760, 22963
PRBool GetCachedBoolPref(PRUint32 aPrefType) const
{
@ -225,12 +232,21 @@ public:
return PR_FALSE;
}
/** Get a cached integer pref, by its type
if the type is not supported, then NS_ERROR_INVALID_ARG is returned
and the aValue argument is undefined, otherwise aValue is set
to the value of the integer pref */
/** Get a cached integer pref, by its type */
// * - initially created for bugs 30910, 61883, 74186, 84398
NS_IMETHOD GetCachedIntPref(PRUint32 aPrefType, PRInt32& aValue) = 0;
PRInt32 GetCachedIntPref(PRUint32 aPrefType) const
{
// If called with a constant parameter, the compiler should optimize
// this switch statement away.
switch (aPrefType) {
case kPresContext_MinimumFontSize:
return mMinimumFontSize;
default:
NS_ERROR("invalid arg passed to GetCachedIntPref");
}
return PR_FALSE;
}
/**
* Access Nav's magic font scaler value
@ -355,8 +371,10 @@ public:
*
* @param aType returns type, must be non-NULL
*/
NS_IMETHOD GetLanguageSpecificTransformType(
nsLanguageSpecificTransformType* aType) = 0;
nsLanguageSpecificTransformType LanguageSpecificTransformType() const
{
return mLanguageSpecificTransformType;
}
/**
* Set and get methods for controling the background drawing
@ -383,14 +401,14 @@ public:
*
* @lina 07/12/2000
*/
NS_IMETHOD GetBidiEnabled(PRBool* aBidiEnabled) const = 0;
virtual PRBool BidiEnabled() const = 0;
/**
* Set bidi enabled. This means we should apply the Unicode Bidi Algorithm
*
* @lina 07/12/2000
*/
NS_IMETHOD SetBidiEnabled(PRBool aBidiEnabled) const = 0;
virtual void SetBidiEnabled(PRBool aBidiEnabled) const = 0;
/**
* Set visual or implicit mode into the pres context.
@ -526,7 +544,9 @@ protected:
nsILinkHandler* mLinkHandler; // [WEAK]
nsILanguageAtom* mLanguage; // [STRONG]
nsLanguageSpecificTransformType mLanguageSpecificTransformType;
PRInt32 mFontScaler;
nscoord mMinimumFontSize;
nsRect mVisibleArea;
@ -540,10 +560,9 @@ protected:
nscolor mFocusBackgroundColor;
nscolor mFocusTextColor;
PRUint8 mFocusRingWidth;
nsCompatibility mCompatibilityMode;
PRUint16 mImageAnimationMode;
PRUint8 mFocusRingWidth;
unsigned mUseDocumentFonts : 1;
unsigned mUseDocumentColors : 1;

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

@ -140,8 +140,8 @@ public:
// All frames owned by the shell are allocated from an arena. They are also recycled
// using free lists (separate free lists being maintained for each size_t).
// Methods for recycling frames.
NS_IMETHOD AllocateFrame(size_t aSize, void** aResult) = 0;
NS_IMETHOD FreeFrame(size_t aSize, void* aFreeChunk) = 0;
virtual void* AllocateFrame(size_t aSize) = 0;
virtual void FreeFrame(size_t aSize, void* aFreeChunk) = 0;
// Dynamic stack memory allocation
NS_IMETHOD PushStackMemory() = 0;

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

@ -83,8 +83,8 @@ class nsIRenderingContext;
#endif
#define NS_IPRESCONTEXT_IID \
{ 0x0a5d12e0, 0x944e, 0x11d1, \
{0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} }
{ 0xfaf7c34a, 0x347c, 0x48f6, \
{0x81, 0x76, 0xc0, 0xf6, 0xd4, 0xe5, 0x74, 0x2e} }
enum nsWidgetType {
eWidgetType_Button = 1,
@ -188,8 +188,18 @@ public:
virtual nsresult GetXBLBindingURL(nsIContent* aContent,
nsIURI** aResult) = 0;
NS_IMETHOD AllocateFromShell(size_t aSize, void** aResult) = 0;
NS_IMETHOD FreeToShell(size_t aSize, void* aFreeChunk) = 0;
void* AllocateFromShell(size_t aSize)
{
if (mShell)
return mShell->AllocateFrame(aSize);
return nsnull;
}
void FreeToShell(size_t aSize, void* aFreeChunk)
{
if (mShell)
mShell->FreeFrame(aSize, aFreeChunk);
}
/**
* Get the font metrics for a given font.
@ -202,10 +212,7 @@ public:
*/
virtual const nsFont* GetDefaultFont(PRUint8 aFontID) const = 0;
/** Get a cached boolean pref, by its type
if the type is not supported, then NS_ERROR_INVALID_ARG is returned
and the aValue argument is undefined, otherwise aValue is set
to the value of the boolean pref */
/** Get a cached boolean pref, by its type */
// * - initially created for bugs 31816, 20760, 22963
PRBool GetCachedBoolPref(PRUint32 aPrefType) const
{
@ -225,12 +232,21 @@ public:
return PR_FALSE;
}
/** Get a cached integer pref, by its type
if the type is not supported, then NS_ERROR_INVALID_ARG is returned
and the aValue argument is undefined, otherwise aValue is set
to the value of the integer pref */
/** Get a cached integer pref, by its type */
// * - initially created for bugs 30910, 61883, 74186, 84398
NS_IMETHOD GetCachedIntPref(PRUint32 aPrefType, PRInt32& aValue) = 0;
PRInt32 GetCachedIntPref(PRUint32 aPrefType) const
{
// If called with a constant parameter, the compiler should optimize
// this switch statement away.
switch (aPrefType) {
case kPresContext_MinimumFontSize:
return mMinimumFontSize;
default:
NS_ERROR("invalid arg passed to GetCachedIntPref");
}
return PR_FALSE;
}
/**
* Access Nav's magic font scaler value
@ -355,8 +371,10 @@ public:
*
* @param aType returns type, must be non-NULL
*/
NS_IMETHOD GetLanguageSpecificTransformType(
nsLanguageSpecificTransformType* aType) = 0;
nsLanguageSpecificTransformType LanguageSpecificTransformType() const
{
return mLanguageSpecificTransformType;
}
/**
* Set and get methods for controling the background drawing
@ -383,14 +401,14 @@ public:
*
* @lina 07/12/2000
*/
NS_IMETHOD GetBidiEnabled(PRBool* aBidiEnabled) const = 0;
virtual PRBool BidiEnabled() const = 0;
/**
* Set bidi enabled. This means we should apply the Unicode Bidi Algorithm
*
* @lina 07/12/2000
*/
NS_IMETHOD SetBidiEnabled(PRBool aBidiEnabled) const = 0;
virtual void SetBidiEnabled(PRBool aBidiEnabled) const = 0;
/**
* Set visual or implicit mode into the pres context.
@ -526,7 +544,9 @@ protected:
nsILinkHandler* mLinkHandler; // [WEAK]
nsILanguageAtom* mLanguage; // [STRONG]
nsLanguageSpecificTransformType mLanguageSpecificTransformType;
PRInt32 mFontScaler;
nscoord mMinimumFontSize;
nsRect mVisibleArea;
@ -540,10 +560,9 @@ protected:
nscolor mFocusBackgroundColor;
nscolor mFocusTextColor;
PRUint8 mFocusRingWidth;
nsCompatibility mCompatibilityMode;
PRUint16 mImageAnimationMode;
PRUint8 mFocusRingWidth;
unsigned mUseDocumentFonts : 1;
unsigned mUseDocumentColors : 1;

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

@ -565,11 +565,7 @@ PRBool nsCaret::SetupDrawingFrameAndOffset(nsIDOMNode* aNode, PRInt32 aOffset, n
nsCOMPtr<nsIPresContext> presContext;
rv = presShell->GetPresContext(getter_AddRefs(presContext));
PRBool bidiEnabled = PR_FALSE;
if (presContext)
presContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled)
if (presContext && presContext->BidiEnabled())
{
presShell->GetCaretBidiLevel(&bidiLevel);
if (bidiLevel & BIDI_LEVEL_UNDEFINED)
@ -1088,7 +1084,7 @@ void nsCaret::GetCaretRectAndInvert()
presContext->SetBidiEnabled(bidiEnabled);
}
else
presContext->GetBidiEnabled(&bidiEnabled);
bidiEnabled = presContext->BidiEnabled();
if (bidiEnabled)
{
if (bidiLevel != mKeyboardRTL)

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

@ -107,7 +107,7 @@ nsPresContext::PrefChangedCallback(const char* aPrefName, void* instance_data)
}
#ifdef IBMBIDI
PRBool
static PRBool
IsVisualCharset(const nsCAutoString& aCharset)
{
if (aCharset.EqualsIgnoreCase("ibm864") // Arabic//ahmed
@ -532,21 +532,6 @@ nsPresContext::GetUserPreferences()
#endif
}
NS_IMETHODIMP
nsPresContext::GetCachedIntPref(PRUint32 aPrefType, PRInt32& aValue)
{
nsresult rv = NS_OK;
switch (aPrefType) {
case kPresContext_MinimumFontSize:
aValue = mMinimumFontSize;
break;
default:
rv = NS_ERROR_INVALID_ARG;
NS_ERROR("invalid arg");
}
return rv;
}
void
nsPresContext::ClearStyleDataAndReflow()
{
@ -831,22 +816,6 @@ nsPresContext::GetXBLBindingURL(nsIContent* aContent, nsIURI** aResult)
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::AllocateFromShell(size_t aSize, void** aResult)
{
if (mShell)
return mShell->AllocateFrame(aSize, aResult);
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::FreeToShell(size_t aSize, void* aFreeChunk)
{
if (mShell)
return mShell->FreeFrame(aSize, aFreeChunk);
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::GetMetricsFor(const nsFont& aFont, nsIFontMetrics** aResult)
{
@ -1031,24 +1000,23 @@ nsPresContext::IsVisRTL(PRBool& aResult) const
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::GetBidiEnabled(PRBool* aBidiEnabled) const
PRBool
nsPresContext::BidiEnabled() const
{
NS_ENSURE_ARG_POINTER(aBidiEnabled);
*aBidiEnabled = PR_FALSE;
PRBool bidiEnabled = PR_FALSE;
NS_ASSERTION(mShell, "PresShell must be set on PresContext before calling nsPresContext::GetBidiEnabled");
if (mShell) {
nsCOMPtr<nsIDocument> doc;
mShell->GetDocument(getter_AddRefs(doc) );
NS_ASSERTION(doc, "PresShell has no document in nsPresContext::GetBidiEnabled");
if (doc) {
*aBidiEnabled = doc->GetBidiEnabled();
bidiEnabled = doc->GetBidiEnabled();
}
}
return NS_OK;
return bidiEnabled;
}
NS_IMETHODIMP
void
nsPresContext::SetBidiEnabled(PRBool aBidiEnabled) const
{
if (mShell) {
@ -1058,7 +1026,6 @@ nsPresContext::SetBidiEnabled(PRBool aBidiEnabled) const
doc->SetBidiEnabled(aBidiEnabled);
}
}
return NS_OK;
}
NS_IMETHODIMP
@ -1115,16 +1082,6 @@ nsPresContext::GetBidiCharset(nsACString &aCharSet) const
#endif //IBMBIDI
NS_IMETHODIMP
nsPresContext::GetLanguageSpecificTransformType(
nsLanguageSpecificTransformType* aType)
{
NS_PRECONDITION(aType, "null out param");
*aType = mLanguageSpecificTransformType;
return NS_OK;
}
NS_IMETHODIMP
nsPresContext::GetTheme(nsITheme** aResult)
{

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

@ -74,10 +74,7 @@ public:
virtual nsresult GetXBLBindingURL(nsIContent* aContent, nsIURI** aResult);
NS_IMETHOD GetMetricsFor(const nsFont& aFont, nsIFontMetrics** aResult);
NS_IMETHOD AllocateFromShell(size_t aSize, void** aResult);
NS_IMETHOD FreeToShell(size_t aSize, void* aFreeChunk);
virtual const nsFont* GetDefaultFont(PRUint8 aFontID) const;
NS_IMETHOD GetCachedIntPref(PRUint32 aPrefType, PRInt32& aValue);
virtual nsresult LoadImage(imgIRequest* aImage,
nsIFrame* aTargetFrame,
@ -90,8 +87,6 @@ public:
virtual void SetPageDim(nsRect* aRect) = 0;
NS_IMETHOD GetTwipsToPixelsForFonts(float* aResult) const;
NS_IMETHOD GetScaledPixelsToTwips(float* aScale) const;
NS_IMETHOD GetLanguageSpecificTransformType(
nsLanguageSpecificTransformType* aType);
#ifdef MOZ_REFLOW_PERF
NS_IMETHOD CountReflows(const char * aName, PRUint32 aType, nsIFrame * aFrame);
@ -104,8 +99,8 @@ public:
const PRUnichar* aData);
#ifdef IBMBIDI
NS_IMETHOD GetBidiEnabled(PRBool* aBidiEnabled) const;
NS_IMETHOD SetBidiEnabled(PRBool aBidiEnabled) const;
virtual PRBool BidiEnabled() const;
virtual void SetBidiEnabled(PRBool aBidiEnabled) const;
NS_IMETHOD GetBidiUtils(nsBidiPresUtils** aBidiUtils);
NS_IMETHOD SetBidi(PRUint32 aSource, PRBool aForceReflow = PR_FALSE);
NS_IMETHOD GetBidi(PRUint32* aDest) const;
@ -128,7 +123,6 @@ protected:
nsCOMPtr<nsIPref> mPrefs;
nsCOMPtr<nsILanguageAtomService> mLangService;
nsLanguageSpecificTransformType mLanguageSpecificTransformType;
nsWeakPtr mContainer;
nsFont mDefaultVariableFont;
@ -138,7 +132,6 @@ protected:
nsFont mDefaultMonospaceFont;
nsFont mDefaultCursiveFont;
nsFont mDefaultFantasyFont;
nscoord mMinimumFontSize;
nsSupportsHashtable mImageLoaders;

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

@ -88,9 +88,7 @@ nsSpaceManager::BandList::Clear()
PR_STATIC_CALLBACK(void*)
PSArenaAllocCB(size_t aSize, void* aClosure)
{
void *rv;
NS_STATIC_CAST(nsIPresShell*, aClosure)->AllocateFrame(aSize, &rv);
return rv;
return NS_STATIC_CAST(nsIPresShell*, aClosure)->AllocateFrame(aSize);
}
// PresShell Arena free callback (for nsIntervalSet use below)

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

@ -296,9 +296,7 @@ Add a <a href="#StyleContextMember">data member</a>
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_UIReset)
void* operator new(size_t sz, nsIPresContext* aContext) {
void* result = nsnull;
aContext-&gt;AllocateFromShell(sz, &amp;result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this-&gt;~nsStyleUIReset();

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

@ -676,9 +676,7 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
mState & NS_FRAME_IS_DIRTY || mState & NS_FRAME_HAS_DIRTY_CHILDREN) {
#ifdef IBMBIDI
if (! mLines.empty()) {
PRBool bidiEnabled;
aPresContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled) {
if (aPresContext->BidiEnabled()) {
nsBidiPresUtils* bidiUtils;
aPresContext->GetBidiUtils(&bidiUtils);
if (bidiUtils) {
@ -3960,10 +3958,7 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
#ifdef IBMBIDI
// XXXldb Why don't we do this earlier?
else {
PRBool bidiEnabled;
aState.mPresContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled) {
if (aState.mPresContext->BidiEnabled()) {
if (!aState.mPresContext->IsVisualMode()) {
nsBidiPresUtils* bidiUtils;
aState.mPresContext->GetBidiUtils(&bidiUtils);

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

@ -433,8 +433,7 @@ void*
nsFrame::operator new(size_t sz, nsIPresShell* aPresShell) CPP_THROW_NEW
{
// Check the recycle list first.
void* result = nsnull;
aPresShell->AllocateFrame(sz, &result);
void* result = aPresShell->AllocateFrame(sz);
if (result) {
memset(result, 0, sz);
@ -3186,9 +3185,7 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIPresContext* aPresContext,
aBlockFrame->GetOffsetFromView(aPresContext, offset,&view);
nscoord newDesiredX = aPos->mDesiredX - offset.x;//get desired x into blockframe coordinates!
#ifdef IBMBIDI
PRBool bidiEnabled;
aPresContext->GetBidiEnabled(&bidiEnabled);
result = it->FindFrameAt(searchingLine, newDesiredX, bidiEnabled, &resultFrame, &isBeforeFirstFrame, &isAfterLastFrame);
result = it->FindFrameAt(searchingLine, newDesiredX, aPresContext->BidiEnabled(), &resultFrame, &isBeforeFirstFrame, &isAfterLastFrame);
#else
result = it->FindFrameAt(searchingLine, newDesiredX, &resultFrame, &isBeforeFirstFrame, &isAfterLastFrame);
#endif // IBMBIDI

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

@ -2514,9 +2514,7 @@ nsHTMLReflowState::IsBidiFormControl(nsIPresContext* aPresContext)
// display correctly on native widgets in OSs with Bidi support.
// So bail out if the page is not Bidi, or not visual, or if the pref is
// set to use visual order on forms in visual pages
PRBool bidiEnabled;
aPresContext->GetBidiEnabled(&bidiEnabled);
if (!bidiEnabled) {
if (!aPresContext->BidiEnabled()) {
return PR_FALSE;
}

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

@ -91,9 +91,7 @@ NS_NewLineBox(nsIPresShell* aPresShell, nsIFrame* aFrame,
void*
nsLineBox::operator new(size_t sz, nsIPresShell* aPresShell) CPP_THROW_NEW
{
void* result = nsnull;
aPresShell->AllocateFrame(sz, &result);
return result;
return aPresShell->AllocateFrame(sz);
}
// Overloaded delete operator. Doesn't actually free the memory, because we

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

@ -980,11 +980,9 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
mSpaceManager->Translate(tx, ty);
#ifdef IBMBIDI
PRBool bidiEnabled;
mPresContext->GetBidiEnabled(&bidiEnabled);
PRInt32 start, end;
if (bidiEnabled) {
if (mPresContext->BidiEnabled()) {
if (aFrame->GetStateBits() & NS_FRAME_IS_BIDI) {
aFrame->GetOffsets(start, end);
}

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

@ -536,9 +536,7 @@ nsPageFrame::DrawHeaderFooter(nsIPresContext* aPresContext,
#ifdef IBMBIDI
nsresult rv = NS_ERROR_FAILURE;
PRBool isBidiEnabled = PR_FALSE;
aPresContext->GetBidiEnabled(&isBidiEnabled);
if (isBidiEnabled) {
if (aPresContext->BidiEnabled()) {
nsBidiPresUtils* bidiUtils;
aPresContext->GetBidiUtils(&bidiUtils);

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

@ -1510,9 +1510,7 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA
if (NS_SUCCEEDED(result) && NS_SUCCEEDED(result = frame->PeekOffset(context, &pos)) && pos.mResultContent)
{
tHint = (HINT)pos.mPreferLeft;
PRBool bidiEnabled = PR_FALSE;
context->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled)
if (context->BidiEnabled())
{
nsIFrame *theFrame;
PRInt32 currentOffset, frameStart, frameEnd;
@ -2596,9 +2594,7 @@ nsSelection::HandleDrag(nsIPresContext *aPresContext, nsIFrame *aFrame, nsPoint&
if (NS_SUCCEEDED(result))
{
#ifdef VISUALSELECTION
PRBool bidiEnabled = PR_FALSE;
aPresContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled) {
if (aPresContext->BidiEnabled()) {
PRUint8 level;
nsPeekOffsetStruct pos;
//set data using mLimiter to stop on scroll views. If we have a limiter then we stop peeking

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

@ -88,9 +88,7 @@ nsSpaceManager::BandList::Clear()
PR_STATIC_CALLBACK(void*)
PSArenaAllocCB(size_t aSize, void* aClosure)
{
void *rv;
NS_STATIC_CAST(nsIPresShell*, aClosure)->AllocateFrame(aSize, &rv);
return rv;
return NS_STATIC_CAST(nsIPresShell*, aClosure)->AllocateFrame(aSize);
}
// PresShell Arena free callback (for nsIntervalSet use below)

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

@ -1440,8 +1440,7 @@ nsTextFrame::Paint(nsIPresContext* aPresContext,
aRenderingContext.GetHints(hints);
#ifdef IBMBIDI
PRBool bidiEnabled;
aPresContext->GetBidiEnabled(&bidiEnabled);
PRBool bidiEnabled = aPresContext->BidiEnabled();
#else
const PRBool bidiEnabled = PR_FALSE;
#endif // IBMBIDI
@ -2234,10 +2233,8 @@ nsTextFrame::PaintUnicodeText(nsIPresContext* aPresContext,
#ifdef IBMBIDI
PRBool isRightToLeftOnBidiPlatform = PR_FALSE;
PRBool isBidiSystem = PR_FALSE;
PRBool bidiEnabled;
nsCharType charType = eCharType_LeftToRight;
aPresContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled) {
if (aPresContext->BidiEnabled()) {
isBidiSystem = aPresContext->IsBidiSystem();
GetBidiProperty(aPresContext, nsLayoutAtoms::embeddingLevel, (void**) &level,sizeof(level));
GetBidiProperty(aPresContext, nsLayoutAtoms::charType, (void**) &charType,sizeof(charType));
@ -2931,12 +2928,10 @@ nsTextFrame::PaintTextSlowly(nsIPresContext* aPresContext,
if (0 != textLength) {
#ifdef IBMBIDI
PRBool bidiEnabled;
PRUint8 level = 0;
nsCharType charType = eCharType_LeftToRight;
aPresContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled) {
if (aPresContext->BidiEnabled()) {
nsBidiPresUtils* bidiUtils;
aPresContext->GetBidiUtils(&bidiUtils);
@ -5223,9 +5218,7 @@ nsTextFrame::Reflow(nsIPresContext* aPresContext,
startingOffset = mContentOffset;
}
PRBool bidiEnabled;
aPresContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled) {
if (aPresContext->BidiEnabled()) {
nsCharType charType = eCharType_LeftToRight;
PRUint32 hints = 0;
aReflowState.rendContext->GetHints(hints);

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

@ -193,8 +193,8 @@ nsTextTransformer::nsTextTransformer(nsILineBreaker* aLineBreaker,
{
MOZ_COUNT_CTOR(nsTextTransformer);
aPresContext->
GetLanguageSpecificTransformType(&mLanguageSpecificTransformType);
mLanguageSpecificTransformType =
aPresContext->LanguageSpecificTransformType();
#ifdef IBMBIDI
mPresContext = aPresContext;
@ -236,10 +236,7 @@ nsTextTransformer::Init(nsIFrame* aFrame,
*
* We do numeric shaping in all Bidi documents.
*/
PRBool bidiEnabled;
mPresContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled) {
if (mPresContext->BidiEnabled()) {
aFrame->GetBidiProperty(mPresContext, nsLayoutAtoms::charType,
(void**)&mCharType, sizeof(mCharType));
if (mCharType == eCharType_RightToLeftArabic) {

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

@ -676,9 +676,7 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext,
mState & NS_FRAME_IS_DIRTY || mState & NS_FRAME_HAS_DIRTY_CHILDREN) {
#ifdef IBMBIDI
if (! mLines.empty()) {
PRBool bidiEnabled;
aPresContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled) {
if (aPresContext->BidiEnabled()) {
nsBidiPresUtils* bidiUtils;
aPresContext->GetBidiUtils(&bidiUtils);
if (bidiUtils) {
@ -3960,10 +3958,7 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
#ifdef IBMBIDI
// XXXldb Why don't we do this earlier?
else {
PRBool bidiEnabled;
aState.mPresContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled) {
if (aState.mPresContext->BidiEnabled()) {
if (!aState.mPresContext->IsVisualMode()) {
nsBidiPresUtils* bidiUtils;
aState.mPresContext->GetBidiUtils(&bidiUtils);

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

@ -433,8 +433,7 @@ void*
nsFrame::operator new(size_t sz, nsIPresShell* aPresShell) CPP_THROW_NEW
{
// Check the recycle list first.
void* result = nsnull;
aPresShell->AllocateFrame(sz, &result);
void* result = aPresShell->AllocateFrame(sz);
if (result) {
memset(result, 0, sz);
@ -3186,9 +3185,7 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIPresContext* aPresContext,
aBlockFrame->GetOffsetFromView(aPresContext, offset,&view);
nscoord newDesiredX = aPos->mDesiredX - offset.x;//get desired x into blockframe coordinates!
#ifdef IBMBIDI
PRBool bidiEnabled;
aPresContext->GetBidiEnabled(&bidiEnabled);
result = it->FindFrameAt(searchingLine, newDesiredX, bidiEnabled, &resultFrame, &isBeforeFirstFrame, &isAfterLastFrame);
result = it->FindFrameAt(searchingLine, newDesiredX, aPresContext->BidiEnabled(), &resultFrame, &isBeforeFirstFrame, &isAfterLastFrame);
#else
result = it->FindFrameAt(searchingLine, newDesiredX, &resultFrame, &isBeforeFirstFrame, &isAfterLastFrame);
#endif // IBMBIDI

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

@ -2514,9 +2514,7 @@ nsHTMLReflowState::IsBidiFormControl(nsIPresContext* aPresContext)
// display correctly on native widgets in OSs with Bidi support.
// So bail out if the page is not Bidi, or not visual, or if the pref is
// set to use visual order on forms in visual pages
PRBool bidiEnabled;
aPresContext->GetBidiEnabled(&bidiEnabled);
if (!bidiEnabled) {
if (!aPresContext->BidiEnabled()) {
return PR_FALSE;
}

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

@ -91,9 +91,7 @@ NS_NewLineBox(nsIPresShell* aPresShell, nsIFrame* aFrame,
void*
nsLineBox::operator new(size_t sz, nsIPresShell* aPresShell) CPP_THROW_NEW
{
void* result = nsnull;
aPresShell->AllocateFrame(sz, &result);
return result;
return aPresShell->AllocateFrame(sz);
}
// Overloaded delete operator. Doesn't actually free the memory, because we

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

@ -980,11 +980,9 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
mSpaceManager->Translate(tx, ty);
#ifdef IBMBIDI
PRBool bidiEnabled;
mPresContext->GetBidiEnabled(&bidiEnabled);
PRInt32 start, end;
if (bidiEnabled) {
if (mPresContext->BidiEnabled()) {
if (aFrame->GetStateBits() & NS_FRAME_IS_BIDI) {
aFrame->GetOffsets(start, end);
}

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

@ -536,9 +536,7 @@ nsPageFrame::DrawHeaderFooter(nsIPresContext* aPresContext,
#ifdef IBMBIDI
nsresult rv = NS_ERROR_FAILURE;
PRBool isBidiEnabled = PR_FALSE;
aPresContext->GetBidiEnabled(&isBidiEnabled);
if (isBidiEnabled) {
if (aPresContext->BidiEnabled()) {
nsBidiPresUtils* bidiUtils;
aPresContext->GetBidiUtils(&bidiUtils);

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

@ -578,8 +578,8 @@ public:
~FrameArena();
// Memory management functions
nsresult AllocateFrame(size_t aSize, void** aResult);
nsresult FreeFrame(size_t aSize, void* aPtr);
NS_HIDDEN_(void*) AllocateFrame(size_t aSize);
NS_HIDDEN_(void) FreeFrame(size_t aSize, void* aPtr);
private:
#if !defined(DEBUG_TRACEMALLOC_FRAMEARENA)
@ -611,11 +611,11 @@ FrameArena::~FrameArena()
#endif
}
nsresult
FrameArena::AllocateFrame(size_t aSize, void** aResult)
void*
FrameArena::AllocateFrame(size_t aSize)
{
#if defined(DEBUG_TRACEMALLOC_FRAMEARENA)
*aResult = PR_Malloc(aSize);
return PR_Malloc(aSize);
#else
void* result = nsnull;
@ -639,12 +639,11 @@ FrameArena::AllocateFrame(size_t aSize, void** aResult)
PL_ARENA_ALLOCATE(result, &mPool, aSize);
}
*aResult = result;
return result;
#endif
return NS_OK;
}
nsresult
void
FrameArena::FreeFrame(size_t aSize, void* aPtr)
{
#ifdef DEBUG
@ -673,7 +672,6 @@ FrameArena::FreeFrame(size_t aSize, void* aPtr)
}
#endif
#endif
return NS_OK;
}
class PresShellViewEventListener : public nsIScrollPositionListener,
@ -1020,8 +1018,8 @@ public:
nsCompatibility aCompatMode);
NS_IMETHOD Destroy();
NS_IMETHOD AllocateFrame(size_t aSize, void** aResult);
NS_IMETHOD FreeFrame(size_t aSize, void* aFreeChunk);
virtual NS_HIDDEN_(void*) AllocateFrame(size_t aSize);
virtual NS_HIDDEN_(void) FreeFrame(size_t aSize, void* aFreeChunk);
// Dynamic stack memory allocation
NS_IMETHOD PushStackMemory();
@ -1959,17 +1957,16 @@ PresShell::FreeDynamicStack()
}
NS_IMETHODIMP
void
PresShell::FreeFrame(size_t aSize, void* aPtr)
{
mFrameArena.FreeFrame(aSize, aPtr);
return NS_OK;
}
NS_IMETHODIMP
PresShell::AllocateFrame(size_t aSize, void** aResult)
void*
PresShell::AllocateFrame(size_t aSize)
{
return mFrameArena.AllocateFrame(aSize, aResult);
return mFrameArena.AllocateFrame(aSize);
}
NS_IMETHODIMP
@ -4886,8 +4883,7 @@ NS_IMETHODIMP
PresShell::PostReflowCallback(nsIReflowCallback* aCallback)
{
nsCallbackEventRequest* request = nsnull;
void* result = nsnull;
AllocateFrame(sizeof(nsCallbackEventRequest), &result);
void* result = AllocateFrame(sizeof(nsCallbackEventRequest));
request = (nsCallbackEventRequest*)result;
request->callback = aCallback;
@ -4950,8 +4946,7 @@ PresShell::PostDOMEvent(nsIContent* aContent, nsEvent* aEvent)
// ok we have a list of events to handle. Queue them up and handle them
// after we finish reflow.
nsDOMEventRequest* request = nsnull;
void* result = nsnull;
AllocateFrame(sizeof(nsDOMEventRequest), &result);
void* result = AllocateFrame(sizeof(nsDOMEventRequest));
request = (nsDOMEventRequest*)result;
request->content = aContent;
@ -4986,8 +4981,7 @@ PresShell::PostAttributeChange(nsIContent* aContent,
// after we finish reflow.
nsAttributeChangeRequest* request = nsnull;
void* result = nsnull;
AllocateFrame(sizeof(nsAttributeChangeRequest), &result);
void* result = AllocateFrame(sizeof(nsAttributeChangeRequest));
request = (nsAttributeChangeRequest*)result;
request->content = aContent;

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

@ -1440,8 +1440,7 @@ nsTextFrame::Paint(nsIPresContext* aPresContext,
aRenderingContext.GetHints(hints);
#ifdef IBMBIDI
PRBool bidiEnabled;
aPresContext->GetBidiEnabled(&bidiEnabled);
PRBool bidiEnabled = aPresContext->BidiEnabled();
#else
const PRBool bidiEnabled = PR_FALSE;
#endif // IBMBIDI
@ -2234,10 +2233,8 @@ nsTextFrame::PaintUnicodeText(nsIPresContext* aPresContext,
#ifdef IBMBIDI
PRBool isRightToLeftOnBidiPlatform = PR_FALSE;
PRBool isBidiSystem = PR_FALSE;
PRBool bidiEnabled;
nsCharType charType = eCharType_LeftToRight;
aPresContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled) {
if (aPresContext->BidiEnabled()) {
isBidiSystem = aPresContext->IsBidiSystem();
GetBidiProperty(aPresContext, nsLayoutAtoms::embeddingLevel, (void**) &level,sizeof(level));
GetBidiProperty(aPresContext, nsLayoutAtoms::charType, (void**) &charType,sizeof(charType));
@ -2931,12 +2928,10 @@ nsTextFrame::PaintTextSlowly(nsIPresContext* aPresContext,
if (0 != textLength) {
#ifdef IBMBIDI
PRBool bidiEnabled;
PRUint8 level = 0;
nsCharType charType = eCharType_LeftToRight;
aPresContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled) {
if (aPresContext->BidiEnabled()) {
nsBidiPresUtils* bidiUtils;
aPresContext->GetBidiUtils(&bidiUtils);
@ -5223,9 +5218,7 @@ nsTextFrame::Reflow(nsIPresContext* aPresContext,
startingOffset = mContentOffset;
}
PRBool bidiEnabled;
aPresContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled) {
if (aPresContext->BidiEnabled()) {
nsCharType charType = eCharType_LeftToRight;
PRUint32 hints = 0;
aReflowState.rendContext->GetHints(hints);

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

@ -193,8 +193,8 @@ nsTextTransformer::nsTextTransformer(nsILineBreaker* aLineBreaker,
{
MOZ_COUNT_CTOR(nsTextTransformer);
aPresContext->
GetLanguageSpecificTransformType(&mLanguageSpecificTransformType);
mLanguageSpecificTransformType =
aPresContext->LanguageSpecificTransformType();
#ifdef IBMBIDI
mPresContext = aPresContext;
@ -236,10 +236,7 @@ nsTextTransformer::Init(nsIFrame* aFrame,
*
* We do numeric shaping in all Bidi documents.
*/
PRBool bidiEnabled;
mPresContext->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled) {
if (mPresContext->BidiEnabled()) {
aFrame->GetBidiProperty(mPresContext, nsLayoutAtoms::charType,
(void**)&mCharType, sizeof(mCharType));
if (mCharType == eCharType_RightToLeftArabic) {

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

@ -68,9 +68,7 @@ struct RuleProcessorData {
~RuleProcessorData();
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~RuleProcessorData();

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

@ -79,9 +79,7 @@ public:
}
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
};
void operator delete(void* aPtr) {} // Does nothing. The arena will free us up when the rule tree
// dies.
@ -369,9 +367,7 @@ void*
nsRuleNode::operator new(size_t sz, nsIPresContext* aPresContext) CPP_THROW_NEW
{
// Check the recycle list first.
void* result = nsnull;
aPresContext->AllocateFromShell(sz, &result);
return result;
return aPresContext->AllocateFromShell(sz);
}
// Overridden to prevent the global delete from being called, since the memory
@ -1385,8 +1381,9 @@ nsRuleNode::SetDefaultOnRoot(const nsStyleStructID aSID, nsStyleContext* aContex
{
nsStyleFont* fontData = new (mPresContext) nsStyleFont(mPresContext);
nscoord minimumFontSize = 0;
mPresContext->GetCachedIntPref(kPresContext_MinimumFontSize, minimumFontSize);
nscoord minimumFontSize =
mPresContext->GetCachedIntPref(kPresContext_MinimumFontSize);
if (minimumFontSize > 0 && !IsChrome(mPresContext)) {
fontData->mFont.size = PR_MAX(fontData->mSize, minimumFontSize);
}
@ -1976,8 +1973,9 @@ nsRuleNode::ComputeFontData(nsStyleStruct* aStartStruct,
parentFont = font;
// See if there is a minimum font-size constraint to honor
nscoord minimumFontSize = 0; // unconstrained by default
mPresContext->GetCachedIntPref(kPresContext_MinimumFontSize, minimumFontSize);
nscoord minimumFontSize =
mPresContext->GetCachedIntPref(kPresContext_MinimumFontSize);
if (minimumFontSize < 0)
minimumFontSize = 0;
@ -2114,9 +2112,9 @@ nsRuleNode::ComputeTextData(nsStyleStruct* aStartStruct,
textData.mLineHeight.GetUnit() == eCSSUnit_Pixel) {
nscoord lh = nsStyleFont::ZoomText(mPresContext,
text->mLineHeight.GetCoordValue());
nscoord minimumFontSize = 0;
mPresContext->GetCachedIntPref(kPresContext_MinimumFontSize,
minimumFontSize);
nscoord minimumFontSize =
mPresContext->GetCachedIntPref(kPresContext_MinimumFontSize);
if (minimumFontSize > 0 && !IsChrome(mPresContext)) {
// If we applied a minimum font size, scale the line height by
// the same ratio. (If we *might* have applied a minimum font

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

@ -67,9 +67,7 @@ struct nsInheritedStyleData
#undef STYLE_STRUCT_RESET
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
};
void ClearInheritedData(PRUint32 aBits) {
@ -126,9 +124,7 @@ struct nsResetStyleData
};
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void ClearInheritedData(PRUint32 aBits) {

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

@ -859,9 +859,7 @@ void*
nsStyleContext::operator new(size_t sz, nsIPresContext* aPresContext) CPP_THROW_NEW
{
// Check the recycle list first.
void* result = nsnull;
aPresContext->AllocateFromShell(sz, &result);
return result;
return aPresContext->AllocateFromShell(sz);
}
// Overridden to prevent the global delete from being called, since the memory

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

@ -212,10 +212,9 @@ nsStyleFont::nsStyleFont(nsIPresContext* aPresContext)
void*
nsStyleFont::operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
void* result = aContext->AllocateFromShell(sz);
if (result)
memset(result, 0, sz);
memset(result, 0, sz);
return result;
}
@ -319,10 +318,9 @@ nsStyleMargin::nsStyleMargin(const nsStyleMargin& aSrc) {
void*
nsStyleMargin::operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
void* result = aContext->AllocateFromShell(sz);
if (result)
memset(result, 0, sz);
memset(result, 0, sz);
return result;
}
@ -377,10 +375,9 @@ nsStylePadding::nsStylePadding(const nsStylePadding& aSrc) {
void*
nsStylePadding::operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
void* result = aContext->AllocateFromShell(sz);
if (result)
memset(result, 0, sz);
memset(result, 0, sz);
return result;
}
@ -476,10 +473,9 @@ nsStyleBorder::nsStyleBorder(const nsStyleBorder& aSrc)
void*
nsStyleBorder::operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
void* result = aContext->AllocateFromShell(sz);
if (result)
memset(result, 0, sz);
memset(result, 0, sz);
return result;
}

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

@ -131,9 +131,7 @@ struct nsStyleColor : public nsStyleStruct {
nsChangeHint CalcDifference(const nsStyleColor& aOther) const;
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleColor();
@ -153,9 +151,7 @@ struct nsStyleBackground : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Background)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleBackground();
@ -489,9 +485,7 @@ struct nsStyleOutline: public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Outline)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleOutline();
@ -574,9 +568,7 @@ struct nsStyleList : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_List)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleList();
@ -599,9 +591,7 @@ struct nsStylePosition : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Position)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStylePosition();
@ -629,9 +619,7 @@ struct nsStyleTextReset : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_TextReset)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleTextReset();
@ -654,9 +642,7 @@ struct nsStyleText : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Text)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleText();
@ -688,9 +674,7 @@ struct nsStyleVisibility : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Visibility)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleVisibility();
@ -721,9 +705,7 @@ struct nsStyleDisplay : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Display)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleDisplay();
@ -776,9 +758,7 @@ struct nsStyleTable: public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Table)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleTable();
@ -802,9 +782,7 @@ struct nsStyleTableBorder: public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_TableBorder)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleTableBorder();
@ -897,9 +875,7 @@ struct nsStyleQuotes : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Quotes)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleQuotes();
@ -969,9 +945,7 @@ struct nsStyleContent: public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Content)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleContent();
@ -1096,9 +1070,7 @@ struct nsStyleUIReset: public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_UIReset)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleUIReset();
@ -1121,9 +1093,7 @@ struct nsStyleUserInterface: public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_UserInterface)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleUserInterface();
@ -1147,9 +1117,7 @@ struct nsStyleXUL : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_XUL)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleXUL();
@ -1187,9 +1155,7 @@ struct nsStyleSVG : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_SVG)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleSVG();
@ -1223,9 +1189,7 @@ struct nsStyleSVGReset : public nsStyleStruct {
NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_SVGReset)
void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW {
void* result = nsnull;
aContext->AllocateFromShell(sz, &result);
return result;
return aContext->AllocateFromShell(sz);
}
void Destroy(nsIPresContext* aContext) {
this->~nsStyleSVGReset();

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

@ -342,8 +342,7 @@ void*
nsBoxLayoutState::Allocate(size_t sz, nsIPresShell* aPresShell)
{
// Check the recycle list first.
void* result = nsnull;
aPresShell->AllocateFrame(sz, &result);
void* result = aPresShell->AllocateFrame(sz);
if (result) {
memset(result, 0, sz);