Changeset 116480 in webkit
- Timestamp:
- May 8, 2012 7:18:38 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r116476 r116480 1 2012-05-08 Julien Chaffraix <jchaffraix@webkit.org> 2 3 Move RenderLayers z-index lists dirtying to post style change 4 https://bugs.webkit.org/show_bug.cgi?id=85437 5 6 Reviewed by Darin Adler. 7 8 No expected change in behavior. 9 10 This change moves the z-order lists to RenderLayer::styleChanged. As part of this 11 change, also added proper handling of stacking context transition. This enabled 12 us to tighten more of the dirtyZOrderLists / clearZOrderLists code. 13 14 * rendering/RenderBoxModelObject.cpp: 15 (WebCore::RenderBoxModelObject::styleWillChange): 16 Removed this code, moved to updateStackingContextsAfterStyleChange. 17 18 * rendering/RenderLayer.cpp: 19 (WebCore::RenderLayer::RenderLayer): 20 Only stacking contexts start with dirty z-order lists. 21 22 (WebCore::RenderLayer::dirtyZOrderLists): 23 Added an ASSERT. 24 25 (WebCore::RenderLayer::updateStackingContextsAfterStyleChange): 26 Refactored the code to handle the transition between stacking context status. 27 28 (WebCore::RenderLayer::styleChanged): 29 Added a call to updateStackingContextsAfterStyleChange. 30 31 * rendering/RenderLayer.h: 32 (WebCore::RenderLayer::isStackingContext): 33 Added a call to the next function. 34 35 (WebCore::RenderLayer::layerWithStyleIsStackingContext): 36 Factored the isStackingContext logic here so that we can reuse it inside 37 updateStackingContextsAfterStyleChange. 38 39 (WebCore::RenderLayer::clearZOrderLists): 40 Added an ASSERT. 41 1 42 2012-05-08 Abhishek Arya <inferno@chromium.org> 2 43 -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r116446 r116480 411 411 repaint(); 412 412 } 413 }414 415 if (hasLayer()416 && (oldStyle->hasAutoZIndex() != newStyle->hasAutoZIndex()417 || oldStyle->zIndex() != newStyle->zIndex()418 || oldStyle->visibility() != newStyle->visibility())) {419 layer()->dirtyStackingContextZOrderLists();420 if (oldStyle->hasAutoZIndex() != newStyle->hasAutoZIndex() || oldStyle->visibility() != newStyle->visibility())421 layer()->dirtyZOrderLists();422 413 } 423 414 } -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r116476 r116480 148 148 : m_inResizeMode(false) 149 149 , m_scrollDimensionsDirty(true) 150 , m_zOrderListsDirty(true)151 150 , m_normalFlowListDirty(true) 152 151 , m_usedTransparency(false) … … 194 193 { 195 194 m_isNormalFlowOnly = shouldBeNormalFlowOnly(); 195 // Non-stacking contexts should have empty z-order lists. As this is already the case, 196 // there is no need to dirty / recompute these lists. 197 m_zOrderListsDirty = isStackingContext(); 196 198 197 199 ScrollableArea::setConstrainsScrollingToContentEdge(false); … … 4460 4462 { 4461 4463 ASSERT(m_layerListMutationAllowed); 4462 // We cannot assume that we are called on a stacking context as it 4463 // is called when we just got demoted from being a stacking context. 4464 ASSERT(isStackingContext()); 4464 4465 4465 4466 if (m_posZOrderList) … … 4677 4678 } 4678 4679 4680 void RenderLayer::updateStackingContextsAfterStyleChange(const RenderStyle* oldStyle) 4681 { 4682 if (!oldStyle) 4683 return; 4684 4685 bool wasStackingContext = isStackingContext(oldStyle); 4686 bool isStackingContext = this->isStackingContext(); 4687 if (isStackingContext != wasStackingContext) { 4688 dirtyStackingContextZOrderLists(); 4689 if (isStackingContext) 4690 dirtyZOrderLists(); 4691 else 4692 clearZOrderLists(); 4693 return; 4694 } 4695 4696 // FIXME: RenderLayer already handles visibility changes through our visiblity dirty bits. This logic could 4697 // likely be folded along with the rest. 4698 if (oldStyle->zIndex() != renderer()->style()->zIndex() || oldStyle->visibility() != renderer()->style()->visibility()) { 4699 dirtyStackingContextZOrderLists(); 4700 if (isStackingContext) 4701 dirtyZOrderLists(); 4702 } 4703 } 4704 4679 4705 static bool overflowCanHaveAScrollbar(EOverflow overflow) 4680 4706 { … … 4731 4757 m_marquee = 0; 4732 4758 } 4733 4759 4760 updateStackingContextsAfterStyleChange(oldStyle); 4734 4761 updateScrollbarsAfterStyleChange(oldStyle); 4735 4762 -
trunk/Source/WebCore/rendering/RenderLayer.h
r116009 r116480 383 383 // that has a non-auto z-index. 384 384 RenderLayer* stackingContext() const; 385 bool isStackingContext() const { return !hasAutoZIndex() || renderer()->isRenderView(); }385 bool isStackingContext() const { return isStackingContext(renderer()->style()); } 386 386 387 387 void dirtyZOrderLists(); … … 444 444 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutRect&) const; 445 445 446 bool hasAutoZIndex() const { return renderer()->style()->hasAutoZIndex(); }447 446 int zIndex() const { return renderer()->style()->zIndex(); } 448 447 … … 619 618 void updateNormalFlowList(); 620 619 620 bool isStackingContext(const RenderStyle* style) const { return !style->hasAutoZIndex() || renderer()->isRenderView(); } 621 621 bool isDirtyStackingContext() const { return m_zOrderListsDirty && isStackingContext(); } 622 622 … … 629 629 630 630 bool shouldRepaintAfterLayout() const; 631 632 void updateStackingContextsAfterStyleChange(const RenderStyle* oldStyle); 631 633 632 634 void updateScrollbarsAfterStyleChange(const RenderStyle* oldStyle); … … 937 939 inline void RenderLayer::clearZOrderLists() 938 940 { 941 ASSERT(!isStackingContext()); 942 939 943 if (m_posZOrderList) { 940 944 delete m_posZOrderList;
Note: See TracChangeset
for help on using the changeset viewer.