Remove |aForceUnique| parameter from style context resolving methods, and corresponding flag from nsStyleContext, since the only caller was ReResolveStyleContext (on the assumption that other callers used it). Allow ReResolveStyleContext to benefit from FindChildWithRules and allow it to re-resolve to the same tree even when called on the root style context. b=133821 r=attinasi sr=hyatt a=asa

This commit is contained in:
dbaron%fas.harvard.edu 2002-03-31 16:59:00 +00:00
Родитель 4415a2bac8
Коммит b350a0fd0f
49 изменённых файлов: 255 добавлений и 344 удалений

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

@ -102,7 +102,6 @@ public:
virtual nsresult ClearStyleData(nsIPresContext* aPresContext, nsIStyleRule* aRule);
virtual void ForceUnique(void);
NS_IMETHOD CalcStyleDifference(nsIStyleContext* aOther, PRInt32& aHint);
#ifdef DEBUG
@ -285,8 +284,7 @@ nsStyleContext::FindChildWithRules(const nsIAtom* aPseudoTag,
if (nsnull != mEmptyChild) {
child = mEmptyChild;
do {
if ((!(child->mBits & NS_STYLE_UNIQUE_CONTEXT)) && // only look at children with un-twiddled data
(aPseudoTag == child->mPseudoTag)) {
if (aPseudoTag == child->mPseudoTag) {
aResult = child;
break;
}
@ -301,9 +299,7 @@ nsStyleContext::FindChildWithRules(const nsIAtom* aPseudoTag,
child = mChild;
do {
if ((!(child->mBits & NS_STYLE_UNIQUE_CONTEXT)) && // only look at children with un-twiddled data
(child->mRuleNode == aRuleNode) &&
(child->mPseudoTag == aPseudoTag)) {
if (child->mRuleNode == aRuleNode && child->mPseudoTag == aPseudoTag) {
aResult = child;
break;
}
@ -607,11 +603,6 @@ nsStyleContext::ClearStyleData(nsIPresContext* aPresContext, nsIStyleRule* aRule
return NS_OK;
}
void nsStyleContext::ForceUnique(void)
{
mBits |= NS_STYLE_UNIQUE_CONTEXT;
}
NS_IMETHODIMP
nsStyleContext::CalcStyleDifference(nsIStyleContext* aOther, PRInt32& aHint)
{

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

@ -125,26 +125,22 @@ public:
virtual nsIStyleContext* ResolveStyleFor(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIStyleContext* aParentContext,
PRBool aForceUnique = PR_FALSE);
nsIStyleContext* aParentContext);
virtual nsIStyleContext* ResolveStyleForNonElement(
nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
PRBool aForceUnique = PR_FALSE);
nsIStyleContext* aParentContext);
virtual nsIStyleContext* ResolvePseudoStyleFor(nsIPresContext* aPresContext,
nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique = PR_FALSE,
nsICSSPseudoComparator* aComparator = nsnull);
virtual nsIStyleContext* ProbePseudoStyleFor(nsIPresContext* aPresContext,
nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique = PR_FALSE);
nsIStyleContext* aParentContext);
NS_IMETHOD Shutdown();
@ -311,8 +307,8 @@ protected:
nsIStyleContext* GetContext(nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
nsIAtom* aPseudoTag,
PRBool aForceUnique);
nsIAtom* aPseudoTag);
#ifdef DEBUG
void List(FILE* out, PRInt32 aIndent, nsISupportsArray* aSheets);
void ListContexts(nsIStyleContext* aRootContext, FILE* out, PRInt32 aIndent);
@ -897,31 +893,24 @@ EnumRulesMatching(nsISupports* aProcessor, void* aData)
*/
nsIStyleContext* StyleSetImpl::GetContext(nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
nsIAtom* aPseudoTag,
PRBool aForceUnique)
nsIAtom* aPseudoTag)
{
nsIStyleContext* result = nsnull;
nsRuleNode* ruleNode = mRuleWalker->GetCurrentNode();
if ((PR_FALSE == aForceUnique) && (nsnull != aParentContext)) {
if (aParentContext)
aParentContext->FindChildWithRules(aPseudoTag, ruleNode, result);
}
if (nsnull == result) {
if (NS_SUCCEEDED(NS_NewStyleContext(&result, aParentContext, aPseudoTag, ruleNode, aPresContext))) {
if (PR_TRUE == aForceUnique)
result->ForceUnique();
}
#ifdef NOISY_DEBUG
if (result)
fprintf(stdout, "--- SharedSC %d ---\n", ++gSharedCount);
else
fprintf(stdout, "+++ NewSC %d +++\n", ++gNewCount);
#endif
}
#ifdef NOISY_DEBUG
else {
fprintf(stdout, "--- SharedSC %d ---\n", ++gSharedCount);
}
#endif
if (!result)
NS_NewStyleContext(&result, aParentContext, aPseudoTag, ruleNode,
aPresContext);
return result;
}
@ -1055,8 +1044,7 @@ void StyleSetImpl::EnsureRuleWalker(nsIPresContext* aPresContext)
nsIStyleContext* StyleSetImpl::ResolveStyleFor(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIStyleContext* aParentContext,
PRBool aForceUnique)
nsIStyleContext* aParentContext)
{
MOZ_TIMER_DEBUGLOG(("Start: StyleSetImpl::ResolveStyleFor(), this=%p\n", this));
STYLESET_START_TIMER(NS_TIMER_STYLE_RESOLUTION);
@ -1079,7 +1067,7 @@ nsIStyleContext* StyleSetImpl::ResolveStyleFor(nsIPresContext* aPresContext,
aPresContext->GetMedium(getter_AddRefs(medium));
RulesMatchingData data(aPresContext, medium, aContent, mRuleWalker);
FileRules(EnumRulesMatching, &data);
result = GetContext(aPresContext, aParentContext, nsnull, aForceUnique);
result = GetContext(aPresContext, aParentContext, nsnull);
// Now reset the walker back to the root of the tree.
mRuleWalker->Reset();
@ -1093,8 +1081,7 @@ nsIStyleContext* StyleSetImpl::ResolveStyleFor(nsIPresContext* aPresContext,
nsIStyleContext* StyleSetImpl::ResolveStyleForNonElement(
nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
PRBool aForceUnique)
nsIStyleContext* aParentContext)
{
MOZ_TIMER_DEBUGLOG(("Start: StyleSetImpl::ResolveStyleForNonElement(), this=%p\n", this));
STYLESET_START_TIMER(NS_TIMER_STYLE_RESOLUTION);
@ -1111,7 +1098,7 @@ nsIStyleContext* StyleSetImpl::ResolveStyleForNonElement(
mOverrideRuleProcessors) {
EnsureRuleWalker(aPresContext);
result = GetContext(aPresContext, aParentContext,
nsHTMLAtoms::mozNonElementPseudo, aForceUnique);
nsHTMLAtoms::mozNonElementPseudo);
NS_ASSERTION(mRuleWalker->AtRoot(), "rule walker must be at root");
}
}
@ -1151,7 +1138,6 @@ nsIStyleContext* StyleSetImpl::ResolvePseudoStyleFor(nsIPresContext* aPresContex
nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsICSSPseudoComparator* aComparator)
{
MOZ_TIMER_DEBUGLOG(("Start: StyleSetImpl::ResolvePseudoStyleFor(), this=%p\n", this));
@ -1178,7 +1164,7 @@ nsIStyleContext* StyleSetImpl::ResolvePseudoStyleFor(nsIPresContext* aPresContex
aPseudoTag, aComparator, mRuleWalker);
FileRules(EnumPseudoRulesMatching, &data);
result = GetContext(aPresContext, aParentContext, aPseudoTag, aForceUnique);
result = GetContext(aPresContext, aParentContext, aPseudoTag);
// Now reset the walker back to the root of the tree.
mRuleWalker->Reset();
@ -1193,8 +1179,7 @@ nsIStyleContext* StyleSetImpl::ResolvePseudoStyleFor(nsIPresContext* aPresContex
nsIStyleContext* StyleSetImpl::ProbePseudoStyleFor(nsIPresContext* aPresContext,
nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique)
nsIStyleContext* aParentContext)
{
MOZ_TIMER_DEBUGLOG(("Start: StyleSetImpl::ProbePseudoStyleFor(), this=%p\n", this));
STYLESET_START_TIMER(NS_TIMER_STYLE_RESOLUTION);
@ -1221,7 +1206,7 @@ nsIStyleContext* StyleSetImpl::ProbePseudoStyleFor(nsIPresContext* aPresContext,
FileRules(EnumPseudoRulesMatching, &data);
if (!mRuleWalker->AtRoot())
result = GetContext(aPresContext, aParentContext, aPseudoTag, aForceUnique);
result = GetContext(aPresContext, aParentContext, aPseudoTag);
// Now reset the walker back to the root of the tree.
mRuleWalker->Reset();

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

@ -3461,11 +3461,11 @@ nsComputedDOMStyle::GetStyleData(nsStyleStructID aID,
if(pctx) {
nsCOMPtr<nsIStyleContext> sctx;
if(!mPseudo) {
pctx->ResolveStyleContextFor(mContent, nsnull, PR_FALSE,
pctx->ResolveStyleContextFor(mContent, nsnull,
getter_AddRefs(sctx));
}
else {
pctx->ResolvePseudoStyleContextFor(mContent, mPseudo, nsnull, PR_FALSE,
pctx->ResolvePseudoStyleContextFor(mContent, mPseudo, nsnull,
getter_AddRefs(sctx));
}
if(sctx) {

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

@ -115,12 +115,8 @@ enum nsStyleStructID {
#define NS_STYLE_INHERIT_MASK 0x00ffffff
// A bit to test whether or not a style context can be shared
// by siblings.
#define NS_STYLE_UNIQUE_CONTEXT 0x01000000
// A bit to test whether or not we have any text decorations.
#define NS_STYLE_HAS_TEXT_DECORATIONS 0x02000000
#define NS_STYLE_HAS_TEXT_DECORATIONS 0x01000000
#define NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(the_sid) \
static const nsStyleStructID GetStyleStructID() {return the_sid;}

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

@ -1386,7 +1386,7 @@ nsCSSFrameConstructor::CreateGeneratedContentFrame(nsIPresShell* aPresShe
// Probe for the existence of the pseudo-element
nsCOMPtr<nsIStyleContext> pseudoStyleContext;
aPresContext->ProbePseudoStyleContextFor(aContent, aPseudoElement, aStyleContext,
PR_FALSE, getter_AddRefs(pseudoStyleContext));
getter_AddRefs(pseudoStyleContext));
if (pseudoStyleContext) {
const nsStyleDisplay* display;
@ -1426,9 +1426,8 @@ nsCSSFrameConstructor::CreateGeneratedContentFrame(nsIPresShell* aPresShe
// Create another pseudo style context to use for all the generated child
// frames
nsIStyleContext* textStyleContext;
aPresContext->ResolveStyleContextForNonElement(
pseudoStyleContext, PR_FALSE,
&textStyleContext);
aPresContext->ResolveStyleContextForNonElement(pseudoStyleContext,
&textStyleContext);
// Now create content objects (and child frames) for each value of the
// 'content' property
@ -1776,7 +1775,7 @@ nsCSSFrameConstructor::CreatePseudoTableFrame(nsIPresShell* aPresShel
// create the SC for the inner table which will be the parent of the outer table's SC
aPresContext->ResolvePseudoStyleContextFor(parentContent, nsHTMLAtoms::tablePseudo,
parentStyle, PR_FALSE,
parentStyle,
getter_AddRefs(childStyle));
nsPseudoFrameData& pseudoOuter = aState.mPseudoFrames.mTableOuter;
@ -1825,7 +1824,7 @@ nsCSSFrameConstructor::CreatePseudoRowGroupFrame(nsIPresShell* aPresS
parentFrame->GetContent(getter_AddRefs(parentContent));
aPresContext->ResolvePseudoStyleContextFor(parentContent, nsHTMLAtoms::tableRowGroupPseudo,
parentStyle, PR_FALSE,
parentStyle,
getter_AddRefs(childStyle));
nsPseudoFrameData& pseudo = aState.mPseudoFrames.mRowGroup;
@ -1870,7 +1869,7 @@ nsCSSFrameConstructor::CreatePseudoColGroupFrame(nsIPresShell* aPresS
parentFrame->GetContent(getter_AddRefs(parentContent));
aPresContext->ResolvePseudoStyleContextFor(parentContent, nsHTMLAtoms::tableColGroupPseudo,
parentStyle, PR_FALSE,
parentStyle,
getter_AddRefs(childStyle));
nsPseudoFrameData& pseudo = aState.mPseudoFrames.mColGroup;
@ -1913,7 +1912,7 @@ nsCSSFrameConstructor::CreatePseudoRowFrame(nsIPresShell* aPresShell,
parentFrame->GetContent(getter_AddRefs(parentContent));
aPresContext->ResolvePseudoStyleContextFor(parentContent, nsHTMLAtoms::tableRowPseudo,
parentStyle, PR_FALSE,
parentStyle,
getter_AddRefs(childStyle));
nsPseudoFrameData& pseudo = aState.mPseudoFrames.mRow;
@ -1957,7 +1956,7 @@ nsCSSFrameConstructor::CreatePseudoCellFrame(nsIPresShell* aPresShell
parentFrame->GetContent(getter_AddRefs(parentContent));
aPresContext->ResolvePseudoStyleContextFor(parentContent, nsHTMLAtoms::tableCellPseudo,
parentStyle, PR_FALSE,
parentStyle,
getter_AddRefs(childStyle));
nsPseudoFrameData& pseudoOuter = aState.mPseudoFrames.mCellOuter;
@ -2330,7 +2329,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresShell* aPresShell,
// create the pseudo SC for the outer table as a child of the inner SC
nsCOMPtr<nsIStyleContext> outerStyleContext;
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::tableOuterPseudo,
aStyleContext, PR_FALSE,
aStyleContext,
getter_AddRefs(outerStyleContext));
// Init the table outer frame and see if we need to create a view, e.g.
@ -2639,7 +2638,7 @@ nsCSSFrameConstructor::ConstructTableColFrame(nsIPresShell* aPresShel
for (PRInt32 spanX = 1; spanX < span; spanX++) {
nsCOMPtr<nsIStyleContext> styleContext;
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::tableColPseudo, aStyleContext,
PR_FALSE, getter_AddRefs(styleContext));
getter_AddRefs(styleContext));
nsIFrame* newCol;
rv = aTableCreator.CreateTableColFrame(&newCol); if (NS_FAILED(rv)) return rv;
InitAndRestoreFrame(aPresContext, aState, aContent, parentFrame, styleContext, nsnull, newCol);
@ -2716,7 +2715,7 @@ nsCSSFrameConstructor::ConstructTableCellFrame(nsIPresShell* aPresShe
// Resolve pseudo style and initialize the body cell frame
nsCOMPtr<nsIStyleContext> innerPseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::cellContentPseudo,
aStyleContext, PR_FALSE,
aStyleContext,
getter_AddRefs(innerPseudoStyle));
InitAndRestoreFrame(aPresContext, aState, aContent,
aNewCellOuterFrame, innerPseudoStyle, nsnull, aNewCellInnerFrame);
@ -3155,7 +3154,6 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresShell* aPresShell,
// --------- CREATE AREA OR BOX FRAME -------
nsCOMPtr<nsIStyleContext> styleContext;
aPresContext->ResolveStyleContextFor(aDocElement, aParentStyleContext,
PR_FALSE,
getter_AddRefs(styleContext));
const nsStyleDisplay* display = (const nsStyleDisplay*)
@ -3417,7 +3415,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> viewportPseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(nsnull, nsLayoutAtoms::viewportPseudo,
nsnull, PR_FALSE,
nsnull,
getter_AddRefs(viewportPseudoStyle));
NS_NewViewportFrame(aPresShell, &viewportFrame);
@ -3554,7 +3552,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
// see if the style is overflow: hidden, first on the document element
nsCOMPtr<nsIStyleContext> styleContext;
aPresContext->ResolveStyleContextFor(aDocElement, nsnull, PR_FALSE,
aPresContext->ResolveStyleContextFor(aDocElement, nsnull,
getter_AddRefs(styleContext));
if (styleContext) {
const nsStyleDisplay* display = (const nsStyleDisplay*)
@ -3596,7 +3594,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
}
if (bodyElement) {
nsCOMPtr<nsIStyleContext> bodyContext;
aPresContext->ResolveStyleContextFor(bodyElement, styleContext, PR_FALSE,
aPresContext->ResolveStyleContextFor(bodyElement, styleContext,
getter_AddRefs(bodyContext));
if (bodyContext) {
const nsStyleDisplay* display = (const nsStyleDisplay*)
@ -3626,7 +3624,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
// If paginated, make sure we don't put scrollbars in
if (isPaginated && !printPreviewContext)
aPresContext->ResolvePseudoStyleContextFor(nsnull, rootPseudo,
viewportPseudoStyle, PR_FALSE,
viewportPseudoStyle,
getter_AddRefs(rootPseudoStyle));
else if (isScrollable) {
@ -3638,7 +3636,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> styleContext;
aPresContext->ResolvePseudoStyleContextFor(nsnull,
nsLayoutAtoms::viewportScrollPseudo,
viewportPseudoStyle, PR_FALSE,
viewportPseudoStyle,
getter_AddRefs(styleContext));
@ -3678,7 +3676,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
// If no scrollbars and xul, don't build a scrollframe at all.
if (isXUL) {
aPresContext->ResolvePseudoStyleContextFor(nsnull, rootPseudo,
viewportPseudoStyle, PR_FALSE,
viewportPseudoStyle,
getter_AddRefs(rootPseudoStyle));
} else {
// if HTML the always create a scrollframe so anchors work. That way you can scroll to
@ -3688,7 +3686,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> scrollPseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(nsnull,
nsLayoutAtoms::scrolledContentPseudo,
viewportPseudoStyle, PR_FALSE,
viewportPseudoStyle,
getter_AddRefs(scrollPseudoStyle));
// create scrollframe
@ -3700,7 +3698,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
// resolve a new style for the root frame
aPresContext->ResolvePseudoStyleContextFor(nsnull, rootPseudo,
scrollPseudoStyle, PR_FALSE,
scrollPseudoStyle,
getter_AddRefs(rootPseudoStyle));
// Inform the view manager about the root scrollable view
@ -3754,7 +3752,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> pagePseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(nsnull, nsLayoutAtoms::pagePseudo,
rootPseudoStyle, PR_FALSE,
rootPseudoStyle,
getter_AddRefs(pagePseudoStyle));
pageFrame->Init(aPresContext, nsnull, rootFrame, pagePseudoStyle,
@ -3766,7 +3764,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> pageContentPseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(nsnull, nsLayoutAtoms::pageContentPseudo,
pagePseudoStyle, PR_FALSE,
pagePseudoStyle,
getter_AddRefs(pageContentPseudoStyle));
pageContentFrame->Init(aPresContext, nsnull, pageFrame, pageContentPseudoStyle, nsnull);
@ -3813,7 +3811,7 @@ nsCSSFrameConstructor::CreatePlaceholderFrameFor(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> placeholderStyle;
nsCOMPtr<nsIStyleContext> parentContext =
dont_AddRef(aStyleContext->GetParent());
aPresContext->ResolveStyleContextForNonElement(parentContext, PR_FALSE,
aPresContext->ResolveStyleContextForNonElement(parentContext,
getter_AddRefs(placeholderStyle));
placeholderFrame->Init(aPresContext, aContent, aParentFrame,
placeholderStyle, nsnull);
@ -3897,8 +3895,10 @@ nsCSSFrameConstructor::ConstructRadioControlFrame(nsIPresShell* aPresShel
}
nsCOMPtr<nsIStyleContext> radioStyle;
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::radioPseudo,
aStyleContext, PR_FALSE, getter_AddRefs(radioStyle));
aPresContext->ResolvePseudoStyleContextFor(aContent,
nsHTMLAtoms::radioPseudo,
aStyleContext,
getter_AddRefs(radioStyle));
nsIRadioControlFrame* radio = nsnull;
if (aNewFrame != nsnull && NS_SUCCEEDED(aNewFrame->QueryInterface(NS_GET_IID(nsIRadioControlFrame), (void**)&radio))) {
radio->SetRadioButtonFaceStyleContext(radioStyle);
@ -3927,7 +3927,7 @@ nsCSSFrameConstructor::ConstructCheckboxControlFrame(nsIPresShell* aPresShell
nsCOMPtr<nsIStyleContext> checkboxStyle;
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::checkPseudo,
aStyleContext, PR_FALSE, getter_AddRefs(checkboxStyle));
aStyleContext, getter_AddRefs(checkboxStyle));
nsICheckboxControlFrame* checkbox = nsnull;
if (aNewFrame != nsnull &&
NS_SUCCEEDED(aNewFrame->QueryInterface(NS_GET_IID(nsICheckboxControlFrame), (void**)&checkbox))) {
@ -4100,7 +4100,6 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell,
rv = aPresContext->ResolvePseudoStyleContextFor(aContent,
nsHTMLAtoms::dropDownListPseudo,
aStyleContext,
PR_FALSE,
getter_AddRefs(listStyle));
// Initialize the scroll frame positioned. Note that it is NOT
@ -4228,7 +4227,7 @@ nsCSSFrameConstructor::InitializeSelectFrame(nsIPresShell* aPresShell,
aPresContext->ResolvePseudoStyleContextFor(aContent,
nsLayoutAtoms::scrolledContentPseudo,
aStyleContext, PR_FALSE,
aStyleContext,
getter_AddRefs(scrolledPseudoStyle));
InitAndRestoreFrame(aPresContext, aState, aContent,
@ -4355,7 +4354,7 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsIPresShell* aPresShel
// Resolve style and initialize the frame
nsIStyleContext* styleContext;
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::fieldsetContentPseudo,
aStyleContext, PR_FALSE, &styleContext);
aStyleContext, &styleContext);
InitAndRestoreFrame(aPresContext, aState, aContent,
newFrame, styleContext, nsnull, areaFrame);
@ -5783,7 +5782,7 @@ nsCSSFrameConstructor::BeginBuildingScrollFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> scrollPseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(aContent,
nsLayoutAtoms::scrolledContentPseudo,
contentStyle, PR_FALSE,
contentStyle,
getter_AddRefs(scrollPseudoStyle));
contentStyle = scrollPseudoStyle;
@ -5802,7 +5801,7 @@ nsCSSFrameConstructor::BeginBuildingScrollFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> scrolledPseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(aContent,
aScrolledPseudo,
contentStyle, PR_FALSE,
contentStyle,
getter_AddRefs(scrolledPseudoStyle));
@ -6570,7 +6569,6 @@ nsCSSFrameConstructor::ResolveStyleContext(nsIPresContext* aPresContext,
aParentFrame->GetStyleContext(getter_AddRefs(parentStyleContext));
if (aContent->IsContentOfType(nsIContent::eELEMENT)) {
rv = aPresContext->ResolveStyleContextFor(aContent, parentStyleContext,
PR_FALSE,
aStyleContext);
} else {
#ifdef DEBUG
@ -6583,7 +6581,6 @@ nsCSSFrameConstructor::ResolveStyleContext(nsIPresContext* aPresContext,
}
#endif
rv = aPresContext->ResolveStyleContextForNonElement(parentStyleContext,
PR_FALSE,
aStyleContext);
}
return rv;
@ -6697,7 +6694,7 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> mrowContext;
aPresContext->ResolvePseudoStyleContextFor(aContent,
nsMathMLAtoms::mozMathInline,
parentContext, PR_FALSE,
parentContext,
getter_AddRefs(mrowContext));
InitAndRestoreFrame(aPresContext, aState, aContent, aParentFrame,
mrowContext, nsnull, newFrame);
@ -6709,14 +6706,14 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> blockContext;
aPresContext->ResolvePseudoStyleContextFor(aContent,
nsHTMLAtoms::mozAnonymousBlock,
mrowContext, PR_FALSE,
mrowContext,
getter_AddRefs(blockContext));
InitAndRestoreFrame(aPresContext, aState, aContent, newFrame,
blockContext, nsnull, blockFrame);
// then, create the table frame itself
nsCOMPtr<nsIStyleContext> tableContext;
aPresContext->ResolveStyleContextFor(aContent, blockContext, PR_FALSE,
aPresContext->ResolveStyleContextFor(aContent, blockContext,
getter_AddRefs(tableContext));
nsFrameItems tempItems;
nsIFrame* outerTable;
@ -6997,7 +6994,7 @@ nsCSSFrameConstructor::ConstructPageBreakFrame(nsIPresShell* aPresShe
{
nsCOMPtr<nsIStyleContext> pseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(nsnull, nsLayoutAtoms::pageBreakPseudo,
aStyleContext, PR_FALSE,
aStyleContext,
getter_AddRefs(pseudoStyle));
nsIFrame* pageBreakFrame;
nsresult rv = NS_NewPageBreakFrame(aPresShell, &pageBreakFrame);
@ -9137,7 +9134,7 @@ HasPseudoStyle(nsIPresContext* aPresContext,
if (aContent) {
aPresContext->ProbePseudoStyleContextFor(aContent,
aPseudoElement,
aStyleContext, PR_FALSE,
aStyleContext,
getter_AddRefs(pseudoStyleContext));
}
return pseudoStyleContext != nsnull;
@ -10356,7 +10353,7 @@ nsCSSFrameConstructor::AttributeChanged(nsIPresContext* aPresContext,
if (parentFrame) {
nsCOMPtr<nsIStyleContext> parentContext;
parentFrame->GetStyleContext(getter_AddRefs(parentContext));
aPresContext->ResolveStyleContextFor(aContent, parentContext, PR_FALSE,
aPresContext->ResolveStyleContextFor(aContent, parentContext,
getter_AddRefs(styleContext));
}
}
@ -10405,7 +10402,7 @@ nsCSSFrameConstructor::AttributeChanged(nsIPresContext* aPresContext,
if (parentFrame) {
nsCOMPtr<nsIStyleContext> parentContext;
parentFrame->GetStyleContext(getter_AddRefs(parentContext));
aPresContext->ResolveStyleContextFor(aContent, parentContext, PR_FALSE,
aPresContext->ResolveStyleContextFor(aContent, parentContext,
getter_AddRefs(styleContext));
}
}
@ -10726,7 +10723,7 @@ nsCSSFrameConstructor::ConstructAlternateFrame(nsIPresShell* aPresShell,
nsIStyleContext* textStyleContext;
NS_NewTextFrame(aPresShell, &textFrame);
aPresContext->ResolveStyleContextForNonElement(aStyleContext, PR_FALSE,
aPresContext->ResolveStyleContextForNonElement(aStyleContext,
&textStyleContext);
textFrame->Init(aPresContext, altTextContent, containerFrame,
@ -11283,7 +11280,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> pageContentPseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(nsnull, nsLayoutAtoms::pageContentPseudo,
styleContext, PR_FALSE,
styleContext,
getter_AddRefs(pageContentPseudoStyle));
pageContentFrame->Init(aPresContext, nsnull, newFrame, pageContentPseudoStyle, nsnull);
@ -11885,7 +11882,7 @@ nsCSSFrameConstructor::GetFirstLetterStyle(nsIPresContext* aPresContext,
if (aContent) {
aPresContext->ResolvePseudoStyleContextFor(aContent,
nsHTMLAtoms::firstLetterPseudo,
aStyleContext, PR_FALSE, &fls);
aStyleContext, &fls);
}
return fls;
}
@ -11899,7 +11896,7 @@ nsCSSFrameConstructor::GetFirstLineStyle(nsIPresContext* aPresContext,
if (aContent) {
aPresContext->ResolvePseudoStyleContextFor(aContent,
nsHTMLAtoms::firstLinePseudo,
aStyleContext, PR_FALSE, &fls);
aStyleContext, &fls);
}
return fls;
}
@ -12463,7 +12460,7 @@ nsCSSFrameConstructor::CreateFloatingLetterFrame(
// letter frame and will have the float property set on it; the text
// frame shouldn't have that set).
nsCOMPtr<nsIStyleContext> textSC;
aPresContext->ResolveStyleContextForNonElement(aStyleContext, PR_FALSE,
aPresContext->ResolveStyleContextForNonElement(aStyleContext,
getter_AddRefs(textSC));
InitAndRestoreFrame(aPresContext, aState, aTextContent,
letterFrame, textSC, nsnull, aTextFrame);
@ -12493,7 +12490,7 @@ nsCSSFrameConstructor::CreateFloatingLetterFrame(
if (parentStyleContext) {
nsCOMPtr<nsIStyleContext> newSC;
aPresContext->ResolveStyleContextForNonElement(parentStyleContext,
PR_FALSE, getter_AddRefs(newSC));
getter_AddRefs(newSC));
if (newSC) {
nextTextFrame->SetStyleContext(aPresContext, newSC);
}
@ -12562,7 +12559,7 @@ nsCSSFrameConstructor::CreateLetterFrame(nsIPresShell* aPresShell, nsIPresContex
letterFrame->Init(aPresContext, aTextContent, aParentFrame,
sc, nsnull);
nsCOMPtr<nsIStyleContext> textSC;
aPresContext->ResolveStyleContextForNonElement(sc, PR_FALSE,
aPresContext->ResolveStyleContextForNonElement(sc,
getter_AddRefs(textSC));
InitAndRestoreFrame(aPresContext, aState, aTextContent,
letterFrame, textSC, nsnull, textFrame);
@ -12773,7 +12770,7 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
return NS_OK;
}
nsCOMPtr<nsIStyleContext> newSC;
aPresContext->ResolveStyleContextForNonElement(parentSC, PR_FALSE,
aPresContext->ResolveStyleContextForNonElement(parentSC,
getter_AddRefs(newSC));
if (!newSC) {
return NS_OK;
@ -12873,7 +12870,7 @@ nsCSSFrameConstructor::RemoveFirstLetterFrames(nsIPresContext* aPresContext,
break;
}
nsCOMPtr<nsIStyleContext> newSC;
aPresContext->ResolveStyleContextForNonElement(parentSC, PR_FALSE,
aPresContext->ResolveStyleContextForNonElement(parentSC,
getter_AddRefs(newSC));
if (!newSC) {
break;
@ -13345,7 +13342,7 @@ nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> blockSC;
aPresContext->ResolvePseudoStyleContextFor(aContent, blockStyle,
aStyleContext, PR_FALSE,
aStyleContext,
getter_AddRefs(blockSC));
InitAndRestoreFrame(aPresContext, aState, aContent,
@ -13818,7 +13815,6 @@ nsCSSFrameConstructor::SplitToContainingBlock(nsIPresContext* aPresContext,
aPresContext->ResolvePseudoStyleContextFor(content,
nsHTMLAtoms::mozAnonymousBlock,
styleContext,
PR_FALSE,
getter_AddRefs(blockSC));
InitAndRestoreFrame(aPresContext, aState, content,

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

@ -1636,24 +1636,40 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
NS_ASSERTION(localContent,
"non pseudo-element frame without content node");
aPresContext->ResolveStyleContextForNonElement(parentContext,
PR_TRUE, &newContext);
&newContext);
}
else if (pseudoTag) {
nsIContent* pseudoContent =
aParentContent ? aParentContent : localContent;
aPresContext->ResolvePseudoStyleContextFor(pseudoContent, pseudoTag,
parentContext,
PR_FALSE, &newContext);
&newContext);
NS_RELEASE(pseudoTag);
}
else {
NS_ASSERTION(localContent,
"non pseudo-element frame without content node");
aPresContext->ResolveStyleContextFor(content, parentContext,
PR_TRUE, &newContext);
&newContext);
}
NS_ASSERTION(newContext, "failed to get new style context");
if (newContext) {
if (!parentContext) {
nsRuleNode *oldNode, *newNode;
oldContext->GetRuleNode(&oldNode);
newContext->GetRuleNode(&newNode);
if (oldNode == newNode) {
// We're the root of the style context tree and the new style
// context returned has the same rule node. This means that
// we can use FindChildWithRules to keep a lot of the old
// style contexts around. However, we need to start from the
// same root.
NS_RELEASE(newContext);
newContext = oldContext;
NS_ADDREF(newContext);
}
}
if (newContext != oldContext) {
aMinChange = CaptureChange(oldContext, newContext, aFrame, content, aChangeList, aMinChange);
if (aMinChange < NS_STYLE_HINT_FRAMECHANGE) { // if frame gets regenerated, let it keep old context
@ -1673,7 +1689,8 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
else {
// XXXdwh figure this out.
// oldContext->RemapStyle(aPresContext, PR_FALSE);
if (aAttribute && (aMinChange < NS_STYLE_HINT_REFLOW) &&
if (pseudoTag && pseudoTag != nsHTMLAtoms::mozNonElementPseudo &&
aAttribute && (aMinChange < NS_STYLE_HINT_REFLOW) &&
HasAttributeContent(oldContext, aAttrNameSpaceID, aAttribute)) {
aChangeList.AppendChange(aFrame, content, NS_STYLE_HINT_REFLOW);
}
@ -1683,6 +1700,7 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
else {
NS_ERROR("resolve style context failed");
newContext = oldContext; // new context failed, recover... (take ref)
oldContext = nsnull;
}
// do additional contexts
@ -1698,7 +1716,7 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
pseudoTag != nsHTMLAtoms::mozNonElementPseudo,
"extra style context is not pseudo element");
result = aPresContext->ResolvePseudoStyleContextFor(content, pseudoTag, newContext,
PR_FALSE, &newExtraContext);
&newExtraContext);
NS_RELEASE(pseudoTag);
if (NS_SUCCEEDED(result) && newExtraContext) {
if (oldExtraContext != newExtraContext) {
@ -1711,7 +1729,10 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
else {
// XXXdwh figure this out.
// oldExtraContext->RemapStyle(aPresContext, PR_FALSE);
if (aAttribute && (aMinChange < NS_STYLE_HINT_REFLOW) &&
// XXXldb |oldContext| is null by this point, so this will
// never do anything.
if (pseudoTag && pseudoTag != nsHTMLAtoms::mozNonElementPseudo &&
aAttribute && (aMinChange < NS_STYLE_HINT_REFLOW) &&
HasAttributeContent(oldContext, aAttrNameSpaceID, aAttribute)) {
aChangeList.AppendChange(aFrame, content, NS_STYLE_HINT_REFLOW);
}
@ -1734,16 +1755,17 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
undisplayed->mStyle->GetPseudoType(pseudoTag);
if (undisplayed->mContent && pseudoTag == nsnull) { // child content
aPresContext->ResolveStyleContextFor(undisplayed->mContent, newContext,
PR_TRUE, &undisplayedContext);
&undisplayedContext);
}
else if (pseudoTag == nsHTMLAtoms::mozNonElementPseudo) {
aPresContext->ResolveStyleContextForNonElement(newContext,
PR_TRUE, &undisplayedContext);
&undisplayedContext);
}
else { // pseudo element
NS_ASSERTION(pseudoTag, "pseudo element without tag");
aPresContext->ResolvePseudoStyleContextFor(localContent, pseudoTag, newContext, PR_FALSE,
&undisplayedContext);
aPresContext->ResolvePseudoStyleContextFor(localContent, pseudoTag,
newContext,
&undisplayedContext);
}
NS_IF_RELEASE(pseudoTag);
if (undisplayedContext) {

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

@ -960,7 +960,6 @@ nsPresContext::GetBaseURL(nsIURI** aResult)
NS_IMETHODIMP
nsPresContext::ResolveStyleContextFor(nsIContent* aContent,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult)
{
NS_PRECONDITION(aResult, "null out param");
@ -970,8 +969,7 @@ nsPresContext::ResolveStyleContextFor(nsIContent* aContent,
nsresult rv = mShell->GetStyleSet(getter_AddRefs(set));
if (NS_SUCCEEDED(rv)) {
if (set) {
result = set->ResolveStyleFor(this, aContent, aParentContext,
aForceUnique);
result = set->ResolveStyleFor(this, aContent, aParentContext);
if (nsnull == result) {
rv = NS_ERROR_OUT_OF_MEMORY;
}
@ -984,7 +982,6 @@ nsPresContext::ResolveStyleContextFor(nsIContent* aContent,
NS_IMETHODIMP
nsPresContext::ResolveStyleContextForNonElement(
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult)
{
NS_PRECONDITION(aResult, "null out param");
@ -993,8 +990,7 @@ nsPresContext::ResolveStyleContextForNonElement(
nsCOMPtr<nsIStyleSet> set;
nsresult rv = mShell->GetStyleSet(getter_AddRefs(set));
if (NS_SUCCEEDED(rv) && set) {
result = set->ResolveStyleForNonElement(this, aParentContext,
aForceUnique);
result = set->ResolveStyleForNonElement(this, aParentContext);
if (!result)
rv = NS_ERROR_OUT_OF_MEMORY;
}
@ -1006,18 +1002,16 @@ NS_IMETHODIMP
nsPresContext::ResolvePseudoStyleContextFor(nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult)
{
return ResolvePseudoStyleWithComparator(aParentContent, aPseudoTag, aParentContext,
aForceUnique, nsnull, aResult);
nsnull, aResult);
}
NS_IMETHODIMP
nsPresContext::ResolvePseudoStyleWithComparator(nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsICSSPseudoComparator* aComparator,
nsIStyleContext** aResult)
{
@ -1029,7 +1023,7 @@ nsPresContext::ResolvePseudoStyleWithComparator(nsIContent* aParentContent,
if (NS_SUCCEEDED(rv)) {
if (set) {
result = set->ResolvePseudoStyleFor(this, aParentContent, aPseudoTag,
aParentContext, aForceUnique, aComparator);
aParentContext, aComparator);
if (nsnull == result) {
rv = NS_ERROR_OUT_OF_MEMORY;
}
@ -1043,7 +1037,6 @@ NS_IMETHODIMP
nsPresContext::ProbePseudoStyleContextFor(nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult)
{
NS_PRECONDITION(aResult, "null out param");
@ -1054,7 +1047,7 @@ nsPresContext::ProbePseudoStyleContextFor(nsIContent* aParentContent,
if (NS_SUCCEEDED(rv)) {
if (set) {
result = set->ProbePseudoStyleFor(this, aParentContent, aPseudoTag,
aParentContext, aForceUnique);
aParentContext);
}
}
*aResult = result;

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

@ -190,7 +190,6 @@ public:
*/
NS_IMETHOD ResolveStyleContextFor(nsIContent* aContent,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult) = 0;
/**
@ -207,7 +206,6 @@ public:
*/
NS_IMETHOD ResolveStyleContextForNonElement(
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult) = 0;
/**
@ -218,7 +216,6 @@ public:
NS_IMETHOD ResolvePseudoStyleContextFor(nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult) = 0;
/**
@ -232,7 +229,6 @@ public:
NS_IMETHOD ResolvePseudoStyleWithComparator(nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsICSSPseudoComparator* aComparator,
nsIStyleContext** aResult) = 0;
@ -245,7 +241,6 @@ public:
NS_IMETHOD ProbePseudoStyleContextFor(nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult) = 0;
/**

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

@ -4618,7 +4618,7 @@ PresShell::GetGeneratedContentIterator(nsIContent* aContent,
primaryFrame->GetStyleContext(getter_AddRefs(styleContext));
mPresContext->ProbePseudoStyleContextFor(aContent, nsCSSAtoms::afterPseudo,
styleContext, PR_FALSE,
styleContext,
getter_AddRefs(pseudoStyleContext));
if (pseudoStyleContext) {
nsIFrame* lastChildFrame = GetLastChildFrame(mPresContext, primaryFrame, aContent);

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

@ -190,7 +190,6 @@ public:
*/
NS_IMETHOD ResolveStyleContextFor(nsIContent* aContent,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult) = 0;
/**
@ -207,7 +206,6 @@ public:
*/
NS_IMETHOD ResolveStyleContextForNonElement(
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult) = 0;
/**
@ -218,7 +216,6 @@ public:
NS_IMETHOD ResolvePseudoStyleContextFor(nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult) = 0;
/**
@ -232,7 +229,6 @@ public:
NS_IMETHOD ResolvePseudoStyleWithComparator(nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsICSSPseudoComparator* aComparator,
nsIStyleContext** aResult) = 0;
@ -245,7 +241,6 @@ public:
NS_IMETHOD ProbePseudoStyleContextFor(nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult) = 0;
/**

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

@ -125,9 +125,6 @@ public:
// Used to clear away the style data for a given style context if it matches the specified |aRule|.
// If |aRule| is null, then the style data is always blown away.
virtual nsresult ClearStyleData(nsIPresContext* aPresContext, nsIStyleRule* aRule) = 0;
// call this to prevent context from getting shared
virtual void ForceUnique(void) = 0;
};

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

@ -147,8 +147,7 @@ public:
// get a style context for a non-pseudo frame
virtual nsIStyleContext* ResolveStyleFor(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIStyleContext* aParentContext,
PRBool aForceUnique = PR_FALSE) = 0;
nsIStyleContext* aParentContext) = 0;
// Get a style context for a non-element (which no rules will match).
// Eventually, this should go away and we shouldn't even create style
@ -162,16 +161,14 @@ public:
//
virtual nsIStyleContext* ResolveStyleForNonElement(
nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
PRBool aForceUnique = PR_FALSE) = 0;
nsIStyleContext* aParentContext) = 0;
// get a style context for a pseudo-element (i.e.,
// |aPseudoTag == NS_NewAtom(":first-line")|;
// |aPseudoTag == nsCOMPtr<nsIAtom>(do_GetAtom(":first-line"))|;
virtual nsIStyleContext* ResolvePseudoStyleFor(nsIPresContext* aPresContext,
nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique = PR_FALSE,
nsICSSPseudoComparator* aComparator = nsnull) = 0;
// This funtions just like ResolvePseudoStyleFor except that it will
@ -180,8 +177,7 @@ public:
virtual nsIStyleContext* ProbePseudoStyleFor(nsIPresContext* aPresContext,
nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique = PR_FALSE) = 0;
nsIStyleContext* aParentContext) = 0;
NS_IMETHOD Shutdown()=0;

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

@ -190,7 +190,6 @@ public:
*/
NS_IMETHOD ResolveStyleContextFor(nsIContent* aContent,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult) = 0;
/**
@ -207,7 +206,6 @@ public:
*/
NS_IMETHOD ResolveStyleContextForNonElement(
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult) = 0;
/**
@ -218,7 +216,6 @@ public:
NS_IMETHOD ResolvePseudoStyleContextFor(nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult) = 0;
/**
@ -232,7 +229,6 @@ public:
NS_IMETHOD ResolvePseudoStyleWithComparator(nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsICSSPseudoComparator* aComparator,
nsIStyleContext** aResult) = 0;
@ -245,7 +241,6 @@ public:
NS_IMETHOD ProbePseudoStyleContextFor(nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult) = 0;
/**

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

@ -960,7 +960,6 @@ nsPresContext::GetBaseURL(nsIURI** aResult)
NS_IMETHODIMP
nsPresContext::ResolveStyleContextFor(nsIContent* aContent,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult)
{
NS_PRECONDITION(aResult, "null out param");
@ -970,8 +969,7 @@ nsPresContext::ResolveStyleContextFor(nsIContent* aContent,
nsresult rv = mShell->GetStyleSet(getter_AddRefs(set));
if (NS_SUCCEEDED(rv)) {
if (set) {
result = set->ResolveStyleFor(this, aContent, aParentContext,
aForceUnique);
result = set->ResolveStyleFor(this, aContent, aParentContext);
if (nsnull == result) {
rv = NS_ERROR_OUT_OF_MEMORY;
}
@ -984,7 +982,6 @@ nsPresContext::ResolveStyleContextFor(nsIContent* aContent,
NS_IMETHODIMP
nsPresContext::ResolveStyleContextForNonElement(
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult)
{
NS_PRECONDITION(aResult, "null out param");
@ -993,8 +990,7 @@ nsPresContext::ResolveStyleContextForNonElement(
nsCOMPtr<nsIStyleSet> set;
nsresult rv = mShell->GetStyleSet(getter_AddRefs(set));
if (NS_SUCCEEDED(rv) && set) {
result = set->ResolveStyleForNonElement(this, aParentContext,
aForceUnique);
result = set->ResolveStyleForNonElement(this, aParentContext);
if (!result)
rv = NS_ERROR_OUT_OF_MEMORY;
}
@ -1006,18 +1002,16 @@ NS_IMETHODIMP
nsPresContext::ResolvePseudoStyleContextFor(nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult)
{
return ResolvePseudoStyleWithComparator(aParentContent, aPseudoTag, aParentContext,
aForceUnique, nsnull, aResult);
nsnull, aResult);
}
NS_IMETHODIMP
nsPresContext::ResolvePseudoStyleWithComparator(nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsICSSPseudoComparator* aComparator,
nsIStyleContext** aResult)
{
@ -1029,7 +1023,7 @@ nsPresContext::ResolvePseudoStyleWithComparator(nsIContent* aParentContent,
if (NS_SUCCEEDED(rv)) {
if (set) {
result = set->ResolvePseudoStyleFor(this, aParentContent, aPseudoTag,
aParentContext, aForceUnique, aComparator);
aParentContext, aComparator);
if (nsnull == result) {
rv = NS_ERROR_OUT_OF_MEMORY;
}
@ -1043,7 +1037,6 @@ NS_IMETHODIMP
nsPresContext::ProbePseudoStyleContextFor(nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult)
{
NS_PRECONDITION(aResult, "null out param");
@ -1054,7 +1047,7 @@ nsPresContext::ProbePseudoStyleContextFor(nsIContent* aParentContent,
if (NS_SUCCEEDED(rv)) {
if (set) {
result = set->ProbePseudoStyleFor(this, aParentContent, aPseudoTag,
aParentContext, aForceUnique);
aParentContext);
}
}
*aResult = result;

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

@ -83,26 +83,21 @@ public:
NS_IMETHOD ClearStyleDataAndReflow(void);
NS_IMETHOD ResolveStyleContextFor(nsIContent* aContent,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult);
NS_IMETHOD ResolveStyleContextForNonElement(nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult);
NS_IMETHOD ResolvePseudoStyleContextFor(nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult);
NS_IMETHOD ResolvePseudoStyleWithComparator(nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsICSSPseudoComparator* aComparator,
nsIStyleContext** aResult);
NS_IMETHOD ProbePseudoStyleContextFor(nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsIStyleContext** aResult);
NS_IMETHOD ReParentStyleContext(nsIFrame* aFrame,
nsIStyleContext* aNewParentContext);

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

@ -349,12 +349,10 @@ nsButtonFrameRenderer::ReResolveStyles(nsIPresContext* aPresContext)
// style for the inner such as a dotted line (Windows)
aPresContext->ProbePseudoStyleContextFor(content, nsHTMLAtoms::mozFocusInnerPseudo, context,
PR_FALSE,
getter_AddRefs(mInnerFocusStyle));
// style for outer focus like a ridged border (MAC).
aPresContext->ProbePseudoStyleContextFor(content, nsHTMLAtoms::mozFocusOuterPseudo, context,
PR_FALSE,
getter_AddRefs(mOuterFocusStyle));
}

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

@ -2173,7 +2173,6 @@ nsComboboxControlFrame::CreateDisplayFrame(nsIPresContext* aPresContext)
rv = aPresContext->ResolvePseudoStyleContextFor(mContent,
nsHTMLAtoms::mozDisplayComboboxControlFrame,
mStyleContext,
PR_FALSE,
getter_AddRefs(styleContext));
if (NS_FAILED(rv)) { return rv; }
if (!styleContext) { return NS_ERROR_NULL_POINTER; }
@ -2185,7 +2184,6 @@ nsComboboxControlFrame::CreateDisplayFrame(nsIPresContext* aPresContext)
nsCOMPtr<nsIStyleContext> textStyleContext;
rv = aPresContext->ResolveStyleContextForNonElement(
styleContext,
PR_FALSE,
getter_AddRefs(textStyleContext));
if (NS_FAILED(rv)) { return rv; }
if (!textStyleContext) { return NS_ERROR_NULL_POINTER; }
@ -2315,7 +2313,6 @@ nsComboboxControlFrame::CreateFrameFor(nsIPresContext* aPresContext,
rv = aPresContext->ResolvePseudoStyleContextFor(mContent,
nsHTMLAtoms::mozDisplayComboboxControlFrame,
mStyleContext,
PR_FALSE,
getter_AddRefs(styleContext));
if (NS_FAILED(rv)) { return rv; }
if (!styleContext) { return NS_ERROR_NULL_POINTER; }
@ -2327,7 +2324,6 @@ nsComboboxControlFrame::CreateFrameFor(nsIPresContext* aPresContext,
nsCOMPtr<nsIStyleContext> textStyleContext;
rv = aPresContext->ResolveStyleContextForNonElement(
styleContext,
PR_FALSE,
getter_AddRefs(textStyleContext));
if (NS_FAILED(rv)) { return rv; }
if (!textStyleContext) { return NS_ERROR_NULL_POINTER; }

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

@ -426,7 +426,6 @@ nsGfxButtonControlFrame::CreateFrameFor(nsIPresContext* aPresContext,
nsCOMPtr<nsIStyleContext> textStyleContext;
rv = aPresContext->ResolveStyleContextForNonElement(
styleContext,
PR_FALSE,
getter_AddRefs(textStyleContext));
if (NS_FAILED(rv)) { return rv; }
if (!textStyleContext) { return NS_ERROR_NULL_POINTER; }

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

@ -151,7 +151,7 @@ nsHTMLButtonControlFrame::Init(nsIPresContext* aPresContext,
// Resolve style and initialize the frame
nsIStyleContext* styleContext;
aPresContext->ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::buttonContentPseudo,
mStyleContext, PR_FALSE,
mStyleContext,
&styleContext);
mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull);
NS_RELEASE(styleContext);

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

@ -6070,7 +6070,7 @@ nsBlockFrame::GetFirstLetterStyle(nsIPresContext* aPresContext)
nsIStyleContext* fls;
aPresContext->ProbePseudoStyleContextFor(mContent,
nsHTMLAtoms::firstLetterPseudo,
mStyleContext, PR_FALSE, &fls);
mStyleContext, &fls);
return fls;
}
@ -6131,8 +6131,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext* aPresContext,
}
nsIStyleContext* kidSC;
aPresContext->ResolvePseudoStyleContextFor(mContent, pseudoElement,
mStyleContext, PR_FALSE,
&kidSC);
mStyleContext, &kidSC);
// Create bullet frame
nsCOMPtr<nsIPresShell> shell;

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

@ -142,7 +142,6 @@ nsFirstLetterFrame::Init(nsIPresContext* aPresContext,
if (parentStyleContext) {
rv = aPresContext->ResolveStyleContextForNonElement(
parentStyleContext,
PR_FALSE,
getter_AddRefs(newSC));
NS_RELEASE(parentStyleContext);
if (NS_FAILED(rv))
@ -365,7 +364,7 @@ nsFirstLetterFrame::DrainOverflowFrames(nsIPresContext* aPresContext)
NS_ASSERTION(kidContent->IsContentOfType(nsIContent::eTEXT),
"should contain only text nodes");
aPresContext->ResolveStyleContextForNonElement(mStyleContext,
PR_FALSE, getter_AddRefs(sc));
getter_AddRefs(sc));
if (sc) {
kid->SetStyleContext(aPresContext, sc);
}

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

@ -360,7 +360,6 @@ nsHTMLFrameOuterFrame::Init(nsIPresContext* aPresContext,
nsresult rv = NS_OK;
nsIStyleContext *innerStyleContext = nsnull;
rv = aPresContext->ResolveStyleContextFor(mContent, mStyleContext,
PR_FALSE,
&innerStyleContext);
if (NS_SUCCEEDED(rv)) {
rv = firstChild->Init(aPresContext, mContent, this, innerStyleContext, nsnull);

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

@ -403,7 +403,7 @@ nsHTMLFramesetFrame::Init(nsIPresContext* aPresContext,
nsresult result;
aPresContext->ResolveStyleContextFor(child, mStyleContext,
PR_FALSE, getter_AddRefs(kidSC));
getter_AddRefs(kidSC));
if (nsHTMLAtoms::frameset == tag) {
result = NS_NewHTMLFramesetFrame(shell, &frame);
@ -446,7 +446,7 @@ nsHTMLFramesetFrame::Init(nsIPresContext* aPresContext,
nsHTMLFramesetBlankFrame* blankFrame = new (shell.get()) nsHTMLFramesetBlankFrame;
nsCOMPtr<nsIStyleContext> pseudoStyleContext;
aPresContext->ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::framesetBlankPseudo,
mStyleContext, PR_FALSE,
mStyleContext,
getter_AddRefs(pseudoStyleContext));
if(blankFrame)
blankFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull);
@ -1213,7 +1213,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext* aPresContext,
borderFrame = new (shell.get()) nsHTMLFramesetBorderFrame(borderWidth, PR_FALSE, PR_FALSE);
nsIStyleContext* pseudoStyleContext;
aPresContext->ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::horizontalFramesetBorderPseudo,
mStyleContext, PR_FALSE,
mStyleContext,
&pseudoStyleContext);
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull);
NS_RELEASE(pseudoStyleContext);
@ -1242,7 +1242,6 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext* aPresContext,
nsIStyleContext* pseudoStyleContext;
aPresContext->ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::verticalFramesetBorderPseudo,
mStyleContext,
PR_FALSE,
&pseudoStyleContext);
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull);
NS_RELEASE(pseudoStyleContext);

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

@ -1065,9 +1065,9 @@ nsFirstLineFrame::Reflow(nsIPresContext* aPresContext,
// of the parent frame.
nsIStyleContext* newSC;
aPresContext->ResolvePseudoStyleContextFor(mContent,
nsHTMLAtoms::mozLineFrame,
parentContext,
PR_FALSE, &newSC);
nsHTMLAtoms::mozLineFrame,
parentContext,
&newSC);
if (newSC) {
// Switch to the new style context.
SetStyleContext(aPresContext, newSC);

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

@ -6070,7 +6070,7 @@ nsBlockFrame::GetFirstLetterStyle(nsIPresContext* aPresContext)
nsIStyleContext* fls;
aPresContext->ProbePseudoStyleContextFor(mContent,
nsHTMLAtoms::firstLetterPseudo,
mStyleContext, PR_FALSE, &fls);
mStyleContext, &fls);
return fls;
}
@ -6131,8 +6131,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext* aPresContext,
}
nsIStyleContext* kidSC;
aPresContext->ResolvePseudoStyleContextFor(mContent, pseudoElement,
mStyleContext, PR_FALSE,
&kidSC);
mStyleContext, &kidSC);
// Create bullet frame
nsCOMPtr<nsIPresShell> shell;

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

@ -142,7 +142,6 @@ nsFirstLetterFrame::Init(nsIPresContext* aPresContext,
if (parentStyleContext) {
rv = aPresContext->ResolveStyleContextForNonElement(
parentStyleContext,
PR_FALSE,
getter_AddRefs(newSC));
NS_RELEASE(parentStyleContext);
if (NS_FAILED(rv))
@ -365,7 +364,7 @@ nsFirstLetterFrame::DrainOverflowFrames(nsIPresContext* aPresContext)
NS_ASSERTION(kidContent->IsContentOfType(nsIContent::eTEXT),
"should contain only text nodes");
aPresContext->ResolveStyleContextForNonElement(mStyleContext,
PR_FALSE, getter_AddRefs(sc));
getter_AddRefs(sc));
if (sc) {
kid->SetStyleContext(aPresContext, sc);
}

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

@ -1636,24 +1636,40 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
NS_ASSERTION(localContent,
"non pseudo-element frame without content node");
aPresContext->ResolveStyleContextForNonElement(parentContext,
PR_TRUE, &newContext);
&newContext);
}
else if (pseudoTag) {
nsIContent* pseudoContent =
aParentContent ? aParentContent : localContent;
aPresContext->ResolvePseudoStyleContextFor(pseudoContent, pseudoTag,
parentContext,
PR_FALSE, &newContext);
&newContext);
NS_RELEASE(pseudoTag);
}
else {
NS_ASSERTION(localContent,
"non pseudo-element frame without content node");
aPresContext->ResolveStyleContextFor(content, parentContext,
PR_TRUE, &newContext);
&newContext);
}
NS_ASSERTION(newContext, "failed to get new style context");
if (newContext) {
if (!parentContext) {
nsRuleNode *oldNode, *newNode;
oldContext->GetRuleNode(&oldNode);
newContext->GetRuleNode(&newNode);
if (oldNode == newNode) {
// We're the root of the style context tree and the new style
// context returned has the same rule node. This means that
// we can use FindChildWithRules to keep a lot of the old
// style contexts around. However, we need to start from the
// same root.
NS_RELEASE(newContext);
newContext = oldContext;
NS_ADDREF(newContext);
}
}
if (newContext != oldContext) {
aMinChange = CaptureChange(oldContext, newContext, aFrame, content, aChangeList, aMinChange);
if (aMinChange < NS_STYLE_HINT_FRAMECHANGE) { // if frame gets regenerated, let it keep old context
@ -1673,7 +1689,8 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
else {
// XXXdwh figure this out.
// oldContext->RemapStyle(aPresContext, PR_FALSE);
if (aAttribute && (aMinChange < NS_STYLE_HINT_REFLOW) &&
if (pseudoTag && pseudoTag != nsHTMLAtoms::mozNonElementPseudo &&
aAttribute && (aMinChange < NS_STYLE_HINT_REFLOW) &&
HasAttributeContent(oldContext, aAttrNameSpaceID, aAttribute)) {
aChangeList.AppendChange(aFrame, content, NS_STYLE_HINT_REFLOW);
}
@ -1683,6 +1700,7 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
else {
NS_ERROR("resolve style context failed");
newContext = oldContext; // new context failed, recover... (take ref)
oldContext = nsnull;
}
// do additional contexts
@ -1698,7 +1716,7 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
pseudoTag != nsHTMLAtoms::mozNonElementPseudo,
"extra style context is not pseudo element");
result = aPresContext->ResolvePseudoStyleContextFor(content, pseudoTag, newContext,
PR_FALSE, &newExtraContext);
&newExtraContext);
NS_RELEASE(pseudoTag);
if (NS_SUCCEEDED(result) && newExtraContext) {
if (oldExtraContext != newExtraContext) {
@ -1711,7 +1729,10 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
else {
// XXXdwh figure this out.
// oldExtraContext->RemapStyle(aPresContext, PR_FALSE);
if (aAttribute && (aMinChange < NS_STYLE_HINT_REFLOW) &&
// XXXldb |oldContext| is null by this point, so this will
// never do anything.
if (pseudoTag && pseudoTag != nsHTMLAtoms::mozNonElementPseudo &&
aAttribute && (aMinChange < NS_STYLE_HINT_REFLOW) &&
HasAttributeContent(oldContext, aAttrNameSpaceID, aAttribute)) {
aChangeList.AppendChange(aFrame, content, NS_STYLE_HINT_REFLOW);
}
@ -1734,16 +1755,17 @@ FrameManager::ReResolveStyleContext(nsIPresContext* aPresContext,
undisplayed->mStyle->GetPseudoType(pseudoTag);
if (undisplayed->mContent && pseudoTag == nsnull) { // child content
aPresContext->ResolveStyleContextFor(undisplayed->mContent, newContext,
PR_TRUE, &undisplayedContext);
&undisplayedContext);
}
else if (pseudoTag == nsHTMLAtoms::mozNonElementPseudo) {
aPresContext->ResolveStyleContextForNonElement(newContext,
PR_TRUE, &undisplayedContext);
&undisplayedContext);
}
else { // pseudo element
NS_ASSERTION(pseudoTag, "pseudo element without tag");
aPresContext->ResolvePseudoStyleContextFor(localContent, pseudoTag, newContext, PR_FALSE,
&undisplayedContext);
aPresContext->ResolvePseudoStyleContextFor(localContent, pseudoTag,
newContext,
&undisplayedContext);
}
NS_IF_RELEASE(pseudoTag);
if (undisplayedContext) {

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

@ -1065,9 +1065,9 @@ nsFirstLineFrame::Reflow(nsIPresContext* aPresContext,
// of the parent frame.
nsIStyleContext* newSC;
aPresContext->ResolvePseudoStyleContextFor(mContent,
nsHTMLAtoms::mozLineFrame,
parentContext,
PR_FALSE, &newSC);
nsHTMLAtoms::mozLineFrame,
parentContext,
&newSC);
if (newSC) {
// Switch to the new style context.
SetStyleContext(aPresContext, newSC);

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

@ -4618,7 +4618,7 @@ PresShell::GetGeneratedContentIterator(nsIContent* aContent,
primaryFrame->GetStyleContext(getter_AddRefs(styleContext));
mPresContext->ProbePseudoStyleContextFor(aContent, nsCSSAtoms::afterPseudo,
styleContext, PR_FALSE,
styleContext,
getter_AddRefs(pseudoStyleContext));
if (pseudoStyleContext) {
nsIFrame* lastChildFrame = GetLastChildFrame(mPresContext, primaryFrame, aContent);

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

@ -360,7 +360,6 @@ nsHTMLFrameOuterFrame::Init(nsIPresContext* aPresContext,
nsresult rv = NS_OK;
nsIStyleContext *innerStyleContext = nsnull;
rv = aPresContext->ResolveStyleContextFor(mContent, mStyleContext,
PR_FALSE,
&innerStyleContext);
if (NS_SUCCEEDED(rv)) {
rv = firstChild->Init(aPresContext, mContent, this, innerStyleContext, nsnull);

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

@ -403,7 +403,7 @@ nsHTMLFramesetFrame::Init(nsIPresContext* aPresContext,
nsresult result;
aPresContext->ResolveStyleContextFor(child, mStyleContext,
PR_FALSE, getter_AddRefs(kidSC));
getter_AddRefs(kidSC));
if (nsHTMLAtoms::frameset == tag) {
result = NS_NewHTMLFramesetFrame(shell, &frame);
@ -446,7 +446,7 @@ nsHTMLFramesetFrame::Init(nsIPresContext* aPresContext,
nsHTMLFramesetBlankFrame* blankFrame = new (shell.get()) nsHTMLFramesetBlankFrame;
nsCOMPtr<nsIStyleContext> pseudoStyleContext;
aPresContext->ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::framesetBlankPseudo,
mStyleContext, PR_FALSE,
mStyleContext,
getter_AddRefs(pseudoStyleContext));
if(blankFrame)
blankFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull);
@ -1213,7 +1213,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext* aPresContext,
borderFrame = new (shell.get()) nsHTMLFramesetBorderFrame(borderWidth, PR_FALSE, PR_FALSE);
nsIStyleContext* pseudoStyleContext;
aPresContext->ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::horizontalFramesetBorderPseudo,
mStyleContext, PR_FALSE,
mStyleContext,
&pseudoStyleContext);
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull);
NS_RELEASE(pseudoStyleContext);
@ -1242,7 +1242,6 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext* aPresContext,
nsIStyleContext* pseudoStyleContext;
aPresContext->ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::verticalFramesetBorderPseudo,
mStyleContext,
PR_FALSE,
&pseudoStyleContext);
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull);
NS_RELEASE(pseudoStyleContext);

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

@ -349,12 +349,10 @@ nsButtonFrameRenderer::ReResolveStyles(nsIPresContext* aPresContext)
// style for the inner such as a dotted line (Windows)
aPresContext->ProbePseudoStyleContextFor(content, nsHTMLAtoms::mozFocusInnerPseudo, context,
PR_FALSE,
getter_AddRefs(mInnerFocusStyle));
// style for outer focus like a ridged border (MAC).
aPresContext->ProbePseudoStyleContextFor(content, nsHTMLAtoms::mozFocusOuterPseudo, context,
PR_FALSE,
getter_AddRefs(mOuterFocusStyle));
}

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

@ -2173,7 +2173,6 @@ nsComboboxControlFrame::CreateDisplayFrame(nsIPresContext* aPresContext)
rv = aPresContext->ResolvePseudoStyleContextFor(mContent,
nsHTMLAtoms::mozDisplayComboboxControlFrame,
mStyleContext,
PR_FALSE,
getter_AddRefs(styleContext));
if (NS_FAILED(rv)) { return rv; }
if (!styleContext) { return NS_ERROR_NULL_POINTER; }
@ -2185,7 +2184,6 @@ nsComboboxControlFrame::CreateDisplayFrame(nsIPresContext* aPresContext)
nsCOMPtr<nsIStyleContext> textStyleContext;
rv = aPresContext->ResolveStyleContextForNonElement(
styleContext,
PR_FALSE,
getter_AddRefs(textStyleContext));
if (NS_FAILED(rv)) { return rv; }
if (!textStyleContext) { return NS_ERROR_NULL_POINTER; }
@ -2315,7 +2313,6 @@ nsComboboxControlFrame::CreateFrameFor(nsIPresContext* aPresContext,
rv = aPresContext->ResolvePseudoStyleContextFor(mContent,
nsHTMLAtoms::mozDisplayComboboxControlFrame,
mStyleContext,
PR_FALSE,
getter_AddRefs(styleContext));
if (NS_FAILED(rv)) { return rv; }
if (!styleContext) { return NS_ERROR_NULL_POINTER; }
@ -2327,7 +2324,6 @@ nsComboboxControlFrame::CreateFrameFor(nsIPresContext* aPresContext,
nsCOMPtr<nsIStyleContext> textStyleContext;
rv = aPresContext->ResolveStyleContextForNonElement(
styleContext,
PR_FALSE,
getter_AddRefs(textStyleContext));
if (NS_FAILED(rv)) { return rv; }
if (!textStyleContext) { return NS_ERROR_NULL_POINTER; }

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

@ -426,7 +426,6 @@ nsGfxButtonControlFrame::CreateFrameFor(nsIPresContext* aPresContext,
nsCOMPtr<nsIStyleContext> textStyleContext;
rv = aPresContext->ResolveStyleContextForNonElement(
styleContext,
PR_FALSE,
getter_AddRefs(textStyleContext));
if (NS_FAILED(rv)) { return rv; }
if (!textStyleContext) { return NS_ERROR_NULL_POINTER; }

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

@ -2666,7 +2666,6 @@ nsGfxTextControlFrame::Reflow(nsIPresContext* aPresContext,
rv = aPresContext->ResolvePseudoStyleContextFor(mContent,
nsHTMLAtoms::mozSingleLineTextControlFrame,
mStyleContext,
PR_FALSE,
getter_AddRefs(styleContext));
if (NS_FAILED(rv)) { return rv; }
if (!styleContext) { return NS_ERROR_NULL_POINTER; }
@ -2680,7 +2679,6 @@ nsGfxTextControlFrame::Reflow(nsIPresContext* aPresContext,
rv = aPresContext->ResolvePseudoStyleContextFor(mContent,
nsHTMLAtoms::mozSingleLineTextControlFrame,
styleContext,
PR_FALSE,
getter_AddRefs(textStyleContext));
if (NS_FAILED(rv)) { return rv; }
if (!textStyleContext) { return NS_ERROR_NULL_POINTER; }

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

@ -151,7 +151,7 @@ nsHTMLButtonControlFrame::Init(nsIPresContext* aPresContext,
// Resolve style and initialize the frame
nsIStyleContext* styleContext;
aPresContext->ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::buttonContentPseudo,
mStyleContext, PR_FALSE,
mStyleContext,
&styleContext);
mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull);
NS_RELEASE(styleContext);

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

@ -1386,7 +1386,7 @@ nsCSSFrameConstructor::CreateGeneratedContentFrame(nsIPresShell* aPresShe
// Probe for the existence of the pseudo-element
nsCOMPtr<nsIStyleContext> pseudoStyleContext;
aPresContext->ProbePseudoStyleContextFor(aContent, aPseudoElement, aStyleContext,
PR_FALSE, getter_AddRefs(pseudoStyleContext));
getter_AddRefs(pseudoStyleContext));
if (pseudoStyleContext) {
const nsStyleDisplay* display;
@ -1426,9 +1426,8 @@ nsCSSFrameConstructor::CreateGeneratedContentFrame(nsIPresShell* aPresShe
// Create another pseudo style context to use for all the generated child
// frames
nsIStyleContext* textStyleContext;
aPresContext->ResolveStyleContextForNonElement(
pseudoStyleContext, PR_FALSE,
&textStyleContext);
aPresContext->ResolveStyleContextForNonElement(pseudoStyleContext,
&textStyleContext);
// Now create content objects (and child frames) for each value of the
// 'content' property
@ -1776,7 +1775,7 @@ nsCSSFrameConstructor::CreatePseudoTableFrame(nsIPresShell* aPresShel
// create the SC for the inner table which will be the parent of the outer table's SC
aPresContext->ResolvePseudoStyleContextFor(parentContent, nsHTMLAtoms::tablePseudo,
parentStyle, PR_FALSE,
parentStyle,
getter_AddRefs(childStyle));
nsPseudoFrameData& pseudoOuter = aState.mPseudoFrames.mTableOuter;
@ -1825,7 +1824,7 @@ nsCSSFrameConstructor::CreatePseudoRowGroupFrame(nsIPresShell* aPresS
parentFrame->GetContent(getter_AddRefs(parentContent));
aPresContext->ResolvePseudoStyleContextFor(parentContent, nsHTMLAtoms::tableRowGroupPseudo,
parentStyle, PR_FALSE,
parentStyle,
getter_AddRefs(childStyle));
nsPseudoFrameData& pseudo = aState.mPseudoFrames.mRowGroup;
@ -1870,7 +1869,7 @@ nsCSSFrameConstructor::CreatePseudoColGroupFrame(nsIPresShell* aPresS
parentFrame->GetContent(getter_AddRefs(parentContent));
aPresContext->ResolvePseudoStyleContextFor(parentContent, nsHTMLAtoms::tableColGroupPseudo,
parentStyle, PR_FALSE,
parentStyle,
getter_AddRefs(childStyle));
nsPseudoFrameData& pseudo = aState.mPseudoFrames.mColGroup;
@ -1913,7 +1912,7 @@ nsCSSFrameConstructor::CreatePseudoRowFrame(nsIPresShell* aPresShell,
parentFrame->GetContent(getter_AddRefs(parentContent));
aPresContext->ResolvePseudoStyleContextFor(parentContent, nsHTMLAtoms::tableRowPseudo,
parentStyle, PR_FALSE,
parentStyle,
getter_AddRefs(childStyle));
nsPseudoFrameData& pseudo = aState.mPseudoFrames.mRow;
@ -1957,7 +1956,7 @@ nsCSSFrameConstructor::CreatePseudoCellFrame(nsIPresShell* aPresShell
parentFrame->GetContent(getter_AddRefs(parentContent));
aPresContext->ResolvePseudoStyleContextFor(parentContent, nsHTMLAtoms::tableCellPseudo,
parentStyle, PR_FALSE,
parentStyle,
getter_AddRefs(childStyle));
nsPseudoFrameData& pseudoOuter = aState.mPseudoFrames.mCellOuter;
@ -2330,7 +2329,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresShell* aPresShell,
// create the pseudo SC for the outer table as a child of the inner SC
nsCOMPtr<nsIStyleContext> outerStyleContext;
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::tableOuterPseudo,
aStyleContext, PR_FALSE,
aStyleContext,
getter_AddRefs(outerStyleContext));
// Init the table outer frame and see if we need to create a view, e.g.
@ -2639,7 +2638,7 @@ nsCSSFrameConstructor::ConstructTableColFrame(nsIPresShell* aPresShel
for (PRInt32 spanX = 1; spanX < span; spanX++) {
nsCOMPtr<nsIStyleContext> styleContext;
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::tableColPseudo, aStyleContext,
PR_FALSE, getter_AddRefs(styleContext));
getter_AddRefs(styleContext));
nsIFrame* newCol;
rv = aTableCreator.CreateTableColFrame(&newCol); if (NS_FAILED(rv)) return rv;
InitAndRestoreFrame(aPresContext, aState, aContent, parentFrame, styleContext, nsnull, newCol);
@ -2716,7 +2715,7 @@ nsCSSFrameConstructor::ConstructTableCellFrame(nsIPresShell* aPresShe
// Resolve pseudo style and initialize the body cell frame
nsCOMPtr<nsIStyleContext> innerPseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::cellContentPseudo,
aStyleContext, PR_FALSE,
aStyleContext,
getter_AddRefs(innerPseudoStyle));
InitAndRestoreFrame(aPresContext, aState, aContent,
aNewCellOuterFrame, innerPseudoStyle, nsnull, aNewCellInnerFrame);
@ -3155,7 +3154,6 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresShell* aPresShell,
// --------- CREATE AREA OR BOX FRAME -------
nsCOMPtr<nsIStyleContext> styleContext;
aPresContext->ResolveStyleContextFor(aDocElement, aParentStyleContext,
PR_FALSE,
getter_AddRefs(styleContext));
const nsStyleDisplay* display = (const nsStyleDisplay*)
@ -3417,7 +3415,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> viewportPseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(nsnull, nsLayoutAtoms::viewportPseudo,
nsnull, PR_FALSE,
nsnull,
getter_AddRefs(viewportPseudoStyle));
NS_NewViewportFrame(aPresShell, &viewportFrame);
@ -3554,7 +3552,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
// see if the style is overflow: hidden, first on the document element
nsCOMPtr<nsIStyleContext> styleContext;
aPresContext->ResolveStyleContextFor(aDocElement, nsnull, PR_FALSE,
aPresContext->ResolveStyleContextFor(aDocElement, nsnull,
getter_AddRefs(styleContext));
if (styleContext) {
const nsStyleDisplay* display = (const nsStyleDisplay*)
@ -3596,7 +3594,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
}
if (bodyElement) {
nsCOMPtr<nsIStyleContext> bodyContext;
aPresContext->ResolveStyleContextFor(bodyElement, styleContext, PR_FALSE,
aPresContext->ResolveStyleContextFor(bodyElement, styleContext,
getter_AddRefs(bodyContext));
if (bodyContext) {
const nsStyleDisplay* display = (const nsStyleDisplay*)
@ -3626,7 +3624,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
// If paginated, make sure we don't put scrollbars in
if (isPaginated && !printPreviewContext)
aPresContext->ResolvePseudoStyleContextFor(nsnull, rootPseudo,
viewportPseudoStyle, PR_FALSE,
viewportPseudoStyle,
getter_AddRefs(rootPseudoStyle));
else if (isScrollable) {
@ -3638,7 +3636,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> styleContext;
aPresContext->ResolvePseudoStyleContextFor(nsnull,
nsLayoutAtoms::viewportScrollPseudo,
viewportPseudoStyle, PR_FALSE,
viewportPseudoStyle,
getter_AddRefs(styleContext));
@ -3678,7 +3676,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
// If no scrollbars and xul, don't build a scrollframe at all.
if (isXUL) {
aPresContext->ResolvePseudoStyleContextFor(nsnull, rootPseudo,
viewportPseudoStyle, PR_FALSE,
viewportPseudoStyle,
getter_AddRefs(rootPseudoStyle));
} else {
// if HTML the always create a scrollframe so anchors work. That way you can scroll to
@ -3688,7 +3686,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> scrollPseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(nsnull,
nsLayoutAtoms::scrolledContentPseudo,
viewportPseudoStyle, PR_FALSE,
viewportPseudoStyle,
getter_AddRefs(scrollPseudoStyle));
// create scrollframe
@ -3700,7 +3698,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
// resolve a new style for the root frame
aPresContext->ResolvePseudoStyleContextFor(nsnull, rootPseudo,
scrollPseudoStyle, PR_FALSE,
scrollPseudoStyle,
getter_AddRefs(rootPseudoStyle));
// Inform the view manager about the root scrollable view
@ -3754,7 +3752,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> pagePseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(nsnull, nsLayoutAtoms::pagePseudo,
rootPseudoStyle, PR_FALSE,
rootPseudoStyle,
getter_AddRefs(pagePseudoStyle));
pageFrame->Init(aPresContext, nsnull, rootFrame, pagePseudoStyle,
@ -3766,7 +3764,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> pageContentPseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(nsnull, nsLayoutAtoms::pageContentPseudo,
pagePseudoStyle, PR_FALSE,
pagePseudoStyle,
getter_AddRefs(pageContentPseudoStyle));
pageContentFrame->Init(aPresContext, nsnull, pageFrame, pageContentPseudoStyle, nsnull);
@ -3813,7 +3811,7 @@ nsCSSFrameConstructor::CreatePlaceholderFrameFor(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> placeholderStyle;
nsCOMPtr<nsIStyleContext> parentContext =
dont_AddRef(aStyleContext->GetParent());
aPresContext->ResolveStyleContextForNonElement(parentContext, PR_FALSE,
aPresContext->ResolveStyleContextForNonElement(parentContext,
getter_AddRefs(placeholderStyle));
placeholderFrame->Init(aPresContext, aContent, aParentFrame,
placeholderStyle, nsnull);
@ -3897,8 +3895,10 @@ nsCSSFrameConstructor::ConstructRadioControlFrame(nsIPresShell* aPresShel
}
nsCOMPtr<nsIStyleContext> radioStyle;
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::radioPseudo,
aStyleContext, PR_FALSE, getter_AddRefs(radioStyle));
aPresContext->ResolvePseudoStyleContextFor(aContent,
nsHTMLAtoms::radioPseudo,
aStyleContext,
getter_AddRefs(radioStyle));
nsIRadioControlFrame* radio = nsnull;
if (aNewFrame != nsnull && NS_SUCCEEDED(aNewFrame->QueryInterface(NS_GET_IID(nsIRadioControlFrame), (void**)&radio))) {
radio->SetRadioButtonFaceStyleContext(radioStyle);
@ -3927,7 +3927,7 @@ nsCSSFrameConstructor::ConstructCheckboxControlFrame(nsIPresShell* aPresShell
nsCOMPtr<nsIStyleContext> checkboxStyle;
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::checkPseudo,
aStyleContext, PR_FALSE, getter_AddRefs(checkboxStyle));
aStyleContext, getter_AddRefs(checkboxStyle));
nsICheckboxControlFrame* checkbox = nsnull;
if (aNewFrame != nsnull &&
NS_SUCCEEDED(aNewFrame->QueryInterface(NS_GET_IID(nsICheckboxControlFrame), (void**)&checkbox))) {
@ -4100,7 +4100,6 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell,
rv = aPresContext->ResolvePseudoStyleContextFor(aContent,
nsHTMLAtoms::dropDownListPseudo,
aStyleContext,
PR_FALSE,
getter_AddRefs(listStyle));
// Initialize the scroll frame positioned. Note that it is NOT
@ -4228,7 +4227,7 @@ nsCSSFrameConstructor::InitializeSelectFrame(nsIPresShell* aPresShell,
aPresContext->ResolvePseudoStyleContextFor(aContent,
nsLayoutAtoms::scrolledContentPseudo,
aStyleContext, PR_FALSE,
aStyleContext,
getter_AddRefs(scrolledPseudoStyle));
InitAndRestoreFrame(aPresContext, aState, aContent,
@ -4355,7 +4354,7 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsIPresShell* aPresShel
// Resolve style and initialize the frame
nsIStyleContext* styleContext;
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::fieldsetContentPseudo,
aStyleContext, PR_FALSE, &styleContext);
aStyleContext, &styleContext);
InitAndRestoreFrame(aPresContext, aState, aContent,
newFrame, styleContext, nsnull, areaFrame);
@ -5783,7 +5782,7 @@ nsCSSFrameConstructor::BeginBuildingScrollFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> scrollPseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(aContent,
nsLayoutAtoms::scrolledContentPseudo,
contentStyle, PR_FALSE,
contentStyle,
getter_AddRefs(scrollPseudoStyle));
contentStyle = scrollPseudoStyle;
@ -5802,7 +5801,7 @@ nsCSSFrameConstructor::BeginBuildingScrollFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> scrolledPseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(aContent,
aScrolledPseudo,
contentStyle, PR_FALSE,
contentStyle,
getter_AddRefs(scrolledPseudoStyle));
@ -6570,7 +6569,6 @@ nsCSSFrameConstructor::ResolveStyleContext(nsIPresContext* aPresContext,
aParentFrame->GetStyleContext(getter_AddRefs(parentStyleContext));
if (aContent->IsContentOfType(nsIContent::eELEMENT)) {
rv = aPresContext->ResolveStyleContextFor(aContent, parentStyleContext,
PR_FALSE,
aStyleContext);
} else {
#ifdef DEBUG
@ -6583,7 +6581,6 @@ nsCSSFrameConstructor::ResolveStyleContext(nsIPresContext* aPresContext,
}
#endif
rv = aPresContext->ResolveStyleContextForNonElement(parentStyleContext,
PR_FALSE,
aStyleContext);
}
return rv;
@ -6697,7 +6694,7 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> mrowContext;
aPresContext->ResolvePseudoStyleContextFor(aContent,
nsMathMLAtoms::mozMathInline,
parentContext, PR_FALSE,
parentContext,
getter_AddRefs(mrowContext));
InitAndRestoreFrame(aPresContext, aState, aContent, aParentFrame,
mrowContext, nsnull, newFrame);
@ -6709,14 +6706,14 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> blockContext;
aPresContext->ResolvePseudoStyleContextFor(aContent,
nsHTMLAtoms::mozAnonymousBlock,
mrowContext, PR_FALSE,
mrowContext,
getter_AddRefs(blockContext));
InitAndRestoreFrame(aPresContext, aState, aContent, newFrame,
blockContext, nsnull, blockFrame);
// then, create the table frame itself
nsCOMPtr<nsIStyleContext> tableContext;
aPresContext->ResolveStyleContextFor(aContent, blockContext, PR_FALSE,
aPresContext->ResolveStyleContextFor(aContent, blockContext,
getter_AddRefs(tableContext));
nsFrameItems tempItems;
nsIFrame* outerTable;
@ -6997,7 +6994,7 @@ nsCSSFrameConstructor::ConstructPageBreakFrame(nsIPresShell* aPresShe
{
nsCOMPtr<nsIStyleContext> pseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(nsnull, nsLayoutAtoms::pageBreakPseudo,
aStyleContext, PR_FALSE,
aStyleContext,
getter_AddRefs(pseudoStyle));
nsIFrame* pageBreakFrame;
nsresult rv = NS_NewPageBreakFrame(aPresShell, &pageBreakFrame);
@ -9137,7 +9134,7 @@ HasPseudoStyle(nsIPresContext* aPresContext,
if (aContent) {
aPresContext->ProbePseudoStyleContextFor(aContent,
aPseudoElement,
aStyleContext, PR_FALSE,
aStyleContext,
getter_AddRefs(pseudoStyleContext));
}
return pseudoStyleContext != nsnull;
@ -10356,7 +10353,7 @@ nsCSSFrameConstructor::AttributeChanged(nsIPresContext* aPresContext,
if (parentFrame) {
nsCOMPtr<nsIStyleContext> parentContext;
parentFrame->GetStyleContext(getter_AddRefs(parentContext));
aPresContext->ResolveStyleContextFor(aContent, parentContext, PR_FALSE,
aPresContext->ResolveStyleContextFor(aContent, parentContext,
getter_AddRefs(styleContext));
}
}
@ -10405,7 +10402,7 @@ nsCSSFrameConstructor::AttributeChanged(nsIPresContext* aPresContext,
if (parentFrame) {
nsCOMPtr<nsIStyleContext> parentContext;
parentFrame->GetStyleContext(getter_AddRefs(parentContext));
aPresContext->ResolveStyleContextFor(aContent, parentContext, PR_FALSE,
aPresContext->ResolveStyleContextFor(aContent, parentContext,
getter_AddRefs(styleContext));
}
}
@ -10726,7 +10723,7 @@ nsCSSFrameConstructor::ConstructAlternateFrame(nsIPresShell* aPresShell,
nsIStyleContext* textStyleContext;
NS_NewTextFrame(aPresShell, &textFrame);
aPresContext->ResolveStyleContextForNonElement(aStyleContext, PR_FALSE,
aPresContext->ResolveStyleContextForNonElement(aStyleContext,
&textStyleContext);
textFrame->Init(aPresContext, altTextContent, containerFrame,
@ -11283,7 +11280,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> pageContentPseudoStyle;
aPresContext->ResolvePseudoStyleContextFor(nsnull, nsLayoutAtoms::pageContentPseudo,
styleContext, PR_FALSE,
styleContext,
getter_AddRefs(pageContentPseudoStyle));
pageContentFrame->Init(aPresContext, nsnull, newFrame, pageContentPseudoStyle, nsnull);
@ -11885,7 +11882,7 @@ nsCSSFrameConstructor::GetFirstLetterStyle(nsIPresContext* aPresContext,
if (aContent) {
aPresContext->ResolvePseudoStyleContextFor(aContent,
nsHTMLAtoms::firstLetterPseudo,
aStyleContext, PR_FALSE, &fls);
aStyleContext, &fls);
}
return fls;
}
@ -11899,7 +11896,7 @@ nsCSSFrameConstructor::GetFirstLineStyle(nsIPresContext* aPresContext,
if (aContent) {
aPresContext->ResolvePseudoStyleContextFor(aContent,
nsHTMLAtoms::firstLinePseudo,
aStyleContext, PR_FALSE, &fls);
aStyleContext, &fls);
}
return fls;
}
@ -12463,7 +12460,7 @@ nsCSSFrameConstructor::CreateFloatingLetterFrame(
// letter frame and will have the float property set on it; the text
// frame shouldn't have that set).
nsCOMPtr<nsIStyleContext> textSC;
aPresContext->ResolveStyleContextForNonElement(aStyleContext, PR_FALSE,
aPresContext->ResolveStyleContextForNonElement(aStyleContext,
getter_AddRefs(textSC));
InitAndRestoreFrame(aPresContext, aState, aTextContent,
letterFrame, textSC, nsnull, aTextFrame);
@ -12493,7 +12490,7 @@ nsCSSFrameConstructor::CreateFloatingLetterFrame(
if (parentStyleContext) {
nsCOMPtr<nsIStyleContext> newSC;
aPresContext->ResolveStyleContextForNonElement(parentStyleContext,
PR_FALSE, getter_AddRefs(newSC));
getter_AddRefs(newSC));
if (newSC) {
nextTextFrame->SetStyleContext(aPresContext, newSC);
}
@ -12562,7 +12559,7 @@ nsCSSFrameConstructor::CreateLetterFrame(nsIPresShell* aPresShell, nsIPresContex
letterFrame->Init(aPresContext, aTextContent, aParentFrame,
sc, nsnull);
nsCOMPtr<nsIStyleContext> textSC;
aPresContext->ResolveStyleContextForNonElement(sc, PR_FALSE,
aPresContext->ResolveStyleContextForNonElement(sc,
getter_AddRefs(textSC));
InitAndRestoreFrame(aPresContext, aState, aTextContent,
letterFrame, textSC, nsnull, textFrame);
@ -12773,7 +12770,7 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
return NS_OK;
}
nsCOMPtr<nsIStyleContext> newSC;
aPresContext->ResolveStyleContextForNonElement(parentSC, PR_FALSE,
aPresContext->ResolveStyleContextForNonElement(parentSC,
getter_AddRefs(newSC));
if (!newSC) {
return NS_OK;
@ -12873,7 +12870,7 @@ nsCSSFrameConstructor::RemoveFirstLetterFrames(nsIPresContext* aPresContext,
break;
}
nsCOMPtr<nsIStyleContext> newSC;
aPresContext->ResolveStyleContextForNonElement(parentSC, PR_FALSE,
aPresContext->ResolveStyleContextForNonElement(parentSC,
getter_AddRefs(newSC));
if (!newSC) {
break;
@ -13345,7 +13342,7 @@ nsCSSFrameConstructor::ConstructInline(nsIPresShell* aPresShell,
nsCOMPtr<nsIStyleContext> blockSC;
aPresContext->ResolvePseudoStyleContextFor(aContent, blockStyle,
aStyleContext, PR_FALSE,
aStyleContext,
getter_AddRefs(blockSC));
InitAndRestoreFrame(aPresContext, aState, aContent,
@ -13818,7 +13815,6 @@ nsCSSFrameConstructor::SplitToContainingBlock(nsIPresContext* aPresContext,
aPresContext->ResolvePseudoStyleContextFor(content,
nsHTMLAtoms::mozAnonymousBlock,
styleContext,
PR_FALSE,
getter_AddRefs(blockSC));
InitAndRestoreFrame(aPresContext, aState, content,

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

@ -925,7 +925,6 @@ nsTableFrame::CreateAnonymousColGroupFrame(nsIPresContext& aPresContext,
aPresContext.ResolvePseudoStyleContextFor(colGroupContent,
nsHTMLAtoms::tableColGroupPseudo,
mStyleContext,
PR_FALSE,
getter_AddRefs(colGroupStyle));
// Create a col group frame
nsIFrame* newFrame;
@ -1043,7 +1042,7 @@ nsTableFrame::CreateAnonymousColFrames(nsIPresContext& aPresContext,
aColGroupFrame.GetContent(getter_AddRefs(iContent));
aColGroupFrame.GetStyleContext(getter_AddRefs(parentStyleContext));
aPresContext.ResolvePseudoStyleContextFor(iContent, nsHTMLAtoms::tableColPseudo,
parentStyleContext, PR_FALSE, getter_AddRefs(styleContext));
parentStyleContext, getter_AddRefs(styleContext));
}
// ASSERTION to check for bug 54454 sneaking back in...
NS_ASSERTION(iContent, "null content in CreateAnonymousColFrames");

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

@ -731,7 +731,7 @@ nsMathMLContainerFrame::WrapForeignFrames(nsIPresContext* aPresContext)
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIStyleContext> newStyleContext;
aPresContext->ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::mozAnonymousBlock,
mStyleContext, PR_FALSE,
mStyleContext,
getter_AddRefs(newStyleContext));
rv = wrapper->Init(aPresContext, mContent, this, newStyleContext, nsnull);
if (NS_FAILED(rv)) {

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

@ -116,7 +116,7 @@ nsMathMLFrame::ResolveMathMLCharStyle(nsIPresContext* aPresContext,
nsMathMLAtoms::fontstyle_anonymous; // savings
nsCOMPtr<nsIStyleContext> newStyleContext;
nsresult rv = aPresContext->ResolvePseudoStyleContextFor(aContent, fontAtom,
aParentStyleContext, PR_FALSE,
aParentStyleContext,
getter_AddRefs(newStyleContext));
if (NS_SUCCEEDED(rv) && newStyleContext)
aMathMLChar->SetStyleContext(newStyleContext);

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

@ -149,7 +149,7 @@ nsMathMLmactionFrame::Init(nsIPresContext* aPresContext,
aParent->GetStyleContext(getter_AddRefs(parentStyleContext));
nsIStyleContext* newStyleContext;
aPresContext->ResolveStyleContextFor(aContent, parentStyleContext,
PR_FALSE, &newStyleContext);
&newStyleContext);
if (!newStyleContext)
mRestyle.Truncate();
else {

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

@ -3461,11 +3461,11 @@ nsComputedDOMStyle::GetStyleData(nsStyleStructID aID,
if(pctx) {
nsCOMPtr<nsIStyleContext> sctx;
if(!mPseudo) {
pctx->ResolveStyleContextFor(mContent, nsnull, PR_FALSE,
pctx->ResolveStyleContextFor(mContent, nsnull,
getter_AddRefs(sctx));
}
else {
pctx->ResolvePseudoStyleContextFor(mContent, mPseudo, nsnull, PR_FALSE,
pctx->ResolvePseudoStyleContextFor(mContent, mPseudo, nsnull,
getter_AddRefs(sctx));
}
if(sctx) {

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

@ -102,7 +102,6 @@ public:
virtual nsresult ClearStyleData(nsIPresContext* aPresContext, nsIStyleRule* aRule);
virtual void ForceUnique(void);
NS_IMETHOD CalcStyleDifference(nsIStyleContext* aOther, PRInt32& aHint);
#ifdef DEBUG
@ -285,8 +284,7 @@ nsStyleContext::FindChildWithRules(const nsIAtom* aPseudoTag,
if (nsnull != mEmptyChild) {
child = mEmptyChild;
do {
if ((!(child->mBits & NS_STYLE_UNIQUE_CONTEXT)) && // only look at children with un-twiddled data
(aPseudoTag == child->mPseudoTag)) {
if (aPseudoTag == child->mPseudoTag) {
aResult = child;
break;
}
@ -301,9 +299,7 @@ nsStyleContext::FindChildWithRules(const nsIAtom* aPseudoTag,
child = mChild;
do {
if ((!(child->mBits & NS_STYLE_UNIQUE_CONTEXT)) && // only look at children with un-twiddled data
(child->mRuleNode == aRuleNode) &&
(child->mPseudoTag == aPseudoTag)) {
if (child->mRuleNode == aRuleNode && child->mPseudoTag == aPseudoTag) {
aResult = child;
break;
}
@ -607,11 +603,6 @@ nsStyleContext::ClearStyleData(nsIPresContext* aPresContext, nsIStyleRule* aRule
return NS_OK;
}
void nsStyleContext::ForceUnique(void)
{
mBits |= NS_STYLE_UNIQUE_CONTEXT;
}
NS_IMETHODIMP
nsStyleContext::CalcStyleDifference(nsIStyleContext* aOther, PRInt32& aHint)
{

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

@ -125,26 +125,22 @@ public:
virtual nsIStyleContext* ResolveStyleFor(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIStyleContext* aParentContext,
PRBool aForceUnique = PR_FALSE);
nsIStyleContext* aParentContext);
virtual nsIStyleContext* ResolveStyleForNonElement(
nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
PRBool aForceUnique = PR_FALSE);
nsIStyleContext* aParentContext);
virtual nsIStyleContext* ResolvePseudoStyleFor(nsIPresContext* aPresContext,
nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique = PR_FALSE,
nsICSSPseudoComparator* aComparator = nsnull);
virtual nsIStyleContext* ProbePseudoStyleFor(nsIPresContext* aPresContext,
nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique = PR_FALSE);
nsIStyleContext* aParentContext);
NS_IMETHOD Shutdown();
@ -311,8 +307,8 @@ protected:
nsIStyleContext* GetContext(nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
nsIAtom* aPseudoTag,
PRBool aForceUnique);
nsIAtom* aPseudoTag);
#ifdef DEBUG
void List(FILE* out, PRInt32 aIndent, nsISupportsArray* aSheets);
void ListContexts(nsIStyleContext* aRootContext, FILE* out, PRInt32 aIndent);
@ -897,31 +893,24 @@ EnumRulesMatching(nsISupports* aProcessor, void* aData)
*/
nsIStyleContext* StyleSetImpl::GetContext(nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
nsIAtom* aPseudoTag,
PRBool aForceUnique)
nsIAtom* aPseudoTag)
{
nsIStyleContext* result = nsnull;
nsRuleNode* ruleNode = mRuleWalker->GetCurrentNode();
if ((PR_FALSE == aForceUnique) && (nsnull != aParentContext)) {
if (aParentContext)
aParentContext->FindChildWithRules(aPseudoTag, ruleNode, result);
}
if (nsnull == result) {
if (NS_SUCCEEDED(NS_NewStyleContext(&result, aParentContext, aPseudoTag, ruleNode, aPresContext))) {
if (PR_TRUE == aForceUnique)
result->ForceUnique();
}
#ifdef NOISY_DEBUG
if (result)
fprintf(stdout, "--- SharedSC %d ---\n", ++gSharedCount);
else
fprintf(stdout, "+++ NewSC %d +++\n", ++gNewCount);
#endif
}
#ifdef NOISY_DEBUG
else {
fprintf(stdout, "--- SharedSC %d ---\n", ++gSharedCount);
}
#endif
if (!result)
NS_NewStyleContext(&result, aParentContext, aPseudoTag, ruleNode,
aPresContext);
return result;
}
@ -1055,8 +1044,7 @@ void StyleSetImpl::EnsureRuleWalker(nsIPresContext* aPresContext)
nsIStyleContext* StyleSetImpl::ResolveStyleFor(nsIPresContext* aPresContext,
nsIContent* aContent,
nsIStyleContext* aParentContext,
PRBool aForceUnique)
nsIStyleContext* aParentContext)
{
MOZ_TIMER_DEBUGLOG(("Start: StyleSetImpl::ResolveStyleFor(), this=%p\n", this));
STYLESET_START_TIMER(NS_TIMER_STYLE_RESOLUTION);
@ -1079,7 +1067,7 @@ nsIStyleContext* StyleSetImpl::ResolveStyleFor(nsIPresContext* aPresContext,
aPresContext->GetMedium(getter_AddRefs(medium));
RulesMatchingData data(aPresContext, medium, aContent, mRuleWalker);
FileRules(EnumRulesMatching, &data);
result = GetContext(aPresContext, aParentContext, nsnull, aForceUnique);
result = GetContext(aPresContext, aParentContext, nsnull);
// Now reset the walker back to the root of the tree.
mRuleWalker->Reset();
@ -1093,8 +1081,7 @@ nsIStyleContext* StyleSetImpl::ResolveStyleFor(nsIPresContext* aPresContext,
nsIStyleContext* StyleSetImpl::ResolveStyleForNonElement(
nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
PRBool aForceUnique)
nsIStyleContext* aParentContext)
{
MOZ_TIMER_DEBUGLOG(("Start: StyleSetImpl::ResolveStyleForNonElement(), this=%p\n", this));
STYLESET_START_TIMER(NS_TIMER_STYLE_RESOLUTION);
@ -1111,7 +1098,7 @@ nsIStyleContext* StyleSetImpl::ResolveStyleForNonElement(
mOverrideRuleProcessors) {
EnsureRuleWalker(aPresContext);
result = GetContext(aPresContext, aParentContext,
nsHTMLAtoms::mozNonElementPseudo, aForceUnique);
nsHTMLAtoms::mozNonElementPseudo);
NS_ASSERTION(mRuleWalker->AtRoot(), "rule walker must be at root");
}
}
@ -1151,7 +1138,6 @@ nsIStyleContext* StyleSetImpl::ResolvePseudoStyleFor(nsIPresContext* aPresContex
nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique,
nsICSSPseudoComparator* aComparator)
{
MOZ_TIMER_DEBUGLOG(("Start: StyleSetImpl::ResolvePseudoStyleFor(), this=%p\n", this));
@ -1178,7 +1164,7 @@ nsIStyleContext* StyleSetImpl::ResolvePseudoStyleFor(nsIPresContext* aPresContex
aPseudoTag, aComparator, mRuleWalker);
FileRules(EnumPseudoRulesMatching, &data);
result = GetContext(aPresContext, aParentContext, aPseudoTag, aForceUnique);
result = GetContext(aPresContext, aParentContext, aPseudoTag);
// Now reset the walker back to the root of the tree.
mRuleWalker->Reset();
@ -1193,8 +1179,7 @@ nsIStyleContext* StyleSetImpl::ResolvePseudoStyleFor(nsIPresContext* aPresContex
nsIStyleContext* StyleSetImpl::ProbePseudoStyleFor(nsIPresContext* aPresContext,
nsIContent* aParentContent,
nsIAtom* aPseudoTag,
nsIStyleContext* aParentContext,
PRBool aForceUnique)
nsIStyleContext* aParentContext)
{
MOZ_TIMER_DEBUGLOG(("Start: StyleSetImpl::ProbePseudoStyleFor(), this=%p\n", this));
STYLESET_START_TIMER(NS_TIMER_STYLE_RESOLUTION);
@ -1221,7 +1206,7 @@ nsIStyleContext* StyleSetImpl::ProbePseudoStyleFor(nsIPresContext* aPresContext,
FileRules(EnumPseudoRulesMatching, &data);
if (!mRuleWalker->AtRoot())
result = GetContext(aPresContext, aParentContext, aPseudoTag, aForceUnique);
result = GetContext(aPresContext, aParentContext, aPseudoTag);
// Now reset the walker back to the root of the tree.
mRuleWalker->Reset();

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

@ -115,12 +115,8 @@ enum nsStyleStructID {
#define NS_STYLE_INHERIT_MASK 0x00ffffff
// A bit to test whether or not a style context can be shared
// by siblings.
#define NS_STYLE_UNIQUE_CONTEXT 0x01000000
// A bit to test whether or not we have any text decorations.
#define NS_STYLE_HAS_TEXT_DECORATIONS 0x02000000
#define NS_STYLE_HAS_TEXT_DECORATIONS 0x01000000
#define NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(the_sid) \
static const nsStyleStructID GetStyleStructID() {return the_sid;}

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

@ -925,7 +925,6 @@ nsTableFrame::CreateAnonymousColGroupFrame(nsIPresContext& aPresContext,
aPresContext.ResolvePseudoStyleContextFor(colGroupContent,
nsHTMLAtoms::tableColGroupPseudo,
mStyleContext,
PR_FALSE,
getter_AddRefs(colGroupStyle));
// Create a col group frame
nsIFrame* newFrame;
@ -1043,7 +1042,7 @@ nsTableFrame::CreateAnonymousColFrames(nsIPresContext& aPresContext,
aColGroupFrame.GetContent(getter_AddRefs(iContent));
aColGroupFrame.GetStyleContext(getter_AddRefs(parentStyleContext));
aPresContext.ResolvePseudoStyleContextFor(iContent, nsHTMLAtoms::tableColPseudo,
parentStyleContext, PR_FALSE, getter_AddRefs(styleContext));
parentStyleContext, getter_AddRefs(styleContext));
}
// ASSERTION to check for bug 54454 sneaking back in...
NS_ASSERTION(iContent, "null content in CreateAnonymousColFrames");

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

@ -750,7 +750,6 @@ nsListBoxBodyFrame::ComputeIntrinsicWidth(nsBoxLayoutState& aBoxLayoutState)
if (firstRowContent) {
nsCOMPtr<nsIStyleContext> styleContext;
aBoxLayoutState.GetPresContext()->ResolveStyleContextFor(firstRowContent, nsnull,
PR_FALSE,
getter_AddRefs(styleContext));
nscoord width = 0;

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

@ -357,7 +357,7 @@ nsSplitterFrame::Init(nsIPresContext* aPresContext,
aContent->SetAttr(kNameSpaceID_None, nsXULAtoms::orient,
NS_LITERAL_STRING("vertical"), PR_FALSE);
nsCOMPtr<nsIStyleContext> parent = dont_AddRef(aContext->GetParent());
aPresContext->ResolveStyleContextFor(aContent, parent, PR_FALSE,
aPresContext->ResolveStyleContextFor(aContent, parent,
getter_AddRefs(newContext));
aContext = newContext;
}

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

@ -155,8 +155,7 @@ nsTreeStyleCache::GetStyleContext(nsICSSPseudoComparator* aComparator,
if (!*aResult) {
// We missed the cache. Resolve this pseudo-style.
aPresContext->ResolvePseudoStyleWithComparator(aContent, aPseudoElement,
aContext, PR_FALSE,
aComparator,
aContext, aComparator,
aResult); // Addref occurs on *aResult.
// Put it in our table.
if (!mCache)