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

Side by Side Diff: Source/core/paint/DeprecatedPaintLayerClipper.h

Issue 1184303003: Ignore overflow clip on root layer if HitTestRequest::IgnoreClipping is set. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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) 2003, 2009, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Intel Corporation. All rights reserved. 3 * Copyright (C) 2013 Intel Corporation. All rights 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@web.de> 10 * Christian Biesinger <cbiesinger@web.de>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 }; 58 };
59 59
60 class ClipRectsContext { 60 class ClipRectsContext {
61 public: 61 public:
62 ClipRectsContext(const DeprecatedPaintLayer* root, ClipRectsCacheSlot slot, OverlayScrollbarSizeRelevancy relevancy = IgnoreOverlayScrollbarSize, const Layo utSize& accumulation = LayoutSize()) 62 ClipRectsContext(const DeprecatedPaintLayer* root, ClipRectsCacheSlot slot, OverlayScrollbarSizeRelevancy relevancy = IgnoreOverlayScrollbarSize, const Layo utSize& accumulation = LayoutSize())
63 : rootLayer(root) 63 : rootLayer(root)
64 , scrollbarRelevancy(relevancy) 64 , scrollbarRelevancy(relevancy)
65 , cacheSlot(slot) 65 , cacheSlot(slot)
66 , subPixelAccumulation(accumulation) 66 , subPixelAccumulation(accumulation)
67 , respectOverflowClip(slot == PaintingClipRectsIgnoringOverflowClip ? Ig noreOverflowClip : RespectOverflowClip) 67 , respectOverflowClip(slot == PaintingClipRectsIgnoringOverflowClip ? Ig noreOverflowClip : RespectOverflowClip)
68 , respectOverflowClipForViewport(slot == RootRelativeClipRectsIgnoringVi ewportClip ? IgnoreOverflowClip : RespectOverflowClip)
68 { 69 {
69 } 70 }
70 71
71 void setIgnoreOverflowClip() 72 void setIgnoreOverflowClip()
72 { 73 {
73 ASSERT(!usesCache() || cacheSlot == PaintingClipRects); 74 ASSERT(!usesCache() || cacheSlot == PaintingClipRects);
74 ASSERT(respectOverflowClip == RespectOverflowClip); 75 ASSERT(respectOverflowClip == RespectOverflowClip);
75 if (usesCache()) 76 if (usesCache())
76 cacheSlot = PaintingClipRectsIgnoringOverflowClip; 77 cacheSlot = PaintingClipRectsIgnoringOverflowClip;
77 respectOverflowClip = IgnoreOverflowClip; 78 respectOverflowClip = IgnoreOverflowClip;
78 } 79 }
79 80
80 bool usesCache() const 81 bool usesCache() const
81 { 82 {
82 return cacheSlot != UncachedClipRects; 83 return cacheSlot != UncachedClipRects;
83 } 84 }
84 85
85 const DeprecatedPaintLayer* const rootLayer; 86 const DeprecatedPaintLayer* const rootLayer;
86 const OverlayScrollbarSizeRelevancy scrollbarRelevancy; 87 const OverlayScrollbarSizeRelevancy scrollbarRelevancy;
87 88
88 private: 89 private:
89 friend class DeprecatedPaintLayerClipper; 90 friend class DeprecatedPaintLayerClipper;
90 91
91 ClipRectsCacheSlot cacheSlot; 92 ClipRectsCacheSlot cacheSlot;
92 LayoutSize subPixelAccumulation; 93 LayoutSize subPixelAccumulation;
93 ShouldRespectOverflowClip respectOverflowClip; 94 ShouldRespectOverflowClip respectOverflowClip;
95 ShouldRespectOverflowClip respectOverflowClipForViewport;
94 }; 96 };
95 97
96 class DeprecatedPaintLayerClipper { 98 class DeprecatedPaintLayerClipper {
97 WTF_MAKE_NONCOPYABLE(DeprecatedPaintLayerClipper); 99 WTF_MAKE_NONCOPYABLE(DeprecatedPaintLayerClipper);
98 public: 100 public:
99 explicit DeprecatedPaintLayerClipper(LayoutBoxModelObject&); 101 explicit DeprecatedPaintLayerClipper(LayoutBoxModelObject&);
100 102
101 void clearClipRectsIncludingDescendants(); 103 void clearClipRectsIncludingDescendants();
102 void clearClipRectsIncludingDescendants(ClipRectsCacheSlot); 104 void clearClipRectsIncludingDescendants(ClipRectsCacheSlot);
103 105
(...skipping 28 matching lines...) Expand all
132 134
133 DeprecatedPaintLayer* clippingRootForPainting() const; 135 DeprecatedPaintLayer* clippingRootForPainting() const;
134 136
135 ClipRectsCache& cache() const 137 ClipRectsCache& cache() const
136 { 138 {
137 if (!m_cache) 139 if (!m_cache)
138 m_cache = adoptPtr(new ClipRectsCache); 140 m_cache = adoptPtr(new ClipRectsCache);
139 return *m_cache; 141 return *m_cache;
140 } 142 }
141 143
144 bool shouldRespectOverflowClip(const ClipRectsContext&) const;
145
142 // FIXME: Could this be a LayoutBox? 146 // FIXME: Could this be a LayoutBox?
143 LayoutBoxModelObject& m_layoutObject; 147 LayoutBoxModelObject& m_layoutObject;
144 mutable OwnPtr<ClipRectsCache> m_cache; 148 mutable OwnPtr<ClipRectsCache> m_cache;
145 }; 149 };
146 150
147 } // namespace blink 151 } // namespace blink
148 152
149 #endif // LayerClipper_h 153 #endif // LayerClipper_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698