Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1494)

Side by Side Diff: Source/WebCore/rendering/RenderLayer.cpp

Issue 9120020: Revert 98735 - Source/WebCore: The HTML5 video element in Safari does not respect "visibility:hid... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/WebCore/rendering/RenderLayer.h ('k') | Source/WebCore/rendering/RenderLayerBacking.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 4052 matching lines...) Expand 10 before | Expand all | Expand 10 after
4063 if (!renderer()->documentBeingDestroyed()) 4063 if (!renderer()->documentBeingDestroyed())
4064 compositor()->setCompositingLayersNeedRebuild(); 4064 compositor()->setCompositingLayersNeedRebuild();
4065 #endif 4065 #endif
4066 } 4066 }
4067 4067
4068 void RenderLayer::updateZOrderLists() 4068 void RenderLayer::updateZOrderLists()
4069 { 4069 {
4070 if (!isStackingContext() || !m_zOrderListsDirty) 4070 if (!isStackingContext() || !m_zOrderListsDirty)
4071 return; 4071 return;
4072 4072
4073 #if USE(ACCELERATED_COMPOSITING)
4074 bool includeHiddenLayers = compositor()->inCompositingMode();
4075 #else
4076 bool includeHiddenLayers = false;
4077 #endif
4078 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) 4073 for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
4079 if (!m_reflection || reflectionLayer() != child) 4074 if (!m_reflection || reflectionLayer() != child)
4080 child->collectLayers(includeHiddenLayers, m_posZOrderList, m_negZOrd erList); 4075 child->collectLayers(m_posZOrderList, m_negZOrderList);
4081 4076
4082 // Sort the two lists. 4077 // Sort the two lists.
4083 if (m_posZOrderList) 4078 if (m_posZOrderList)
4084 std::stable_sort(m_posZOrderList->begin(), m_posZOrderList->end(), compa reZIndex); 4079 std::stable_sort(m_posZOrderList->begin(), m_posZOrderList->end(), compa reZIndex);
4085 4080
4086 if (m_negZOrderList) 4081 if (m_negZOrderList)
4087 std::stable_sort(m_negZOrderList->begin(), m_negZOrderList->end(), compa reZIndex); 4082 std::stable_sort(m_negZOrderList->begin(), m_negZOrderList->end(), compa reZIndex);
4088 4083
4089 m_zOrderListsDirty = false; 4084 m_zOrderListsDirty = false;
4090 } 4085 }
4091 4086
4092 void RenderLayer::updateNormalFlowList() 4087 void RenderLayer::updateNormalFlowList()
4093 { 4088 {
4094 if (!m_normalFlowListDirty) 4089 if (!m_normalFlowListDirty)
4095 return; 4090 return;
4096 4091
4097 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) { 4092 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) {
4098 // Ignore non-overflow layers and reflections. 4093 // Ignore non-overflow layers and reflections.
4099 if (child->isNormalFlowOnly() && (!m_reflection || reflectionLayer() != child)) { 4094 if (child->isNormalFlowOnly() && (!m_reflection || reflectionLayer() != child)) {
4100 if (!m_normalFlowList) 4095 if (!m_normalFlowList)
4101 m_normalFlowList = new Vector<RenderLayer*>; 4096 m_normalFlowList = new Vector<RenderLayer*>;
4102 m_normalFlowList->append(child); 4097 m_normalFlowList->append(child);
4103 } 4098 }
4104 } 4099 }
4105 4100
4106 m_normalFlowListDirty = false; 4101 m_normalFlowListDirty = false;
4107 } 4102 }
4108 4103
4109 void RenderLayer::collectLayers(bool includeHiddenLayers, Vector<RenderLayer*>*& posBuffer, Vector<RenderLayer*>*& negBuffer) 4104 void RenderLayer::collectLayers(Vector<RenderLayer*>*& posBuffer, Vector<RenderL ayer*>*& negBuffer)
4110 { 4105 {
4111 updateVisibilityStatus(); 4106 updateVisibilityStatus();
4112 4107
4113 // Overflow layers are just painted by their enclosing layers, so they don't get put in zorder lists. 4108 // Overflow layers are just painted by their enclosing layers, so they don't get put in zorder lists.
4114 bool includeHiddenLayer = includeHiddenLayers || (m_hasVisibleContent || (m_ hasVisibleDescendant && isStackingContext())); 4109 if ((m_hasVisibleContent || (m_hasVisibleDescendant && isStackingContext())) && !isNormalFlowOnly() && !renderer()->isRenderFlowThread()) {
4115 if (includeHiddenLayer && !isNormalFlowOnly() && !renderer()->isRenderFlowTh read()) {
4116 // Determine which buffer the child should be in. 4110 // Determine which buffer the child should be in.
4117 Vector<RenderLayer*>*& buffer = (zIndex() >= 0) ? posBuffer : negBuffer; 4111 Vector<RenderLayer*>*& buffer = (zIndex() >= 0) ? posBuffer : negBuffer;
4118 4112
4119 // Create the buffer if it doesn't exist yet. 4113 // Create the buffer if it doesn't exist yet.
4120 if (!buffer) 4114 if (!buffer)
4121 buffer = new Vector<RenderLayer*>; 4115 buffer = new Vector<RenderLayer*>;
4122 4116
4123 // Append ourselves at the end of the appropriate buffer. 4117 // Append ourselves at the end of the appropriate buffer.
4124 buffer->append(this); 4118 buffer->append(this);
4125 } 4119 }
4126 4120
4127 // Recur into our children to collect more layers, but only if we don't esta blish 4121 // Recur into our children to collect more layers, but only if we don't esta blish
4128 // a stacking context. 4122 // a stacking context.
4129 if ((includeHiddenLayers || m_hasVisibleDescendant) && !isStackingContext()) { 4123 if (m_hasVisibleDescendant && !isStackingContext()) {
4130 for (RenderLayer* child = firstChild(); child; child = child->nextSiblin g()) { 4124 for (RenderLayer* child = firstChild(); child; child = child->nextSiblin g()) {
4131 // Ignore reflections. 4125 // Ignore reflections.
4132 if (!m_reflection || reflectionLayer() != child) 4126 if (!m_reflection || reflectionLayer() != child)
4133 child->collectLayers(includeHiddenLayers, posBuffer, negBuffer); 4127 child->collectLayers(posBuffer, negBuffer);
4134 } 4128 }
4135 } 4129 }
4136 } 4130 }
4137 4131
4138 void RenderLayer::updateLayerListsIfNeeded() 4132 void RenderLayer::updateLayerListsIfNeeded()
4139 { 4133 {
4140 updateZOrderLists(); 4134 updateZOrderLists();
4141 updateNormalFlowList(); 4135 updateNormalFlowList();
4142 } 4136 }
4143 4137
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
4440 } 4434 }
4441 } 4435 }
4442 4436
4443 void showLayerTree(const WebCore::RenderObject* renderer) 4437 void showLayerTree(const WebCore::RenderObject* renderer)
4444 { 4438 {
4445 if (!renderer) 4439 if (!renderer)
4446 return; 4440 return;
4447 showLayerTree(renderer->enclosingLayer()); 4441 showLayerTree(renderer->enclosingLayer());
4448 } 4442 }
4449 #endif 4443 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/RenderLayer.h ('k') | Source/WebCore/rendering/RenderLayerBacking.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698