Bug 577450. Replicated fixed-pos frames should have the right style. r=roc, a=roc

This commit is contained in:
Boris Zbarsky 2011-01-14 10:34:39 -05:00
Родитель 60e33b5876
Коммит 160107e244
4 изменённых файлов: 40 добавлений и 3 удалений

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

@ -8791,9 +8791,29 @@ nsCSSFrameConstructor::ReplicateFixedFrames(nsPageContentFrame* aParentFrame)
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);
}
}
}

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

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html class="reftest-print">
<body>
<div style="position: fixed; color: green; font-size: 2em">Big green text</div>
<!-- force two pages -->
<div style="height: 3in; width: 2in"></div>
</body>
</html>

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

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html class="reftest-print">
<body style="color: green; font-size: 2em">
<div style="position: fixed">Big green text</div>
<!-- force two pages -->
<div style="height: 3in; width: 2in"></div>
</body>
</html>

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

@ -9,3 +9,4 @@
== 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