Change the way we determine the style context parent frame to skip css anon boxes unless we're determining the style context parent for something that is itself a css anon box (and is not a non-element frame). Fixes bug 323656 (which is where the patch is), bug 85872, bug 280610. As far as I can tell,also fixes bug 317876, bug 372376, bug 374297. r+sr=dbaron, a=dveditz

git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@224918 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2007-04-24 02:28:08 +00:00
parent 3aa3bba85d
commit 59d2dd7867
4 changed files with 95 additions and 53 deletions

View File

@@ -6960,17 +6960,12 @@ already_AddRefed<nsStyleContext>
nsCSSFrameConstructor::ResolveStyleContext(nsIFrame* aParentFrame,
nsIContent* aContent)
{
aParentFrame = nsFrame::CorrectStyleParentFrame(aParentFrame, nsnull);
// Resolve the style context based on the content object and the parent
// style context
nsStyleContext* parentStyleContext = aParentFrame->GetStyleContext();
// skip past any parents that are scrolled-content. We want to inherit directly
// from the outer scroll frame.
while (parentStyleContext && parentStyleContext->GetPseudoType() ==
nsCSSAnonBoxes::scrolledContent) {
parentStyleContext = parentStyleContext->GetParent();
}
nsStyleSet *styleSet = mPresShell->StyleSet();
if (aContent->IsContentOfType(nsIContent::eELEMENT)) {
@@ -12191,7 +12186,10 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState,
// XXXbz ideally, this would do all the pushing of various
// containing blocks as needed, so callers don't have to do it...
nsresult rv = NS_OK;
nsStyleContext* styleContext = aFrame->GetStyleContext();
// :before/:after content should have the same style context parent
// as normal kids.
nsStyleContext* styleContext =
nsFrame::CorrectStyleParentFrame(aFrame, nsnull)->GetStyleContext();
if (aCanHaveGeneratedContent) {
// Probe for generated content before