Bug 452964. Don't flag pseudo-frames wrapping generated content as themselves being generated content, since they might be shared with non-generated content. r+sr=roc.

This commit is contained in:
Boris Zbarsky 2008-10-07 14:53:22 -04:00
parent c0a57d4047
commit 3d3ffffc5e
4 changed files with 49 additions and 0 deletions

View File

@ -3158,6 +3158,9 @@ nsCSSFrameConstructor::GetParentFrame(PRInt32 aNameSpaceID,
aParentFrame = &aParentFrameIn;
aIsPseudoParent = PR_FALSE;
nsFrameState savedStateBits = aState.mAdditionalStateBits;
aState.mAdditionalStateBits &= ~NS_FRAME_GENERATED_CONTENT;
if (nsGkAtoms::tableOuterFrame == aChildFrameType) { // table child
if (IsTableRelated(parentFrameType, PR_TRUE) &&
(nsGkAtoms::tableCaptionFrame != parentFrameType) ) { // need pseudo cell parent
@ -3226,6 +3229,7 @@ nsCSSFrameConstructor::GetParentFrame(PRInt32 aNameSpaceID,
aIsPseudoParent = PR_TRUE;
}
aState.mAdditionalStateBits = savedStateBits;
return rv;
}
@ -3412,10 +3416,13 @@ nsCSSFrameConstructor::AdjustParentFrame(nsFrameConstructorState& aState,
// with a frame based on something other than display.
childIsSpecialContent || // looked it up before
IsSpecialContent(aChildContent, aTag, aNameSpaceID, aChildStyle))) {
nsFrameState savedStateBits = aState.mAdditionalStateBits;
aState.mAdditionalStateBits &= ~NS_FRAME_GENERATED_CONTENT;
nsresult rv = GetPseudoCellFrame(aNameSpaceID, aState, *aParentFrame);
if (NS_FAILED(rv)) {
return rv;
}
aState.mAdditionalStateBits = savedStateBits;
NS_ASSERTION(aState.mPseudoFrames.mCellInner.mFrame,
"Must have inner cell frame now!");

View File

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<style>
div { display: table; }
p { display: table-row; }
span { display: table-cell; }
</style>
</head>
<body>
<div>
<p>
<span>Test</span>
</p>
<p>
<span>Col 1</span>
<span>Col 2</span>
</p>
</div>
</body>
</html>

View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<style>
div::before { content: "Test"; }
div { display: table; }
p { display: table-row; }
span { display: table-cell; }
</style>
</head>
<body>
<div>
<p>
<span>Col 1</span>
<span>Col 2</span>
</p>
</div>
</body>
</html>

View File

@ -917,6 +917,7 @@ fails == 441259-2.html 441259-2-ref.html # bug 441400
# == 449653-1.html 449653-1-ref.html # Disabled for now - it needs privileges
== 450670-1.html 450670-1-ref.html
== 451168-1.html 451168-1-ref.html
== 452964-1.html 452964-1-ref.html
== 454361.html about:blank
== 455280-1.xhtml 455280-1-ref.xhtml
fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") == 456147.xul 456147-ref.html # bug 456147, but not caused by it