[iOS WK2] Compositing layers in iframes are misplaced
https://bugs.webkit.org/show_bug.cgi?id=132554
<rdar://problem/16203027>

Reviewed by Benjamin Poulain.

Have requiresScrollLayer() only consider frameView.delegatesScrolling()
for the main frame, so that iframes get scroll layers (even though they
will never scroll), so that the rest of geometry code works as on other
platforms.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresScrollLayer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 7ef0d07..a14a57e 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2014-05-04  Simon Fraser  <simon.fraser@apple.com>
+
+        [iOS WK2] Compositing layers in iframes are misplaced
+        https://bugs.webkit.org/show_bug.cgi?id=132554
+        <rdar://problem/16203027>
+
+        Reviewed by Benjamin Poulain.
+
+        Have requiresScrollLayer() only consider frameView.delegatesScrolling()
+        for the main frame, so that iframes get scroll layers (even though they
+        will never scroll), so that the rest of geometry code works as on other
+        platforms.
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::requiresScrollLayer):
+
 2014-05-04  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
         Use std::unique_ptr in m_taskTimer of Notification class
diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp
index b3d5a5f..4160472 100644
--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp
@@ -2661,8 +2661,10 @@
 
 bool RenderLayerCompositor::requiresScrollLayer(RootLayerAttachment attachment) const
 {
+    FrameView& frameView = m_renderView.frameView();
+
     // This applies when the application UI handles scrolling, in which case RenderLayerCompositor doesn't need to manage it.
-    if (m_renderView.frameView().delegatesScrolling())
+    if (frameView.delegatesScrolling() && frameView.frame().isMainFrame())
         return false;
 
     // We need to handle our own scrolling if we're: