Backout 9786b28d116e & 08b07098228a (bug 701190) for permaorange reftest on Win7; a=romaxa

This commit is contained in:
Ed Morley 2011-11-18 21:59:29 +00:00
Родитель 03ce5a73ad
Коммит d3088c26e4
4 изменённых файлов: 23 добавлений и 30 удалений

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

@ -138,20 +138,22 @@ static bool IsFixedFrame(nsIFrame* aFrame)
return aFrame && aFrame->GetParent() && !aFrame->GetParent()->GetParent();
}
static bool IsFixedItem(nsDisplayItem *aItem, nsDisplayListBuilder* aBuilder)
static bool IsFixedItem(nsDisplayItem *aItem, nsDisplayListBuilder* aBuilder,
bool* aIsFixedBackground)
{
nsIFrame* activeScrolledRoot =
nsLayoutUtils::GetActiveScrolledRootFor(aItem, aBuilder);
nsLayoutUtils::GetActiveScrolledRootFor(aItem, aBuilder, aIsFixedBackground);
return activeScrolledRoot &&
!nsLayoutUtils::ScrolledByViewportScrolling(activeScrolledRoot,
aBuilder);
}
static bool ForceVisiblityForFixedItem(nsDisplayListBuilder* aBuilder,
nsDisplayItem* aItem)
nsDisplayItem* aItem,
bool* aIsFixedBackground)
{
return aBuilder->GetDisplayPort() && aBuilder->GetHasFixedItems() &&
IsFixedItem(aItem, aBuilder);
IsFixedItem(aItem, aBuilder, aIsFixedBackground);
}
void nsDisplayListBuilder::SetDisplayPort(const nsRect& aDisplayPort)
@ -446,18 +448,21 @@ TreatAsOpaque(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder,
return opaque;
}
static nsRect
GetDisplayPortBounds(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem)
static nsRect GetDisplayPortBounds(nsDisplayListBuilder* aBuilder,
nsDisplayItem* aItem,
bool aIgnoreTransform)
{
nsIFrame* frame = aItem->GetUnderlyingFrame();
const nsRect* displayport = aBuilder->GetDisplayPort();
nsRect result = nsLayoutUtils::TransformRectToBoundsInAncestor(
frame,
nsRect(0, 0, displayport->width, displayport->height),
aBuilder->ReferenceFrame());
result.MoveBy(aBuilder->ToReferenceFrame(frame));
return result;
if (aIgnoreTransform) {
return *displayport;
}
return nsLayoutUtils::TransformRectToBoundsInAncestor(
frame,
nsRect(0, 0, displayport->width, displayport->height),
aBuilder->ReferenceFrame());
}
bool
@ -502,8 +507,9 @@ nsDisplayList::ComputeVisibilityForSublist(nsDisplayListBuilder* aBuilder,
nsRect bounds = item->GetBounds(aBuilder);
nsRegion itemVisible;
if (ForceVisiblityForFixedItem(aBuilder, item)) {
itemVisible.And(GetDisplayPortBounds(aBuilder, item), bounds);
bool isFixedBackground;
if (ForceVisiblityForFixedItem(aBuilder, item, &isFixedBackground)) {
itemVisible.And(GetDisplayPortBounds(aBuilder, item, isFixedBackground), bounds);
} else {
itemVisible.And(*aVisibleRegion, bounds);
}
@ -890,8 +896,9 @@ bool nsDisplayItem::RecomputeVisibility(nsDisplayListBuilder* aBuilder,
nsRect bounds = GetBounds(aBuilder);
nsRegion itemVisible;
if (ForceVisiblityForFixedItem(aBuilder, this)) {
itemVisible.And(GetDisplayPortBounds(aBuilder, this), bounds);
bool isFixedBackground;
if (ForceVisiblityForFixedItem(aBuilder, this, &isFixedBackground)) {
itemVisible.And(GetDisplayPortBounds(aBuilder, this, isFixedBackground), bounds);
} else {
itemVisible.And(*aVisibleRegion, bounds);
}

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

@ -97,7 +97,6 @@ skip-if(!browserIsRemote) == test-displayport-bg.html test-displayport-ref.html
# Fixed layers are temporarily disabled (bug 656167).
#== test-pos-fixed.html test-pos-fixed-ref.html
== test-bg-attachment-fixed.html test-bg-attachment-fixed-ref.html
== test-pos-fixed-transform.html test-pos-fixed-transform-ref.html
# reftest syntax: require-or
require-or(unrecognizedCondition,skip) script scripttest-fail.html

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

@ -1,6 +0,0 @@
<!DOCTYPE HTML>
<html reftest-viewport-w="800" reftest-viewport-h="300">
<body>
<div style="position: fixed; background: lightblue; top: 0; left: 0; width:100px; height:100px; -moz-transform: translate(360px,0px);"/>
</body>
</html>

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

@ -1,7 +0,0 @@
<!DOCTYPE HTML>
<html reftest-viewport-w="800" reftest-viewport-h="300"
reftest-displayport-w="800" reftest-displayport-h="300">
<body>
<div style="position: fixed; background: lightblue; top: 0; left: 0; width:100px; height:100px; -moz-transform: translate(360px,0px);"/>
</body>
</html>