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

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

Issue 1586723003: Fix a bad cast in PaintLayerClipper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert inline flow changes Created 4 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/containment/inline-paint-containment-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 } 67 }
68 68
69 static void applyClipRects(const ClipRectsContext& context, const LayoutObject& layoutObject, LayoutPoint offset, ClipRects& clipRects) 69 static void applyClipRects(const ClipRectsContext& context, const LayoutObject& layoutObject, LayoutPoint offset, ClipRects& clipRects)
70 { 70 {
71 ASSERT(layoutObject.hasOverflowClip() || layoutObject.hasClip() || layoutObj ect.style()->containsPaint()); 71 ASSERT(layoutObject.hasOverflowClip() || layoutObject.hasClip() || layoutObj ect.style()->containsPaint());
72 LayoutView* view = layoutObject.view(); 72 LayoutView* view = layoutObject.view();
73 ASSERT(view); 73 ASSERT(view);
74 if (clipRects.fixed() && context.rootLayer->layoutObject() == view) 74 if (clipRects.fixed() && context.rootLayer->layoutObject() == view)
75 offset -= toIntSize(view->frameView()->scrollPosition()); 75 offset -= toIntSize(view->frameView()->scrollPosition());
76 if (layoutObject.hasOverflowClip() || layoutObject.style()->containsPaint()) { 76 if (layoutObject.hasOverflowClip() || (layoutObject.style()->containsPaint() && layoutObject.isBox())) {
77 ClipRect newOverflowClip = toLayoutBox(layoutObject).overflowClipRect(of fset, context.scrollbarRelevancy); 77 ClipRect newOverflowClip = toLayoutBox(layoutObject).overflowClipRect(of fset, context.scrollbarRelevancy);
78 newOverflowClip.setHasRadius(layoutObject.style()->hasBorderRadius()); 78 newOverflowClip.setHasRadius(layoutObject.style()->hasBorderRadius());
79 clipRects.setOverflowClipRect(intersection(newOverflowClip, clipRects.ov erflowClipRect())); 79 clipRects.setOverflowClipRect(intersection(newOverflowClip, clipRects.ov erflowClipRect()));
80 if (layoutObject.isPositioned()) 80 if (layoutObject.isPositioned())
81 clipRects.setPosClipRect(intersection(newOverflowClip, clipRects.pos ClipRect())); 81 clipRects.setPosClipRect(intersection(newOverflowClip, clipRects.pos ClipRect()));
82 if (layoutObject.isLayoutView()) 82 if (layoutObject.isLayoutView())
83 clipRects.setFixedClipRect(intersection(newOverflowClip, clipRects.f ixedClipRect())); 83 clipRects.setFixedClipRect(intersection(newOverflowClip, clipRects.f ixedClipRect()));
84 if (layoutObject.style()->containsPaint()) { 84 if (layoutObject.style()->containsPaint()) {
85 clipRects.setPosClipRect(intersection(newOverflowClip, clipRects.pos ClipRect())); 85 clipRects.setPosClipRect(intersection(newOverflowClip, clipRects.pos ClipRect()));
86 clipRects.setFixedClipRect(intersection(newOverflowClip, clipRects.f ixedClipRect())); 86 clipRects.setFixedClipRect(intersection(newOverflowClip, clipRects.f ixedClipRect()));
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 foregroundRect = backgroundRect; 209 foregroundRect = backgroundRect;
210 210
211 LayoutPoint offset; 211 LayoutPoint offset;
212 if (offsetFromRoot) 212 if (offsetFromRoot)
213 offset = *offsetFromRoot; 213 offset = *offsetFromRoot;
214 else 214 else
215 m_layoutObject.layer()->convertToLayerCoords(context.rootLayer, offset); 215 m_layoutObject.layer()->convertToLayerCoords(context.rootLayer, offset);
216 layerBounds = LayoutRect(offset, LayoutSize(m_layoutObject.layer()->size())) ; 216 layerBounds = LayoutRect(offset, LayoutSize(m_layoutObject.layer()->size())) ;
217 217
218 // Update the clip rects that will be passed to child layers. 218 // Update the clip rects that will be passed to child layers.
219 if ((m_layoutObject.hasOverflowClip() && shouldRespectOverflowClip(context)) || m_layoutObject.style()->containsPaint()) { 219 if ((m_layoutObject.hasOverflowClip() && shouldRespectOverflowClip(context))
220 || (m_layoutObject.style()->containsPaint() && m_layoutObject.isBox())) {
220 foregroundRect.intersect(toLayoutBox(m_layoutObject).overflowClipRect(of fset, context.scrollbarRelevancy)); 221 foregroundRect.intersect(toLayoutBox(m_layoutObject).overflowClipRect(of fset, context.scrollbarRelevancy));
221 if (m_layoutObject.style()->hasBorderRadius()) 222 if (m_layoutObject.style()->hasBorderRadius())
222 foregroundRect.setHasRadius(true); 223 foregroundRect.setHasRadius(true);
223 224
224 // FIXME: Does not do the right thing with columns yet, since we don't y et factor in the 225 // FIXME: Does not do the right thing with columns yet, since we don't y et factor in the
225 // individual column boxes as overflow. 226 // individual column boxes as overflow.
226 227
227 // The LayoutView is special since its overflow clipping rect may be lar ger than its box rect (crbug.com/492871). 228 // The LayoutView is special since its overflow clipping rect may be lar ger than its box rect (crbug.com/492871).
228 LayoutRect layerBoundsWithVisualOverflow = m_layoutObject.isLayoutView() ? toLayoutView(m_layoutObject).viewRect() : toLayoutBox(m_layoutObject).visualO verflowRect(); 229 LayoutRect layerBoundsWithVisualOverflow = m_layoutObject.isLayoutView() ? toLayoutView(m_layoutObject).viewRect() : toLayoutBox(m_layoutObject).visualO verflowRect();
229 toLayoutBox(m_layoutObject).flipForWritingMode(layerBoundsWithVisualOver flow); // PaintLayer are in physical coordinates, so the overflow has to be flip ped. 230 toLayoutBox(m_layoutObject).flipForWritingMode(layerBoundsWithVisualOver flow); // PaintLayer are in physical coordinates, so the overflow has to be flip ped.
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 335
335 ClipRects* PaintLayerClipper::paintingClipRects(const PaintLayer* rootLayer, Sho uldRespectOverflowClip respectOverflowClip, const LayoutSize& subpixelAccumulati on) const 336 ClipRects* PaintLayerClipper::paintingClipRects(const PaintLayer* rootLayer, Sho uldRespectOverflowClip respectOverflowClip, const LayoutSize& subpixelAccumulati on) const
336 { 337 {
337 ClipRectsContext context(rootLayer, PaintingClipRects, IgnoreOverlayScrollba rSize, subpixelAccumulation); 338 ClipRectsContext context(rootLayer, PaintingClipRects, IgnoreOverlayScrollba rSize, subpixelAccumulation);
338 if (respectOverflowClip == IgnoreOverflowClip) 339 if (respectOverflowClip == IgnoreOverflowClip)
339 context.setIgnoreOverflowClip(); 340 context.setIgnoreOverflowClip();
340 return getClipRects(context); 341 return getClipRects(context);
341 } 342 }
342 343
343 } // namespace blink 344 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/containment/inline-paint-containment-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698