Bug 1081272 - Include position and transform when computing header/footer size [r=tn]

This commit is contained in:
Matt Brubeck 2015-11-12 16:55:02 -08:00
parent 33924679b5
commit de3d881423
2 changed files with 16 additions and 5 deletions

View File

@ -3706,7 +3706,9 @@ GetScrollPortSizeExcludingHeadersAndFooters(nsIFrame* aViewportFrame,
for (nsFrameList::Enumerator iterator(fixedFrames); !iterator.AtEnd();
iterator.Next()) {
nsIFrame* f = iterator.get();
nsRect r = f->GetRect().Intersect(aScrollPort);
nsRect r = f->GetRectRelativeToSelf();
r = nsLayoutUtils::TransformFrameRectToAncestor(f, r, aViewportFrame);
r = r.Intersect(aScrollPort);
if ((r.width >= aScrollPort.width / 2 ||
r.width >= NSIntPixelsToAppUnits(800, AppUnitsPerCSSPixel())) &&
r.height <= aScrollPort.height/3) {

View File

@ -91,10 +91,19 @@ function runTest() {
"Don't ignore elements that span more than half the viewport side");
document.getElementById("top").style.width = "100%";
// Scroll back up so test results are visible
document.documentElement.scrollTop = 0;
SimpleTest.finish();
window.close();
document.getElementById("top").style.top = "-40px";
document.getElementById("top").style.transform = "translateY(38px)";
scrollDownOnePageWithContinuation(function() {
is(document.documentElement.scrollTop,
fullPageScrollDown - (10 + 13 - 40 + 38),
"Account for offset and transform");
document.getElementById("top").style.width = "100%";
// Scroll back up so test results are visible
document.documentElement.scrollTop = 0;
SimpleTest.finish();
window.close();
});
});
});
});