| 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 } | 351 } |
| 352 | 352 |
| 353 if (scrollOffset() == toIntSize(newScrollOffset)) | 353 if (scrollOffset() == toIntSize(newScrollOffset)) |
| 354 return; | 354 return; |
| 355 | 355 |
| 356 m_scrollOffset = toIntSize(newScrollOffset); | 356 m_scrollOffset = toIntSize(newScrollOffset); |
| 357 | 357 |
| 358 LocalFrame* frame = box().frame(); | 358 LocalFrame* frame = box().frame(); |
| 359 ASSERT(frame); | 359 ASSERT(frame); |
| 360 | 360 |
| 361 RefPtr<FrameView> frameView = box().frameView(); | 361 RefPtrWillBeRawPtr<FrameView> frameView = box().frameView(); |
| 362 | 362 |
| 363 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ScrollLayer",
"data", InspectorScrollLayerEvent::data(&box())); | 363 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ScrollLayer",
"data", InspectorScrollLayerEvent::data(&box())); |
| 364 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli
ne migrates to tracing. | 364 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli
ne migrates to tracing. |
| 365 InspectorInstrumentation::willScrollLayer(&box()); | 365 InspectorInstrumentation::willScrollLayer(&box()); |
| 366 | 366 |
| 367 const RenderLayerModelObject* paintInvalidationContainer = box().containerFo
rPaintInvalidation(); | 367 const RenderLayerModelObject* paintInvalidationContainer = box().containerFo
rPaintInvalidation(); |
| 368 | 368 |
| 369 // Update the positions of our child layers (if needed as only fixed layers
should be impacted by a scroll). | 369 // Update the positions of our child layers (if needed as only fixed layers
should be impacted by a scroll). |
| 370 // We don't update compositing layers, because we need to do a deep update f
rom the compositing ancestor. | 370 // We don't update compositing layers, because we need to do a deep update f
rom the compositing ancestor. |
| 371 if (!frameView->isInPerformLayout()) { | 371 if (!frameView->isInPerformLayout()) { |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 if (Node* node = renderer.node()) { | 843 if (Node* node = renderer.node()) { |
| 844 if (ShadowRoot* shadowRoot = node->containingShadowRoot()) { | 844 if (ShadowRoot* shadowRoot = node->containingShadowRoot()) { |
| 845 if (shadowRoot->type() == ShadowRoot::UserAgentShadowRoot) | 845 if (shadowRoot->type() == ShadowRoot::UserAgentShadowRoot) |
| 846 return shadowRoot->host()->renderer(); | 846 return shadowRoot->host()->renderer(); |
| 847 } | 847 } |
| 848 } | 848 } |
| 849 | 849 |
| 850 return &renderer; | 850 return &renderer; |
| 851 } | 851 } |
| 852 | 852 |
| 853 PassRefPtr<Scrollbar> RenderLayerScrollableArea::createScrollbar(ScrollbarOrient
ation orientation) | 853 PassRefPtrWillBeRawPtr<Scrollbar> RenderLayerScrollableArea::createScrollbar(Scr
ollbarOrientation orientation) |
| 854 { | 854 { |
| 855 RefPtr<Scrollbar> widget; | 855 RefPtrWillBeRawPtr<Scrollbar> widget = nullptr; |
| 856 RenderObject* actualRenderer = rendererForScrollbar(box()); | 856 RenderObject* actualRenderer = rendererForScrollbar(box()); |
| 857 bool hasCustomScrollbarStyle = actualRenderer->isBox() && actualRenderer->st
yle()->hasPseudoStyle(SCROLLBAR); | 857 bool hasCustomScrollbarStyle = actualRenderer->isBox() && actualRenderer->st
yle()->hasPseudoStyle(SCROLLBAR); |
| 858 if (hasCustomScrollbarStyle) { | 858 if (hasCustomScrollbarStyle) { |
| 859 widget = RenderScrollbar::createCustomScrollbar(this, orientation, actua
lRenderer->node()); | 859 widget = RenderScrollbar::createCustomScrollbar(this, orientation, actua
lRenderer->node()); |
| 860 } else { | 860 } else { |
| 861 ScrollbarControlSize scrollbarSize = RegularScrollbar; | 861 ScrollbarControlSize scrollbarSize = RegularScrollbar; |
| 862 if (actualRenderer->style()->hasAppearance()) | 862 if (actualRenderer->style()->hasAppearance()) |
| 863 scrollbarSize = RenderTheme::theme().scrollbarControlSizeForPart(act
ualRenderer->style()->appearance()); | 863 scrollbarSize = RenderTheme::theme().scrollbarControlSizeForPart(act
ualRenderer->style()->appearance()); |
| 864 widget = Scrollbar::create(this, orientation, scrollbarSize); | 864 widget = Scrollbar::create(this, orientation, scrollbarSize); |
| 865 if (orientation == HorizontalScrollbar) | 865 if (orientation == HorizontalScrollbar) |
| 866 didAddScrollbar(widget.get(), HorizontalScrollbar); | 866 didAddScrollbar(widget.get(), HorizontalScrollbar); |
| 867 else | 867 else |
| 868 didAddScrollbar(widget.get(), VerticalScrollbar); | 868 didAddScrollbar(widget.get(), VerticalScrollbar); |
| 869 } | 869 } |
| 870 box().document().view()->addChild(widget.get()); | 870 box().document().view()->addChild(widget.get()); |
| 871 return widget.release(); | 871 return widget.release(); |
| 872 } | 872 } |
| 873 | 873 |
| 874 void RenderLayerScrollableArea::destroyScrollbar(ScrollbarOrientation orientatio
n) | 874 void RenderLayerScrollableArea::destroyScrollbar(ScrollbarOrientation orientatio
n) |
| 875 { | 875 { |
| 876 RefPtr<Scrollbar>& scrollbar = orientation == HorizontalScrollbar ? m_hBar :
m_vBar; | 876 RefPtrWillBePersistent<Scrollbar>& scrollbar = orientation == HorizontalScro
llbar ? m_hBar : m_vBar; |
| 877 if (!scrollbar) | 877 if (!scrollbar) |
| 878 return; | 878 return; |
| 879 | 879 |
| 880 if (!scrollbar->isCustomScrollbar()) | 880 if (!scrollbar->isCustomScrollbar()) |
| 881 willRemoveScrollbar(scrollbar.get(), orientation); | 881 willRemoveScrollbar(scrollbar.get(), orientation); |
| 882 | 882 |
| 883 scrollbar->removeFromParent(); | 883 scrollbar->removeFromParent(); |
| 884 scrollbar->disconnectFromScrollableArea(); | 884 scrollbar->disconnectFromScrollableArea(); |
| 885 scrollbar = nullptr; | 885 scrollbar = nullptr; |
| 886 } | 886 } |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1470 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild) | 1470 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild) |
| 1471 { | 1471 { |
| 1472 // We only want to track the topmost scroll child for scrollable areas with | 1472 // We only want to track the topmost scroll child for scrollable areas with |
| 1473 // overlay scrollbars. | 1473 // overlay scrollbars. |
| 1474 if (!hasOverlayScrollbars()) | 1474 if (!hasOverlayScrollbars()) |
| 1475 return; | 1475 return; |
| 1476 m_nextTopmostScrollChild = scrollChild; | 1476 m_nextTopmostScrollChild = scrollChild; |
| 1477 } | 1477 } |
| 1478 | 1478 |
| 1479 } // namespace blink | 1479 } // namespace blink |
| OLD | NEW |