Changeset 164252 in webkit
- Timestamp:
- Feb 17, 2014 3:45:44 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r164249 r164252 1 2014-02-17 Simon Fraser <simon.fraser@apple.com> 2 3 box-shadows get truncated with a combination of transforms and clip: (affects Google Maps) 4 https://bugs.webkit.org/show_bug.cgi?id=128937 5 6 Reviewed by Dean Jackson. 7 8 Test with CSS clip() with a rect larger than the border box, and compositing. 9 10 * compositing/geometry/clip-expected.txt: New expectation. This is a progression. 11 * compositing/geometry/css-clip-oversize-expected.html: Added. 12 * compositing/geometry/css-clip-oversize.html: Added. 13 1 14 2014-02-17 Chris Fleizach <cfleizach@apple.com> 2 15 -
trunk/LayoutTests/compositing/geometry/clip-expected.txt
r146531 r164252 9 9 (children 2 10 10 (GraphicsLayer 11 (position 20.00 20.00) 12 (bounds 100.00 100.00) 13 (contentsOpaque 1) 11 (position 15.00 15.00) 12 (bounds 110.00 110.00) 14 13 (drawsContent 1) 15 14 (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00]) -
trunk/Source/WebCore/ChangeLog
r164251 r164252 1 2014-02-17 Simon Fraser <simon.fraser@apple.com> 2 3 box-shadows get truncated with a combination of transforms and clip: (affects Google Maps) 4 https://bugs.webkit.org/show_bug.cgi?id=128937 5 6 Reviewed by Dean Jackson. 7 8 RenderLayer::calculateLayerBounds() incorrectly assumed that if localClipRect() returns 9 a non-infinite rect, that rect is OK to use as the compositing bounds. 10 11 That is not a valid assumption when clip() has a larger rect than the element (e.g. 12 with negative top/left in the rect). In that case, localClipRect() still just 13 returns the background rect, but we actually need a larger compositing layer 14 to show the unclipped parts of descendants. 15 16 Fix by detecting clip() that exceeds the renderer bounds, and when it does, 17 not early returning in the UseLocalClipRectIfPossible clause. 18 19 Test: compositing/geometry/css-clip-oversize.html 20 21 * rendering/RenderLayer.cpp: 22 (WebCore::RenderLayer::localClipRect): Do a convertToLayerCoords() 23 because we need offsetFromRoot later, and we can pass our value down to 24 calculateRects(). Compute clipExceedsBounds based on the CSS clip rect. 25 (WebCore::RenderLayer::calculateClipRects): Don't early return if clipExceedsBounds 26 is true. 27 * rendering/RenderLayer.h: 28 1 29 2014-02-17 Antti Koivisto <antti@apple.com> 2 30 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r164103 r164252 5527 5527 } 5528 5528 5529 LayoutRect RenderLayer::localClipRect() const 5530 { 5529 LayoutRect RenderLayer::localClipRect(bool& clipExceedsBounds) const 5530 { 5531 clipExceedsBounds = false; 5532 5531 5533 // FIXME: border-radius not accounted for. 5532 5534 // FIXME: Regions not accounted for. 5533 5535 RenderLayer* clippingRootLayer = clippingRootForPainting(); 5536 5537 LayoutPoint offsetFromRoot; 5538 convertToLayerCoords(clippingRootLayer, offsetFromRoot); 5539 5534 5540 LayoutRect layerBounds; 5535 5541 ClipRect backgroundRect, foregroundRect, outlineRect; 5536 5542 ClipRectsContext clipRectsContext(clippingRootLayer, 0, PaintingClipRects); 5537 calculateRects(clipRectsContext, LayoutRect::infiniteRect(), layerBounds, backgroundRect, foregroundRect, outlineRect );5543 calculateRects(clipRectsContext, LayoutRect::infiniteRect(), layerBounds, backgroundRect, foregroundRect, outlineRect, &offsetFromRoot); 5538 5544 5539 5545 LayoutRect clipRect = backgroundRect.rect(); 5540 5546 if (clipRect == LayoutRect::infiniteRect()) 5541 5547 return clipRect; 5548 5549 if (renderer().hasClip()) { 5550 // CSS clip may be larger than our border box. 5551 LayoutRect cssClipRect = toRenderBox(renderer()).clipRect(offsetFromRoot, clipRectsContext.region); 5552 clipExceedsBounds = !clipRect.contains(cssClipRect); 5553 } 5542 5554 5543 5555 LayoutPoint clippingRootOffset; … … 5730 5742 5731 5743 if (flags & UseLocalClipRectIfPossible) { 5732 LayoutRect localClipRect = this->localClipRect(); 5733 if (localClipRect != LayoutRect::infiniteRect()) { 5744 bool clipExceedsBounds = false; 5745 LayoutRect localClipRect = this->localClipRect(clipExceedsBounds); 5746 if (localClipRect != LayoutRect::infiniteRect() && !clipExceedsBounds) { 5734 5747 if ((flags & IncludeSelfTransform) && paintsWithTransform(PaintBehaviorNormal)) 5735 5748 localClipRect = transform()->mapRect(localClipRect); -
trunk/Source/WebCore/rendering/RenderLayer.h
r163955 r164252 694 694 LayoutRect childrenClipRect() const; // Returns the foreground clip rect of the layer in the document's coordinate space. 695 695 LayoutRect selfClipRect() const; // Returns the background clip rect of the layer in the document's coordinate space. 696 LayoutRect localClipRect( ) const; // Returns the background clip rect of the layer in the local coordinate space.696 LayoutRect localClipRect(bool& clipExceedsBounds) const; // Returns the background clip rect of the layer in the local coordinate space. 697 697 698 698 // Pass offsetFromRoot if known.
Note: See TracChangeset
for help on using the changeset viewer.