OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 { | 351 { |
352 GraphicsLayer* scrollLayer = scrollLayerForScrollableArea(scrollableArea); | 352 GraphicsLayer* scrollLayer = scrollLayerForScrollableArea(scrollableArea); |
353 if (scrollLayer) { | 353 if (scrollLayer) { |
354 bool isMainFrame = isForMainFrame(scrollableArea); | 354 bool isMainFrame = isForMainFrame(scrollableArea); |
355 scrollLayer->setScrollableArea(scrollableArea, isMainFrame); | 355 scrollLayer->setScrollableArea(scrollableArea, isMainFrame); |
356 } | 356 } |
357 | 357 |
358 WebLayer* webLayer = scrollingWebLayerForScrollableArea(scrollableArea); | 358 WebLayer* webLayer = scrollingWebLayerForScrollableArea(scrollableArea); |
359 WebLayer* containerLayer = containerWebLayerForScrollableArea(scrollableArea
); | 359 WebLayer* containerLayer = containerWebLayerForScrollableArea(scrollableArea
); |
360 if (webLayer) { | 360 if (webLayer) { |
361 // TODO(wjmaclean) Remove the next line once https://codereview.chromium
.org/23983047 lands. | |
362 webLayer->setScrollable(true); | |
363 webLayer->setScrollClipLayer(containerLayer); | 361 webLayer->setScrollClipLayer(containerLayer); |
364 webLayer->setScrollPosition(IntPoint(scrollableArea->scrollPosition() -
scrollableArea->minimumScrollPosition())); | 362 webLayer->setScrollPosition(IntPoint(scrollableArea->scrollPosition() -
scrollableArea->minimumScrollPosition())); |
365 // TODO(wjmaclean) Remove the next line once https://codereview.chromium
.org/23983047 lands. | |
366 webLayer->setMaxScrollPosition(IntSize(scrollableArea->scrollSize(Horizo
ntalScrollbar), scrollableArea->scrollSize(VerticalScrollbar))); | |
367 webLayer->setBounds(scrollableArea->contentsSize()); | 363 webLayer->setBounds(scrollableArea->contentsSize()); |
368 bool canScrollX = scrollableArea->userInputScrollable(HorizontalScrollba
r); | 364 bool canScrollX = scrollableArea->userInputScrollable(HorizontalScrollba
r); |
369 bool canScrollY = scrollableArea->userInputScrollable(VerticalScrollbar)
; | 365 bool canScrollY = scrollableArea->userInputScrollable(VerticalScrollbar)
; |
370 webLayer->setUserScrollable(canScrollX, canScrollY); | 366 webLayer->setUserScrollable(canScrollX, canScrollY); |
371 } | 367 } |
372 if (WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea,
HorizontalScrollbar)) { | 368 if (WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea,
HorizontalScrollbar)) { |
373 GraphicsLayer* horizontalScrollbarLayer = horizontalScrollbarLayerForScr
ollableArea(scrollableArea); | 369 GraphicsLayer* horizontalScrollbarLayer = horizontalScrollbarLayerForScr
ollableArea(scrollableArea); |
374 if (horizontalScrollbarLayer) | 370 if (horizontalScrollbarLayer) |
375 setupScrollbarLayer(horizontalScrollbarLayer, scrollbarLayer, webLay
er, containerLayer); | 371 setupScrollbarLayer(horizontalScrollbarLayer, scrollbarLayer, webLay
er, containerLayer); |
376 } | 372 } |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 bool frameIsScrollable = frameView && frameView->isScrollable(); | 948 bool frameIsScrollable = frameView && frameView->isScrollable(); |
953 if (frameIsScrollable != m_wasFrameScrollable) | 949 if (frameIsScrollable != m_wasFrameScrollable) |
954 return true; | 950 return true; |
955 | 951 |
956 if (WebLayer* scrollLayer = frameView ? scrollingWebLayerForScrollableArea(f
rameView) : 0) | 952 if (WebLayer* scrollLayer = frameView ? scrollingWebLayerForScrollableArea(f
rameView) : 0) |
957 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); | 953 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); |
958 return false; | 954 return false; |
959 } | 955 } |
960 | 956 |
961 } // namespace WebCore | 957 } // namespace WebCore |
OLD | NEW |