Changeset 57919 in webkit
- Timestamp:
- Apr 20, 2010 2:24:10 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r57916 r57919 13 13 14 14 * platform/chromium/test_expectations.txt: 15 16 2010-04-20 Simon Fraser <simon.fraser@apple.com> 17 18 Reviewed by Dan Bernstein. 19 20 Hook compositing layers together across iframes 21 https://bugs.webkit.org/show_bug.cgi?id=37878 22 23 Testcase that has a composited iframe, and dumps the layer tree of the parent document 24 to ensure that it also became composited. 25 26 * compositing/iframes/composited-iframe-expected.txt: Added. 27 * compositing/iframes/composited-iframe.html: Added. 28 * compositing/iframes/resources/composited-subframe.html: Added. 15 29 16 30 2010-04-20 Simon Fraser <simon.fraser@apple.com> -
trunk/WebCore/ChangeLog
r57913 r57919 1 2010-04-20 Simon Fraser <simon.fraser@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Hook compositing layers together across iframes 6 https://bugs.webkit.org/show_bug.cgi?id=37878 7 8 First step: if an iframe's document goes into compositing mode, also throw the parent 9 document into compositing mode (all the way up to the root). This is required both 10 to preserve layering (since parent document content can obscure iframe content), 11 and so that we can eventually hook the layer trees together. 12 13 Test: compositing/iframes/composited-iframe.html 14 15 * rendering/RenderIFrame.h: 16 * rendering/RenderIFrame.cpp: 17 (WebCore::RenderIFrame::requiresLayer): In order to make an iframe composited, it also has to have 18 a RenderLayer, so must return |true| from requiresLayer(). 19 (WebCore::RenderIFrame::requiresAcceleratedCompositing): Returns true if the content document 20 is in compositing mode. 21 (WebCore::RenderIFrame::isRenderIFrame): Required so that RenderLayerCompositor can check 22 if a renderer is an iframe. 23 (WebCore::toRenderIFrame): Required so that RenderLayerCompositor can cast to a RenderIFrame. 24 25 * rendering/RenderLayerCompositor.h: 26 * rendering/RenderLayerCompositor.cpp: 27 (WebCore::RenderLayerCompositor::enableCompositingMode): Call out to the RenderView when 28 the compositing mode changes, so that the parent document can update its compositing status. 29 (WebCore::RenderLayerCompositor::requiresCompositingLayer): Call requiresCompositingForIFrame(). 30 (WebCore::RenderLayerCompositor::requiresCompositingForIFrame): Check to see if the iframe 31 wants to be composited. 32 33 * rendering/RenderObject.h: 34 (WebCore::RenderObject::isRenderIFrame): Base class returns false. 35 36 * rendering/RenderView.h: 37 * rendering/RenderView.cpp: 38 (WebCore::RenderView::compositingStateChanged): New method that allows an iframe to notify 39 its parent document that a recalcStyle is required, to update compositing state. 40 1 41 2010-04-20 Gavin Barraclough <barraclough@apple.com> 2 42 -
trunk/WebCore/rendering/RenderIFrame.cpp
r57866 r57919 119 119 } 120 120 121 #if USE(ACCELERATED_COMPOSITING) 122 bool RenderIFrame::requiresLayer() const 123 { 124 if (RenderPart::requiresLayer()) 125 return true; 126 127 return requiresAcceleratedCompositing(); 121 128 } 129 130 bool RenderIFrame::requiresAcceleratedCompositing() const 131 { 132 if (!node() || !node()->hasTagName(iframeTag)) 133 return false; 134 135 // If the contents of the iframe are composited, then we have to be as well. 136 HTMLIFrameElement* element = static_cast<HTMLIFrameElement*>(node()); 137 if (Document* contentDocument = element->contentDocument()) { 138 if (RenderView* view = contentDocument->renderView()) 139 return view->usesCompositing(); 140 } 141 142 return false; 143 } 144 #endif 145 146 } -
trunk/WebCore/rendering/RenderIFrame.h
r57866 r57919 35 35 RenderIFrame(Element*); 36 36 37 #if USE(ACCELERATED_COMPOSITING) 38 bool requiresAcceleratedCompositing() const; 39 #endif 40 37 41 private: 38 42 virtual void calcHeight(); … … 40 44 41 45 virtual void layout(); 46 47 #if USE(ACCELERATED_COMPOSITING) 48 virtual bool requiresLayer() const; 49 #endif 50 virtual bool isRenderIFrame() const { return true; } 42 51 43 52 virtual const char* renderName() const { return "RenderPartObject"; } // Lying for now to avoid breaking tests … … 47 56 }; 48 57 58 inline RenderIFrame* toRenderIFrame(RenderObject* object) 59 { 60 ASSERT(!object || object->isRenderIFrame()); 61 return static_cast<RenderIFrame*>(object); 62 } 63 64 inline const RenderIFrame* toRenderIFrame(const RenderObject* object) 65 { 66 ASSERT(!object || object->isRenderIFrame()); 67 return static_cast<const RenderIFrame*>(object); 68 } 69 70 // This will catch anyone doing an unnecessary cast. 71 void toRenderIFrame(const RenderIFrame*); 72 73 49 74 } // namespace WebCore 50 75 -
trunk/WebCore/rendering/RenderLayerCompositor.cpp
r56949 r57919 44 44 #include "Page.h" 45 45 #include "RenderEmbeddedObject.h" 46 #include "RenderIFrame.h" 46 47 #include "RenderLayerBacking.h" 47 48 #include "RenderReplica.h" … … 117 118 else 118 119 destroyRootPlatformLayer(); 120 121 m_renderView->compositingStateChanged(m_compositing); 119 122 } 120 123 } … … 977 980 || requiresCompositingForCanvas(renderer) 978 981 || requiresCompositingForPlugin(renderer) 982 || requiresCompositingForIFrame(renderer) 979 983 || renderer->style()->backfaceVisibility() == BackfaceVisibilityHidden 980 984 || clipsCompositingDescendants(layer) … … 1084 1088 } 1085 1089 1090 bool RenderLayerCompositor::requiresCompositingForIFrame(RenderObject* renderer) const 1091 { 1092 return renderer->isRenderIFrame() && toRenderIFrame(renderer)->requiresAcceleratedCompositing(); 1093 } 1094 1086 1095 bool RenderLayerCompositor::requiresCompositingForAnimation(RenderObject* renderer) const 1087 1096 { -
trunk/WebCore/rendering/RenderLayerCompositor.h
r56949 r57919 182 182 bool requiresCompositingForCanvas(RenderObject*) const; 183 183 bool requiresCompositingForPlugin(RenderObject*) const; 184 bool requiresCompositingForIFrame(RenderObject*) const; 184 185 bool requiresCompositingWhenDescendantsAreCompositing(RenderObject*) const; 185 186 -
trunk/WebCore/rendering/RenderObject.h
r57895 r57919 283 283 virtual bool isRenderBlock() const { return false; } 284 284 virtual bool isRenderButton() const { return false; } 285 virtual bool isRenderIFrame() const { return false; } 285 286 virtual bool isRenderImage() const { return false; } 286 287 virtual bool isRenderInline() const { return false; } -
trunk/WebCore/rendering/RenderView.cpp
r56646 r57919 709 709 } 710 710 711 void RenderView::compositingStateChanged(bool) 712 { 713 Element* elt = document()->ownerElement(); 714 if (!elt) 715 return; 716 717 // Trigger a recalcStyle in the parent document, to update compositing in that document. 718 elt->setNeedsStyleRecalc(SyntheticStyleChange); 719 } 720 711 721 RenderLayerCompositor* RenderView::compositor() 712 722 { -
trunk/WebCore/rendering/RenderView.h
r52757 r57919 164 164 RenderLayerCompositor* compositor(); 165 165 bool usesCompositing() const; 166 void compositingStateChanged(bool nowComposited); 166 167 #endif 167 168
Note: See TracChangeset
for help on using the changeset viewer.