Bug 928607. Ensure that nsGfxScrollFrameInner::UpdatePosition clips the overflow area of its children. r=tn
authorRobert O'Callahan <robert@ocallahan.org>
Tue, 22 Oct 2013 14:10:31 +0200
changeset 167102 8631813be2e1794868a2cebea9e671824ad72e9f
parent 167101 673ca84a9171f87b22bd736dba7be879583d316e
child 167103 ca5280f3d696c1d519cad78ed39757ee301d5163
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn
bugs928607
milestone27.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 928607. Ensure that nsGfxScrollFrameInner::UpdatePosition clips the overflow area of its children. r=tn
layout/generic/nsFrame.cpp
layout/reftests/bugs/928607-1-ref.html
layout/reftests/bugs/928607-1.html
layout/reftests/bugs/reftest.list
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -5237,18 +5237,18 @@ nsFrame::UpdateOverflow()
 {
   MOZ_ASSERT(!(mState & NS_FRAME_SVG_LAYOUT) ||
              !(mState & NS_FRAME_IS_NONDISPLAY),
              "Non-display SVG do not maintain visual overflow rects");
 
   nsRect rect(nsPoint(0, 0), GetSize());
   nsOverflowAreas overflowAreas(rect, rect);
 
-  bool isBox = IsBoxFrame() || IsBoxWrapped();
-  if (!isBox || (!IsCollapsed() && !DoesClipChildren())) {
+  if (!DoesClipChildren() &&
+      !(IsCollapsed() && (IsBoxFrame() || IsBoxWrapped()))) {
     nsLayoutUtils::UnionChildOverflow(this, overflowAreas);
   }
 
   if (FinishAndStoreOverflow(overflowAreas, GetSize())) {
     nsView* view = GetView();
     if (view) {
       uint32_t flags = 0;
       GetLayoutFlags(flags);
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/928607-1-ref.html
@@ -0,0 +1,8 @@
+<DOCTYPE HTML>
+<html>
+<body>
+<div style="overflow:hidden; border:1px solid black;">
+  <div style="position:relative; left:50px; height:10px; background:blue;"></div>
+</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/928607-1.html
@@ -0,0 +1,15 @@
+<DOCTYPE HTML>
+<html class="reftest-wait">
+<body>
+<div style="overflow:hidden; border:1px solid black;">
+  <div id="d" style="position:relative; left:10px; height:10px; background:blue;"></div>
+</div>
+<script>
+function doTest() {
+  d.style.left = "50px";
+  document.documentElement.removeAttribute("class");
+}
+window.addEventListener("MozReftestInvalidate", doTest);
+</script>
+</body>
+</html>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1770,8 +1770,9 @@ test-pref(layout.css.flexbox.enabled,tru
 == 883987-1f.html 883987-1-ref.html
 == 890495-1.html 890495-1-ref.html
 == 894931-1.html 894931-1-ref.html
 == 897491-1.html 897491-1-ref.html
 == 897491-2.html 897491-2-ref.html
 fuzzy(1,10000) fuzzy-if(Android&&AndroidVersion>=15,5,10000) == 902330-1.html 902330-1-ref.html
 fuzzy-if(Android,8,400) == 906199-1.html 906199-1-ref.html
 == 921716-1.html 921716-1-ref.html
+fuzzy-if(cocoaWidget,1,40) == 928607-1.html 928607-1-ref.html