mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 13:56:29 +00:00
Bug 1293125 - Work around a layout issue that causes StickyScrollContainer::GetScrollRanges() to compute malformed rects. r=mstange
MozReview-Commit-ID: IClxdc8tfBh --HG-- extra : rebase_source : 1be980c68b93244b1cf910335f3693c682c2ba22
This commit is contained in:
parent
b5f53ace1c
commit
4df075436c
@ -283,7 +283,16 @@ StickyScrollContainer::GetScrollRanges(nsIFrame* aFrame, nsRect* aOuter,
|
||||
aOuter->SetRect(nscoord_MIN/2, nscoord_MIN/2, nscoord_MAX, nscoord_MAX);
|
||||
aInner->SetRect(nscoord_MIN/2, nscoord_MIN/2, nscoord_MAX, nscoord_MAX);
|
||||
|
||||
const nsPoint normalPosition = firstCont->GetNormalPosition();
|
||||
// Due to margin collapsing, |firstCont->GetNormalPosition()| can sometimes
|
||||
// fall outside of |contain|. (This is because GetNormalPosition() returns
|
||||
// the actual position after margin collapsing, while|contain| is
|
||||
// calculated based on the frame's GetUsedMargin() which is pre-collapsing.)
|
||||
// This can cause |aInner|, as computed below, to not be contained inside
|
||||
// |aOuter|, which confuses the code that consumes these values.
|
||||
// This is hard to fix properly (TODO), but clamping |normalPosition| to
|
||||
// |contain| works around it.
|
||||
const nsPoint normalPosition =
|
||||
contain.ClampPoint(firstCont->GetNormalPosition());
|
||||
|
||||
// Bottom and top
|
||||
if (stick.YMost() != nscoord_MAX/2) {
|
||||
|
@ -25,6 +25,7 @@ skip-if(!asyncPan) == split-layers-1.html split-layers-1-ref.html
|
||||
skip-if(!asyncPan) == split-layers-multi-scrolling-1.html split-layers-multi-scrolling-1-ref.html
|
||||
fuzzy-if(skiaContent,2,240000) fuzzy-if(browserIsRemote&&!skiaContent&&(cocoaWidget||winWidget),1,240000) skip-if(!asyncPan) == split-opacity-layers-1.html split-opacity-layers-1-ref.html
|
||||
skip-if(!asyncPan) == sticky-pos-scrollable-1.html sticky-pos-scrollable-1-ref.html
|
||||
skip-if(!asyncPan) == sticky-pos-scrollable-2.html sticky-pos-scrollable-2-ref.html
|
||||
skip-if(!asyncPan) == fixed-pos-scrollable-1.html fixed-pos-scrollable-1-ref.html
|
||||
skip-if(!asyncPan) == culling-1.html culling-1-ref.html
|
||||
skip-if(!asyncPan) == position-fixed-iframe-1.html position-fixed-iframe-1-ref.html
|
||||
|
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
height: 4000px;
|
||||
overflow: hidden;
|
||||
}
|
||||
div {
|
||||
background: blue;
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
margin-top: 300px;
|
||||
position: sticky;
|
||||
bottom: 100px;
|
||||
}
|
||||
</style>
|
||||
<div></div>
|
21
layout/reftests/async-scrolling/sticky-pos-scrollable-2.html
Normal file
21
layout/reftests/async-scrolling/sticky-pos-scrollable-2.html
Normal file
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html reftest-async-scroll
|
||||
reftest-displayport-x="0" reftest-displayport-y="0"
|
||||
reftest-displayport-w="800" reftest-displayport-h="2000"
|
||||
reftest-async-scroll-x="0" reftest-async-scroll-y="100">
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
height: 4000px;
|
||||
overflow: hidden;
|
||||
}
|
||||
div {
|
||||
background: blue;
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
margin-top: 400px;
|
||||
position: sticky;
|
||||
bottom: 100px;
|
||||
}
|
||||
</style>
|
||||
<div></div>
|
Loading…
x
Reference in New Issue
Block a user