Changeset 123971 in webkit
- Timestamp:
- Jul 28, 2012 12:44:23 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r123970 r123971 1 2012-07-28 Simon Fraser <simon.fraser@apple.com> 2 3 Ignore visibility:hidden elements when computing compositing layer bounds 4 https://bugs.webkit.org/show_bug.cgi?id=92569 5 6 Reviewed by Dan Bernstein. 7 8 Tests related to visibility:hidden's affect on composited layer bounds. 9 10 * compositing/geometry/bounds-ignores-hidden-composited-expected.txt: Added. 11 * compositing/geometry/bounds-ignores-hidden-composited-descendant.html: Added. 12 Test with visibility:visible descendants of a visibility:hidden element in a 13 compositing layer. 14 15 * compositing/geometry/bounds-ignores-hidden-dynamic-expected.txt: Added. 16 * compositing/geometry/bounds-ignores-hidden-dynamic.html: Added. 17 Test that changes visibility on descendants of a compositing layer, to test dynamic changes. 18 19 * compositing/geometry/bounds-ignores-hidden-expected.txt: Added. 20 * compositing/geometry/bounds-ignores-hidden.html: Added. 21 Test with a compositing layer having visibility:hidden descendants, which dumps 22 layer tree information. 23 24 1 25 2012-07-28 Peter Kasting <pkasting@google.com> 2 26 -
trunk/Source/WebCore/ChangeLog
r123969 r123971 1 2012-07-28 Simon Fraser <simon.fraser@apple.com> 2 3 Ignore visibility:hidden elements when computing compositing layer bounds 4 https://bugs.webkit.org/show_bug.cgi?id=92569 5 6 Reviewed by Dan Bernstein. 7 8 When computing the bounds of compositing layers, we would take into account 9 layers with no visible content (visibility:hidden, and no non-hidden descendants). 10 This caused some huge layers in mobile Google maps. 11 12 Tests: compositing/geometry/bounds-ignores-hidden-composited-descendant.html 13 compositing/geometry/bounds-ignores-hidden-dynamic.html 14 compositing/geometry/bounds-ignores-hidden.html 15 16 * rendering/RenderLayer.cpp: 17 (WebCore::RenderLayer::calculateLayerBounds): If the ExcludeHiddenDescendants flag is set, return 18 the empty rect for layers with no visible content or descendants, as long as the layer is not 19 the root of the subtree whose bounds are being computed. 20 calculateLayerBounds() currently (I think incorrectly) passes the default flags to the recursive calls. 21 It should probably just pass 'flags', but to make this change safe, OR in the ExcludeHiddenDescendants 22 flag. 23 * rendering/RenderLayer.h: Add an ExcludeHiddenDescendants flag to the CalculateLayerBoundsFlags. 24 * rendering/RenderLayerCompositor.cpp: 25 (WebCore::RenderLayerCompositor::calculateCompositedBounds): Pass the ExcludeHiddenDescendants 26 flag. 27 1 28 2012-07-28 Min Qin <qinmin@chromium.org> 2 29 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r123811 r123971 4227 4227 return IntRect(); 4228 4228 4229 // FIXME: This could be improved to do a check like hasVisibleNonCompositingDescendantLayers() (bug 92580). 4230 if ((flags & ExcludeHiddenDescendants) && layer != ancestorLayer && !layer->hasVisibleContent() && !layer->hasVisibleDescendant()) 4231 return IntRect(); 4232 4229 4233 LayoutRect boundingBoxRect = layer->localBoundingBox(); 4230 4234 if (layer->renderer()->isBox()) … … 4261 4265 } 4262 4266 4267 // FIXME: should probably just pass 'flags' down to descendants. 4268 CalculateLayerBoundsFlags descendantFlags = DefaultCalculateLayerBoundsFlags | (flags & ExcludeHiddenDescendants); 4269 4263 4270 const_cast<RenderLayer*>(layer)->updateLayerListsIfNeeded(); 4264 4271 4265 4272 if (RenderLayer* reflection = layer->reflectionLayer()) { 4266 4273 if (!reflection->isComposited()) { 4267 IntRect childUnionBounds = calculateLayerBounds(reflection, layer );4274 IntRect childUnionBounds = calculateLayerBounds(reflection, layer, descendantFlags); 4268 4275 unionBounds.unite(childUnionBounds); 4269 4276 } … … 4281 4288 RenderLayer* curLayer = negZOrderList->at(i); 4282 4289 if (!curLayer->isComposited()) { 4283 IntRect childUnionBounds = calculateLayerBounds(curLayer, layer );4290 IntRect childUnionBounds = calculateLayerBounds(curLayer, layer, descendantFlags); 4284 4291 unionBounds.unite(childUnionBounds); 4285 4292 } … … 4292 4299 RenderLayer* curLayer = posZOrderList->at(i); 4293 4300 if (!curLayer->isComposited()) { 4294 IntRect childUnionBounds = calculateLayerBounds(curLayer, layer );4301 IntRect childUnionBounds = calculateLayerBounds(curLayer, layer, descendantFlags); 4295 4302 unionBounds.unite(childUnionBounds); 4296 4303 } … … 4303 4310 RenderLayer* curLayer = normalFlowList->at(i); 4304 4311 if (!curLayer->isComposited()) { 4305 IntRect curAbsBounds = calculateLayerBounds(curLayer, layer );4312 IntRect curAbsBounds = calculateLayerBounds(curLayer, layer, descendantFlags); 4306 4313 unionBounds.unite(curAbsBounds); 4307 4314 } -
trunk/Source/WebCore/rendering/RenderLayer.h
r123624 r123971 548 548 UseLocalClipRectIfPossible = 1 << 1, 549 549 IncludeLayerFilterOutsets = 1 << 2, 550 ExcludeHiddenDescendants = 1 << 3, 550 551 DefaultCalculateLayerBoundsFlags = IncludeSelfTransform | UseLocalClipRectIfPossible | IncludeLayerFilterOutsets 551 552 }; -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r123811 r123971 613 613 if (!canBeComposited(layer)) 614 614 return IntRect(); 615 return RenderLayer::calculateLayerBounds(layer, ancestorLayer );615 return RenderLayer::calculateLayerBounds(layer, ancestorLayer, RenderLayer::DefaultCalculateLayerBoundsFlags | RenderLayer::ExcludeHiddenDescendants); 616 616 } 617 617
Note: See TracChangeset
for help on using the changeset viewer.