OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #include "core/css/PseudoStyleRequest.h" | 47 #include "core/css/PseudoStyleRequest.h" |
48 #include "core/dom/AXObjectCache.h" | 48 #include "core/dom/AXObjectCache.h" |
49 #include "core/dom/Node.h" | 49 #include "core/dom/Node.h" |
50 #include "core/dom/shadow/ShadowRoot.h" | 50 #include "core/dom/shadow/ShadowRoot.h" |
51 #include "core/editing/FrameSelection.h" | 51 #include "core/editing/FrameSelection.h" |
52 #include "core/frame/FrameView.h" | 52 #include "core/frame/FrameView.h" |
53 #include "core/frame/LocalFrame.h" | 53 #include "core/frame/LocalFrame.h" |
54 #include "core/frame/Settings.h" | 54 #include "core/frame/Settings.h" |
55 #include "core/html/HTMLFrameOwnerElement.h" | 55 #include "core/html/HTMLFrameOwnerElement.h" |
56 #include "core/layout/LayoutGeometryMap.h" | 56 #include "core/layout/LayoutGeometryMap.h" |
| 57 #include "core/layout/LayoutScrollbar.h" |
| 58 #include "core/layout/LayoutScrollbarPart.h" |
57 #include "core/layout/LayoutTheme.h" | 59 #include "core/layout/LayoutTheme.h" |
58 #include "core/layout/compositing/CompositedLayerMapping.h" | 60 #include "core/layout/compositing/CompositedLayerMapping.h" |
59 #include "core/layout/compositing/LayerCompositor.h" | 61 #include "core/layout/compositing/LayerCompositor.h" |
60 #include "core/page/Chrome.h" | 62 #include "core/page/Chrome.h" |
61 #include "core/page/EventHandler.h" | 63 #include "core/page/EventHandler.h" |
62 #include "core/page/FocusController.h" | 64 #include "core/page/FocusController.h" |
63 #include "core/page/Page.h" | 65 #include "core/page/Page.h" |
64 #include "core/page/scrolling/ScrollingCoordinator.h" | 66 #include "core/page/scrolling/ScrollingCoordinator.h" |
65 #include "core/rendering/RenderScrollbar.h" | |
66 #include "core/rendering/RenderScrollbarPart.h" | |
67 #include "core/rendering/RenderView.h" | 67 #include "core/rendering/RenderView.h" |
68 #include "platform/PlatformGestureEvent.h" | 68 #include "platform/PlatformGestureEvent.h" |
69 #include "platform/PlatformMouseEvent.h" | 69 #include "platform/PlatformMouseEvent.h" |
70 #include "platform/graphics/GraphicsContextStateSaver.h" | 70 #include "platform/graphics/GraphicsContextStateSaver.h" |
71 #include "platform/graphics/GraphicsLayer.h" | 71 #include "platform/graphics/GraphicsLayer.h" |
72 #include "platform/graphics/paint/DrawingRecorder.h" | 72 #include "platform/graphics/paint/DrawingRecorder.h" |
73 #include "platform/scroll/ScrollAnimator.h" | 73 #include "platform/scroll/ScrollAnimator.h" |
74 #include "platform/scroll/ScrollbarTheme.h" | 74 #include "platform/scroll/ScrollbarTheme.h" |
75 #include "public/platform/Platform.h" | 75 #include "public/platform/Platform.h" |
76 | 76 |
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 | 907 |
908 return &renderer; | 908 return &renderer; |
909 } | 909 } |
910 | 910 |
911 PassRefPtrWillBeRawPtr<Scrollbar> LayerScrollableArea::createScrollbar(Scrollbar
Orientation orientation) | 911 PassRefPtrWillBeRawPtr<Scrollbar> LayerScrollableArea::createScrollbar(Scrollbar
Orientation orientation) |
912 { | 912 { |
913 RefPtrWillBeRawPtr<Scrollbar> widget = nullptr; | 913 RefPtrWillBeRawPtr<Scrollbar> widget = nullptr; |
914 LayoutObject* actualRenderer = rendererForScrollbar(box()); | 914 LayoutObject* actualRenderer = rendererForScrollbar(box()); |
915 bool hasCustomScrollbarStyle = actualRenderer->isBox() && actualRenderer->st
yle()->hasPseudoStyle(SCROLLBAR); | 915 bool hasCustomScrollbarStyle = actualRenderer->isBox() && actualRenderer->st
yle()->hasPseudoStyle(SCROLLBAR); |
916 if (hasCustomScrollbarStyle) { | 916 if (hasCustomScrollbarStyle) { |
917 widget = RenderScrollbar::createCustomScrollbar(this, orientation, actua
lRenderer->node()); | 917 widget = LayoutScrollbar::createCustomScrollbar(this, orientation, actua
lRenderer->node()); |
918 } else { | 918 } else { |
919 ScrollbarControlSize scrollbarSize = RegularScrollbar; | 919 ScrollbarControlSize scrollbarSize = RegularScrollbar; |
920 if (actualRenderer->style()->hasAppearance()) | 920 if (actualRenderer->style()->hasAppearance()) |
921 scrollbarSize = LayoutTheme::theme().scrollbarControlSizeForPart(act
ualRenderer->style()->appearance()); | 921 scrollbarSize = LayoutTheme::theme().scrollbarControlSizeForPart(act
ualRenderer->style()->appearance()); |
922 widget = Scrollbar::create(this, orientation, scrollbarSize); | 922 widget = Scrollbar::create(this, orientation, scrollbarSize); |
923 if (orientation == HorizontalScrollbar) | 923 if (orientation == HorizontalScrollbar) |
924 didAddScrollbar(widget.get(), HorizontalScrollbar); | 924 didAddScrollbar(widget.get(), HorizontalScrollbar); |
925 else | 925 else |
926 didAddScrollbar(widget.get(), VerticalScrollbar); | 926 didAddScrollbar(widget.get(), VerticalScrollbar); |
927 } | 927 } |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 { | 1050 { |
1051 if (!m_scrollCorner && !hasScrollbar()) | 1051 if (!m_scrollCorner && !hasScrollbar()) |
1052 return; | 1052 return; |
1053 if (!m_scrollCorner && hasOverlayScrollbars()) | 1053 if (!m_scrollCorner && hasOverlayScrollbars()) |
1054 return; | 1054 return; |
1055 | 1055 |
1056 LayoutObject* actualRenderer = rendererForScrollbar(box()); | 1056 LayoutObject* actualRenderer = rendererForScrollbar(box()); |
1057 RefPtr<LayoutStyle> corner = box().hasOverflowClip() ? actualRenderer->getUn
cachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), actualRenderer->style())
: PassRefPtr<LayoutStyle>(nullptr); | 1057 RefPtr<LayoutStyle> corner = box().hasOverflowClip() ? actualRenderer->getUn
cachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), actualRenderer->style())
: PassRefPtr<LayoutStyle>(nullptr); |
1058 if (corner) { | 1058 if (corner) { |
1059 if (!m_scrollCorner) { | 1059 if (!m_scrollCorner) { |
1060 m_scrollCorner = RenderScrollbarPart::createAnonymous(&box().documen
t()); | 1060 m_scrollCorner = LayoutScrollbarPart::createAnonymous(&box().documen
t()); |
1061 m_scrollCorner->setParent(&box()); | 1061 m_scrollCorner->setParent(&box()); |
1062 } | 1062 } |
1063 m_scrollCorner->setStyle(corner.release()); | 1063 m_scrollCorner->setStyle(corner.release()); |
1064 } else if (m_scrollCorner) { | 1064 } else if (m_scrollCorner) { |
1065 m_scrollCorner->destroy(); | 1065 m_scrollCorner->destroy(); |
1066 m_scrollCorner = nullptr; | 1066 m_scrollCorner = nullptr; |
1067 } | 1067 } |
1068 } | 1068 } |
1069 | 1069 |
1070 bool LayerScrollableArea::hitTestOverflowControls(HitTestResult& result, const I
ntPoint& localPoint) | 1070 bool LayerScrollableArea::hitTestOverflowControls(HitTestResult& result, const I
ntPoint& localPoint) |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1178 | 1178 |
1179 void LayerScrollableArea::updateResizerStyle() | 1179 void LayerScrollableArea::updateResizerStyle() |
1180 { | 1180 { |
1181 if (!m_resizer && !box().canResize()) | 1181 if (!m_resizer && !box().canResize()) |
1182 return; | 1182 return; |
1183 | 1183 |
1184 LayoutObject* actualRenderer = rendererForScrollbar(box()); | 1184 LayoutObject* actualRenderer = rendererForScrollbar(box()); |
1185 RefPtr<LayoutStyle> resizer = box().hasOverflowClip() ? actualRenderer->getU
ncachedPseudoStyle(PseudoStyleRequest(RESIZER), actualRenderer->style()) : PassR
efPtr<LayoutStyle>(nullptr); | 1185 RefPtr<LayoutStyle> resizer = box().hasOverflowClip() ? actualRenderer->getU
ncachedPseudoStyle(PseudoStyleRequest(RESIZER), actualRenderer->style()) : PassR
efPtr<LayoutStyle>(nullptr); |
1186 if (resizer) { | 1186 if (resizer) { |
1187 if (!m_resizer) { | 1187 if (!m_resizer) { |
1188 m_resizer = RenderScrollbarPart::createAnonymous(&box().document()); | 1188 m_resizer = LayoutScrollbarPart::createAnonymous(&box().document()); |
1189 m_resizer->setParent(&box()); | 1189 m_resizer->setParent(&box()); |
1190 } | 1190 } |
1191 m_resizer->setStyle(resizer.release()); | 1191 m_resizer->setStyle(resizer.release()); |
1192 } else if (m_resizer) { | 1192 } else if (m_resizer) { |
1193 m_resizer->destroy(); | 1193 m_resizer->destroy(); |
1194 m_resizer = nullptr; | 1194 m_resizer = nullptr; |
1195 } | 1195 } |
1196 } | 1196 } |
1197 | 1197 |
1198 IntSize LayerScrollableArea::offsetFromResizeCorner(const IntPoint& absolutePoin
t) const | 1198 IntSize LayerScrollableArea::offsetFromResizeCorner(const IntPoint& absolutePoin
t) const |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1382 void LayerScrollableArea::setTopmostScrollChild(Layer* scrollChild) | 1382 void LayerScrollableArea::setTopmostScrollChild(Layer* scrollChild) |
1383 { | 1383 { |
1384 // We only want to track the topmost scroll child for scrollable areas with | 1384 // We only want to track the topmost scroll child for scrollable areas with |
1385 // overlay scrollbars. | 1385 // overlay scrollbars. |
1386 if (!hasOverlayScrollbars()) | 1386 if (!hasOverlayScrollbars()) |
1387 return; | 1387 return; |
1388 m_nextTopmostScrollChild = scrollChild; | 1388 m_nextTopmostScrollChild = scrollChild; |
1389 } | 1389 } |
1390 | 1390 |
1391 } // namespace blink | 1391 } // namespace blink |
OLD | NEW |