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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 bool isOpaqueScrollbar = !scrollbar->isOverlayScrollbar(); | 260 bool isOpaqueScrollbar = !scrollbar->isOverlayScrollbar(); |
261 if (!scrollbarGraphicsLayer->contentsOpaque()) | 261 if (!scrollbarGraphicsLayer->contentsOpaque()) |
262 scrollbarGraphicsLayer->setContentsOpaque(isMainFrame && isOpaqueScr
ollbar); | 262 scrollbarGraphicsLayer->setContentsOpaque(isMainFrame && isOpaqueScr
ollbar); |
263 scrollbarLayer->layer()->setOpaque(scrollbarGraphicsLayer->contentsOpaqu
e()); | 263 scrollbarLayer->layer()->setOpaque(scrollbarGraphicsLayer->contentsOpaqu
e()); |
264 | 264 |
265 setupScrollbarLayer(scrollbarGraphicsLayer, scrollbarLayer, scrollingWeb
LayerForScrollableArea(scrollableArea)); | 265 setupScrollbarLayer(scrollbarGraphicsLayer, scrollbarLayer, scrollingWeb
LayerForScrollableArea(scrollableArea)); |
266 } else | 266 } else |
267 removeWebScrollbarLayer(scrollableArea, orientation); | 267 removeWebScrollbarLayer(scrollableArea, orientation); |
268 } | 268 } |
269 | 269 |
270 void ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* sc
rollableArea) | 270 bool ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* sc
rollableArea) |
271 { | 271 { |
272 GraphicsLayer* scrollLayer = scrollLayerForScrollableArea(scrollableArea); | 272 GraphicsLayer* scrollLayer = scrollLayerForScrollableArea(scrollableArea); |
273 if (scrollLayer) { | 273 if (scrollLayer) { |
274 bool isMainFrame = isForMainFrame(scrollableArea); | 274 bool isMainFrame = isForMainFrame(scrollableArea); |
275 scrollLayer->setScrollableArea(scrollableArea, isMainFrame); | 275 scrollLayer->setScrollableArea(scrollableArea, isMainFrame); |
276 } | 276 } |
277 | 277 |
278 WebLayer* webLayer = scrollingWebLayerForScrollableArea(scrollableArea); | 278 WebLayer* webLayer = scrollingWebLayerForScrollableArea(scrollableArea); |
279 if (webLayer) { | 279 if (webLayer) { |
280 webLayer->setScrollable(true); | 280 webLayer->setScrollable(true); |
281 webLayer->setScrollPosition(IntPoint(scrollableArea->scrollPosition() -
scrollableArea->minimumScrollPosition())); | 281 webLayer->setScrollPosition(IntPoint(scrollableArea->scrollPosition() -
scrollableArea->minimumScrollPosition())); |
282 webLayer->setMaxScrollPosition(IntSize(scrollableArea->scrollSize(Horizo
ntalScrollbar), scrollableArea->scrollSize(VerticalScrollbar))); | 282 webLayer->setMaxScrollPosition(IntSize(scrollableArea->scrollSize(Horizo
ntalScrollbar), scrollableArea->scrollSize(VerticalScrollbar))); |
283 } | 283 } |
284 if (WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea,
HorizontalScrollbar)) | 284 if (WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea,
HorizontalScrollbar)) |
285 setupScrollbarLayer(horizontalScrollbarLayerForScrollableArea(scrollable
Area), scrollbarLayer, webLayer); | 285 setupScrollbarLayer(horizontalScrollbarLayerForScrollableArea(scrollable
Area), scrollbarLayer, webLayer); |
286 if (WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea,
VerticalScrollbar)) | 286 if (WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea,
VerticalScrollbar)) |
287 setupScrollbarLayer(verticalScrollbarLayerForScrollableArea(scrollableAr
ea), scrollbarLayer, webLayer); | 287 setupScrollbarLayer(verticalScrollbarLayerForScrollableArea(scrollableAr
ea), scrollbarLayer, webLayer); |
| 288 |
| 289 return !!webLayer; |
288 } | 290 } |
289 | 291 |
290 void ScrollingCoordinator::setTouchEventTargetRects(const Vector<IntRect>& absol
uteHitTestRects) | 292 void ScrollingCoordinator::setTouchEventTargetRects(const Vector<IntRect>& absol
uteHitTestRects) |
291 { | 293 { |
292 if (WebLayer* scrollLayer = scrollingWebLayerForScrollableArea(m_page->mainF
rame()->view())) { | 294 if (WebLayer* scrollLayer = scrollingWebLayerForScrollableArea(m_page->mainF
rame()->view())) { |
293 WebVector<WebRect> webRects(absoluteHitTestRects.size()); | 295 WebVector<WebRect> webRects(absoluteHitTestRects.size()); |
294 for (size_t i = 0; i < absoluteHitTestRects.size(); ++i) | 296 for (size_t i = 0; i < absoluteHitTestRects.size(); ++i) |
295 webRects[i] = absoluteHitTestRects[i]; | 297 webRects[i] = absoluteHitTestRects[i]; |
296 scrollLayer->setTouchEventHandlerRegion(webRects); | 298 scrollLayer->setTouchEventHandlerRegion(webRects); |
297 } | 299 } |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 stringBuilder.resize(stringBuilder.length() - 2); | 641 stringBuilder.resize(stringBuilder.length() - 2); |
640 return stringBuilder.toString(); | 642 return stringBuilder.toString(); |
641 } | 643 } |
642 | 644 |
643 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const | 645 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const |
644 { | 646 { |
645 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); | 647 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); |
646 } | 648 } |
647 | 649 |
648 } // namespace WebCore | 650 } // namespace WebCore |
OLD | NEW |