Bug 1096181. Recompute overflow areas of transformed elements when a parent element with perspective is scrolled. r=mattwoodrow
authorRobert O'Callahan <robert@ocallahan.org>
Wed, 12 Nov 2014 18:08:27 +1300
changeset 215348 9906eabbfd3a86c9cfb6882d770ff28a0a8b55b9
parent 215347 d6b57648a956d811e093c1846ae4a4992ad91004
child 215349 2999f246a4e293455cc8fa32f7f1ee279a2c51c1
push id27813
push userkwierso@gmail.com
push dateThu, 13 Nov 2014 01:03:17 +0000
treeherdermozilla-central@64f1fb1e2f38 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1096181
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1096181. Recompute overflow areas of transformed elements when a parent element with perspective is scrolled. r=mattwoodrow
layout/generic/nsGfxScrollFrame.cpp
layout/reftests/bugs/reftest.list
layout/reftests/pixel-rounding/reftest.list
layout/reftests/transform-3d/reftest.list
layout/reftests/transform-3d/scroll-perspective-1-ref.html
layout/reftests/transform-3d/scroll-perspective-1.html
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -2429,16 +2429,22 @@ ScrollFrameHelper::ScrollToImpl(nsPoint 
   mScrolledFrame->SetPosition(mScrollPort.TopLeft() - pt);
   mLastScrollOrigin = aOrigin;
   mLastSmoothScrollOrigin = nullptr;
   mScrollGeneration = ++sScrollGenerationCounter;
 
   // We pass in the amount to move visually
   ScrollVisual(oldScrollFramePos);
 
+  if (mOuter->ChildrenHavePerspective()) {
+    // The overflow areas of descendants may depend on the scroll position,
+    // so ensure they get updated.
+    mOuter->RecomputePerspectiveChildrenOverflow(mOuter->StyleContext(), nullptr);
+  }
+
   ScheduleSyntheticMouseMove();
   nsWeakFrame weakFrame(mOuter);
   UpdateScrollbarPosition();
   if (!weakFrame.IsAlive()) {
     return;
   }
   PostScrollEvent();
 
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -519,17 +519,17 @@ random-if(cocoaWidget) == 350506-1.html 
 == 352980-3d.html 352980-3-ref.html
 == 352980-3e.html 352980-3-ref.html
 == 352980-3f.html 352980-3-ref.html
 == 355548-1.xml 355548-1-ref.xml
 == 355548-2.xml 355548-2-ref.xml
 == 355548-3.xml 355548-3-ref.xml
 == 355548-4.xml 355548-4-ref.xml
 == 355548-5.xml 355548-5-ref.xml
-fails-if(cocoaWidget) == 356774-1.html 356774-1-ref.html # probably bug 379317
+== 356774-1.html 356774-1-ref.html
 == 356775-1.html 356775-1-ref.html
 == 359869-1.html 359869-1-ref.html
 skip-if(B2G) == 359903-1.html 359903-1-ref.html
 == 359903-2.html 359903-2-ref.html
 == 360065-1.html 360065-1-ref.html
 == 360746-1.html 360746-1-ref.html
 == 360757-1a.html 360757-1-ref.html
 == 360757-1b.html 360757-1-ref.html
--- a/layout/reftests/pixel-rounding/reftest.list
+++ b/layout/reftests/pixel-rounding/reftest.list
@@ -162,17 +162,17 @@ fails == collapsed-border-top-6.html bor
 == rounded-background-color-left-width-6.html rounded-background-color-width-6.html
 == rounded-background-color-height-top-4.html rounded-background-color-height-4.html
 == rounded-background-color-height-top-5.html rounded-background-color-height-5.html
 == rounded-background-color-height-top-6.html rounded-background-color-height-6.html
 == rounded-background-color-width-left-4.html rounded-background-color-width-4.html
 == rounded-background-color-width-left-5.html rounded-background-color-width-5.html
 == rounded-background-color-width-left-6.html rounded-background-color-width-6.html
 
-skip-if(B2G) fails-if(cocoaWidget) == background-image-tiling.html background-image-tiling-ref.html # probably bug 379317 # bug 773482
+skip-if(B2G) == background-image-tiling.html background-image-tiling-ref.html # bug 773482
 
 != border-image-width-0.html border-image-width-10.html
 skip-if(B2G) random-if(Android) == border-image-width-4.html border-image-width-0.html # bug 661996 # bug 773482
 skip-if(B2G) random-if(Android) == border-image-width-9.html border-image-width-0.html # bug 661996 # bug 773482
 
 == iframe-1.html iframe-1-ref.html
 
 == viewport-units-rounding-1.html viewport-units-rounding-1-ref.html
--- a/layout/reftests/transform-3d/reftest.list
+++ b/layout/reftests/transform-3d/reftest.list
@@ -49,8 +49,9 @@ random-if(Android&&!browserIsRemote) == 
 == sorting-2b.html sorting-2-ref.html
 == sorting-3a.html green-rect.html
 # Different, but equivalent (for the given transform) transform origins
 == rotatex-transformorigin-1a.html rotatex-transformorigin-1-ref.html
 == overflow-hidden-1a.html overflow-hidden-1-ref.html
 == transform-style-flat-1a.html transform-style-flat-1-ref.html
 pref(layout.css.will-change.enabled,true) == willchange-containing-block.html?willchange willchange-containing-block.html?ref
 pref(layout.css.will-change.enabled,true) != willchange-containing-block.html?willchange willchange-containing-block.html?noblock
+== scroll-perspective-1.html scroll-perspective-1-ref.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/transform-3d/scroll-perspective-1-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+<div id="s" style="perspective:300px; width: 500px; height:500px; position:relative; overflow:scroll">
+  <div id="t" style="position:absolute; top:3000px; transform-style:preserve-3d; transform:translateZ(20px); background:yellow; width:300px; height:0"></div>
+  <div style="height:4000px"></div>
+</div>
+<script>
+s.scrollTop = 3000;
+var tr = t.getBoundingClientRect();
+t.style.height = "300px";
+</script>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/transform-3d/scroll-perspective-1.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+<div id="s" style="perspective:300px; width: 500px; height:500px; position:relative; overflow:scroll">
+  <div style="position:absolute; top:3000px; transform-style:preserve-3d; transform:translateZ(20px); background:yellow; width:300px; height:300px;"></div>
+  <div style="height:4000px"></div>
+</div>
+<script>
+s.scrollTop = 3000;
+</script>