Align RenderLayer's descendant dependent flags semantics
authorjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Jun 2012 23:39:16 +0000 (23:39 +0000)
committerjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Jun 2012 23:39:16 +0000 (23:39 +0000)
commit7bad91805bbfb31fef119841090f59d2bea57aa0
tree57c0ee08f6baabb5cbb7ab158593c00a918f90b6
parent7b2c5a1498b10bcda73b49e95011bbb51295730e
Align RenderLayer's descendant dependent flags semantics
https://bugs.webkit.org/show_bug.cgi?id=89241

Reviewed by Simon Fraser.

Refactoring only, covered by existing tests.

This change aligns the naming and implementation of the different descendant
dependent flags. While aligning, I found some bugs (inefficiencies) with how
the visible descendant flags was computed.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::setHasVisibleContent):
Changed this method to not take a boolean as every callers was passing 'true'.
Reworked the logic under this assumption.

(WebCore::RenderLayer::dirtyVisibleContentStatus):
Updated after the following renaming.

(WebCore::RenderLayer::dirtyAncestorChainVisibleDescendantStatus):
Renamed this function from dirtyVisibleDescendantStatus to match the hasSelfPaintingLayer
naming and implementation.

(WebCore::RenderLayer::setAncestorChainHasVisibleDescendant):
Added this function to factor the visible descendant setting out of defunct childVisibilityChanged.
Also improved the efficiency of the function by clearing the dirty flag as it goes up (an unnoticed bug).

(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
Updated to use the new functions lieu of childVisibilityChanged.
* rendering/RenderLayer.h:
(RenderLayer::childVisibilityChanged):
Removed this function as it wasn't adding much and it's a lot more clear to call
dirtyAncestorChainVisibleDescendantStatus / setAncestorChainHasVisibleDescendant.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::styleWillChange):
* rendering/RenderObjectChildList.cpp:
(WebCore::RenderObjectChildList::appendChildNode):
(WebCore::RenderObjectChildList::insertChildNode):
Updated those callers after removing the boolean parameter from setHasVisibleContent.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@120770 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObjectChildList.cpp