Viewport constrained elements should work properly with headers and footers
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Apr 2013 18:25:41 +0000 (18:25 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Apr 2013 18:25:41 +0000 (18:25 +0000)
commit63defd85d8773fb48232ff313a23b14348c2e75d
tree83063b60d43d87066e486abf5216de37e2ac9cb7
parent2ae76baba15dc07a6af2c839225032a075069057
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
15 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/four-bars-with-header-and-footer-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/four-bars-with-header-and-footer.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h
Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h
Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h
Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm
Source/WebCore/platform/ScrollableArea.cpp
Source/WebCore/platform/ScrollableArea.h