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)
commit3ea08ece7e1bb6d06f1f107abc3d16bf1ae2d35c
tree57c0ee08f6baabb5cbb7ab158593c00a918f90b6
parent52ba9e6d7e774b295f5a3fcdd129d67006958116
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: http://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