Viewport constrained elements should work properly with headers and footers
https://bugs.webkit.org/show_bug.cgi?id=113743
Reviewed by Simon Fraser.
Source/WebCore:
ScrollableArea::constrainScrollPositionForOverhang() needs to take headerHeight
and footerHeight into account. It also needs to use totalContentsSize() instead of
contentsSize().
Send totalContentsSize() instead of contentsSize() and also send headerHeight()
and footerHeight().
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetForFixedPosition):
* page/FrameView.h:
(FrameView):
The scrolling tree will also need to know about header and footer heights since it
will need these values to call
ScrollableArea::constrainScrollPositionForOverhang().
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setHeaderHeight):
(WebCore::ScrollingStateScrollingNode::setFooterHeight):
* page/scrolling/ScrollingStateScrollingNode.h:
(WebCore::ScrollingStateScrollingNode::headerHeight):
(ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::footerHeight):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::ScrollingTreeScrollingNode):
(WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::headerHeight):
(WebCore::ScrollingTreeScrollingNode::footerHeight):
(ScrollingTreeScrollingNode):
* page/scrolling/mac/ScrollingCoordinatorMac.h:
(ScrollParameters):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::frameViewLayoutUpdated):
(WebCore::ScrollingCoordinatorMac::setScrollParametersForNode):
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::setScrollLayerPosition):
Use footerHeight when calculating the maxValue and use headerHeight in determining
what the minimum value is.
* platform/ScrollableArea.cpp:
(WebCore::constrainedScrollPosition):
(WebCore::ScrollableArea::constrainScrollPositionForOverhang):
* platform/ScrollableArea.h:
(ScrollableArea):
LayoutTests:
* platform/mac-wk2/tiled-drawing/fixed/four-bars-with-header-and-footer-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/fixed/four-bars-with-header-and-footer.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147471
268f45cc-cd09-0410-ab3c-
d52691b4dbfc