RenderLayer scrollbars' updates should be split between layout induced and style...
authorjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Apr 2012 04:30:23 +0000 (04:30 +0000)
committerjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Apr 2012 04:30:23 +0000 (04:30 +0000)
commit9d0c8b9d5164490ad40d4c9b8070f3e2fa9bc84f
tree0c3a495dbcb7a399f160bf1efa5fd7f1b264a84c
parent75f1d1b0f3aa6796305519efeb36a8ec6a480f2f
RenderLayer scrollbars' updates should be split between layout induced and style change induced
https://bugs.webkit.org/show_bug.cgi?id=83213

Reviewed by Simon Fraser.

Refactoring only, no change in behavior.

This patches splits up the 2 reasons for modifying the scrollbars:
- style updates, handled in updateScrollbarsAfterStyleChange.
- layout time, handled in updateScrollbarsAfterLayout.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::contentsSize):
Removed now unneeded const-casts.

(WebCore::RenderLayer::setHasHorizontalScrollbar):
(WebCore::RenderLayer::setHasVerticalScrollbar):
Updated to use hasHorizontalScrollbar / hasVerticalScrollbar.

(WebCore::RenderLayer::scrollWidth):
(WebCore::RenderLayer::scrollHeight):
Made those functions |const|.

(WebCore::RenderLayer::computeScrollDimensions):
Removed the unneeded booleans and move the do-we-have-overflow-logic
into hasHorizontalOverflow and hasVerticalOverflow.

(WebCore::RenderLayer::hasHorizontalOverflow):
(WebCore::RenderLayer::hasVerticalOverflow):
Added those new helper functions.

(WebCore::RenderLayer::updateScrollbarsAfterLayout):
(WebCore::RenderLayer::updateScrollInfoAfterLayout):
Updated the latter to call the former.

(WebCore::RenderLayer::updateScrollbarsAfterStyleChange):
(WebCore::RenderLayer::styleChanged):
Ditto.

(WebCore::overflowCanHaveAScrollbar):
Add this helper function for updateScrollbarsAfterStyleChange.

* rendering/RenderLayer.h:
(WebCore::RenderLayer::hasHorizontalScrollbar):
(WebCore::RenderLayer::hasVerticalScrollbar):
Added those 2 new helper functions.

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