mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-05 16:22:53 +00:00
Bug 781360 patch 4: Remove the Get from nsStyleContext::GetStyleData and nsIFrame::GetStyleDataExternal, which never return null. r=dholbert
This commit is contained in:
parent
c5b9eee040
commit
309d5f8f42
@ -742,8 +742,7 @@ nsCaret::GetCaretFrameForNodeOffset(nsIContent* aContentNode,
|
||||
|
||||
// Mamdouh : modification of the caret to work at rtl and ltr with Bidi
|
||||
//
|
||||
// Direction Style from this->GetStyleData()
|
||||
// now in (visibility->mDirection)
|
||||
// Direction Style from visibility->mDirection
|
||||
// ------------------
|
||||
// NS_STYLE_DIRECTION_LTR : LTR or Default
|
||||
// NS_STYLE_DIRECTION_RTL
|
||||
|
@ -7375,10 +7375,10 @@ nsFrame::GetFirstLeaf(nsPresContext* aPresContext, nsIFrame **aFrame)
|
||||
}
|
||||
|
||||
/* virtual */ const void*
|
||||
nsFrame::GetStyleDataExternal(nsStyleStructID aSID) const
|
||||
nsFrame::StyleDataExternal(nsStyleStructID aSID) const
|
||||
{
|
||||
NS_ASSERTION(mStyleContext, "unexpected null pointer");
|
||||
return mStyleContext->GetStyleData(aSID);
|
||||
return mStyleContext->StyleData(aSID);
|
||||
}
|
||||
|
||||
/* virtual */ bool
|
||||
|
@ -405,7 +405,7 @@ public:
|
||||
void ConsiderChildOverflow(nsOverflowAreas& aOverflowAreas,
|
||||
nsIFrame* aChildFrame);
|
||||
|
||||
virtual const void* GetStyleDataExternal(nsStyleStructID aSID) const;
|
||||
virtual const void* StyleDataExternal(nsStyleStructID aSID) const;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -778,12 +778,12 @@ public:
|
||||
/**
|
||||
* Get the style data associated with this frame. This returns a
|
||||
* const style struct pointer that should never be modified. See
|
||||
* |nsIStyleContext::GetStyleData| for more information.
|
||||
* |nsStyleContext::StyleData| for more information.
|
||||
*
|
||||
* The use of the typesafe functions below is preferred to direct use
|
||||
* of this function.
|
||||
*/
|
||||
virtual const void* GetStyleDataExternal(nsStyleStructID aSID) const = 0;
|
||||
virtual const void* StyleDataExternal(nsStyleStructID aSID) const = 0;
|
||||
|
||||
/**
|
||||
* Define typesafe getter functions for each style struct by
|
||||
@ -803,7 +803,7 @@ public:
|
||||
#define STYLE_STRUCT(name_, checkdata_cb_, ctor_args_) \
|
||||
const nsStyle##name_ * Style##name_ () const { \
|
||||
return static_cast<const nsStyle##name_*>( \
|
||||
GetStyleDataExternal(eStyleStruct_##name_)); \
|
||||
StyleDataExternal(eStyleStruct_##name_)); \
|
||||
}
|
||||
#endif
|
||||
#include "nsStyleStructList.h"
|
||||
|
@ -2065,7 +2065,7 @@ nsRuleNode::WalkRuleTree(const nsStyleStructID aSID,
|
||||
// Set the inherit bits on our context. These bits tell the style context that
|
||||
// it never has to go back to the rule tree for data. Instead the style context tree
|
||||
// should be walked to find the data.
|
||||
const void* parentStruct = parentContext->GetStyleData(aSID);
|
||||
const void* parentStruct = parentContext->StyleData(aSID);
|
||||
aContext->AddStyleBit(bit); // makes const_cast OK.
|
||||
aContext->SetStyle(aSID, const_cast<void*>(parentStruct));
|
||||
return parentStruct;
|
||||
|
@ -2323,7 +2323,7 @@ nsStyleAnimation::ComputeValue(nsCSSProperty aProperty,
|
||||
|
||||
// Force walk of rule tree
|
||||
nsStyleStructID sid = nsCSSProps::kSIDTable[aProperty];
|
||||
tmpStyleContext->GetStyleData(sid);
|
||||
tmpStyleContext->StyleData(sid);
|
||||
|
||||
// If the rule node will have cached style data if the value is not
|
||||
// context-sensitive. So if there's nothing cached, it's not context
|
||||
@ -2603,7 +2603,7 @@ nsStyleAnimation::ExtractComputedValue(nsCSSProperty aProperty,
|
||||
aProperty < eCSSProperty_COUNT_no_shorthands,
|
||||
"bad property");
|
||||
const void* styleStruct =
|
||||
aStyleContext->GetStyleData(nsCSSProps::kSIDTable[aProperty]);
|
||||
aStyleContext->StyleData(nsCSSProps::kSIDTable[aProperty]);
|
||||
ptrdiff_t ssOffset = nsCSSProps::kStyleStructOffsetTable[aProperty];
|
||||
nsStyleAnimType animType = nsCSSProps::kAnimTypeTable[aProperty];
|
||||
NS_ABORT_IF_FALSE(0 <= ssOffset || animType == eStyleAnimType_Custom,
|
||||
|
@ -213,7 +213,7 @@ const void* nsStyleContext::GetCachedStyleData(nsStyleStructID aSID)
|
||||
return cachedData;
|
||||
}
|
||||
|
||||
const void* nsStyleContext::GetStyleData(nsStyleStructID aSID)
|
||||
const void* nsStyleContext::StyleData(nsStyleStructID aSID)
|
||||
{
|
||||
const void* cachedData = GetCachedStyleData(aSID);
|
||||
if (cachedData)
|
||||
@ -232,7 +232,7 @@ nsStyleContext::GetUniqueStyleData(const nsStyleStructID& aSID)
|
||||
// function really shouldn't be called for style contexts that could
|
||||
// have kids depending on the data. ClearStyleData would be OK, but
|
||||
// this test for no mChild or mEmptyChild doesn't catch that case.)
|
||||
const void *current = GetStyleData(aSID);
|
||||
const void *current = StyleData(aSID);
|
||||
if (!mChild && !mEmptyChild &&
|
||||
!(mBits & nsCachedStyleData::GetBitForSID(aSID)) &&
|
||||
GetCachedStyleData(aSID))
|
||||
|
@ -230,7 +230,7 @@ public:
|
||||
* function, both because they're easier to read and because they're
|
||||
* faster.
|
||||
*/
|
||||
const void* NS_FASTCALL GetStyleData(nsStyleStructID aSID);
|
||||
const void* NS_FASTCALL StyleData(nsStyleStructID aSID);
|
||||
|
||||
/**
|
||||
* Define typesafe getter functions for each style struct by
|
||||
|
Loading…
x
Reference in New Issue
Block a user