--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -34,17 +34,17 @@
#include "nsIWidget.h"
#include "nsIPresShell.h"
#include "nsFontMetrics.h"
#include "gfxFont.h"
#include "nsCSSAnonBoxes.h"
#include "nsCSSPseudoElements.h"
#include "nsThemeConstants.h"
#include "PLDHashTable.h"
-#include "nsStyleContext.h"
+#include "GeckoStyleContext.h"
#include "nsStyleSet.h"
#include "nsStyleStruct.h"
#include "nsSize.h"
#include "nsRuleData.h"
#include "nsIStyleRule.h"
#include "nsBidiUtils.h"
#include "nsStyleStructInlines.h"
#include "nsCSSProps.h"
@@ -86,17 +86,17 @@ enum UnsetAction
eUnsetInitial,
eUnsetInherit
};
} // namespace mozilla
void*
nsConditionalResetStyleData::GetConditionalStyleData(nsStyleStructID aSID,
- nsStyleContext* aStyleContext) const
+ GeckoStyleContext* aStyleContext) const
{
Entry* e = static_cast<Entry*>(mEntries[aSID]);
MOZ_ASSERT(e, "if mConditionalBits bit is set, we must have at least one "
"conditional style struct");
do {
if (e->mConditions.Matches(aStyleContext)) {
void* data = e->mStyleStruct;
@@ -140,24 +140,24 @@ CreateStyleImageRequest(nsPresContext* a
RefPtr<nsStyleImageRequest> request =
new nsStyleImageRequest(aModeFlags, proxy, imageValue, imageTracker);
return request.forget();
}
static void
SetStyleShapeSourceToCSSValue(StyleShapeSource* aShapeSource,
const nsCSSValue* aValue,
- nsStyleContext* aStyleContext,
+ GeckoStyleContext* aStyleContext,
nsPresContext* aPresContext,
RuleNodeCacheConditions& aConditions);
/* Helper function to convert a CSS <position> specified value into its
* computed-style form. */
static void
-ComputePositionValue(nsStyleContext* aStyleContext,
+ComputePositionValue(GeckoStyleContext* aStyleContext,
const nsCSSValue& aValue,
Position& aComputedValue,
RuleNodeCacheConditions& aConditions);
/*
* For storage of an |nsRuleNode|'s children in a PLDHashTable.
*/
@@ -920,17 +920,17 @@ GetFloatFromBoxPosition(int32_t aEnumVal
#define SETCOORD_LE (SETCOORD_LENGTH | SETCOORD_ENUMERATED)
#define SETCOORD_LEH (SETCOORD_LE | SETCOORD_INHERIT)
#define SETCOORD_IA (SETCOORD_INTEGER | SETCOORD_AUTO)
#define SETCOORD_LAE (SETCOORD_LENGTH | SETCOORD_AUTO | SETCOORD_ENUMERATED)
// changes aCoord iff it returns true
static bool SetCoord(const nsCSSValue& aValue, nsStyleCoord& aCoord,
const nsStyleCoord& aParentCoord,
- int32_t aMask, nsStyleContext* aStyleContext,
+ int32_t aMask, GeckoStyleContext* aStyleContext,
nsPresContext* aPresContext,
RuleNodeCacheConditions& aConditions)
{
bool result = true;
if (aValue.GetUnit() == eCSSUnit_Null) {
result = false;
}
else if ((((aMask & SETCOORD_LENGTH) != 0) &&
@@ -1049,17 +1049,17 @@ static inline bool SetAbsCoord(const nsC
MOZ_ASSERT((aMask & (SETCOORD_LH | SETCOORD_UNSET_INHERIT |
SETCOORD_UNSET_INITIAL)) == 0,
"does not handle SETCOORD_LENGTH, SETCOORD_INHERIT and "
"SETCOORD_UNSET_*");
// The values of the following variables will never be used; so it does not
// matter what to set.
const nsStyleCoord dummyParentCoord;
- nsStyleContext* dummyStyleContext = nullptr;
+ GeckoStyleContext* dummyStyleContext = nullptr;
nsPresContext* dummyPresContext = nullptr;
RuleNodeCacheConditions dummyCacheKey;
bool rv = SetCoord(aValue, aCoord, dummyParentCoord, aMask,
dummyStyleContext, dummyPresContext,
dummyCacheKey);
MOZ_ASSERT(dummyCacheKey.CacheableWithoutDependencies(),
"SetCoord() should not modify dummyCacheKey.");
@@ -1069,17 +1069,17 @@ static inline bool SetAbsCoord(const nsC
/* Given a specified value that might be a pair value, call SetCoord twice,
* either using each member of the pair, or using the unpaired value twice.
*/
static bool
SetPairCoords(const nsCSSValue& aValue,
nsStyleCoord& aCoordX, nsStyleCoord& aCoordY,
const nsStyleCoord& aParentX, const nsStyleCoord& aParentY,
- int32_t aMask, nsStyleContext* aStyleContext,
+ int32_t aMask, GeckoStyleContext* aStyleContext,
nsPresContext* aPresContext, RuleNodeCacheConditions& aConditions)
{
const nsCSSValue& valX =
aValue.GetUnit() == eCSSUnit_Pair ? aValue.GetPairValue().mXValue : aValue;
const nsCSSValue& valY =
aValue.GetUnit() == eCSSUnit_Pair ? aValue.GetPairValue().mYValue : aValue;
bool cX = SetCoord(valX, aCoordX, aParentX, aMask, aStyleContext,
@@ -1228,17 +1228,17 @@ SetComplexColor(const nsCSSValue& aValue
}
}
template<UnsetAction UnsetTo>
static Maybe<nscoord>
ComputeLineWidthValue(const nsCSSValue& aValue,
const nscoord aParentCoord,
const nscoord aInitialCoord,
- nsStyleContext* aStyleContext,
+ GeckoStyleContext* aStyleContext,
nsPresContext* aPresContext,
RuleNodeCacheConditions& aConditions)
{
nsCSSUnit unit = aValue.GetUnit();
if (unit == eCSSUnit_Initial ||
(UnsetTo == eUnsetInitial && unit == eCSSUnit_Unset)) {
return Some(aInitialCoord);
} else if (unit == eCSSUnit_Inherit ||
@@ -1264,30 +1264,30 @@ ComputeLineWidthValue(const nsCSSValue&
} else {
NS_ASSERTION(unit == eCSSUnit_Null,
"Missing case handling for line-width computing!");
return Maybe<nscoord>(Nothing());
}
}
static void SetGradientCoord(const nsCSSValue& aValue, nsPresContext* aPresContext,
- nsStyleContext* aContext, nsStyleCoord& aResult,
+ GeckoStyleContext* aContext, nsStyleCoord& aResult,
RuleNodeCacheConditions& aConditions)
{
// OK to pass bad aParentCoord since we're not passing SETCOORD_INHERIT
if (!SetCoord(aValue, aResult, nsStyleCoord(),
SETCOORD_LPO | SETCOORD_BOX_POSITION | SETCOORD_STORE_CALC,
aContext, aPresContext, aConditions)) {
NS_NOTREACHED("unexpected unit for gradient anchor point");
aResult.SetNoneValue();
}
}
static void SetGradient(const nsCSSValue& aValue, nsPresContext* aPresContext,
- nsStyleContext* aContext, nsStyleGradient& aResult,
+ GeckoStyleContext* aContext, nsStyleGradient& aResult,
RuleNodeCacheConditions& aConditions)
{
MOZ_ASSERT(aValue.GetUnit() == eCSSUnit_Gradient,
"The given data is not a gradient");
const nsCSSValueGradient* gradient = aValue.GetGradientValue();
if (gradient->mIsExplicitSize) {
@@ -1375,17 +1375,17 @@ static void SetGradient(const nsCSSValue
stop.mColor = NS_RGB(0, 0, 0);
}
aResult.mStops.AppendElement(stop);
}
}
// -moz-image-rect(<uri>, <top>, <right>, <bottom>, <left>)
-static void SetStyleImageToImageRect(nsStyleContext* aStyleContext,
+static void SetStyleImageToImageRect(GeckoStyleContext* aStyleContext,
const nsCSSValue& aValue,
nsStyleImage& aResult)
{
MOZ_ASSERT(aValue.GetUnit() == eCSSUnit_Function &&
aValue.EqualsFunction(eCSSKeyword__moz_image_rect),
"the value is not valid -moz-image-rect()");
nsCSSValue::Array* arr = aValue.GetArrayValue();
@@ -1410,17 +1410,17 @@ static void SetStyleImageToImageRect(nsS
#endif
SetAbsCoord(val, coord, SETCOORD_FACTOR | SETCOORD_PERCENT);
MOZ_ASSERT(unitOk, "Incorrect data structure created by CSS parser");
cropRect.Set(side, coord);
}
aResult.SetCropRect(MakeUnique<nsStyleSides>(cropRect));
}
-static void SetStyleImage(nsStyleContext* aStyleContext,
+static void SetStyleImage(GeckoStyleContext* aStyleContext,
const nsCSSValue& aValue,
nsStyleImage& aResult,
RuleNodeCacheConditions& aConditions)
{
if (aValue.GetUnit() == eCSSUnit_Null) {
return;
}
@@ -1981,25 +1981,25 @@ nsRuleNode::PropagateDependentBit(nsStyl
if (curr->IsUsedDirectly()) {
curr->mStyleData.SetStyleData(aSID, mPresContext, aStruct);
}
}
}
/* static */ void
-nsRuleNode::PropagateGrandancestorBit(nsStyleContext* aContext,
- nsStyleContext* aContextInheritedFrom)
+nsRuleNode::PropagateGrandancestorBit(GeckoStyleContext* aContext,
+ GeckoStyleContext* aContextInheritedFrom)
{
MOZ_ASSERT(aContext);
MOZ_ASSERT(aContextInheritedFrom &&
aContextInheritedFrom != aContext,
"aContextInheritedFrom must be an ancestor of aContext");
- for (nsStyleContext* context = aContext->GetParent();
+ for (GeckoStyleContext* context = aContext->GetParent();
context != aContextInheritedFrom;
context = context->GetParent()) {
if (!context) {
MOZ_ASSERT(false, "aContextInheritedFrom must be an ancestor of "
"aContext's parent");
break;
}
context->AddStyleBit(NS_STYLE_CHILD_USES_GRANDANCESTOR_STYLE);
@@ -2391,17 +2391,17 @@ nsRuleNode::CheckSpecifiedProperties(con
return result;
}
// If we need to restrict which properties apply to the style context,
// return the bit to check in nsCSSProp's flags table. Otherwise,
// return 0.
inline uint32_t
-GetPseudoRestriction(nsStyleContext *aContext)
+GetPseudoRestriction(GeckoStyleContext *aContext)
{
// This needs to match nsStyleSet::WalkRestrictionRule.
uint32_t pseudoRestriction = 0;
nsIAtom *pseudoType = aContext->GetPseudo();
if (pseudoType) {
if (pseudoType == nsCSSPseudoElements::firstLetter) {
pseudoRestriction = CSS_PROPERTY_APPLIES_TO_FIRST_LETTER;
} else if (pseudoType == nsCSSPseudoElements::firstLine) {
@@ -2452,17 +2452,17 @@ AutoCSSValueArray::~AutoCSSValueArray()
for (size_t i = 0; i < mCount; ++i) {
mArray[i].~nsCSSValue();
}
}
/* static */ bool
nsRuleNode::ResolveVariableReferences(const nsStyleStructID aSID,
nsRuleData* aRuleData,
- nsStyleContext* aContext)
+ GeckoStyleContext* aContext)
{
MOZ_ASSERT(aSID != eStyleStruct_Variables);
MOZ_ASSERT(aRuleData->mSIDs & nsCachedStyleData::GetBitForSID(aSID));
MOZ_ASSERT(aRuleData->mValueOffsets[aSID] == 0);
nsCSSParser parser;
bool anyTokenStreams = false;
@@ -2504,17 +2504,17 @@ nsRuleNode::ResolveVariableReferences(co
anyTokenStreams = true;
}
return anyTokenStreams;
}
const void*
nsRuleNode::WalkRuleTree(const nsStyleStructID aSID,
- nsStyleContext* aContext)
+ GeckoStyleContext* aContext)
{
// use placement new[] on the result of alloca() to allocate a
// variable-sized stack array, including execution of constructors,
// and use an RAII class to run the destructors too.
size_t nprops = nsCSSProps::PropertyCountInStruct(aSID);
void* dataStorage = alloca(nprops * sizeof(nsCSSValue));
AutoCSSValueArray dataArray(dataStorage, nprops);
@@ -2684,17 +2684,17 @@ nsRuleNode::WalkRuleTree(const nsStyleSt
// We must check |!isReset| because the Compute*Data functions for
// reset structs wouldn't handle none bits correctly.
if (highestNode != this && !isReset)
PropagateNoneBit(bit, highestNode);
// All information must necessarily be inherited from our parent style context.
// In the absence of any computed data in the rule tree and with
// no rules specified that didn't have values of 'inherit', we should check our parent.
- nsStyleContext* parentContext = aContext->GetParent();
+ GeckoStyleContext* parentContext = aContext->GetParent();
if (isReset) {
/* Reset structs don't inherit from first-line. */
/* See similar code in COMPUTE_START_RESET */
while (parentContext &&
parentContext->GetPseudo() == nsCSSPseudoElements::firstLine) {
parentContext = parentContext->GetParent();
}
if (parentContext && parentContext != aContext->GetParent()) {
@@ -2716,33 +2716,33 @@ nsRuleNode::WalkRuleTree(const nsStyleSt
}
else
// We are the root. In the case of fonts, the default values just
// come from the pres context.
return SetDefaultOnRoot(aSID, aContext);
}
typedef const void* (nsRuleNode::*ComputeFunc)(void*, const nsRuleData*,
- nsStyleContext*, nsRuleNode*,
+ GeckoStyleContext*, nsRuleNode*,
RuleDetail,
const RuleNodeCacheConditions);
static const ComputeFunc sComputeFuncs[] = {
#define STYLE_STRUCT(name, checkdata_cb) &nsRuleNode::Compute##name##Data,
#include "nsStyleStructList.h"
#undef STYLE_STRUCT
};
// We need to compute the data from the information that the rules specified.
return (this->*sComputeFuncs[aSID])(startStruct, &ruleData, aContext,
highestNode, detail,
ruleData.mConditions);
}
const void*
-nsRuleNode::SetDefaultOnRoot(const nsStyleStructID aSID, nsStyleContext* aContext)
+nsRuleNode::SetDefaultOnRoot(const nsStyleStructID aSID, GeckoStyleContext* aContext)
{
switch (aSID) {
case eStyleStruct_Font:
{
nsStyleFont* fontData = new (mPresContext) nsStyleFont(mPresContext);
nscoord minimumFontSize = mPresContext->MinFontSize(fontData->mLanguage);
if (minimumFontSize > 0 && !mPresContext->IsChrome()) {
@@ -2911,17 +2911,17 @@ nsRuleNode::SetDefaultOnRoot(const nsSty
* function.
* @param parentdata_ Variable (declared here) holding the parent style
* context's data for this struct.
*/
#define COMPUTE_START_INHERITED(type_, data_, parentdata_) \
NS_ASSERTION(aRuleDetail != eRuleFullInherited, \
"should not have bothered calling Compute*Data"); \
\
- nsStyleContext* parentContext = aContext->GetParent(); \
+ GeckoStyleContext* parentContext = aContext->GetParent(); \
\
nsStyle##type_* data_ = nullptr; \
mozilla::Maybe<nsStyle##type_> maybeFakeParentData; \
const nsStyle##type_* parentdata_ = nullptr; \
RuleNodeCacheConditions conditions = aConditions; \
\
/* If |conditions.Cacheable()| might be true by the time we're done, we */ \
/* can't call parentContext->Style##type_() since it could recur into */ \
@@ -2971,17 +2971,17 @@ nsRuleNode::SetDefaultOnRoot(const nsSty
* function.
* @param parentdata_ Variable (declared here) holding the parent style
* context's data for this struct.
*/
#define COMPUTE_START_RESET(type_, data_, parentdata_) \
NS_ASSERTION(aRuleDetail != eRuleFullInherited, \
"should not have bothered calling Compute*Data"); \
\
- nsStyleContext* parentContext = aContext->GetParent(); \
+ GeckoStyleContext* parentContext = aContext->GetParent(); \
/* Reset structs don't inherit from first-line */ \
/* See similar code in WalkRuleTree */ \
while (parentContext && \
parentContext->GetPseudo() == nsCSSPseudoElements::firstLine) { \
parentContext = parentContext->GetParent(); \
} \
\
nsStyle##type_* data_; \
@@ -3299,23 +3299,23 @@ struct SetFontSizeCalcOps : public css::
// resolve coeff_type (BasicCoordCalcOps and FloatCoeffsAlreadyNormalizedOps
// both have |typedef float coeff_type|).
typedef float coeff_type;
// The parameters beyond aValue that we need for CalcLengthWith.
const nscoord mParentSize;
const nsStyleFont* const mParentFont;
nsPresContext* const mPresContext;
- nsStyleContext* const mStyleContext;
+ GeckoStyleContext* const mStyleContext;
const bool mAtRoot;
RuleNodeCacheConditions& mConditions;
SetFontSizeCalcOps(nscoord aParentSize, const nsStyleFont* aParentFont,
nsPresContext* aPresContext,
- nsStyleContext* aStyleContext,
+ GeckoStyleContext* aStyleContext,
bool aAtRoot,
RuleNodeCacheConditions& aConditions)
: mParentSize(aParentSize),
mParentFont(aParentFont),
mPresContext(aPresContext),
mStyleContext(aStyleContext),
mAtRoot(aAtRoot),
mConditions(aConditions)
@@ -3350,17 +3350,17 @@ struct SetFontSizeCalcOps : public css::
}
return size;
}
};
/* static */ void
nsRuleNode::SetFontSize(nsPresContext* aPresContext,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
const nsRuleData* aRuleData,
const nsStyleFont* aFont,
const nsStyleFont* aParentFont,
nscoord* aSize,
const nsFont& aSystemFont,
nscoord aParentSize,
nscoord aScriptLevelAdjustedParentSize,
bool aUsedStartStruct,
@@ -3529,17 +3529,17 @@ nsRuleNode::ComputeSystemFont(nsFont* aS
std::max(aDefaultVariableFont->size -
nsPresContext::CSSPointsToAppUnits(2), 0);
}
#endif
}
}
/* static */ void
-nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext,
+nsRuleNode::SetFont(nsPresContext* aPresContext, GeckoStyleContext* aContext,
uint8_t aGenericFontID, const nsRuleData* aRuleData,
const nsStyleFont* aParentFont,
nsStyleFont* aFont, bool aUsedStartStruct,
RuleNodeCacheConditions& aConditions)
{
bool atRoot = !aContext->GetParent();
// -x-text-zoom: none, inherit, initial
@@ -4156,24 +4156,24 @@ nsRuleNode::ComputeFontVariations(const
// This should die (bug 380915).
//
// SetGenericFont:
// - backtrack to an ancestor with the same generic font name (possibly
// up to the root where default values come from the presentation context)
// - re-apply cascading rules from there without caching intermediate values
/* static */ void
nsRuleNode::SetGenericFont(nsPresContext* aPresContext,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
uint8_t aGenericFontID,
nsStyleFont* aFont)
{
// walk up the contexts until a context with the desired generic font
- AutoTArray<nsStyleContext*, 8> contextPath;
+ AutoTArray<GeckoStyleContext*, 8> contextPath;
contextPath.AppendElement(aContext);
- nsStyleContext* higherContext = aContext->GetParent();
+ GeckoStyleContext* higherContext = aContext->GetParent();
while (higherContext) {
if (higherContext->StyleFont()->mGenericID == aGenericFontID) {
// done walking up the higher contexts
break;
}
contextPath.AppendElement(higherContext);
higherContext = higherContext->GetParent();
}
@@ -4196,17 +4196,17 @@ nsRuleNode::SetGenericFont(nsPresContext
// use placement new[] on the result of alloca() to allocate a
// variable-sized stack array, including execution of constructors,
// and use an RAII class to run the destructors too.
size_t nprops = nsCSSProps::PropertyCountInStruct(eStyleStruct_Font);
void* dataStorage = alloca(nprops * sizeof(nsCSSValue));
for (int32_t i = contextPath.Length() - 1; i >= 0; --i) {
- nsStyleContext* context = contextPath[i];
+ GeckoStyleContext* context = contextPath[i];
AutoCSSValueArray dataArray(dataStorage, nprops);
nsRuleData ruleData(NS_STYLE_INHERIT_BIT(Font), dataArray.get(),
aPresContext, context);
ruleData.mValueOffsets[eStyleStruct_Font] = 0;
// Trimmed down version of ::WalkRuleTree() to re-apply the style rules
// Note that we *do* need to do this for our own data, since what is
@@ -4249,17 +4249,17 @@ nsRuleNode::SetGenericFont(nsPresContext
// styles.
PropagateGrandancestorBit(aContext, higherContext);
}
}
const void*
nsRuleNode::ComputeFontData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_INHERITED(Font, font, parentFont)
// NOTE: The |aRuleDetail| passed in is a little bit conservative due
// to the -moz-system-font property. We really don't need to consider
@@ -4357,17 +4357,17 @@ inline uint32_t ListLength(const T* aLis
len++;
aList = aList->mNext;
}
return len;
}
static already_AddRefed<nsCSSShadowArray>
GetShadowData(const nsCSSValueList* aList,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
bool aIsBoxShadow,
nsPresContext* aPresContext,
RuleNodeCacheConditions& aConditions)
{
uint32_t arrayLength = ListLength(aList);
MOZ_ASSERT(arrayLength > 0,
"Non-null text-shadow list, yet we counted 0 items.");
@@ -4498,21 +4498,21 @@ struct LengthNumberCalcObj
{
float mValue;
bool mIsNumber;
};
struct LengthNumberCalcOps : public css::FloatCoeffsAlreadyNormalizedOps
{
typedef LengthNumberCalcObj result_type;
- nsStyleContext* const mStyleContext;
+ GeckoStyleContext* const mStyleContext;
nsPresContext* const mPresContext;
RuleNodeCacheConditions& mConditions;
- LengthNumberCalcOps(nsStyleContext* aStyleContext,
+ LengthNumberCalcOps(GeckoStyleContext* aStyleContext,
nsPresContext* aPresContext,
RuleNodeCacheConditions& aConditions)
: mStyleContext(aStyleContext),
mPresContext(aPresContext),
mConditions(aConditions)
{
}
@@ -4580,17 +4580,17 @@ struct LengthNumberCalcOps : public css:
}
return result;
}
};
struct SetLineHeightCalcOps : public LengthNumberCalcOps
{
- SetLineHeightCalcOps(nsStyleContext* aStyleContext,
+ SetLineHeightCalcOps(GeckoStyleContext* aStyleContext,
nsPresContext* aPresContext,
RuleNodeCacheConditions& aConditions)
: LengthNumberCalcOps(aStyleContext, aPresContext, aConditions)
{
}
result_type ComputeLeafValue(const nsCSSValue& aValue)
{
@@ -4617,17 +4617,17 @@ struct SetLineHeightCalcOps : public Len
return result;
}
};
const void*
nsRuleNode::ComputeTextData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_INHERITED(Text, text, parentText)
auto setComplexColor = [&](const nsCSSValue* aValue,
StyleComplexColor nsStyleText::* aField) {
@@ -4743,17 +4743,17 @@ nsRuleNode::ComputeTextData(void* aStart
conditions.SetUncacheable();
uint8_t parentAlign = parentText->mTextAlign;
text->mTextAlign = (NS_STYLE_TEXT_ALIGN_START == parentAlign) ?
NS_STYLE_TEXT_ALIGN_CENTER : parentAlign;
} else if (eCSSUnit_Enumerated == textAlignValue->GetUnit() &&
NS_STYLE_TEXT_ALIGN_MATCH_PARENT ==
textAlignValue->GetIntValue()) {
conditions.SetUncacheable();
- nsStyleContext* parent = aContext->GetParent();
+ GeckoStyleContext* parent = aContext->GetParent();
if (parent) {
uint8_t parentAlign = parentText->mTextAlign;
uint8_t parentDirection = parent->StyleVisibility()->mDirection;
switch (parentAlign) {
case NS_STYLE_TEXT_ALIGN_START:
text->mTextAlign = parentDirection == NS_STYLE_DIRECTION_RTL ?
NS_STYLE_TEXT_ALIGN_RIGHT : NS_STYLE_TEXT_ALIGN_LEFT;
break;
@@ -4999,17 +4999,17 @@ nsRuleNode::ComputeTextData(void* aStart
nsCSSParser::ControlCharVisibilityDefault());
COMPUTE_END_INHERITED(Text, text)
}
const void*
nsRuleNode::ComputeTextResetData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_RESET(TextReset, text, parentText)
// text-decoration-line: enum (bit field), inherit, initial
const nsCSSValue* decorationLineValue =
@@ -5138,17 +5138,17 @@ nsRuleNode::ComputeTextResetData(void* a
}
COMPUTE_END_RESET(TextReset, text)
}
const void*
nsRuleNode::ComputeUserInterfaceData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_INHERITED(UserInterface, ui, parentUI)
// cursor: enum, url, inherit
const nsCSSValue* cursorValue = aRuleData->ValueForCursor();
@@ -5228,17 +5228,17 @@ nsRuleNode::ComputeUserInterfaceData(voi
ui->mCaretColor, conditions);
COMPUTE_END_INHERITED(UserInterface, ui)
}
const void*
nsRuleNode::ComputeUIResetData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_RESET(UIReset, ui, parentUI)
// user-select: enum, inherit, initial
SetValue(*aRuleData->ValueForUserSelect(),
@@ -5482,17 +5482,17 @@ GetWillChangeBitFieldFromPropFlags(const
}
return willChangeBitField;
}
const void*
nsRuleNode::ComputeDisplayData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_RESET(Display, display, parentDisplay)
// We may have ended up with aStartStruct's values of mDisplay and
// mFloat, but those may not be correct if our style data overrides
@@ -6579,17 +6579,17 @@ nsRuleNode::ComputeDisplayData(void* aSt
}
COMPUTE_END_RESET(Display, display)
}
const void*
nsRuleNode::ComputeVisibilityData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_INHERITED(Visibility, visibility, parentVisibility)
// IMPORTANT: No properties in this struct have lengths in them. We
// depend on this since CalcLengthWith can call StyleVisibility()
@@ -6677,17 +6677,17 @@ nsRuleNode::ComputeVisibilityData(void*
NS_STYLE_COLOR_ADJUST_ECONOMY);
COMPUTE_END_INHERITED(Visibility, visibility)
}
const void*
nsRuleNode::ComputeColorData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_INHERITED(Color, color, parentColor)
// color: color, string, inherit
// Special case for currentColor. According to CSS3, setting color to 'currentColor'
@@ -6713,30 +6713,30 @@ nsRuleNode::ComputeColorData(void* aStar
// information about how to compute values for background-* properties
template <class SpecifiedValueItem, class ComputedValueItem>
struct BackgroundItemComputer {
};
template <>
struct BackgroundItemComputer<nsCSSValueList, uint8_t>
{
- static void ComputeValue(nsStyleContext* aStyleContext,
+ static void ComputeValue(GeckoStyleContext* aStyleContext,
const nsCSSValueList* aSpecifiedValue,
uint8_t& aComputedValue,
RuleNodeCacheConditions& aConditions)
{
SetValue(aSpecifiedValue->mValue, aComputedValue, aConditions,
SETVAL_ENUMERATED, uint8_t(0), 0);
}
};
template <>
struct BackgroundItemComputer<nsCSSValuePairList, nsStyleImageLayers::Repeat>
{
- static void ComputeValue(nsStyleContext* aStyleContext,
+ static void ComputeValue(GeckoStyleContext* aStyleContext,
const nsCSSValuePairList* aSpecifiedValue,
nsStyleImageLayers::Repeat& aComputedValue,
RuleNodeCacheConditions& aConditions)
{
NS_ASSERTION(aSpecifiedValue->mXValue.GetUnit() == eCSSUnit_Enumerated &&
(aSpecifiedValue->mYValue.GetUnit() == eCSSUnit_Enumerated ||
aSpecifiedValue->mYValue.GetUnit() == eCSSUnit_Null),
"Invalid unit");
@@ -6787,47 +6787,47 @@ struct BackgroundItemComputer<nsCSSValue
break;
}
}
};
template <>
struct BackgroundItemComputer<nsCSSValueList, nsStyleImage>
{
- static void ComputeValue(nsStyleContext* aStyleContext,
+ static void ComputeValue(GeckoStyleContext* aStyleContext,
const nsCSSValueList* aSpecifiedValue,
nsStyleImage& aComputedValue,
RuleNodeCacheConditions& aConditions)
{
SetStyleImage(aStyleContext, aSpecifiedValue->mValue, aComputedValue,
aConditions);
}
};
template <typename T>
struct BackgroundItemComputer<nsCSSValueList, T>
{
typedef typename EnableIf<IsEnum<T>::value, T>::Type ComputedType;
- static void ComputeValue(nsStyleContext* aStyleContext,
+ static void ComputeValue(GeckoStyleContext* aStyleContext,
const nsCSSValueList* aSpecifiedValue,
ComputedType& aComputedValue,
RuleNodeCacheConditions& aConditions)
{
aComputedValue =
static_cast<T>(aSpecifiedValue->mValue.GetIntValue());
}
};
/* Helper function for ComputePositionValue.
* This function computes a single PositionCoord from two nsCSSValue objects,
* which represent an edge and an offset from that edge.
*/
static void
-ComputePositionCoord(nsStyleContext* aStyleContext,
+ComputePositionCoord(GeckoStyleContext* aStyleContext,
const nsCSSValue& aEdge,
const nsCSSValue& aOffset,
Position::Coord* aResult,
RuleNodeCacheConditions& aConditions)
{
if (eCSSUnit_Percent == aOffset.GetUnit()) {
aResult->mLength = 0;
aResult->mPercent = aOffset.GetPercentValue();
@@ -6868,17 +6868,17 @@ ComputePositionCoord(nsStyleContext* aSt
} else {
NS_ASSERTION(eCSSUnit_Null == aEdge.GetUnit(), "unexpected unit");
}
}
/* Helper function to convert a CSS <position> specified value into its
* computed-style form. */
static void
-ComputePositionValue(nsStyleContext* aStyleContext,
+ComputePositionValue(GeckoStyleContext* aStyleContext,
const nsCSSValue& aValue,
Position& aComputedValue,
RuleNodeCacheConditions& aConditions)
{
NS_ASSERTION(aValue.GetUnit() == eCSSUnit_Array,
"unexpected unit for CSS <position> value");
RefPtr<nsCSSValue::Array> positionArray = aValue.GetArrayValue();
@@ -6905,17 +6905,17 @@ ComputePositionValue(nsStyleContext* aSt
ComputePositionCoord(aStyleContext, yEdge, yOffset,
&aComputedValue.mYPosition,
aConditions);
}
/* Helper function to convert the -x or -y part of a CSS <position> specified
* value into its computed-style form. */
static void
-ComputePositionCoordValue(nsStyleContext* aStyleContext,
+ComputePositionCoordValue(GeckoStyleContext* aStyleContext,
const nsCSSValue& aValue,
Position::Coord& aComputedValue,
RuleNodeCacheConditions& aConditions)
{
NS_ASSERTION(aValue.GetUnit() == eCSSUnit_Array,
"unexpected unit for position coord value");
RefPtr<nsCSSValue::Array> positionArray = aValue.GetArrayValue();
@@ -6948,17 +6948,17 @@ static const BackgroundSizeAxis gBGSizeA
{ &nsCSSValuePairList::mYValue,
&nsStyleImageLayers::Size::mHeight,
&nsStyleImageLayers::Size::mHeightType }
};
template <>
struct BackgroundItemComputer<nsCSSValuePairList, nsStyleImageLayers::Size>
{
- static void ComputeValue(nsStyleContext* aStyleContext,
+ static void ComputeValue(GeckoStyleContext* aStyleContext,
const nsCSSValuePairList* aSpecifiedValue,
nsStyleImageLayers::Size& aComputedValue,
RuleNodeCacheConditions& aConditions)
{
nsStyleImageLayers::Size &size = aComputedValue;
for (const BackgroundSizeAxis *axis = gBGSizeAxes,
*axis_end = ArrayEnd(gBGSizeAxes);
axis < axis_end; ++axis) {
@@ -7031,17 +7031,17 @@ struct BackgroundItemComputer<nsCSSValue
size.mWidthType != nsStyleImageLayers::Size::eCover) ||
size.mWidthType == size.mHeightType,
"contain/cover apply to both dimensions or to neither");
}
};
template <class ComputedValueItem>
static void
-SetImageLayerList(nsStyleContext* aStyleContext,
+SetImageLayerList(GeckoStyleContext* aStyleContext,
const nsCSSValue& aValue,
nsStyleAutoArray<nsStyleImageLayers::Layer>& aLayers,
const nsStyleAutoArray<nsStyleImageLayers::Layer>& aParentLayers,
ComputedValueItem nsStyleImageLayers::Layer::* aResultLocation,
ComputedValueItem aInitialValue,
uint32_t aParentItemCount,
uint32_t& aItemCount,
uint32_t& aMaxItemCount,
@@ -7100,17 +7100,17 @@ SetImageLayerList(nsStyleContext* aStyle
}
// The same as SetImageLayerList, but for values stored in
// layer.mPosition.*aResultLocation instead of layer.*aResultLocation.
// This code is duplicated because it would be annoying to make
// SetImageLayerList generic enough to handle both cases.
static void
SetImageLayerPositionCoordList(
- nsStyleContext* aStyleContext,
+ GeckoStyleContext* aStyleContext,
const nsCSSValue& aValue,
nsStyleAutoArray<nsStyleImageLayers::Layer>& aLayers,
const nsStyleAutoArray<nsStyleImageLayers::Layer>& aParentLayers,
Position::Coord
Position::* aResultLocation,
Position::Coord aInitialValue,
uint32_t aParentItemCount,
uint32_t& aItemCount,
@@ -7166,17 +7166,17 @@ SetImageLayerPositionCoordList(
}
if (aItemCount > aMaxItemCount)
aMaxItemCount = aItemCount;
}
template <class ComputedValueItem>
static void
-SetImageLayerPairList(nsStyleContext* aStyleContext,
+SetImageLayerPairList(GeckoStyleContext* aStyleContext,
const nsCSSValue& aValue,
nsStyleAutoArray<nsStyleImageLayers::Layer>& aLayers,
const nsStyleAutoArray<nsStyleImageLayers::Layer>& aParentLayers,
ComputedValueItem nsStyleImageLayers::Layer::*
aResultLocation,
ComputedValueItem aInitialValue,
uint32_t aParentItemCount,
uint32_t& aItemCount,
@@ -7314,17 +7314,17 @@ nsRuleNode::FillAllBackgroundLists(nsSty
FillImageLayerList(aImage.mLayers,
&nsStyleImageLayers::Layer::mComposite,
aImage.mCompositeCount, fillCount);
}
const void*
nsRuleNode::ComputeBackgroundData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_RESET(Background, bg, parentBG)
// background-color: color, inherit
SetComplexColor<eUnsetInitial>(*aRuleData->ValueForBackgroundColor(),
@@ -7435,17 +7435,17 @@ nsRuleNode::ComputeBackgroundData(void*
}
COMPUTE_END_RESET(Background, bg)
}
const void*
nsRuleNode::ComputeMarginData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_RESET(Margin, margin, parentMargin)
// margin: length, percent, calc, inherit
const nsCSSPropertyID* subprops =
@@ -7540,17 +7540,17 @@ SetBorderImageSlice(const nsCSSValue& aV
default:
NS_ASSERTION(false, "Unexpected border image value for pair.");
}
}
const void*
nsRuleNode::ComputeBorderData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_RESET(Border, border, parentBorder)
// box-decoration-break: enum, inherit, initial
SetValue(*aRuleData->ValueForBoxDecorationBreak(),
@@ -7799,17 +7799,17 @@ nsRuleNode::ComputeBorderData(void* aSta
NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH);
COMPUTE_END_RESET(Border, border)
}
const void*
nsRuleNode::ComputePaddingData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_RESET(Padding, padding, parentPadding)
// padding: length, percent, calc, inherit
const nsCSSPropertyID* subprops =
@@ -7827,17 +7827,17 @@ nsRuleNode::ComputePaddingData(void* aSt
}
COMPUTE_END_RESET(Padding, padding)
}
const void*
nsRuleNode::ComputeOutlineData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_RESET(Outline, outline, parentOutline)
// outline-width: length, enum, inherit
Maybe<nscoord> coord =
@@ -7911,17 +7911,17 @@ nsRuleNode::ComputeOutlineData(void* aSt
outline->RecalcData();
COMPUTE_END_RESET(Outline, outline)
}
const void*
nsRuleNode::ComputeListData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_INHERITED(List, list, parentList)
// quotes: inherit, initial, none, [string string]+
const nsCSSValue* quotesValue = aRuleData->ValueForQuotes();
@@ -8102,17 +8102,17 @@ nsRuleNode::ComputeListData(void* aStart
}
COMPUTE_END_INHERITED(List, list)
}
static void
SetGridTrackBreadth(const nsCSSValue& aValue,
nsStyleCoord& aResult,
- nsStyleContext* aStyleContext,
+ GeckoStyleContext* aStyleContext,
nsPresContext* aPresContext,
RuleNodeCacheConditions& aConditions)
{
nsCSSUnit unit = aValue.GetUnit();
if (unit == eCSSUnit_FlexFraction) {
aResult.SetFlexFractionValue(aValue.GetFloatValue());
} else if (unit == eCSSUnit_Auto) {
aResult.SetAutoValue();
@@ -8130,17 +8130,17 @@ SetGridTrackBreadth(const nsCSSValue& aV
MOZ_ASSERT(stored, "invalid <track-size> value");
}
}
static void
SetGridTrackSize(const nsCSSValue& aValue,
nsStyleCoord& aResultMin,
nsStyleCoord& aResultMax,
- nsStyleContext* aStyleContext,
+ GeckoStyleContext* aStyleContext,
nsPresContext* aPresContext,
RuleNodeCacheConditions& aConditions)
{
if (aValue.GetUnit() == eCSSUnit_Function) {
nsCSSValue::Array* func = aValue.GetArrayValue();
auto funcName = func->Item(0).GetKeywordValue();
if (funcName == eCSSKeyword_minmax) {
SetGridTrackBreadth(func->Item(1), aResultMin,
@@ -8166,17 +8166,17 @@ SetGridTrackSize(const nsCSSValue& aValu
}
static void
SetGridAutoColumnsRows(const nsCSSValue& aValue,
nsStyleCoord& aResultMin,
nsStyleCoord& aResultMax,
const nsStyleCoord& aParentValueMin,
const nsStyleCoord& aParentValueMax,
- nsStyleContext* aStyleContext,
+ GeckoStyleContext* aStyleContext,
nsPresContext* aPresContext,
RuleNodeCacheConditions& aConditions)
{
switch (aValue.GetUnit()) {
case eCSSUnit_Null:
break;
@@ -8216,17 +8216,17 @@ AppendGridLineNames(const nsCSSValue& aV
} while (item);
}
}
static void
SetGridTrackList(const nsCSSValue& aValue,
nsStyleGridTemplate& aResult,
const nsStyleGridTemplate& aParentValue,
- nsStyleContext* aStyleContext,
+ GeckoStyleContext* aStyleContext,
nsPresContext* aPresContext,
RuleNodeCacheConditions& aConditions)
{
switch (aValue.GetUnit()) {
case eCSSUnit_Null:
break;
@@ -8408,17 +8408,17 @@ SetGridLine(const nsCSSValue& aValue,
MOZ_ASSERT(!aResult.IsAuto(),
"should have set something away from default value");
}
}
const void*
nsRuleNode::ComputePositionData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_RESET(Position, pos, parentPos)
// box offsets: length, percent, calc, auto, inherit
static const nsCSSPropertyID offsetProps[] = {
@@ -8751,17 +8751,17 @@ nsRuleNode::ComputePositionData(void* aS
}
COMPUTE_END_RESET(Position, pos)
}
const void*
nsRuleNode::ComputeTableData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_RESET(Table, table, parentTable)
// table-layout: enum, inherit, initial
SetValue(*aRuleData->ValueForTableLayout(),
@@ -8777,17 +8777,17 @@ nsRuleNode::ComputeTableData(void* aStar
table->mSpan = spanValue->GetIntValue();
COMPUTE_END_RESET(Table, table)
}
const void*
nsRuleNode::ComputeTableBorderData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_INHERITED(TableBorder, table, parentTable)
// border-collapse: enum, inherit, initial
SetValue(*aRuleData->ValueForBorderCollapse(), table->mBorderCollapse,
@@ -8834,17 +8834,17 @@ nsRuleNode::ComputeTableBorderData(void*
NS_STYLE_TABLE_EMPTY_CELLS_SHOW);
COMPUTE_END_INHERITED(TableBorder, table)
}
const void*
nsRuleNode::ComputeContentData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
uint32_t count;
nsAutoString buffer;
COMPUTE_START_RESET(Content, content, parentContent)
@@ -9057,17 +9057,17 @@ nsRuleNode::ComputeContentData(void* aSt
}
COMPUTE_END_RESET(Content, content)
}
const void*
nsRuleNode::ComputeXULData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_RESET(XUL, xul, parentXUL)
// box-align: enum, inherit, initial
SetValue(*aRuleData->ValueForBoxAlign(),
@@ -9116,17 +9116,17 @@ nsRuleNode::ComputeXULData(void* aStartS
StyleStackSizing::StretchToFit);
COMPUTE_END_RESET(XUL, xul)
}
const void*
nsRuleNode::ComputeColumnData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_RESET(Column, column, parent)
// column-width: length, auto, inherit
SetCoord(*aRuleData->ValueForColumnWidth(),
@@ -9212,17 +9212,17 @@ nsRuleNode::ComputeColumnData(void* aSta
parent->mColumnSpan,
NS_STYLE_COLUMN_SPAN_NONE);
COMPUTE_END_RESET(Column, column)
}
static void
SetSVGPaint(const nsCSSValue& aValue, const nsStyleSVGPaint& parentPaint,
- nsPresContext* aPresContext, nsStyleContext *aContext,
+ nsPresContext* aPresContext, GeckoStyleContext *aContext,
nsStyleSVGPaint& aResult, nsStyleSVGPaintType aInitialPaintType,
RuleNodeCacheConditions& aConditions)
{
MOZ_ASSERT(aInitialPaintType == eStyleSVGPaintType_None ||
aInitialPaintType == eStyleSVGPaintType_Color,
"SetSVGPaint only supports initial values being either 'black' "
"(represented by eStyleSVGPaintType_Color) or none (by "
"eStyleSVGPaintType_None)");
@@ -9371,17 +9371,17 @@ nsRuleNode::FillAllMaskLists(nsStyleImag
FillImageLayerList(aMask.mLayers,
&nsStyleImageLayers::Layer::mComposite,
aMask.mCompositeCount, fillCount);
}
const void*
nsRuleNode::ComputeSVGData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_INHERITED(SVG, svg, parentSVG)
// clip-rule: enum, inherit, initial
SetValue(*aRuleData->ValueForClipRule(),
@@ -9677,17 +9677,17 @@ nsRuleNode::ComputeSVGData(void* aStartS
MOZ_ASSERT(false, "unrecognized -moz-context-properties value");
}
COMPUTE_END_INHERITED(SVG, svg)
}
static already_AddRefed<StyleBasicShape>
GetStyleBasicShapeFromCSSValue(const nsCSSValue& aValue,
- nsStyleContext* aStyleContext,
+ GeckoStyleContext* aStyleContext,
nsPresContext* aPresContext,
RuleNodeCacheConditions& aConditions)
{
RefPtr<StyleBasicShape> basicShape;
nsCSSValue::Array* shapeFunction = aValue.GetArrayValue();
nsCSSKeyword functionName =
(nsCSSKeyword)shapeFunction->Item(0).GetIntValue();
@@ -9830,17 +9830,17 @@ GetStyleBasicShapeFromCSSValue(const nsC
return basicShape.forget();
}
static void
SetStyleShapeSourceToCSSValue(
StyleShapeSource* aShapeSource,
const nsCSSValue* aValue,
- nsStyleContext* aStyleContext,
+ GeckoStyleContext* aStyleContext,
nsPresContext* aPresContext,
RuleNodeCacheConditions& aConditions)
{
MOZ_ASSERT(aValue->GetUnit() == eCSSUnit_Array,
"expected a basic shape or reference box");
const nsCSSValue::Array* array = aValue->GetArrayValue();
MOZ_ASSERT(array->Count() == 1 || array->Count() == 2,
@@ -9868,17 +9868,17 @@ SetStyleShapeSourceToCSSValue(
aShapeSource->SetReferenceBox(referenceBox);
}
}
// Returns true if the nsStyleFilter was successfully set using the nsCSSValue.
static bool
SetStyleFilterToCSSValue(nsStyleFilter* aStyleFilter,
const nsCSSValue& aValue,
- nsStyleContext* aStyleContext,
+ GeckoStyleContext* aStyleContext,
nsPresContext* aPresContext,
RuleNodeCacheConditions& aConditions)
{
nsCSSUnit unit = aValue.GetUnit();
if (unit == eCSSUnit_URL) {
return aStyleFilter->SetURL(aValue.GetURLStructValue());
}
@@ -9926,17 +9926,17 @@ SetStyleFilterToCSSValue(nsStyleFilter*
aStyleFilter->SetFilterParameter(filterParameter, type);
MOZ_ASSERT(didSetCoord, "unexpected unit");
return true;
}
const void*
nsRuleNode::ComputeSVGResetData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_RESET(SVGReset, svgReset, parentSVGReset)
// stop-color:
const nsCSSValue* stopColorValue = aRuleData->ValueForStopColor();
@@ -10151,17 +10151,17 @@ nsRuleNode::ComputeSVGResetData(void* aS
#endif
COMPUTE_END_RESET(SVGReset, svgReset)
}
const void*
nsRuleNode::ComputeVariablesData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_INHERITED(Variables, variables, parentVariables)
MOZ_ASSERT(aRuleData->mVariables,
"shouldn't be in ComputeVariablesData if there were no variable "
@@ -10173,17 +10173,17 @@ nsRuleNode::ComputeVariablesData(void* a
conditions.SetUncacheable();
COMPUTE_END_INHERITED(Variables, variables)
}
const void*
nsRuleNode::ComputeEffectsData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
const RuleDetail aRuleDetail,
const RuleNodeCacheConditions aConditions)
{
COMPUTE_START_RESET(Effects, effects, parentEffects)
// filter: url, none, inherit
const nsCSSValue* filterValue = aRuleData->ValueForFilter();
@@ -10333,17 +10333,17 @@ nsRuleNode::ComputeEffectsData(void* aSt
SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL,
parentEffects->mMixBlendMode, NS_STYLE_BLEND_NORMAL);
COMPUTE_END_RESET(Effects, effects)
}
const void*
nsRuleNode::GetStyleData(nsStyleStructID aSID,
- nsStyleContext* aContext,
+ GeckoStyleContext* aContext,
bool aComputeData)
{
NS_ASSERTION(IsUsedDirectly(),
"if we ever call this on rule nodes that aren't used "
"directly, we should adjust handling of mDependentBits "
"in some way.");
MOZ_ASSERT(!aContext->GetCachedStyleData(aSID),
"style context should not have cached data for struct");
@@ -10402,16 +10402,18 @@ nsRuleNode::HasAuthorSpecifiedRules(nsSt
{
#ifdef MOZ_STYLO
if (aStyleContext->StyleSource().IsServoComputedValues()) {
NS_WARNING("stylo: nsRuleNode::HasAuthorSpecifiedRules not implemented");
return true;
}
#endif
+ RefPtr<GeckoStyleContext> styleContext = aStyleContext->AsGecko();
+
uint32_t inheritBits = 0;
if (ruleTypeMask & NS_AUTHOR_SPECIFIED_BACKGROUND)
inheritBits |= NS_STYLE_INHERIT_BIT(Background);
if (ruleTypeMask & NS_AUTHOR_SPECIFIED_BORDER)
inheritBits |= NS_STYLE_INHERIT_BIT(Border);
if (ruleTypeMask & NS_AUTHOR_SPECIFIED_PADDING)
@@ -10447,19 +10449,19 @@ nsRuleNode::HasAuthorSpecifiedRules(nsSt
if (ruleTypeMask & NS_AUTHOR_SPECIFIED_TEXT_SHADOW) {
textShadowOffset = nprops;
nprops += nsCSSProps::PropertyCountInStruct(eStyleStruct_Text);
}
void* dataStorage = alloca(nprops * sizeof(nsCSSValue));
AutoCSSValueArray dataArray(dataStorage, nprops);
- /* We're relying on the use of |aStyleContext| not mutating it! */
+ /* We're relying on the use of |styleContext| not mutating it! */
nsRuleData ruleData(inheritBits, dataArray.get(),
- aStyleContext->PresContext(), aStyleContext);
+ styleContext->PresContext(), styleContext);
if (ruleTypeMask & NS_AUTHOR_SPECIFIED_BACKGROUND) {
ruleData.mValueOffsets[eStyleStruct_Background] = backgroundOffset;
}
if (ruleTypeMask & NS_AUTHOR_SPECIFIED_BORDER) {
ruleData.mValueOffsets[eStyleStruct_Border] = borderOffset;
}
@@ -10547,28 +10549,28 @@ nsRuleNode::HasAuthorSpecifiedRules(nsSt
if (ruleTypeMask & NS_AUTHOR_SPECIFIED_TEXT_SHADOW) {
for (uint32_t i = 0, i_end = ArrayLength(textShadowValues);
i < i_end; ++i) {
properties[nValues] = textShadowValues[i];
values[nValues++] = ruleData.ValueFor(textShadowValues[i]);
}
}
- nsStyleContext* styleContext = aStyleContext;
+ GeckoStyleContext* styleContextRef = styleContext;
// We need to be careful not to count styles covered up by user-important or
// UA-important declarations. But we do want to catch explicit inherit
// styling in those and check our parent style context to see whether we have
// user styling for those properties. Note that we don't care here about
// inheritance due to lack of a specified value, since all the properties we
// care about are reset properties.
bool haveExplicitUAInherit;
do {
haveExplicitUAInherit = false;
- for (nsRuleNode* ruleNode = styleContext->RuleNode(); ruleNode;
+ for (nsRuleNode* ruleNode = styleContextRef->RuleNode(); ruleNode;
ruleNode = ruleNode->GetParent()) {
nsIStyleRule *rule = ruleNode->GetRule();
if (rule) {
ruleData.mLevel = ruleNode->GetLevel();
ruleData.mIsImportantRule = ruleNode->IsImportantRule();
rule->MapRuleInfoInto(&ruleData);
@@ -10625,27 +10627,27 @@ nsRuleNode::HasAuthorSpecifiedRules(nsSt
// detect them being styled by the author) and move up to our parent
// style context.
for (uint32_t i = 0; i < nValues; ++i)
if (values[i]->GetUnit() == eCSSUnit_Null)
values[i]->SetDummyValue();
for (uint32_t i = 0; i < nValues; ++i)
if (values[i]->GetUnit() == eCSSUnit_DummyInherit)
values[i]->Reset();
- styleContext = styleContext->GetParent();
+ styleContextRef = styleContextRef->GetParent();
}
} while (haveExplicitUAInherit && styleContext);
return false;
}
/* static */ void
nsRuleNode::ComputePropertiesOverridingAnimation(
const nsTArray<nsCSSPropertyID>& aProperties,
- nsStyleContext* aStyleContext,
+ GeckoStyleContext* aStyleContext,
nsCSSPropertyIDSet& aPropertiesOverridden)
{
/*
* Set up an nsRuleData with all the structs needed for all of the
* properties in aProperties.
*/
uint32_t structBits = 0;
size_t nprops = 0;
@@ -10735,31 +10737,31 @@ nsRuleNode::ComputeColor(const nsCSSValu
RuleNodeCacheConditions conditions;
bool ok = SetColor(aValue, NS_RGB(0, 0, 0), aPresContext, aStyleContext,
aResult, conditions);
MOZ_ASSERT(ok || !(aPresContext && aStyleContext));
return ok;
}
/* static */ bool
-nsRuleNode::ParentHasPseudoElementData(nsStyleContext* aContext)
-{
- nsStyleContext* parent = aContext->GetParent();
+nsRuleNode::ParentHasPseudoElementData(GeckoStyleContext* aContext)
+{
+ GeckoStyleContext* parent = aContext->GetParent();
return parent && parent->HasPseudoElementData();
}
/* static */ void
-nsRuleNode::StoreStyleOnContext(nsStyleContext* aContext,
+nsRuleNode::StoreStyleOnContext(GeckoStyleContext* aContext,
nsStyleStructID aSID,
void* aStruct)
{
aContext->AddStyleBit(nsCachedStyleData::GetBitForSID(aSID));
aContext->SetStyle(aSID, aStruct);
}
#ifdef DEBUG
bool
-nsRuleNode::ContextHasCachedData(nsStyleContext* aContext,
+nsRuleNode::ContextHasCachedData(GeckoStyleContext* aContext,
nsStyleStructID aSID)
{
return !!aContext->GetCachedStyleData(aSID);
}
#endif
--- a/layout/style/nsRuleNode.h
+++ b/layout/style/nsRuleNode.h
@@ -20,23 +20,26 @@
#include "mozilla/SheetType.h"
#include "nsPresContext.h"
#include "nsStyleStruct.h"
class nsCSSPropertyIDSet;
class nsCSSValue;
class nsFontMetrics;
class nsIStyleRule;
-class nsStyleContext;
class nsStyleCoord;
struct nsCSSRect;
struct nsCSSValueList;
struct nsCSSValuePairList;
struct nsRuleData;
+namespace mozilla {
+ class GeckoStyleContext;
+}
+
struct nsInheritedStyleData
{
mozilla::RangedArray<void*,
nsStyleStructID_Inherited_Start,
nsStyleStructID_Inherited_Count> mStyleStructs;
void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()->
@@ -158,17 +161,17 @@ struct nsConditionalResetStyleData
void* GetStyleData(nsStyleStructID aSID) const {
if (mConditionalBits & GetBitForSID(aSID)) {
return nullptr;
}
return mEntries[aSID];
}
void* GetStyleData(nsStyleStructID aSID,
- nsStyleContext* aStyleContext,
+ mozilla::GeckoStyleContext* aStyleContext,
bool aCanComputeData) const {
if (!(mConditionalBits & GetBitForSID(aSID))) {
return mEntries[aSID];
}
if (!aCanComputeData) {
// If aCanComputeData is false, then any previously-computed data
// would have been cached on the style context. Therefore it's
// unnecessary to check the conditional data. It's also
@@ -178,17 +181,17 @@ struct nsConditionalResetStyleData
return nullptr;
}
return GetConditionalStyleData(aSID, aStyleContext);
}
private:
// non-inline helper for GetStyleData
void* GetConditionalStyleData(nsStyleStructID aSID,
- nsStyleContext* aStyleContext) const;
+ mozilla::GeckoStyleContext* aStyleContext) const;
public:
void SetStyleData(nsStyleStructID aSID, void* aStyleStruct) {
MOZ_ASSERT(!(mConditionalBits & GetBitForSID(aSID)),
"rule node should not have unconditional and conditional style "
"data for a given struct");
mEntries[aSID] = aStyleStruct;
}
@@ -279,17 +282,17 @@ struct nsCachedStyleData
if (mInheritedData) {
return mInheritedData->mStyleStructs[aSID];
}
}
return nullptr;
}
void* NS_FASTCALL GetStyleData(const nsStyleStructID aSID,
- nsStyleContext* aStyleContext,
+ mozilla::GeckoStyleContext* aStyleContext,
bool aCanComputeData) {
if (IsReset(aSID)) {
if (mResetData) {
return mResetData->GetStyleData(aSID, aStyleContext, aCanComputeData);
}
} else {
if (mInheritedData) {
return mInheritedData->mStyleStructs[aSID];
@@ -315,17 +318,17 @@ struct nsCachedStyleData
// Typesafe and faster versions of the above
#define STYLE_STRUCT_INHERITED(name_, checkdata_cb_) \
nsStyle##name_ * NS_FASTCALL GetStyle##name_ () { \
return mInheritedData ? static_cast<nsStyle##name_*>( \
mInheritedData->mStyleStructs[eStyleStruct_##name_]) : nullptr; \
}
#define STYLE_STRUCT_RESET(name_, checkdata_cb_) \
- nsStyle##name_ * NS_FASTCALL GetStyle##name_ (nsStyleContext* aContext, \
+ nsStyle##name_ * NS_FASTCALL GetStyle##name_ (mozilla::GeckoStyleContext* aContext, \
bool aCanComputeData) { \
return mResetData ? static_cast<nsStyle##name_*>( \
mResetData->GetStyleData(eStyleStruct_##name_, aContext, \
aCanComputeData)) \
: nullptr; \
}
#include "nsStyleStructList.h"
#undef STYLE_STRUCT_RESET
@@ -350,43 +353,43 @@ struct nsCachedStyleData
*
* The rule tree is owned by the nsStyleSet and is destroyed when the
* presentation of the document goes away. Its entries are reference-
* counted, with strong references held by child nodes, style structs
* and (for the root), the style set. Rule nodes are not immediately
* destroyed when their reference-count drops to zero, but are instead
* destroyed during a GC sweep.
*
- * An nsStyleContext, which represents the computed style data for an
+ * An mozilla::GeckoStyleContext, which represents the computed style data for an
* element, points to an nsRuleNode. The path from the root of the rule
- * tree to the nsStyleContext's mRuleNode gives the list of the rules
+ * tree to the mozilla::GeckoStyleContext's mRuleNode gives the list of the rules
* matched, from least important in the cascading order to most
* important in the cascading order.
*
* The reason for using a lexicographic tree is that it allows for
* sharing of style data, which saves both memory (for storing the
* computed style data) and time (for computing them). This sharing
* depends on the computed style data being stored in structs (nsStyle*)
* that contain only properties that are inherited by default
* ("inherited structs") or structs that contain only properties that
* are not inherited by default ("reset structs"). The optimization
* depends on the normal case being that style rules specify relatively
* few properties and even that elements generally have relatively few
* properties specified. This allows sharing in the following ways:
* 1. [mainly reset structs] When a style data struct will contain the
* same computed value for any elements that match the same set of
* rules (common for reset structs), it can be stored on the
- * nsRuleNode instead of on the nsStyleContext.
+ * nsRuleNode instead of on the mozilla::GeckoStyleContext.
* 2. [only? reset structs] When (1) occurs, and an nsRuleNode doesn't
* have any rules that change the values in the struct, the
* nsRuleNode can share that struct with its parent nsRuleNode.
* 3. [mainly inherited structs] When an element doesn't match any
* rules that change the value of a property (or, in the edge case,
- * when all the values specified are 'inherit'), the nsStyleContext
- * can use the same nsStyle* struct as its parent nsStyleContext.
+ * when all the values specified are 'inherit'), the mozilla::GeckoStyleContext
+ * can use the same nsStyle* struct as its parent mozilla::GeckoStyleContext.
*
* Since the data represented by an nsIStyleRule are immutable, the data
* represented by an nsRuleNode are also immutable.
*/
enum nsFontSizeType {
eFontSize_HTML = 1,
eFontSize_CSS = 2
@@ -560,231 +563,231 @@ public:
// Implemented in nsStyleSet.h, since it needs to know about nsStyleSet.
inline void Release();
protected:
void PropagateDependentBit(nsStyleStructID aSID, nsRuleNode* aHighestNode,
void* aStruct);
void PropagateNoneBit(uint32_t aBit, nsRuleNode* aHighestNode);
- static void PropagateGrandancestorBit(nsStyleContext* aContext,
- nsStyleContext* aContextInheritedFrom);
+ static void PropagateGrandancestorBit(mozilla::GeckoStyleContext* aContext,
+ mozilla::GeckoStyleContext* aContextInheritedFrom);
const void* SetDefaultOnRoot(const nsStyleStructID aSID,
- nsStyleContext* aContext);
+ mozilla::GeckoStyleContext* aContext);
/**
* Resolves any property values in aRuleData for a given style struct that
* have eCSSUnit_TokenStream values, by resolving them against the computed
* variable values on the style context and re-parsing the property.
*
* @return Whether any properties with eCSSUnit_TokenStream values were
* encountered.
*/
static bool ResolveVariableReferences(const nsStyleStructID aSID,
nsRuleData* aRuleData,
- nsStyleContext* aContext);
+ mozilla::GeckoStyleContext* aContext);
const void*
- WalkRuleTree(const nsStyleStructID aSID, nsStyleContext* aContext);
+ WalkRuleTree(const nsStyleStructID aSID, mozilla::GeckoStyleContext* aContext);
const void*
ComputeDisplayData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeVisibilityData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeFontData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeColorData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeBackgroundData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeMarginData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeBorderData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputePaddingData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeOutlineData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeListData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputePositionData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeTableData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeTableBorderData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeContentData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeTextData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeTextResetData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeUserInterfaceData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext,
+ mozilla::GeckoStyleContext* aContext,
nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeUIResetData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeXULData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeColumnData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeSVGData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeSVGResetData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeVariablesData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
const void*
ComputeEffectsData(void* aStartStruct,
const nsRuleData* aRuleData,
- nsStyleContext* aContext, nsRuleNode* aHighestNode,
+ mozilla::GeckoStyleContext* aContext, nsRuleNode* aHighestNode,
RuleDetail aRuleDetail,
const mozilla::RuleNodeCacheConditions aConditions);
// helpers for |ComputeFontData| that need access to |mNoneBits|:
static void SetFontSize(nsPresContext* aPresContext,
- nsStyleContext* aContext,
+ mozilla::GeckoStyleContext* aContext,
const nsRuleData* aRuleData,
const nsStyleFont* aFont,
const nsStyleFont* aParentFont,
nscoord* aSize,
const nsFont& aSystemFont,
nscoord aParentSize,
nscoord aScriptLevelAdjustedParentSize,
bool aUsedStartStruct,
bool aAtRoot,
mozilla::RuleNodeCacheConditions& aConditions);
static void SetFont(nsPresContext* aPresContext,
- nsStyleContext* aContext,
+ mozilla::GeckoStyleContext* aContext,
uint8_t aGenericFontID,
const nsRuleData* aRuleData,
const nsStyleFont* aParentFont,
nsStyleFont* aFont,
bool aStartStruct,
mozilla::RuleNodeCacheConditions& aConditions);
static void SetGenericFont(nsPresContext* aPresContext,
- nsStyleContext* aContext,
+ mozilla::GeckoStyleContext* aContext,
uint8_t aGenericFontID,
nsStyleFont* aFont);
inline RuleDetail CheckSpecifiedProperties(const nsStyleStructID aSID,
const nsRuleData* aRuleData);
private:
nsRuleNode(nsPresContext* aPresContext, nsRuleNode* aParent,
@@ -885,28 +888,28 @@ public:
}
// NOTE: Does not |AddRef|. Null only for the root.
nsIStyleRule* GetRule() const { return mRule; }
// NOTE: Does not |AddRef|. Never null.
nsPresContext* PresContext() const { return mPresContext; }
const void* GetStyleData(nsStyleStructID aSID,
- nsStyleContext* aContext,
+ mozilla::GeckoStyleContext* aContext,
bool aComputeData);
void GetDiscretelyAnimatedCSSValue(nsCSSPropertyID aProperty,
nsCSSValue* aValue);
// See comments in GetStyleData for an explanation of what the
// code below does.
#define STYLE_STRUCT_INHERITED(name_, checkdata_cb_) \
template<bool aComputeData> \
const nsStyle##name_* \
- GetStyle##name_(nsStyleContext* aContext, uint64_t& aContextStyleBits) \
+ GetStyle##name_(mozilla::GeckoStyleContext* aContext, uint64_t& aContextStyleBits) \
{ \
NS_ASSERTION(IsUsedDirectly(), \
"if we ever call this on rule nodes that aren't used " \
"directly, we should adjust handling of mDependentBits " \
"in some way."); \
MOZ_ASSERT(!ContextHasCachedData(aContext, eStyleStruct_##name_), \
"style context should not have cached data for struct"); \
\
@@ -935,17 +938,17 @@ public:
\
MOZ_ASSERT(data, "should have aborted on out-of-memory"); \
return data; \
}
#define STYLE_STRUCT_RESET(name_, checkdata_cb_) \
template<bool aComputeData> \
const nsStyle##name_* \
- GetStyle##name_(nsStyleContext* aContext) \
+ GetStyle##name_(mozilla::GeckoStyleContext* aContext) \
{ \
NS_ASSERTION(IsUsedDirectly(), \
"if we ever call this on rule nodes that aren't used " \
"directly, we should adjust handling of mDependentBits " \
"in some way."); \
MOZ_ASSERT(!ContextHasCachedData(aContext, eStyleStruct_##name_), \
"style context should not have cached data for struct"); \
\
@@ -991,17 +994,17 @@ public:
/**
* Fill in to aPropertiesOverridden all of the properties in aProperties
* that, for this rule node, have a declaration that is higher than the
* animation level in the CSS Cascade.
*/
static void
ComputePropertiesOverridingAnimation(
const nsTArray<nsCSSPropertyID>& aProperties,
- nsStyleContext* aStyleContext,
+ mozilla::GeckoStyleContext* aStyleContext,
nsCSSPropertyIDSet& aPropertiesOverridden);
// Expose this so media queries can use it
static nscoord CalcLengthWithInitialFont(nsPresContext* aPresContext,
const nsCSSValue& aValue);
// Expose this so nsTransformFunctions can use it.
static nscoord CalcLength(const nsCSSValue& aValue,
nsStyleContext* aStyleContext,
@@ -1086,17 +1089,17 @@ public:
* @return false if we fail to extract a color; this will not happen if both
* aPresContext and aStyleContext are non-null
*/
static bool ComputeColor(const nsCSSValue& aValue,
nsPresContext* aPresContext,
nsStyleContext* aStyleContext,
nscolor& aResult);
- static bool ParentHasPseudoElementData(nsStyleContext* aContext);
+ static bool ParentHasPseudoElementData(mozilla::GeckoStyleContext* aContext);
static void ComputeTimingFunction(const nsCSSValue& aValue,
nsTimingFunction& aResult);
// Fill unspecified layers by cycling through their values
// till they all are of length aMaxItemCount
static void FillAllBackgroundLists(nsStyleImageLayers& aLayers,
uint32_t aMaxItemCount);
@@ -1108,22 +1111,22 @@ public:
mozilla::LookAndFeel::FontID aFontID,
const nsPresContext* aPresContext,
const nsFont* aDefaultVariableFont);
private:
#ifdef DEBUG
// non-inline helper function to allow assertions without incomplete
// type errors
- bool ContextHasCachedData(nsStyleContext* aContext, nsStyleStructID aSID);
+ bool ContextHasCachedData(mozilla::GeckoStyleContext* aContext, nsStyleStructID aSID);
#endif
// Store style struct on the style context and tell the style context
// that it doesn't own the data
- static void StoreStyleOnContext(nsStyleContext* aContext,
+ static void StoreStyleOnContext(mozilla::GeckoStyleContext* aContext,
nsStyleStructID aSID,
void* aStruct);
};
/**
* We allocate arrays of CSS values with alloca. (These arrays are a
* fixed size per style struct, but we don't want to waste the
* allocation and construction/destruction costs of the big structs when