Bug 1209603 patch 5 - Move inline method nsStyleContext::GetCachedStyleData into header file, and make it public. r=heycam

Moving it to the header allows its use by another method in the header
file, in patch 6.

Making it public allows its use in assertions in nsRuleNode in patch 7.

--HG--
extra : commitid : EL4WTKW32KS
This commit is contained in:
L. David Baron 2015-10-19 20:42:28 -07:00
Родитель d8ffda64d3
Коммит e3c4c7ddd1
2 изменённых файлов: 22 добавлений и 19 удалений

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

@ -412,21 +412,6 @@ nsStyleContext::HasChildThatUsesGrandancestorStyle() const
ListContainsStyleContextThatUsesGrandancestorStyle(mChild);
}
const void* nsStyleContext::GetCachedStyleData(nsStyleStructID aSID)
{
const void* cachedData;
if (nsCachedStyleData::IsReset(aSID)) {
if (mCachedResetData) {
cachedData = mCachedResetData->mStyleStructs[aSID];
} else {
cachedData = nullptr;
}
} else {
cachedData = mCachedInheritedData.mStyleStructs[aSID];
}
return cachedData;
}
const void* nsStyleContext::StyleData(nsStyleStructID aSID)
{
const void* cachedData = GetCachedStyleData(aSID);

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

@ -453,6 +453,28 @@ public:
int32_t& LoggingDepth();
#endif
/**
* Return style data that is currently cached on the style context.
* Only returns the structs we cache ourselves; never consults the
* rule tree.
*
* For "internal" use only in nsStyleContext and nsRuleNode.
*/
const void* GetCachedStyleData(nsStyleStructID aSID)
{
const void* cachedData;
if (nsCachedStyleData::IsReset(aSID)) {
if (mCachedResetData) {
cachedData = mCachedResetData->mStyleStructs[aSID];
} else {
cachedData = nullptr;
}
} else {
cachedData = mCachedInheritedData.mStyleStructs[aSID];
}
return cachedData;
}
private:
// Private destructor, to discourage deletion outside of Release():
~nsStyleContext();
@ -469,10 +491,6 @@ private:
static bool ListContainsStyleContextThatUsesGrandancestorStyle(
const nsStyleContext* aHead);
// Helper function that GetStyleData and GetUniqueStyleData use. Only
// returns the structs we cache ourselves; never consults the ruletree.
inline const void* GetCachedStyleData(nsStyleStructID aSID);
#ifdef DEBUG
struct AutoCheckDependency {