зеркало из https://github.com/mozilla/pjs.git
Backout 9786b28d116e & 08b07098228a (bug 701190) for permaorange reftest on Win7; a=romaxa
This commit is contained in:
Родитель
03ce5a73ad
Коммит
d3088c26e4
|
@ -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) {
|
||||||
|
return *displayport;
|
||||||
|
}
|
||||||
|
|
||||||
|
return nsLayoutUtils::TransformRectToBoundsInAncestor(
|
||||||
frame,
|
frame,
|
||||||
nsRect(0, 0, displayport->width, displayport->height),
|
nsRect(0, 0, displayport->width, displayport->height),
|
||||||
aBuilder->ReferenceFrame());
|
aBuilder->ReferenceFrame());
|
||||||
result.MoveBy(aBuilder->ToReferenceFrame(frame));
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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>
|
|
Загрузка…
Ссылка в новой задаче