# HG changeset patch # User Boris Zbarsky # Date 1291349211 18000 # Node ID d2dacc665a648a517e956336594a5aedad1f946a # Parent 5e6ec9272354d509740538e5039ca76defdf3e54 Bug 577450. Replicated fixed-pos frames should have the right style. r=roc diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -8788,19 +8788,39 @@ nsCSSFrameConstructor::ReplicateFixedFra // Iterate across fixed frames and replicate each whose placeholder is a // descendant of aFrame. (We don't want to explicitly copy placeholders that // are within fixed frames, because that would cause duplicates on the new // page - bug 389619) for (nsIFrame* fixed = firstFixed; fixed; fixed = fixed->GetNextSibling()) { nsIFrame* prevPlaceholder = mPresShell->FrameManager()->GetPlaceholderFrameFor(fixed); if (prevPlaceholder && nsLayoutUtils::IsProperAncestorFrame(prevCanvasFrame, prevPlaceholder)) { - nsresult rv = ConstructFrame(state, fixed->GetContent(), - canvasFrame, fixedPlaceholders); - NS_ENSURE_SUCCESS(rv, rv); + // We want to use the same style as the primary style frame for + // our content + nsIContent* content = fixed->GetContent(); + nsStyleContext* styleContext = + nsLayoutUtils::GetStyleFrame(content->GetPrimaryFrame())-> + GetStyleContext(); + FrameConstructionItemList items; + AddFrameConstructionItemsInternal(state, content, canvasFrame, + content->Tag(), + content->GetNameSpaceID(), + PR_TRUE, + styleContext, + ITEM_ALLOW_XBL_BASE | + ITEM_ALLOW_PAGE_BREAK, + items); + for (FCItemIterator iter(items); !iter.IsDone(); iter.Next()) { + NS_ASSERTION(iter.item().DesiredParentType() == + GetParentType(canvasFrame), + "This is not going to work"); + nsresult rv = + ConstructFramesFromItem(state, iter, canvasFrame, fixedPlaceholders); + NS_ENSURE_SUCCESS(rv, rv); + } } } // Add the placeholders to our primary child list. // XXXbz this is a little screwed up, since the fixed frames will have // broken auto-positioning. Oh, well. NS_ASSERTION(!canvasFrame->GetFirstChild(nsnull), "leaking frames; doc root continuation must be empty"); diff --git a/layout/reftests/printing/577450-1-ref.html b/layout/reftests/printing/577450-1-ref.html new file mode 100644 --- /dev/null +++ b/layout/reftests/printing/577450-1-ref.html @@ -0,0 +1,8 @@ + + + +
Big green text
+ +
+ + diff --git a/layout/reftests/printing/577450-1.html b/layout/reftests/printing/577450-1.html new file mode 100644 --- /dev/null +++ b/layout/reftests/printing/577450-1.html @@ -0,0 +1,8 @@ + + + +
Big green text
+ +
+ + diff --git a/layout/reftests/printing/reftest.list b/layout/reftests/printing/reftest.list --- a/layout/reftests/printing/reftest.list +++ b/layout/reftests/printing/reftest.list @@ -4,11 +4,12 @@ # Bugs == 272830-1.html 272830-1-ref.html == 318022-1.html 318022-1-ref.html == 403669-1.html 403669-1-ref.html == 381497-n.html 381497-f.html == test-async-print.html 272830-1-ref.html == 129941-1a.html 129941-1-ref.html == 129941-1b.html 129941-1-ref.html +== 577450-1.html 577450-1-ref.html == 609227-1.html 609227-1-ref.html == 609227-2a.html 609227-2-ref.html == 609227-2b.html 609227-2-ref.html