Avoid crashing when no frame is found during attribute change notifications
git-svn-id: svn://10.0.0.236/trunk@19696 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -4324,23 +4324,27 @@ HTMLStyleSheetImpl::AttributeChanged(nsIPresContext* aPresContext,
|
||||
RecreateFramesOnAttributeChange(aPresContext, aContent, aAttribute);
|
||||
}
|
||||
else if (PR_TRUE == restyle) {
|
||||
nsIStyleContext* frameContext;
|
||||
frame->GetStyleContext(frameContext);
|
||||
NS_ASSERTION(nsnull != frameContext, "frame must have style context");
|
||||
if (nsnull != frameContext) {
|
||||
nsIStyleContext* parentContext = frameContext->GetParent();
|
||||
frame->ReResolveStyleContext(aPresContext, parentContext);
|
||||
NS_IF_RELEASE(parentContext);
|
||||
NS_RELEASE(frameContext);
|
||||
}
|
||||
if (PR_TRUE == reflow) {
|
||||
StyleChangeReflow(aPresContext, frame, aAttribute);
|
||||
}
|
||||
else if (PR_TRUE == render) {
|
||||
ApplyRenderingChangeToTree(aPresContext, frame);
|
||||
}
|
||||
else { // let the frame deal with it, since we don't know how to
|
||||
frame->AttributeChanged(aPresContext, aContent, aAttribute, aHint);
|
||||
// If there is no frame then there is no point in re-styling it,
|
||||
// is there?
|
||||
if (nsnull != frame) {
|
||||
nsIStyleContext* frameContext;
|
||||
frame->GetStyleContext(frameContext);
|
||||
NS_ASSERTION(nsnull != frameContext, "frame must have style context");
|
||||
if (nsnull != frameContext) {
|
||||
nsIStyleContext* parentContext = frameContext->GetParent();
|
||||
frame->ReResolveStyleContext(aPresContext, parentContext);
|
||||
NS_IF_RELEASE(parentContext);
|
||||
NS_RELEASE(frameContext);
|
||||
}
|
||||
if (PR_TRUE == reflow) {
|
||||
StyleChangeReflow(aPresContext, frame, aAttribute);
|
||||
}
|
||||
else if (PR_TRUE == render) {
|
||||
ApplyRenderingChangeToTree(aPresContext, frame);
|
||||
}
|
||||
else { // let the frame deal with it, since we don't know how to
|
||||
frame->AttributeChanged(aPresContext, aContent, aAttribute, aHint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4324,23 +4324,27 @@ HTMLStyleSheetImpl::AttributeChanged(nsIPresContext* aPresContext,
|
||||
RecreateFramesOnAttributeChange(aPresContext, aContent, aAttribute);
|
||||
}
|
||||
else if (PR_TRUE == restyle) {
|
||||
nsIStyleContext* frameContext;
|
||||
frame->GetStyleContext(frameContext);
|
||||
NS_ASSERTION(nsnull != frameContext, "frame must have style context");
|
||||
if (nsnull != frameContext) {
|
||||
nsIStyleContext* parentContext = frameContext->GetParent();
|
||||
frame->ReResolveStyleContext(aPresContext, parentContext);
|
||||
NS_IF_RELEASE(parentContext);
|
||||
NS_RELEASE(frameContext);
|
||||
}
|
||||
if (PR_TRUE == reflow) {
|
||||
StyleChangeReflow(aPresContext, frame, aAttribute);
|
||||
}
|
||||
else if (PR_TRUE == render) {
|
||||
ApplyRenderingChangeToTree(aPresContext, frame);
|
||||
}
|
||||
else { // let the frame deal with it, since we don't know how to
|
||||
frame->AttributeChanged(aPresContext, aContent, aAttribute, aHint);
|
||||
// If there is no frame then there is no point in re-styling it,
|
||||
// is there?
|
||||
if (nsnull != frame) {
|
||||
nsIStyleContext* frameContext;
|
||||
frame->GetStyleContext(frameContext);
|
||||
NS_ASSERTION(nsnull != frameContext, "frame must have style context");
|
||||
if (nsnull != frameContext) {
|
||||
nsIStyleContext* parentContext = frameContext->GetParent();
|
||||
frame->ReResolveStyleContext(aPresContext, parentContext);
|
||||
NS_IF_RELEASE(parentContext);
|
||||
NS_RELEASE(frameContext);
|
||||
}
|
||||
if (PR_TRUE == reflow) {
|
||||
StyleChangeReflow(aPresContext, frame, aAttribute);
|
||||
}
|
||||
else if (PR_TRUE == render) {
|
||||
ApplyRenderingChangeToTree(aPresContext, frame);
|
||||
}
|
||||
else { // let the frame deal with it, since we don't know how to
|
||||
frame->AttributeChanged(aPresContext, aContent, aAttribute, aHint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4324,23 +4324,27 @@ HTMLStyleSheetImpl::AttributeChanged(nsIPresContext* aPresContext,
|
||||
RecreateFramesOnAttributeChange(aPresContext, aContent, aAttribute);
|
||||
}
|
||||
else if (PR_TRUE == restyle) {
|
||||
nsIStyleContext* frameContext;
|
||||
frame->GetStyleContext(frameContext);
|
||||
NS_ASSERTION(nsnull != frameContext, "frame must have style context");
|
||||
if (nsnull != frameContext) {
|
||||
nsIStyleContext* parentContext = frameContext->GetParent();
|
||||
frame->ReResolveStyleContext(aPresContext, parentContext);
|
||||
NS_IF_RELEASE(parentContext);
|
||||
NS_RELEASE(frameContext);
|
||||
}
|
||||
if (PR_TRUE == reflow) {
|
||||
StyleChangeReflow(aPresContext, frame, aAttribute);
|
||||
}
|
||||
else if (PR_TRUE == render) {
|
||||
ApplyRenderingChangeToTree(aPresContext, frame);
|
||||
}
|
||||
else { // let the frame deal with it, since we don't know how to
|
||||
frame->AttributeChanged(aPresContext, aContent, aAttribute, aHint);
|
||||
// If there is no frame then there is no point in re-styling it,
|
||||
// is there?
|
||||
if (nsnull != frame) {
|
||||
nsIStyleContext* frameContext;
|
||||
frame->GetStyleContext(frameContext);
|
||||
NS_ASSERTION(nsnull != frameContext, "frame must have style context");
|
||||
if (nsnull != frameContext) {
|
||||
nsIStyleContext* parentContext = frameContext->GetParent();
|
||||
frame->ReResolveStyleContext(aPresContext, parentContext);
|
||||
NS_IF_RELEASE(parentContext);
|
||||
NS_RELEASE(frameContext);
|
||||
}
|
||||
if (PR_TRUE == reflow) {
|
||||
StyleChangeReflow(aPresContext, frame, aAttribute);
|
||||
}
|
||||
else if (PR_TRUE == render) {
|
||||
ApplyRenderingChangeToTree(aPresContext, frame);
|
||||
}
|
||||
else { // let the frame deal with it, since we don't know how to
|
||||
frame->AttributeChanged(aPresContext, aContent, aAttribute, aHint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user