mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
Bug 494117 preliminary refactor: Search-and-replace 'ReStyle' with 'Restyle' throughout layout. r=roc
This commit is contained in:
parent
724ecf37b9
commit
8a8adc758b
@ -7645,7 +7645,7 @@ nsCSSFrameConstructor::DoContentStateChanged(nsIContent* aContent,
|
||||
}
|
||||
}
|
||||
|
||||
nsReStyleHint rshint =
|
||||
nsRestyleHint rshint =
|
||||
styleSet->HasStateDependentStyle(presContext, aContent, aStateMask);
|
||||
|
||||
if ((aStateMask & NS_EVENT_STATE_HOVER) && rshint != 0) {
|
||||
@ -7662,7 +7662,7 @@ nsCSSFrameConstructor::AttributeWillChange(nsIContent* aContent,
|
||||
nsIAtom* aAttribute,
|
||||
PRInt32 aModType)
|
||||
{
|
||||
nsReStyleHint rshint =
|
||||
nsRestyleHint rshint =
|
||||
mPresShell->FrameManager()->HasAttributeDependentStyle(aContent,
|
||||
aAttribute,
|
||||
aModType,
|
||||
@ -7749,7 +7749,7 @@ nsCSSFrameConstructor::AttributeChanged(nsIContent* aContent,
|
||||
// See if we can optimize away the style re-resolution -- must be called after
|
||||
// the frame's AttributeChanged() in case it does something that affects the style
|
||||
nsFrameManager *frameManager = shell->FrameManager();
|
||||
nsReStyleHint rshint = frameManager->HasAttributeDependentStyle(aContent,
|
||||
nsRestyleHint rshint = frameManager->HasAttributeDependentStyle(aContent,
|
||||
aAttribute,
|
||||
aModType,
|
||||
PR_TRUE);
|
||||
@ -8601,7 +8601,7 @@ nsCSSFrameConstructor::RecreateFramesForContent(nsIContent* aContent,
|
||||
// ContentRemoved triggered reconstruction, then we don't need to do this
|
||||
// because the frames will already have been built.
|
||||
if (aAsyncInsert) {
|
||||
PostRestyleEvent(aContent, nsReStyleHint(0), nsChangeHint_ReconstructFrame);
|
||||
PostRestyleEvent(aContent, nsRestyleHint(0), nsChangeHint_ReconstructFrame);
|
||||
} else {
|
||||
rv = ContentInserted(container, aContent,
|
||||
indexInContainer, mTempFrameTreeState);
|
||||
@ -10797,7 +10797,7 @@ nsCSSFrameConstructor::RestyleForAppend(nsIContent* aContainer,
|
||||
return;
|
||||
|
||||
if (selectorFlags & NODE_HAS_SLOW_SELECTOR) {
|
||||
PostRestyleEvent(aContainer, eReStyle_Self, NS_STYLE_HINT_NONE);
|
||||
PostRestyleEvent(aContainer, eRestyle_Self, NS_STYLE_HINT_NONE);
|
||||
// Restyling the container is the most we can do here, so we're done.
|
||||
return;
|
||||
}
|
||||
@ -10817,7 +10817,7 @@ nsCSSFrameConstructor::RestyleForAppend(nsIContent* aContainer,
|
||||
}
|
||||
}
|
||||
if (wasEmpty) {
|
||||
PostRestyleEvent(aContainer, eReStyle_Self, NS_STYLE_HINT_NONE);
|
||||
PostRestyleEvent(aContainer, eRestyle_Self, NS_STYLE_HINT_NONE);
|
||||
// Restyling the container is the most we can do here, so we're done.
|
||||
return;
|
||||
}
|
||||
@ -10827,7 +10827,7 @@ nsCSSFrameConstructor::RestyleForAppend(nsIContent* aContainer,
|
||||
for (PRInt32 index = aNewIndexInContainer - 1; index >= 0; --index) {
|
||||
nsIContent *content = aContainer->GetChildAt(index);
|
||||
if (content->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
PostRestyleEvent(content, eReStyle_Self, NS_STYLE_HINT_NONE);
|
||||
PostRestyleEvent(content, eRestyle_Self, NS_STYLE_HINT_NONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -10853,7 +10853,7 @@ nsCSSFrameConstructor::RestyleForInsertOrChange(nsIContent* aContainer,
|
||||
|
||||
if (selectorFlags & (NODE_HAS_SLOW_SELECTOR |
|
||||
NODE_HAS_SLOW_SELECTOR_NOAPPEND)) {
|
||||
PostRestyleEvent(aContainer, eReStyle_Self, NS_STYLE_HINT_NONE);
|
||||
PostRestyleEvent(aContainer, eRestyle_Self, NS_STYLE_HINT_NONE);
|
||||
// Restyling the container is the most we can do here, so we're done.
|
||||
return;
|
||||
}
|
||||
@ -10877,7 +10877,7 @@ nsCSSFrameConstructor::RestyleForInsertOrChange(nsIContent* aContainer,
|
||||
}
|
||||
}
|
||||
if (wasEmpty) {
|
||||
PostRestyleEvent(aContainer, eReStyle_Self, NS_STYLE_HINT_NONE);
|
||||
PostRestyleEvent(aContainer, eRestyle_Self, NS_STYLE_HINT_NONE);
|
||||
// Restyling the container is the most we can do here, so we're done.
|
||||
return;
|
||||
}
|
||||
@ -10896,7 +10896,7 @@ nsCSSFrameConstructor::RestyleForInsertOrChange(nsIContent* aContainer,
|
||||
}
|
||||
if (content->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
if (passedChild) {
|
||||
PostRestyleEvent(content, eReStyle_Self, NS_STYLE_HINT_NONE);
|
||||
PostRestyleEvent(content, eRestyle_Self, NS_STYLE_HINT_NONE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -10912,7 +10912,7 @@ nsCSSFrameConstructor::RestyleForInsertOrChange(nsIContent* aContainer,
|
||||
}
|
||||
if (content->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
if (passedChild) {
|
||||
PostRestyleEvent(content, eReStyle_Self, NS_STYLE_HINT_NONE);
|
||||
PostRestyleEvent(content, eRestyle_Self, NS_STYLE_HINT_NONE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -10934,7 +10934,7 @@ nsCSSFrameConstructor::RestyleForRemove(nsIContent* aContainer,
|
||||
|
||||
if (selectorFlags & (NODE_HAS_SLOW_SELECTOR |
|
||||
NODE_HAS_SLOW_SELECTOR_NOAPPEND)) {
|
||||
PostRestyleEvent(aContainer, eReStyle_Self, NS_STYLE_HINT_NONE);
|
||||
PostRestyleEvent(aContainer, eRestyle_Self, NS_STYLE_HINT_NONE);
|
||||
// Restyling the container is the most we can do here, so we're done.
|
||||
return;
|
||||
}
|
||||
@ -10956,7 +10956,7 @@ nsCSSFrameConstructor::RestyleForRemove(nsIContent* aContainer,
|
||||
}
|
||||
}
|
||||
if (isEmpty) {
|
||||
PostRestyleEvent(aContainer, eReStyle_Self, NS_STYLE_HINT_NONE);
|
||||
PostRestyleEvent(aContainer, eRestyle_Self, NS_STYLE_HINT_NONE);
|
||||
// Restyling the container is the most we can do here, so we're done.
|
||||
return;
|
||||
}
|
||||
@ -10970,7 +10970,7 @@ nsCSSFrameConstructor::RestyleForRemove(nsIContent* aContainer,
|
||||
break; // went through all children
|
||||
if (content->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
if (index >= aIndexInContainer) {
|
||||
PostRestyleEvent(content, eReStyle_Self, NS_STYLE_HINT_NONE);
|
||||
PostRestyleEvent(content, eRestyle_Self, NS_STYLE_HINT_NONE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -10981,7 +10981,7 @@ nsCSSFrameConstructor::RestyleForRemove(nsIContent* aContainer,
|
||||
nsIContent *content = aContainer->GetChildAt(index);
|
||||
if (content->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
if (index < aIndexInContainer) {
|
||||
PostRestyleEvent(content, eReStyle_Self, NS_STYLE_HINT_NONE);
|
||||
PostRestyleEvent(content, eRestyle_Self, NS_STYLE_HINT_NONE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -11012,7 +11012,7 @@ CollectRestyles(nsISupports* aContent,
|
||||
|
||||
void
|
||||
nsCSSFrameConstructor::ProcessOneRestyle(nsIContent* aContent,
|
||||
nsReStyleHint aRestyleHint,
|
||||
nsRestyleHint aRestyleHint,
|
||||
nsChangeHint aChangeHint)
|
||||
{
|
||||
NS_PRECONDITION(aContent, "Must have content node");
|
||||
@ -11025,7 +11025,7 @@ nsCSSFrameConstructor::ProcessOneRestyle(nsIContent* aContent,
|
||||
}
|
||||
|
||||
nsIFrame* primaryFrame = aContent->GetPrimaryFrame();
|
||||
if (aRestyleHint & eReStyle_Self) {
|
||||
if (aRestyleHint & eRestyle_Self) {
|
||||
RestyleElement(aContent, primaryFrame, aChangeHint);
|
||||
} else if (aChangeHint &&
|
||||
(primaryFrame ||
|
||||
@ -11036,7 +11036,7 @@ nsCSSFrameConstructor::ProcessOneRestyle(nsIContent* aContent,
|
||||
ProcessRestyledFrames(changeList);
|
||||
}
|
||||
|
||||
if (aRestyleHint & eReStyle_LaterSiblings) {
|
||||
if (aRestyleHint & eRestyle_LaterSiblings) {
|
||||
RestyleLaterSiblings(aContent);
|
||||
}
|
||||
}
|
||||
@ -11198,7 +11198,7 @@ nsCSSFrameConstructor::ProcessPendingRestyles()
|
||||
|
||||
void
|
||||
nsCSSFrameConstructor::PostRestyleEventCommon(nsIContent* aContent,
|
||||
nsReStyleHint aRestyleHint,
|
||||
nsRestyleHint aRestyleHint,
|
||||
nsChangeHint aMinChangeHint,
|
||||
PRBool aForAnimation)
|
||||
{
|
||||
@ -11215,7 +11215,7 @@ nsCSSFrameConstructor::PostRestyleEventCommon(nsIContent* aContent,
|
||||
"Shouldn't be trying to restyle non-elements directly");
|
||||
|
||||
RestyleData existingData;
|
||||
existingData.mRestyleHint = nsReStyleHint(0);
|
||||
existingData.mRestyleHint = nsRestyleHint(0);
|
||||
existingData.mChangeHint = NS_STYLE_HINT_NONE;
|
||||
|
||||
nsDataHashtable<nsISupportsHashKey, RestyleData> &restyles =
|
||||
@ -11223,7 +11223,7 @@ nsCSSFrameConstructor::PostRestyleEventCommon(nsIContent* aContent,
|
||||
|
||||
restyles.Get(aContent, &existingData);
|
||||
existingData.mRestyleHint =
|
||||
nsReStyleHint(existingData.mRestyleHint | aRestyleHint);
|
||||
nsRestyleHint(existingData.mRestyleHint | aRestyleHint);
|
||||
NS_UpdateHint(existingData.mChangeHint, aMinChangeHint);
|
||||
|
||||
restyles.Put(aContent, existingData);
|
||||
|
@ -193,7 +193,7 @@ private:
|
||||
// This function does not call ProcessAttachedQueue() on the binding manager.
|
||||
// If the caller wants that to happen synchronously, it needs to handle that
|
||||
// itself.
|
||||
void ProcessOneRestyle(nsIContent* aContent, nsReStyleHint aRestyleHint,
|
||||
void ProcessOneRestyle(nsIContent* aContent, nsRestyleHint aRestyleHint,
|
||||
nsChangeHint aChangeHint);
|
||||
|
||||
void ProcessPendingRestyleTable(
|
||||
@ -229,7 +229,7 @@ public:
|
||||
void RebuildAllStyleData(nsChangeHint aExtraHint);
|
||||
|
||||
// See PostRestyleEventCommon below.
|
||||
void PostRestyleEvent(nsIContent* aContent, nsReStyleHint aRestyleHint,
|
||||
void PostRestyleEvent(nsIContent* aContent, nsRestyleHint aRestyleHint,
|
||||
nsChangeHint aMinChangeHint)
|
||||
{
|
||||
nsPresContext *presContext = mPresShell->GetPresContext();
|
||||
@ -241,7 +241,7 @@ public:
|
||||
|
||||
// See PostRestyleEventCommon below.
|
||||
void PostAnimationRestyleEvent(nsIContent* aContent,
|
||||
nsReStyleHint aRestyleHint,
|
||||
nsRestyleHint aRestyleHint,
|
||||
nsChangeHint aMinChangeHint)
|
||||
{
|
||||
PostRestyleEventCommon(aContent, aRestyleHint, aMinChangeHint, PR_TRUE);
|
||||
@ -265,7 +265,7 @@ private:
|
||||
* IsProcessingAnimationStyleChange() value
|
||||
* (which is the default value).
|
||||
*/
|
||||
void PostRestyleEventCommon(nsIContent* aContent, nsReStyleHint aRestyleHint,
|
||||
void PostRestyleEventCommon(nsIContent* aContent, nsRestyleHint aRestyleHint,
|
||||
nsChangeHint aMinChangeHint,
|
||||
PRBool aForAnimation);
|
||||
void PostRestyleEventInternal();
|
||||
@ -1698,7 +1698,7 @@ private:
|
||||
public:
|
||||
|
||||
struct RestyleData {
|
||||
nsReStyleHint mRestyleHint; // What we want to restyle
|
||||
nsRestyleHint mRestyleHint; // What we want to restyle
|
||||
nsChangeHint mChangeHint; // The minimal change hint for "self"
|
||||
};
|
||||
|
||||
|
@ -139,13 +139,13 @@ inline PRBool NS_IsHintSubset(nsChangeHint aSubset, nsChangeHint aSuperSet) {
|
||||
nsChangeHint(NS_STYLE_HINT_REFLOW | nsChangeHint_ReconstructFrame)
|
||||
|
||||
/**
|
||||
* |nsReStyleHint| is a bitfield for the result of |HasStateDependentStyle|
|
||||
* |nsRestyleHint| is a bitfield for the result of |HasStateDependentStyle|
|
||||
* and |HasAttributeDependentStyle|. All values have an implied "and
|
||||
* descendants." When no restyling is necessary, use |nsReStyleHint(0)|.
|
||||
* descendants." When no restyling is necessary, use |nsRestyleHint(0)|.
|
||||
*/
|
||||
enum nsReStyleHint {
|
||||
eReStyle_Self = 0x1,
|
||||
eReStyle_LaterSiblings = 0x2
|
||||
enum nsRestyleHint {
|
||||
eRestyle_Self = 0x1,
|
||||
eRestyle_LaterSiblings = 0x2
|
||||
};
|
||||
|
||||
|
||||
|
@ -1505,13 +1505,13 @@ nsFrameManager::ComputeStyleChangeFor(nsIFrame *aFrame,
|
||||
}
|
||||
|
||||
|
||||
nsReStyleHint
|
||||
nsRestyleHint
|
||||
nsFrameManager::HasAttributeDependentStyle(nsIContent *aContent,
|
||||
nsIAtom *aAttribute,
|
||||
PRInt32 aModType,
|
||||
PRBool aAttrHasChanged)
|
||||
{
|
||||
nsReStyleHint hint = mStyleSet->HasAttributeDependentStyle(GetPresContext(),
|
||||
nsRestyleHint hint = mStyleSet->HasAttributeDependentStyle(GetPresContext(),
|
||||
aContent,
|
||||
aAttribute,
|
||||
aModType,
|
||||
@ -1521,7 +1521,7 @@ nsFrameManager::HasAttributeDependentStyle(nsIContent *aContent,
|
||||
// Perhaps should check that it's XUL, SVG, (or HTML) namespace, but
|
||||
// it doesn't really matter. Or we could even let
|
||||
// HTMLCSSStyleSheetImpl::HasAttributeDependentStyle handle it.
|
||||
hint = nsReStyleHint(hint | eReStyle_Self);
|
||||
hint = nsRestyleHint(hint | eRestyle_Self);
|
||||
}
|
||||
|
||||
return hint;
|
||||
|
@ -163,7 +163,7 @@ public:
|
||||
// Determine whether an attribute affects style
|
||||
// If aAttrHasChanged is false, the attribute's value is about to
|
||||
// change. If it's true, it has already changed.
|
||||
NS_HIDDEN_(nsReStyleHint) HasAttributeDependentStyle(nsIContent *aContent,
|
||||
NS_HIDDEN_(nsRestyleHint) HasAttributeDependentStyle(nsIContent *aContent,
|
||||
nsIAtom *aAttribute,
|
||||
PRInt32 aModType,
|
||||
PRBool aAttrHasChanged);
|
||||
|
@ -3496,14 +3496,14 @@ PresShell::RecreateFramesFor(nsIContent* aContent)
|
||||
void
|
||||
nsIPresShell::PostRecreateFramesFor(nsIContent* aContent)
|
||||
{
|
||||
FrameConstructor()->PostRestyleEvent(aContent, eReStyle_Self,
|
||||
FrameConstructor()->PostRestyleEvent(aContent, eRestyle_Self,
|
||||
nsChangeHint_ReconstructFrame);
|
||||
}
|
||||
|
||||
void
|
||||
nsIPresShell::RestyleForAnimation(nsIContent* aContent)
|
||||
{
|
||||
FrameConstructor()->PostAnimationRestyleEvent(aContent, eReStyle_Self,
|
||||
FrameConstructor()->PostAnimationRestyleEvent(aContent, eRestyle_Self,
|
||||
NS_STYLE_HINT_NONE);
|
||||
}
|
||||
|
||||
@ -4750,7 +4750,7 @@ PresShell::DocumentStatesChanged(nsIDocument* aDocument,
|
||||
mDocument->GetRootContent(),
|
||||
aStateMask)) {
|
||||
mFrameConstructor->PostRestyleEvent(mDocument->GetRootContent(),
|
||||
eReStyle_Self, NS_STYLE_HINT_NONE);
|
||||
eRestyle_Self, NS_STYLE_HINT_NONE);
|
||||
VERIFY_STYLE_TREE;
|
||||
}
|
||||
}
|
||||
@ -4924,7 +4924,7 @@ nsIPresShell::ReconstructStyleDataInternal()
|
||||
return;
|
||||
}
|
||||
|
||||
mFrameConstructor->PostRestyleEvent(root, eReStyle_Self, NS_STYLE_HINT_NONE);
|
||||
mFrameConstructor->PostRestyleEvent(root, eRestyle_Self, NS_STYLE_HINT_NONE);
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
InvalidateAccessibleSubtree(nsnull);
|
||||
|
@ -276,7 +276,7 @@ nsMathMLTokenFrame::ProcessTextData()
|
||||
|
||||
// explicitly request a re-resolve to pick up the change of style
|
||||
PresContext()->PresShell()->FrameConstructor()->
|
||||
PostRestyleEvent(mContent, eReStyle_Self, NS_STYLE_HINT_NONE);
|
||||
PostRestyleEvent(mContent, eRestyle_Self, NS_STYLE_HINT_NONE);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
@ -525,7 +525,7 @@ nsMathMLmtableOuterFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
||||
|
||||
// Explicitly request a re-resolve and reflow in our subtree to pick up any changes
|
||||
presContext->PresShell()->FrameConstructor()->
|
||||
PostRestyleEvent(mContent, eReStyle_Self, nsChangeHint_ReflowFrame);
|
||||
PostRestyleEvent(mContent, eRestyle_Self, nsChangeHint_ReflowFrame);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -704,7 +704,7 @@ nsMathMLmtableFrame::RestyleTable()
|
||||
|
||||
// Explicitly request a re-resolve and reflow in our subtree to pick up any changes
|
||||
PresContext()->PresShell()->FrameConstructor()->
|
||||
PostRestyleEvent(mContent, eReStyle_Self, nsChangeHint_ReflowFrame);
|
||||
PostRestyleEvent(mContent, eRestyle_Self, nsChangeHint_ReflowFrame);
|
||||
}
|
||||
|
||||
// --------
|
||||
@ -764,7 +764,7 @@ nsMathMLmtrFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
||||
|
||||
// Explicitly request a re-resolve and reflow in our subtree to pick up any changes
|
||||
presContext->PresShell()->FrameConstructor()->
|
||||
PostRestyleEvent(mContent, eReStyle_Self, nsChangeHint_ReflowFrame);
|
||||
PostRestyleEvent(mContent, eRestyle_Self, nsChangeHint_ReflowFrame);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -2271,7 +2271,7 @@ IsSiblingOperator(PRUnichar oper)
|
||||
return oper == PRUnichar('+') || oper == PRUnichar('~');
|
||||
}
|
||||
|
||||
nsReStyleHint
|
||||
nsRestyleHint
|
||||
nsCSSRuleProcessor::HasStateDependentStyle(StateRuleProcessorData* aData)
|
||||
{
|
||||
NS_PRECONDITION(aData->mContent->IsNodeOfType(nsINode::eELEMENT),
|
||||
@ -2287,15 +2287,15 @@ nsCSSRuleProcessor::HasStateDependentStyle(StateRuleProcessorData* aData)
|
||||
// "body > p:hover" will be in |cascade->mStateSelectors|). Note that
|
||||
// |IsStateSelector| below determines which selectors are in
|
||||
// |cascade->mStateSelectors|.
|
||||
nsReStyleHint hint = nsReStyleHint(0);
|
||||
nsRestyleHint hint = nsRestyleHint(0);
|
||||
if (cascade) {
|
||||
nsCSSSelector **iter = cascade->mStateSelectors.Elements(),
|
||||
**end = iter + cascade->mStateSelectors.Length();
|
||||
for(; iter != end; ++iter) {
|
||||
nsCSSSelector* selector = *iter;
|
||||
|
||||
nsReStyleHint possibleChange = IsSiblingOperator(selector->mOperator) ?
|
||||
eReStyle_LaterSiblings : eReStyle_Self;
|
||||
nsRestyleHint possibleChange = IsSiblingOperator(selector->mOperator) ?
|
||||
eRestyle_LaterSiblings : eRestyle_Self;
|
||||
|
||||
// If hint already includes all the bits of possibleChange,
|
||||
// don't bother calling SelectorMatches, since even if it returns false
|
||||
@ -2303,7 +2303,7 @@ nsCSSRuleProcessor::HasStateDependentStyle(StateRuleProcessorData* aData)
|
||||
if ((possibleChange & ~hint) &&
|
||||
SelectorMatches(*aData, selector, aData->mStateMask, PR_FALSE) &&
|
||||
SelectorMatchesTree(*aData, selector->mNext, PR_FALSE)) {
|
||||
hint = nsReStyleHint(hint | possibleChange);
|
||||
hint = nsRestyleHint(hint | possibleChange);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2320,10 +2320,10 @@ nsCSSRuleProcessor::HasDocumentStateDependentStyle(StateRuleProcessorData* aData
|
||||
|
||||
struct AttributeEnumData {
|
||||
AttributeEnumData(AttributeRuleProcessorData *aData)
|
||||
: data(aData), change(nsReStyleHint(0)) {}
|
||||
: data(aData), change(nsRestyleHint(0)) {}
|
||||
|
||||
AttributeRuleProcessorData *data;
|
||||
nsReStyleHint change;
|
||||
nsRestyleHint change;
|
||||
};
|
||||
|
||||
|
||||
@ -2332,8 +2332,8 @@ AttributeEnumFunc(nsCSSSelector* aSelector, AttributeEnumData* aData)
|
||||
{
|
||||
AttributeRuleProcessorData *data = aData->data;
|
||||
|
||||
nsReStyleHint possibleChange = IsSiblingOperator(aSelector->mOperator) ?
|
||||
eReStyle_LaterSiblings : eReStyle_Self;
|
||||
nsRestyleHint possibleChange = IsSiblingOperator(aSelector->mOperator) ?
|
||||
eRestyle_LaterSiblings : eRestyle_Self;
|
||||
|
||||
// If enumData->change already includes all the bits of possibleChange, don't
|
||||
// bother calling SelectorMatches, since even if it returns false
|
||||
@ -2341,11 +2341,11 @@ AttributeEnumFunc(nsCSSSelector* aSelector, AttributeEnumData* aData)
|
||||
if ((possibleChange & ~(aData->change)) &&
|
||||
SelectorMatches(*data, aSelector, 0, PR_FALSE) &&
|
||||
SelectorMatchesTree(*data, aSelector->mNext, PR_FALSE)) {
|
||||
aData->change = nsReStyleHint(aData->change | possibleChange);
|
||||
aData->change = nsRestyleHint(aData->change | possibleChange);
|
||||
}
|
||||
}
|
||||
|
||||
nsReStyleHint
|
||||
nsRestyleHint
|
||||
nsCSSRuleProcessor::HasAttributeDependentStyle(AttributeRuleProcessorData* aData)
|
||||
{
|
||||
NS_PRECONDITION(aData->mContent->IsNodeOfType(nsINode::eELEMENT),
|
||||
@ -2365,7 +2365,7 @@ nsCSSRuleProcessor::HasAttributeDependentStyle(AttributeRuleProcessorData* aData
|
||||
aData->mNameSpaceID == kNameSpaceID_XUL &&
|
||||
aData->mContent == aData->mContent->GetOwnerDoc()->GetRootContent())
|
||||
{
|
||||
data.change = nsReStyleHint(data.change | eReStyle_Self);
|
||||
data.change = nsRestyleHint(data.change | eRestyle_Self);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,11 +102,11 @@ public:
|
||||
NS_IMETHOD RulesMatching(XULTreeRuleProcessorData* aData);
|
||||
#endif
|
||||
|
||||
virtual nsReStyleHint HasStateDependentStyle(StateRuleProcessorData* aData);
|
||||
virtual nsRestyleHint HasStateDependentStyle(StateRuleProcessorData* aData);
|
||||
|
||||
virtual PRBool HasDocumentStateDependentStyle(StateRuleProcessorData* aData);
|
||||
|
||||
virtual nsReStyleHint
|
||||
virtual nsRestyleHint
|
||||
HasAttributeDependentStyle(AttributeRuleProcessorData* aData);
|
||||
|
||||
NS_IMETHOD MediumFeaturesChanged(nsPresContext* aPresContext,
|
||||
|
@ -142,10 +142,10 @@ nsHTMLCSSStyleSheet::Init(nsIURI* aURL, nsIDocument* aDocument)
|
||||
}
|
||||
|
||||
// Test if style is dependent on content state
|
||||
nsReStyleHint
|
||||
nsRestyleHint
|
||||
nsHTMLCSSStyleSheet::HasStateDependentStyle(StateRuleProcessorData* aData)
|
||||
{
|
||||
return nsReStyleHint(0);
|
||||
return nsRestyleHint(0);
|
||||
}
|
||||
|
||||
PRBool
|
||||
@ -155,10 +155,10 @@ nsHTMLCSSStyleSheet::HasDocumentStateDependentStyle(StateRuleProcessorData* aDat
|
||||
}
|
||||
|
||||
// Test if style is dependent on attribute
|
||||
nsReStyleHint
|
||||
nsRestyleHint
|
||||
nsHTMLCSSStyleSheet::HasAttributeDependentStyle(AttributeRuleProcessorData* aData)
|
||||
{
|
||||
return nsReStyleHint(0);
|
||||
return nsRestyleHint(0);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -79,9 +79,9 @@ public:
|
||||
#ifdef MOZ_XUL
|
||||
NS_IMETHOD RulesMatching(XULTreeRuleProcessorData* aData);
|
||||
#endif
|
||||
virtual nsReStyleHint HasStateDependentStyle(StateRuleProcessorData* aData);
|
||||
virtual nsRestyleHint HasStateDependentStyle(StateRuleProcessorData* aData);
|
||||
virtual PRBool HasDocumentStateDependentStyle(StateRuleProcessorData* aData);
|
||||
virtual nsReStyleHint
|
||||
virtual nsRestyleHint
|
||||
HasAttributeDependentStyle(AttributeRuleProcessorData* aData);
|
||||
NS_IMETHOD MediumFeaturesChanged(nsPresContext* aPresContext,
|
||||
PRBool* aResult);
|
||||
|
@ -286,7 +286,7 @@ nsHTMLStyleSheet::RulesMatching(ElementRuleProcessorData* aData)
|
||||
}
|
||||
|
||||
// Test if style is dependent on content state
|
||||
nsReStyleHint
|
||||
nsRestyleHint
|
||||
nsHTMLStyleSheet::HasStateDependentStyle(StateRuleProcessorData* aData)
|
||||
{
|
||||
if (aData->mIsHTMLContent &&
|
||||
@ -295,10 +295,10 @@ nsHTMLStyleSheet::HasStateDependentStyle(StateRuleProcessorData* aData)
|
||||
((mActiveRule && (aData->mStateMask & NS_EVENT_STATE_ACTIVE)) ||
|
||||
(mLinkRule && (aData->mStateMask & NS_EVENT_STATE_VISITED)) ||
|
||||
(mVisitedRule && (aData->mStateMask & NS_EVENT_STATE_VISITED)))) {
|
||||
return eReStyle_Self;
|
||||
return eRestyle_Self;
|
||||
}
|
||||
|
||||
return nsReStyleHint(0);
|
||||
return nsRestyleHint(0);
|
||||
}
|
||||
|
||||
PRBool
|
||||
@ -307,12 +307,12 @@ nsHTMLStyleSheet::HasDocumentStateDependentStyle(StateRuleProcessorData* aData)
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
nsReStyleHint
|
||||
nsRestyleHint
|
||||
nsHTMLStyleSheet::HasAttributeDependentStyle(AttributeRuleProcessorData* aData)
|
||||
{
|
||||
// Do nothing on before-change checks
|
||||
if (!aData->mAttrHasChanged) {
|
||||
return nsReStyleHint(0);
|
||||
return nsRestyleHint(0);
|
||||
}
|
||||
|
||||
// Note: no need to worry about whether some states changed with this
|
||||
@ -326,7 +326,7 @@ nsHTMLStyleSheet::HasAttributeDependentStyle(AttributeRuleProcessorData* aData)
|
||||
content &&
|
||||
content->IsHTML() &&
|
||||
aData->mContentTag == nsGkAtoms::a) {
|
||||
return eReStyle_Self;
|
||||
return eRestyle_Self;
|
||||
}
|
||||
|
||||
// Don't worry about the mDocumentColorRule since it only applies
|
||||
@ -334,10 +334,10 @@ nsHTMLStyleSheet::HasAttributeDependentStyle(AttributeRuleProcessorData* aData)
|
||||
|
||||
// Handle the content style rules.
|
||||
if (content && content->IsAttributeMapped(aData->mAttribute)) {
|
||||
return eReStyle_Self;
|
||||
return eRestyle_Self;
|
||||
}
|
||||
|
||||
return nsReStyleHint(0);
|
||||
return nsRestyleHint(0);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -84,9 +84,9 @@ public:
|
||||
#ifdef MOZ_XUL
|
||||
NS_IMETHOD RulesMatching(XULTreeRuleProcessorData* aData);
|
||||
#endif
|
||||
virtual nsReStyleHint HasStateDependentStyle(StateRuleProcessorData* aData);
|
||||
virtual nsRestyleHint HasStateDependentStyle(StateRuleProcessorData* aData);
|
||||
virtual PRBool HasDocumentStateDependentStyle(StateRuleProcessorData* aData);
|
||||
virtual nsReStyleHint
|
||||
virtual nsRestyleHint
|
||||
HasAttributeDependentStyle(AttributeRuleProcessorData* aData);
|
||||
NS_IMETHOD MediumFeaturesChanged(nsPresContext* aPresContext,
|
||||
PRBool* aRulesChanged);
|
||||
|
@ -118,14 +118,14 @@ public:
|
||||
HasDocumentStateDependentStyle(StateRuleProcessorData* aData) = 0;
|
||||
|
||||
/**
|
||||
* Return how (as described by nsReStyleHint) style can depend on a
|
||||
* Return how (as described by nsRestyleHint) style can depend on a
|
||||
* change of the given content state on the given content node. This
|
||||
* test is used for optimization only, and may err on the side of
|
||||
* reporting more dependencies than really exist.
|
||||
*
|
||||
* Event states are defined in nsIEventStateManager.h.
|
||||
*/
|
||||
virtual nsReStyleHint
|
||||
virtual nsRestyleHint
|
||||
HasStateDependentStyle(StateRuleProcessorData* aData) = 0;
|
||||
|
||||
/**
|
||||
@ -144,7 +144,7 @@ public:
|
||||
* only, and may err on the side of reporting more dependencies than
|
||||
* really exist.
|
||||
*/
|
||||
virtual nsReStyleHint
|
||||
virtual nsRestyleHint
|
||||
HasAttributeDependentStyle(AttributeRuleProcessorData* aData) = 0;
|
||||
|
||||
/**
|
||||
|
@ -1072,9 +1072,9 @@ struct StatefulData : public StateRuleProcessorData {
|
||||
StatefulData(nsPresContext* aPresContext,
|
||||
nsIContent* aContent, PRInt32 aStateMask)
|
||||
: StateRuleProcessorData(aPresContext, aContent, aStateMask),
|
||||
mHint(nsReStyleHint(0))
|
||||
mHint(nsRestyleHint(0))
|
||||
{}
|
||||
nsReStyleHint mHint;
|
||||
nsRestyleHint mHint;
|
||||
};
|
||||
|
||||
static PRBool SheetHasDocumentStateStyle(nsIStyleRuleProcessor* aProcessor,
|
||||
@ -1082,7 +1082,7 @@ static PRBool SheetHasDocumentStateStyle(nsIStyleRuleProcessor* aProcessor,
|
||||
{
|
||||
StatefulData* data = (StatefulData*)aData;
|
||||
if (aProcessor->HasDocumentStateDependentStyle(data)) {
|
||||
data->mHint = eReStyle_Self;
|
||||
data->mHint = eRestyle_Self;
|
||||
return PR_FALSE; // don't continue
|
||||
}
|
||||
return PR_TRUE; // continue
|
||||
@ -1106,18 +1106,18 @@ static PRBool SheetHasStatefulStyle(nsIStyleRuleProcessor* aProcessor,
|
||||
void *aData)
|
||||
{
|
||||
StatefulData* data = (StatefulData*)aData;
|
||||
nsReStyleHint hint = aProcessor->HasStateDependentStyle(data);
|
||||
data->mHint = nsReStyleHint(data->mHint | hint);
|
||||
nsRestyleHint hint = aProcessor->HasStateDependentStyle(data);
|
||||
data->mHint = nsRestyleHint(data->mHint | hint);
|
||||
return PR_TRUE; // continue
|
||||
}
|
||||
|
||||
// Test if style is dependent on content state
|
||||
nsReStyleHint
|
||||
nsRestyleHint
|
||||
nsStyleSet::HasStateDependentStyle(nsPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aStateMask)
|
||||
{
|
||||
nsReStyleHint result = nsReStyleHint(0);
|
||||
nsRestyleHint result = nsRestyleHint(0);
|
||||
|
||||
if (aContent->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
StatefulData data(aPresContext, aContent, aStateMask);
|
||||
@ -1134,29 +1134,29 @@ struct AttributeData : public AttributeRuleProcessorData {
|
||||
PRBool aAttrHasChanged)
|
||||
: AttributeRuleProcessorData(aPresContext, aContent, aAttribute, aModType,
|
||||
aAttrHasChanged),
|
||||
mHint(nsReStyleHint(0))
|
||||
mHint(nsRestyleHint(0))
|
||||
{}
|
||||
nsReStyleHint mHint;
|
||||
nsRestyleHint mHint;
|
||||
};
|
||||
|
||||
static PRBool
|
||||
SheetHasAttributeStyle(nsIStyleRuleProcessor* aProcessor, void *aData)
|
||||
{
|
||||
AttributeData* data = (AttributeData*)aData;
|
||||
nsReStyleHint hint = aProcessor->HasAttributeDependentStyle(data);
|
||||
data->mHint = nsReStyleHint(data->mHint | hint);
|
||||
nsRestyleHint hint = aProcessor->HasAttributeDependentStyle(data);
|
||||
data->mHint = nsRestyleHint(data->mHint | hint);
|
||||
return PR_TRUE; // continue
|
||||
}
|
||||
|
||||
// Test if style is dependent on content state
|
||||
nsReStyleHint
|
||||
nsRestyleHint
|
||||
nsStyleSet::HasAttributeDependentStyle(nsPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIAtom* aAttribute,
|
||||
PRInt32 aModType,
|
||||
PRBool aAttrHasChanged)
|
||||
{
|
||||
nsReStyleHint result = nsReStyleHint(0);
|
||||
nsRestyleHint result = nsRestyleHint(0);
|
||||
|
||||
if (aContent->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
AttributeData data(aPresContext, aContent, aAttribute, aModType,
|
||||
|
@ -183,12 +183,12 @@ class nsStyleSet
|
||||
PRInt32 aStateMask);
|
||||
|
||||
// Test if style is dependent on content state
|
||||
nsReStyleHint HasStateDependentStyle(nsPresContext* aPresContext,
|
||||
nsRestyleHint HasStateDependentStyle(nsPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aStateMask);
|
||||
|
||||
// Test if style is dependent on the presence of an attribute.
|
||||
nsReStyleHint HasAttributeDependentStyle(nsPresContext* aPresContext,
|
||||
nsRestyleHint HasAttributeDependentStyle(nsPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIAtom* aAttribute,
|
||||
PRInt32 aModType,
|
||||
|
@ -886,10 +886,10 @@ nsTransitionManager::RulesMatching(XULTreeRuleProcessorData* aData)
|
||||
}
|
||||
#endif
|
||||
|
||||
nsReStyleHint
|
||||
nsRestyleHint
|
||||
nsTransitionManager::HasStateDependentStyle(StateRuleProcessorData* aData)
|
||||
{
|
||||
return nsReStyleHint(0);
|
||||
return nsRestyleHint(0);
|
||||
}
|
||||
|
||||
PRBool
|
||||
@ -898,10 +898,10 @@ nsTransitionManager::HasDocumentStateDependentStyle(StateRuleProcessorData* aDat
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
nsReStyleHint
|
||||
nsRestyleHint
|
||||
nsTransitionManager::HasAttributeDependentStyle(AttributeRuleProcessorData* aData)
|
||||
{
|
||||
return nsReStyleHint(0);
|
||||
return nsRestyleHint(0);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -92,9 +92,9 @@ public:
|
||||
#ifdef MOZ_XUL
|
||||
NS_IMETHOD RulesMatching(XULTreeRuleProcessorData* aData);
|
||||
#endif
|
||||
virtual nsReStyleHint HasStateDependentStyle(StateRuleProcessorData* aData);
|
||||
virtual nsRestyleHint HasStateDependentStyle(StateRuleProcessorData* aData);
|
||||
virtual PRBool HasDocumentStateDependentStyle(StateRuleProcessorData* aData);
|
||||
virtual nsReStyleHint
|
||||
virtual nsRestyleHint
|
||||
HasAttributeDependentStyle(AttributeRuleProcessorData* aData);
|
||||
NS_IMETHOD MediumFeaturesChanged(nsPresContext* aPresContext,
|
||||
PRBool* aRulesChanged);
|
||||
|
@ -255,7 +255,7 @@ nsSVGFilterProperty::DoUpdate()
|
||||
NS_UpdateHint(changeHint, nsChangeHint_ReflowFrame);
|
||||
}
|
||||
mFramePresShell->FrameConstructor()->PostRestyleEvent(
|
||||
mFrame->GetContent(), nsReStyleHint(0), changeHint);
|
||||
mFrame->GetContent(), nsRestyleHint(0), changeHint);
|
||||
}
|
||||
|
||||
void
|
||||
@ -272,7 +272,7 @@ nsSVGMarkerProperty::DoUpdate()
|
||||
nsChangeHint(nsChangeHint_RepaintFrame | nsChangeHint_UpdateEffects);
|
||||
|
||||
mFramePresShell->FrameConstructor()->PostRestyleEvent(
|
||||
mFrame->GetContent(), nsReStyleHint(0), changeHint);
|
||||
mFrame->GetContent(), nsRestyleHint(0), changeHint);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
x
Reference in New Issue
Block a user