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(); 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 = nsIFrame* activeScrolledRoot =
nsLayoutUtils::GetActiveScrolledRootFor(aItem, aBuilder); nsLayoutUtils::GetActiveScrolledRootFor(aItem, aBuilder, aIsFixedBackground);
return activeScrolledRoot && return activeScrolledRoot &&
!nsLayoutUtils::ScrolledByViewportScrolling(activeScrolledRoot, !nsLayoutUtils::ScrolledByViewportScrolling(activeScrolledRoot,
aBuilder); aBuilder);
} }
static bool ForceVisiblityForFixedItem(nsDisplayListBuilder* aBuilder, static bool ForceVisiblityForFixedItem(nsDisplayListBuilder* aBuilder,
nsDisplayItem* aItem) nsDisplayItem* aItem,
bool* aIsFixedBackground)
{ {
return aBuilder->GetDisplayPort() && aBuilder->GetHasFixedItems() && return aBuilder->GetDisplayPort() && aBuilder->GetHasFixedItems() &&
IsFixedItem(aItem, aBuilder); IsFixedItem(aItem, aBuilder, aIsFixedBackground);
} }
void nsDisplayListBuilder::SetDisplayPort(const nsRect& aDisplayPort) void nsDisplayListBuilder::SetDisplayPort(const nsRect& aDisplayPort)
@ -446,18 +448,21 @@ TreatAsOpaque(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder,
return opaque; return opaque;
} }
static nsRect static nsRect GetDisplayPortBounds(nsDisplayListBuilder* aBuilder,
GetDisplayPortBounds(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem) nsDisplayItem* aItem,
bool aIgnoreTransform)
{ {
nsIFrame* frame = aItem->GetUnderlyingFrame(); nsIFrame* frame = aItem->GetUnderlyingFrame();
const nsRect* displayport = aBuilder->GetDisplayPort(); const nsRect* displayport = aBuilder->GetDisplayPort();
nsRect result = nsLayoutUtils::TransformRectToBoundsInAncestor( if (aIgnoreTransform) {
frame, return *displayport;
nsRect(0, 0, displayport->width, displayport->height), }
aBuilder->ReferenceFrame());
result.MoveBy(aBuilder->ToReferenceFrame(frame)); return nsLayoutUtils::TransformRectToBoundsInAncestor(
return result; frame,
nsRect(0, 0, displayport->width, displayport->height),
aBuilder->ReferenceFrame());
} }
bool bool
@ -502,8 +507,9 @@ nsDisplayList::ComputeVisibilityForSublist(nsDisplayListBuilder* aBuilder,
nsRect bounds = item->GetBounds(aBuilder); nsRect bounds = item->GetBounds(aBuilder);
nsRegion itemVisible; nsRegion itemVisible;
if (ForceVisiblityForFixedItem(aBuilder, item)) { bool isFixedBackground;
itemVisible.And(GetDisplayPortBounds(aBuilder, item), bounds); if (ForceVisiblityForFixedItem(aBuilder, item, &isFixedBackground)) {
itemVisible.And(GetDisplayPortBounds(aBuilder, item, isFixedBackground), bounds);
} else { } else {
itemVisible.And(*aVisibleRegion, bounds); itemVisible.And(*aVisibleRegion, bounds);
} }
@ -890,8 +896,9 @@ bool nsDisplayItem::RecomputeVisibility(nsDisplayListBuilder* aBuilder,
nsRect bounds = GetBounds(aBuilder); nsRect bounds = GetBounds(aBuilder);
nsRegion itemVisible; nsRegion itemVisible;
if (ForceVisiblityForFixedItem(aBuilder, this)) { bool isFixedBackground;
itemVisible.And(GetDisplayPortBounds(aBuilder, this), bounds); if (ForceVisiblityForFixedItem(aBuilder, this, &isFixedBackground)) {
itemVisible.And(GetDisplayPortBounds(aBuilder, this, isFixedBackground), bounds);
} else { } else {
itemVisible.And(*aVisibleRegion, bounds); 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). # Fixed layers are temporarily disabled (bug 656167).
#== test-pos-fixed.html test-pos-fixed-ref.html #== test-pos-fixed.html test-pos-fixed-ref.html
== test-bg-attachment-fixed.html test-bg-attachment-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 # reftest syntax: require-or
require-or(unrecognizedCondition,skip) script scripttest-fail.html 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>