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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 } | 357 } |
358 | 358 |
359 if (scrollOffset() == toDoubleSize(newScrollOffset)) | 359 if (scrollOffset() == toDoubleSize(newScrollOffset)) |
360 return; | 360 return; |
361 | 361 |
362 m_scrollOffset = toDoubleSize(newScrollOffset); | 362 m_scrollOffset = toDoubleSize(newScrollOffset); |
363 | 363 |
364 LocalFrame* frame = box().frame(); | 364 LocalFrame* frame = box().frame(); |
365 ASSERT(frame); | 365 ASSERT(frame); |
366 | 366 |
367 RefPtr<FrameView> frameView = box().frameView(); | 367 RefPtrWillBeRawPtr<FrameView> frameView = box().frameView(); |
368 | 368 |
369 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ScrollLayer",
"data", InspectorScrollLayerEvent::data(&box())); | 369 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ScrollLayer",
"data", InspectorScrollLayerEvent::data(&box())); |
370 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli
ne migrates to tracing. | 370 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli
ne migrates to tracing. |
371 InspectorInstrumentation::willScrollLayer(&box()); | 371 InspectorInstrumentation::willScrollLayer(&box()); |
372 | 372 |
373 const RenderLayerModelObject* paintInvalidationContainer = box().containerFo
rPaintInvalidation(); | 373 const RenderLayerModelObject* paintInvalidationContainer = box().containerFo
rPaintInvalidation(); |
374 | 374 |
375 // Update the positions of our child layers (if needed as only fixed layers
should be impacted by a scroll). | 375 // Update the positions of our child layers (if needed as only fixed layers
should be impacted by a scroll). |
376 // We don't update compositing layers, because we need to do a deep update f
rom the compositing ancestor. | 376 // We don't update compositing layers, because we need to do a deep update f
rom the compositing ancestor. |
377 if (!frameView->isInPerformLayout()) { | 377 if (!frameView->isInPerformLayout()) { |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 if (Node* node = renderer.node()) { | 859 if (Node* node = renderer.node()) { |
860 if (ShadowRoot* shadowRoot = node->containingShadowRoot()) { | 860 if (ShadowRoot* shadowRoot = node->containingShadowRoot()) { |
861 if (shadowRoot->type() == ShadowRoot::UserAgentShadowRoot) | 861 if (shadowRoot->type() == ShadowRoot::UserAgentShadowRoot) |
862 return shadowRoot->host()->renderer(); | 862 return shadowRoot->host()->renderer(); |
863 } | 863 } |
864 } | 864 } |
865 | 865 |
866 return &renderer; | 866 return &renderer; |
867 } | 867 } |
868 | 868 |
869 PassRefPtr<Scrollbar> RenderLayerScrollableArea::createScrollbar(ScrollbarOrient
ation orientation) | 869 PassRefPtrWillBeRawPtr<Scrollbar> RenderLayerScrollableArea::createScrollbar(Scr
ollbarOrientation orientation) |
870 { | 870 { |
871 RefPtr<Scrollbar> widget; | 871 RefPtrWillBeRawPtr<Scrollbar> widget = nullptr; |
872 RenderObject* actualRenderer = rendererForScrollbar(box()); | 872 RenderObject* actualRenderer = rendererForScrollbar(box()); |
873 bool hasCustomScrollbarStyle = actualRenderer->isBox() && actualRenderer->st
yle()->hasPseudoStyle(SCROLLBAR); | 873 bool hasCustomScrollbarStyle = actualRenderer->isBox() && actualRenderer->st
yle()->hasPseudoStyle(SCROLLBAR); |
874 if (hasCustomScrollbarStyle) { | 874 if (hasCustomScrollbarStyle) { |
875 widget = RenderScrollbar::createCustomScrollbar(this, orientation, actua
lRenderer->node()); | 875 widget = RenderScrollbar::createCustomScrollbar(this, orientation, actua
lRenderer->node()); |
876 } else { | 876 } else { |
877 ScrollbarControlSize scrollbarSize = RegularScrollbar; | 877 ScrollbarControlSize scrollbarSize = RegularScrollbar; |
878 if (actualRenderer->style()->hasAppearance()) | 878 if (actualRenderer->style()->hasAppearance()) |
879 scrollbarSize = RenderTheme::theme().scrollbarControlSizeForPart(act
ualRenderer->style()->appearance()); | 879 scrollbarSize = RenderTheme::theme().scrollbarControlSizeForPart(act
ualRenderer->style()->appearance()); |
880 widget = Scrollbar::create(this, orientation, scrollbarSize); | 880 widget = Scrollbar::create(this, orientation, scrollbarSize); |
881 if (orientation == HorizontalScrollbar) | 881 if (orientation == HorizontalScrollbar) |
882 didAddScrollbar(widget.get(), HorizontalScrollbar); | 882 didAddScrollbar(widget.get(), HorizontalScrollbar); |
883 else | 883 else |
884 didAddScrollbar(widget.get(), VerticalScrollbar); | 884 didAddScrollbar(widget.get(), VerticalScrollbar); |
885 } | 885 } |
886 box().document().view()->addChild(widget.get()); | 886 box().document().view()->addChild(widget.get()); |
887 return widget.release(); | 887 return widget.release(); |
888 } | 888 } |
889 | 889 |
890 void RenderLayerScrollableArea::destroyScrollbar(ScrollbarOrientation orientatio
n) | 890 void RenderLayerScrollableArea::destroyScrollbar(ScrollbarOrientation orientatio
n) |
891 { | 891 { |
892 RefPtr<Scrollbar>& scrollbar = orientation == HorizontalScrollbar ? m_hBar :
m_vBar; | 892 RefPtrWillBePersistent<Scrollbar>& scrollbar = orientation == HorizontalScro
llbar ? m_hBar : m_vBar; |
893 if (!scrollbar) | 893 if (!scrollbar) |
894 return; | 894 return; |
895 | 895 |
896 if (!scrollbar->isCustomScrollbar()) | 896 if (!scrollbar->isCustomScrollbar()) |
897 willRemoveScrollbar(scrollbar.get(), orientation); | 897 willRemoveScrollbar(scrollbar.get(), orientation); |
898 | 898 |
899 toFrameView(scrollbar->parent())->removeChild(scrollbar.get()); | 899 toFrameView(scrollbar->parent())->removeChild(scrollbar.get()); |
900 scrollbar->disconnectFromScrollableArea(); | 900 scrollbar->disconnectFromScrollableArea(); |
901 scrollbar = nullptr; | 901 scrollbar = nullptr; |
902 } | 902 } |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1486 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild) | 1486 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild) |
1487 { | 1487 { |
1488 // We only want to track the topmost scroll child for scrollable areas with | 1488 // We only want to track the topmost scroll child for scrollable areas with |
1489 // overlay scrollbars. | 1489 // overlay scrollbars. |
1490 if (!hasOverlayScrollbars()) | 1490 if (!hasOverlayScrollbars()) |
1491 return; | 1491 return; |
1492 m_nextTopmostScrollChild = scrollChild; | 1492 m_nextTopmostScrollChild = scrollChild; |
1493 } | 1493 } |
1494 | 1494 |
1495 } // namespace blink | 1495 } // namespace blink |
OLD | NEW |