OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 void scrollRectToVisible(const LayoutRect&, const ScrollAlignment& alignX, c
onst ScrollAlignment& alignY); | 403 void scrollRectToVisible(const LayoutRect&, const ScrollAlignment& alignX, c
onst ScrollAlignment& alignY); |
404 | 404 |
405 LayoutRect getRectToExpose(const LayoutRect& visibleRect, const LayoutRect&
exposeRect, const ScrollAlignment& alignX, const ScrollAlignment& alignY); | 405 LayoutRect getRectToExpose(const LayoutRect& visibleRect, const LayoutRect&
exposeRect, const ScrollAlignment& alignX, const ScrollAlignment& alignY); |
406 | 406 |
407 bool hasHorizontalScrollbar() const { return horizontalScrollbar(); } | 407 bool hasHorizontalScrollbar() const { return horizontalScrollbar(); } |
408 bool hasVerticalScrollbar() const { return verticalScrollbar(); } | 408 bool hasVerticalScrollbar() const { return verticalScrollbar(); } |
409 | 409 |
410 int verticalScrollbarWidth(OverlayScrollbarSizeRelevancy = IgnoreOverlayScro
llbarSize) const; | 410 int verticalScrollbarWidth(OverlayScrollbarSizeRelevancy = IgnoreOverlayScro
llbarSize) const; |
411 int horizontalScrollbarHeight(OverlayScrollbarSizeRelevancy = IgnoreOverlayS
crollbarSize) const; | 411 int horizontalScrollbarHeight(OverlayScrollbarSizeRelevancy = IgnoreOverlayS
crollbarSize) const; |
412 | 412 |
| 413 bool hasScrollParent() const { return m_compositingProperties.compositingRea
sons & CompositingReasonOverflowScrollingParent; } |
413 // isPointInResizeControl() is used for testing if a pointer/touch position
is in the resize control | 414 // isPointInResizeControl() is used for testing if a pointer/touch position
is in the resize control |
414 // area. | 415 // area. |
415 bool isPointInResizeControl(const IntPoint& absolutePoint, ResizerHitTestTyp
e resizerHitTestType) const; | 416 bool isPointInResizeControl(const IntPoint& absolutePoint, ResizerHitTestTyp
e resizerHitTestType) const; |
416 bool hitTestOverflowControls(HitTestResult&, const IntPoint& localPoint); | 417 bool hitTestOverflowControls(HitTestResult&, const IntPoint& localPoint); |
417 IntSize offsetFromResizeCorner(const IntPoint& absolutePoint) const; | 418 IntSize offsetFromResizeCorner(const IntPoint& absolutePoint) const; |
418 | 419 |
419 void paintOverflowControls(GraphicsContext*, const IntPoint&, const IntRect&
damageRect, bool paintingOverlayControls = false); | 420 void paintOverflowControls(GraphicsContext*, const IntPoint&, const IntRect&
damageRect, bool paintingOverlayControls = false); |
420 void paintScrollCorner(GraphicsContext*, const IntPoint&, const IntRect& dam
ageRect); | 421 void paintScrollCorner(GraphicsContext*, const IntPoint&, const IntRect& dam
ageRect); |
421 void paintResizer(GraphicsContext*, const IntPoint&, const IntRect& damageRe
ct); | 422 void paintResizer(GraphicsContext*, const IntPoint&, const IntRect& damageRe
ct); |
422 | 423 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 // paints the layers that intersect the damage rect from back to | 604 // paints the layers that intersect the damage rect from back to |
604 // front. The hitTest method looks for mouse events by walking | 605 // front. The hitTest method looks for mouse events by walking |
605 // layers that intersect the point from front to back. | 606 // layers that intersect the point from front to back. |
606 void paint(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior = P
aintBehaviorNormal, RenderObject* paintingRoot = 0, | 607 void paint(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior = P
aintBehaviorNormal, RenderObject* paintingRoot = 0, |
607 RenderRegion* = 0, PaintLayerFlags = 0); | 608 RenderRegion* = 0, PaintLayerFlags = 0); |
608 bool hitTest(const HitTestRequest&, HitTestResult&); | 609 bool hitTest(const HitTestRequest&, HitTestResult&); |
609 bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&); | 610 bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&); |
610 void paintOverlayScrollbars(GraphicsContext*, const LayoutRect& damageRect,
PaintBehavior, RenderObject* paintingRoot = 0); | 611 void paintOverlayScrollbars(GraphicsContext*, const LayoutRect& damageRect,
PaintBehavior, RenderObject* paintingRoot = 0); |
611 | 612 |
612 struct ClipRectsContext { | 613 struct ClipRectsContext { |
613 ClipRectsContext(const RenderLayer* inRootLayer, RenderRegion* inRegion,
ClipRectsType inClipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollbar
SizeRelevancy = IgnoreOverlayScrollbarSize, ShouldRespectOverflowClip inRespectO
verflowClip = RespectOverflowClip) | 614 ClipRectsContext(const RenderLayer* inRootLayer, RenderRegion* inRegion,
ClipRectsType inClipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollbar
SizeRelevancy = IgnoreOverlayScrollbarSize, ShouldRespectOverflowClip inRespectO
verflowClip = RespectOverflowClip, const RenderLayer* scrollParent = 0) |
614 : rootLayer(inRootLayer) | 615 : rootLayer(inRootLayer) |
615 , region(inRegion) | 616 , region(inRegion) |
616 , clipRectsType(inClipRectsType) | 617 , clipRectsType(inClipRectsType) |
617 , overlayScrollbarSizeRelevancy(inOverlayScrollbarSizeRelevancy) | 618 , overlayScrollbarSizeRelevancy(inOverlayScrollbarSizeRelevancy) |
618 , respectOverflowClip(inRespectOverflowClip) | 619 , respectOverflowClip(inRespectOverflowClip) |
| 620 , scrollParent(scrollParent) |
619 { } | 621 { } |
620 const RenderLayer* rootLayer; | 622 const RenderLayer* rootLayer; |
621 RenderRegion* region; | 623 RenderRegion* region; |
622 ClipRectsType clipRectsType; | 624 ClipRectsType clipRectsType; |
623 OverlayScrollbarSizeRelevancy overlayScrollbarSizeRelevancy; | 625 OverlayScrollbarSizeRelevancy overlayScrollbarSizeRelevancy; |
624 ShouldRespectOverflowClip respectOverflowClip; | 626 ShouldRespectOverflowClip respectOverflowClip; |
| 627 const RenderLayer* scrollParent; |
625 }; | 628 }; |
626 | 629 |
627 // This method figures out our layerBounds in coordinates relative to | 630 // This method figures out our layerBounds in coordinates relative to |
628 // |rootLayer}. It also computes our background and foreground clip rects | 631 // |rootLayer}. It also computes our background and foreground clip rects |
629 // for painting/event handling. | 632 // for painting/event handling. |
630 // Pass offsetFromRoot if known. | 633 // Pass offsetFromRoot if known. |
631 void calculateRects(const ClipRectsContext&, const LayoutRect& paintDirtyRec
t, LayoutRect& layerBounds, | 634 void calculateRects(const ClipRectsContext&, const LayoutRect& paintDirtyRec
t, LayoutRect& layerBounds, |
632 ClipRect& backgroundRect, ClipRect& foregroundRect, ClipRect& outlineRec
t, const LayoutPoint* offsetFromRoot = 0) const; | 635 ClipRect& backgroundRect, ClipRect& foregroundRect, ClipRect& outlineRec
t, const LayoutPoint* offsetFromRoot = 0) const; |
633 | 636 |
634 // Compute and cache clip rects computed with the given layer as the root | 637 // Compute and cache clip rects computed with the given layer as the root |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 NotCompositedForNonViewContainer, | 788 NotCompositedForNonViewContainer, |
786 NotCompositedForNoVisibleContent, | 789 NotCompositedForNoVisibleContent, |
787 NotCompositedForUnscrollableAncestors, | 790 NotCompositedForUnscrollableAncestors, |
788 }; | 791 }; |
789 | 792 |
790 void setViewportConstrainedNotCompositedReason(ViewportConstrainedNotComposi
tedReason reason) { m_compositingProperties.viewportConstrainedNotCompositedReas
on = reason; } | 793 void setViewportConstrainedNotCompositedReason(ViewportConstrainedNotComposi
tedReason reason) { m_compositingProperties.viewportConstrainedNotCompositedReas
on = reason; } |
791 ViewportConstrainedNotCompositedReason viewportConstrainedNotCompositedReaso
n() const { return static_cast<ViewportConstrainedNotCompositedReason>(m_composi
tingProperties.viewportConstrainedNotCompositedReason); } | 794 ViewportConstrainedNotCompositedReason viewportConstrainedNotCompositedReaso
n() const { return static_cast<ViewportConstrainedNotCompositedReason>(m_composi
tingProperties.viewportConstrainedNotCompositedReason); } |
792 | 795 |
793 bool isOutOfFlowRenderFlowThread() const { return renderer()->isOutOfFlowRen
derFlowThread(); } | 796 bool isOutOfFlowRenderFlowThread() const { return renderer()->isOutOfFlowRen
derFlowThread(); } |
794 | 797 |
| 798 GraphicsLayer* layerForScrollChild() const; |
795 enum PaintOrderListType {BeforePromote, AfterPromote}; | 799 enum PaintOrderListType {BeforePromote, AfterPromote}; |
796 void computePaintOrderList(PaintOrderListType type, Vector<RefPtr<Node> >&); | 800 void computePaintOrderList(PaintOrderListType type, Vector<RefPtr<Node> >&); |
797 bool scrollsWithRespectTo(const RenderLayer*) const; | 801 bool scrollsWithRespectTo(const RenderLayer*) const; |
798 | 802 |
799 enum ForceNeedsCompositedScrollingMode { | 803 enum ForceNeedsCompositedScrollingMode { |
800 DoNotForceCompositedScrolling = 0, | 804 DoNotForceCompositedScrolling = 0, |
801 CompositedScrollingAlwaysOn = 1, | 805 CompositedScrollingAlwaysOn = 1, |
802 CompositedScrollingAlwaysOff = 2 | 806 CompositedScrollingAlwaysOff = 2 |
803 }; | 807 }; |
804 | 808 |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1328 | 1332 |
1329 } // namespace WebCore | 1333 } // namespace WebCore |
1330 | 1334 |
1331 #ifndef NDEBUG | 1335 #ifndef NDEBUG |
1332 // Outside the WebCore namespace for ease of invocation from gdb. | 1336 // Outside the WebCore namespace for ease of invocation from gdb. |
1333 void showLayerTree(const WebCore::RenderLayer*); | 1337 void showLayerTree(const WebCore::RenderLayer*); |
1334 void showLayerTree(const WebCore::RenderObject*); | 1338 void showLayerTree(const WebCore::RenderObject*); |
1335 #endif | 1339 #endif |
1336 | 1340 |
1337 #endif // RenderLayer_h | 1341 #endif // RenderLayer_h |
OLD | NEW |