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
Родитель 3777952460
Коммит 871cea5bf5
2 изменённых файлов: 16 добавлений и 5 удалений

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

@ -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) {

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

@ -91,6 +91,14 @@ function runTest() {
"Don't ignore elements that span more than half the viewport side");
document.getElementById("top").style.width = "100%";
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();
@ -101,6 +109,7 @@ function runTest() {
});
});
});
});
}
</script>
</pre>