Bug 697215. CanScrollWithBitBlit needs to return true for scrollframes inside replaced elements (i.e., iframes) that are honoring border-radius. r=mats
☠☠ backed out by ba2ad6d3d864 ☠ ☠
authorRobert O'Callahan <robert@ocallahan.org>
Sun, 18 Dec 2011 21:47:00 +1300
changeset 82874 026ec6345ae3b84fb4f51a7a32493dff5dd8f9e1
parent 82873 0230dde92166d6f223f89da28c03a9af4842a666
child 82875 06e8ee7aa95df4b108d1854ce0383af8b2cf1336
child 82877 ba2ad6d3d8641ff7ee82e9010fe80bd6af1760bf
push id4163
push userrocallahan@mozilla.com
push dateSun, 18 Dec 2011 08:53:55 +0000
treeherdermozilla-inbound@2674bffd5575 [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
@@ -1636,17 +1636,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:50px'><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;"></iframe>
+<script>
+var f = document.getElementById("f");
+function doTest() {
+  f.contentWindow.scrollTo(0, 60);
+}
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/scrolling/iframe-border-radius.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait">
+<body>
+<iframe src="data:text/html,<body style='font-size:50px'><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;"></iframe>
+<script>
+var f = document.getElementById("f");
+var count = 0;
+function doTest() {
+  ++count;
+  if (count < 4) {
+    f.contentWindow.scrollTo(0, count*20);
+    setTimeout(doTest, 10);
+  }
+  document.documentElement.removeAttribute("class");
+}
+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