Bug 28837

Summary: Compositing layer sizes do not take inner reflections into account
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Layout and RenderingAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: eric
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
Testcase
none
Patch, testcase, changelog mitz: review+

Description Simon Fraser (smfr) 2009-08-30 22:37:59 PDT
Created attachment 38799 [details]
Testcase

When elements inside a compositing layer are reflected, the compositing layer is not make large enough to show the entire reflection. See attached testcase.
Comment 1 Simon Fraser (smfr) 2009-08-30 22:41:16 PDT
Patch:
diff --git a/WebCore/rendering/RenderLayerCompositor.cpp b/WebCore/rendering/RenderLayerCompositor.cpp
index 517735e..5eb25cb 100644
--- a/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/WebCore/rendering/RenderLayerCompositor.cpp
@@ -291,6 +291,13 @@ IntRect RenderLayerCompositor::calculateCompositedBounds(const RenderLayer* laye
         return boundingBoxRect;
     }
 
+    if (RenderLayer* reflection = layer->reflectionLayer()) {
+        if (!reflection->isComposited()) {
+            IntRect childUnionBounds = calculateCompositedBounds(reflection, layer);
+            unionBounds.unite(childUnionBounds);
+        }
+    }
+
     ASSERT(layer->isStackingContext() || (!layer->m_posZOrderList || layer->m_posZOrderList->size() == 0));
 
     if (Vector<RenderLayer*>* negZOrderList = layer->negZOrderList()) {
Comment 2 Simon Fraser (smfr) 2009-08-31 12:11:55 PDT
Created attachment 38828 [details]
Patch, testcase, changelog
Comment 3 mitz 2009-08-31 13:44:14 PDT
Comment on attachment 38828 [details]
Patch, testcase, changelog

> +</html>
> \ No newline at end of file

Please add a newline.
Comment 4 Simon Fraser (smfr) 2009-08-31 14:00:34 PDT
http://trac.webkit.org/changeset/47905
Comment 5 Eric Seidel (no email) 2009-09-01 02:58:16 PDT
Looks landed.
Comment 6 Eric Seidel (no email) 2009-09-01 02:59:05 PDT
/me makes comments under his breath about tools like "bugzilla-tool" being able to update and close bugs after landing. :)

bugzilla-tool land-diff 28837

in this instance. :)