Changeset 234187 in webkit
- Timestamp:
- Jul 24, 2018 9:09:47 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r234186 r234187 1 2018-07-24 Simon Fraser <simon.fraser@apple.com> 2 3 Animation stops with object-fit:contain on an animated 2d canvas 4 https://bugs.webkit.org/show_bug.cgi?id=187840 5 6 Reviewed by Zalan Bujtas. 7 8 * fast/repaint/canvas-object-fit-expected.txt: Added. 9 * fast/repaint/canvas-object-fit.html: Added. 10 1 11 2018-07-24 Basuke Suzuki <Basuke.Suzuki@sony.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r234186 r234187 1 2018-07-24 Simon Fraser <simon.fraser@apple.com> 2 3 Animation stops with object-fit:contain on an animated 2d canvas 4 https://bugs.webkit.org/show_bug.cgi?id=187840 5 6 Reviewed by Zalan Bujtas. 7 8 If a canvas has object-fit: cover or contain, repaints need to mapped through 9 the rect that is used to position the canvas in the element bounds, which is replacedContentRect(). 10 11 Add a version of replacedContentRect() that doesn't require passing the intrinsicSize() since 12 all but RenderVideo just pass the RenderReplaced's intrinsicSize. 13 14 Test: fast/repaint/canvas-object-fit.html 15 16 * html/HTMLCanvasElement.cpp: 17 (WebCore::HTMLCanvasElement::didDraw): 18 * rendering/RenderHTMLCanvas.cpp: 19 (WebCore::RenderHTMLCanvas::paintReplaced): 20 * rendering/RenderImage.cpp: 21 (WebCore::RenderImage::updateInnerContentRect): 22 (WebCore::RenderImage::paintReplaced): 23 * rendering/RenderLayerBacking.cpp: 24 (WebCore::RenderLayerBacking::contentsBox const): 25 * rendering/RenderReplaced.h: 26 (WebCore::RenderReplaced::replacedContentRect const): 27 * rendering/shapes/ShapeOutsideInfo.cpp: 28 (WebCore::ShapeOutsideInfo::createShapeForImage const): 29 1 30 2018-07-24 Basuke Suzuki <Basuke.Suzuki@sony.com> 2 31 -
trunk/Source/WebCore/html/HTMLCanvasElement.cpp
r233827 r234187 509 509 510 510 FloatRect dirtyRect = rect; 511 if (RenderBox* ro = renderBox()) { 512 FloatRect destRect = ro->contentBoxRect(); 511 if (auto* renderer = renderBox()) { 512 FloatRect destRect; 513 if (is<RenderReplaced>(renderer)) 514 destRect = downcast<RenderReplaced>(renderer)->replacedContentRect(); 515 else 516 destRect = renderer->contentBoxRect(); 517 513 518 // Inflate dirty rect to cover antialiasing on image buffers. 514 519 if (drawingContext() && drawingContext()->shouldAntialias()) 515 520 dirtyRect.inflate(1); 521 516 522 FloatRect r = mapRect(dirtyRect, FloatRect(0, 0, size().width(), size().height()), destRect); 517 523 r.intersect(destRect); 524 518 525 if (!r.isEmpty() && !m_dirtyRect.contains(r)) { 519 526 m_dirtyRect.unite(r); 520 r o->repaintRectangle(enclosingIntRect(m_dirtyRect));527 renderer->repaintRectangle(enclosingIntRect(m_dirtyRect)); 521 528 } 522 529 } -
trunk/Source/WebCore/rendering/RenderHTMLCanvas.cpp
r224537 r234187 75 75 LayoutRect contentBoxRect = this->contentBoxRect(); 76 76 contentBoxRect.moveBy(paintOffset); 77 LayoutRect replacedContentRect = this->replacedContentRect( intrinsicSize());77 LayoutRect replacedContentRect = this->replacedContentRect(); 78 78 replacedContentRect.moveBy(paintOffset); 79 79 -
trunk/Source/WebCore/rendering/RenderImage.cpp
r233872 r234187 286 286 { 287 287 // Propagate container size to image resource. 288 IntSize containerSize(replacedContentRect( intrinsicSize()).size());288 IntSize containerSize(replacedContentRect().size()); 289 289 if (!containerSize.isEmpty()) { 290 290 URL imageSourceURL; … … 498 498 LayoutRect contentBoxRect = this->contentBoxRect(); 499 499 contentBoxRect.moveBy(paintOffset); 500 LayoutRect replacedContentRect = this->replacedContentRect( intrinsicSize());500 LayoutRect replacedContentRect = this->replacedContentRect(); 501 501 replacedContentRect.moveBy(paintOffset); 502 502 bool clip = !contentBoxRect.contains(replacedContentRect); -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r233552 r234187 2345 2345 if (is<RenderReplaced>(renderBox)) { 2346 2346 RenderReplaced& renderReplaced = downcast<RenderReplaced>(renderBox); 2347 contentsRect = renderReplaced.replacedContentRect( renderBox.intrinsicSize());2347 contentsRect = renderReplaced.replacedContentRect(); 2348 2348 } else 2349 2349 contentsRect = renderBox.contentBoxRect(); -
trunk/Source/WebCore/rendering/RenderReplaced.h
r228908 r234187 35 35 36 36 LayoutRect replacedContentRect(const LayoutSize& intrinsicSize) const; 37 LayoutRect replacedContentRect() const { return replacedContentRect(intrinsicSize()); } 37 38 38 39 bool hasReplacedLogicalWidth() const; -
trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp
r233302 r234187 152 152 const LayoutRect& marginRect = getShapeImageMarginRect(m_renderer, m_referenceBoxLogicalSize); 153 153 const LayoutRect& imageRect = is<RenderImage>(m_renderer) 154 ? downcast<RenderImage>(m_renderer).replacedContentRect( m_renderer.intrinsicSize())154 ? downcast<RenderImage>(m_renderer).replacedContentRect() 155 155 : LayoutRect(LayoutPoint(), imageSize); 156 156
Note: See TracChangeset
for help on using the changeset viewer.