Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 2644243002: Move ScrollableArea timer to TaskRunnerTimer. (Closed)
Patch Set: use derived class in unique_ptr Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@gmail.com> 10 * Christian Biesinger <cbiesinger@gmail.com>
(...skipping 30 matching lines...) Expand all
41 * If you do not delete the provisions above, a recipient may use your 41 * If you do not delete the provisions above, a recipient may use your
42 * version of this file under any of the LGPL, the MPL or the GPL. 42 * version of this file under any of the LGPL, the MPL or the GPL.
43 */ 43 */
44 44
45 #include "core/paint/PaintLayerScrollableArea.h" 45 #include "core/paint/PaintLayerScrollableArea.h"
46 46
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/DOMNodeIds.h" 49 #include "core/dom/DOMNodeIds.h"
50 #include "core/dom/Node.h" 50 #include "core/dom/Node.h"
51 #include "core/dom/TaskRunnerHelper.h"
51 #include "core/dom/shadow/ShadowRoot.h" 52 #include "core/dom/shadow/ShadowRoot.h"
52 #include "core/editing/FrameSelection.h" 53 #include "core/editing/FrameSelection.h"
53 #include "core/frame/FrameHost.h" 54 #include "core/frame/FrameHost.h"
54 #include "core/frame/FrameView.h" 55 #include "core/frame/FrameView.h"
55 #include "core/frame/LocalFrame.h" 56 #include "core/frame/LocalFrame.h"
56 #include "core/frame/PageScaleConstraintsSet.h" 57 #include "core/frame/PageScaleConstraintsSet.h"
57 #include "core/frame/RootFrameViewport.h" 58 #include "core/frame/RootFrameViewport.h"
58 #include "core/frame/Settings.h" 59 #include "core/frame/Settings.h"
59 #include "core/frame/VisualViewport.h" 60 #include "core/frame/VisualViewport.h"
60 #include "core/html/HTMLFrameOwnerElement.h" 61 #include "core/html/HTMLFrameOwnerElement.h"
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 const FloatQuad& quad, 876 const FloatQuad& quad,
876 const LayoutObject* localObject, 877 const LayoutObject* localObject,
877 MapCoordinatesFlags flags) const { 878 MapCoordinatesFlags flags) const {
878 LayoutBox* box = layoutBox(); 879 LayoutBox* box = layoutBox();
879 if (!box) 880 if (!box)
880 return quad; 881 return quad;
881 DCHECK(localObject); 882 DCHECK(localObject);
882 return localObject->localToAncestorQuad(quad, box, flags); 883 return localObject->localToAncestorQuad(quad, box, flags);
883 } 884 }
884 885
886 RefPtr<WebTaskRunner> PaintLayerScrollableArea::getTimerTaskRunner() const {
887 return TaskRunnerHelper::get(TaskType::UnspecedTimer, box().frame());
888 }
889
885 ScrollBehavior PaintLayerScrollableArea::scrollBehaviorStyle() const { 890 ScrollBehavior PaintLayerScrollableArea::scrollBehaviorStyle() const {
886 return box().style()->getScrollBehavior(); 891 return box().style()->getScrollBehavior();
887 } 892 }
888 893
889 bool PaintLayerScrollableArea::hasHorizontalOverflow() const { 894 bool PaintLayerScrollableArea::hasHorizontalOverflow() const {
890 // TODO(szager): Make the algorithm for adding/subtracting overflow:auto 895 // TODO(szager): Make the algorithm for adding/subtracting overflow:auto
891 // scrollbars memoryless (crbug.com/625300). This clientWidth hack will 896 // scrollbars memoryless (crbug.com/625300). This clientWidth hack will
892 // prevent the spurious horizontal scrollbar, but it can cause a converse 897 // prevent the spurious horizontal scrollbar, but it can cause a converse
893 // problem: it can leave a sliver of horizontal overflow hidden behind the 898 // problem: it can leave a sliver of horizontal overflow hidden behind the
894 // vertical scrollbar without creating a horizontal scrollbar. This 899 // vertical scrollbar without creating a horizontal scrollbar. This
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after
2105 2110
2106 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: 2111 void PaintLayerScrollableArea::DelayScrollOffsetClampScope::
2107 clampScrollableAreas() { 2112 clampScrollableAreas() {
2108 for (auto& scrollableArea : *s_needsClamp) 2113 for (auto& scrollableArea : *s_needsClamp)
2109 scrollableArea->clampScrollOffsetAfterOverflowChange(); 2114 scrollableArea->clampScrollOffsetAfterOverflowChange();
2110 delete s_needsClamp; 2115 delete s_needsClamp;
2111 s_needsClamp = nullptr; 2116 s_needsClamp = nullptr;
2112 } 2117 }
2113 2118
2114 } // namespace blink 2119 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698