Bug 697215. CanScrollWithBitBlit needs to return true for scrollframes inside replaced elements (i.e., iframes) that are honoring border-radius. r=mats
authorRobert O'Callahan <robert@ocallahan.org>
Tue, 20 Dec 2011 14:31:20 +1300
changeset 83147 8b83a0ecb986baf0be44a4f4110393d54c27d586
parent 83146 3e861cc550d4454926fb6016a3e1aa08720e08a1
child 83148 2675a1cc6792337286127bef6f736091c91b3132
push id21738
push userbmo@edmorley.co.uk
push dateWed, 21 Dec 2011 12:12:10 +0000
treeherdermozilla-central@d6b976e83811 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs697215
milestone11.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 697215. CanScrollWithBitBlit needs to return true for scrollframes inside replaced elements (i.e., iframes) that are honoring border-radius. r=mats
layout/generic/nsGfxScrollFrame.cpp
layout/reftests/scrolling/iframe-border-radius-ref.html
layout/reftests/scrolling/iframe-border-radius.html
layout/reftests/scrolling/reftest.list
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -1633,17 +1633,18 @@ CanScrollWithBlitting(nsIFrame* aFrame)
 
   for (nsIFrame* f = aFrame; f;
        f = nsLayoutUtils::GetCrossDocParentFrame(f)) {
     if (nsSVGIntegrationUtils::UsingEffectsForFrame(f) ||
         f->IsFrameOfType(nsIFrame::eSVG)) {
       return false;
     }
     nsIScrollableFrame* sf = do_QueryFrame(f);
-    if (sf && nsLayoutUtils::HasNonZeroCorner(f->GetStyleBorder()->mBorderRadius))
+    if ((sf || f->IsFrameOfType(nsIFrame::eReplaced)) &&
+        nsLayoutUtils::HasNonZeroCorner(f->GetStyleBorder()->mBorderRadius))
       return false;
     if (nsLayoutUtils::IsPopup(f))
       break;
   }
   return true;
 }
 
 static void
new file mode 100644
--- /dev/null
+++ b/layout/reftests/scrolling/iframe-border-radius-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<html>
+<body onload="doTest()">
+<iframe src="data:text/html,<body style='font-size:100px; overflow:hidden'><p>Hello<p>Kitty<p>Hello<p>Kitty<p>Hello<p>Kitty<p>Hello<p>Kitty<p>Hello<p>Kitty<p>Hello<p>Kitty"
+        id="f" style="width:500px; height:500px; border-radius:100px; border:none;"></iframe>
+<script>
+var f = document.getElementById("f");
+function doTest() {
+  f.contentWindow.scrollTo(0, 80);
+}
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/scrolling/iframe-border-radius.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait">
+<body>
+<iframe src="data:text/html,<body style='font-size:100px; overflow:hidden'><p>Hello<p>Kitty<p>Hello<p>Kitty<p>Hello<p>Kitty<p>Hello<p>Kitty<p>Hello<p>Kitty<p>Hello<p>Kitty"
+        id="f" style="width:500px; height:500px; border-radius:100px; border:none;"></iframe>
+<script>
+var f = document.getElementById("f");
+var count = 0;
+function doTest() {
+  ++count;
+  f.contentWindow.scrollTo(0, count*20);
+  if (count == 4) {
+    document.documentElement.removeAttribute("class");
+  } else {
+    setTimeout(doTest, 20);
+  }
+}
+document.addEventListener("MozReftestInvalidate", doTest, false);
+</script>
+</body>
+</html>
--- a/layout/reftests/scrolling/reftest.list
+++ b/layout/reftests/scrolling/reftest.list
@@ -1,13 +1,14 @@
 HTTP == fixed-1.html fixed-1.html?ref
 HTTP == fixed-opacity-1.html fixed-opacity-1.html?ref
 HTTP == fixed-opacity-2.html fixed-opacity-2.html?ref
 HTTP == fixed-text-1.html fixed-text-1.html?ref
 HTTP == fixed-text-2.html fixed-text-2.html?ref
+== iframe-border-radius.html iframe-border-radius-ref.html
 HTTP == opacity-mixed-scrolling-1.html opacity-mixed-scrolling-1.html?ref
 random-if(cocoaWidget) HTTP == opacity-mixed-scrolling-2.html opacity-mixed-scrolling-2.html?ref # see bug 625357
 HTTP == simple-1.html simple-1.html?ref
 HTTP == text-1.html text-1.html?ref
 HTTP == transformed-1.html transformed-1.html?ref
 HTTP == transformed-1.html?up transformed-1.html?ref
 == uncovering-1.html uncovering-1-ref.html
 == uncovering-2.html uncovering-2-ref.html