Changeset 246845 in webkit
- Timestamp:
- Jun 26, 2019 12:12:40 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r246844 r246845 1 2019-06-26 Simon Fraser <simon.fraser@apple.com> 2 3 Incorrect clippping with overflow:scroll inside oveflow:hidden with border-radius 4 https://bugs.webkit.org/show_bug.cgi?id=199135 5 rdar://problem/51882383 6 7 Reviewed by Zalan Bujtas. 8 9 * compositing/scrolling/async-overflow-scrolling/border-radius-on-scroll-container-expected.html: Added. 10 * compositing/scrolling/async-overflow-scrolling/border-radius-on-scroll-container.html: Added. 11 1 12 2019-06-26 Antoine Quint <graouts@apple.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r246844 r246845 1 2019-06-26 Simon Fraser <simon.fraser@apple.com> 2 3 Incorrect clippping with overflow:scroll inside oveflow:hidden with border-radius 4 https://bugs.webkit.org/show_bug.cgi?id=199135 5 rdar://problem/51882383 6 7 Reviewed by Zalan Bujtas. 8 9 In some cases the geometry of the shape mask layer added to m_childContainmentLayer, for 10 border-radius, was incorrect. GraphicsLayerCA::updateClippingStrategy() treated 11 the rounded rect as if it were in renderer coordinates, but to match the other geometry 12 on GraphicsLayer, it should in GraphicsLayer coordinates, so we need to offset by 13 clipLayer->offsetFromRenderer(). 14 15 In addition, RenderLayerBacking::updateChildClippingStrategy() is called from 16 the updateConfiguration(), which is before we've set offsetFromRenderer() on the clipLayer. 17 This first call is really to find out whether the platform supports this rounded rect 18 as a shape mask. 19 20 So we need to call setMasksToBoundsRect() a second time in RenderLayerBacking::updateGeometry() 21 after clipLayers's offsetFromRenderer() has been computed. 22 23 Test: compositing/scrolling/async-overflow-scrolling/border-radius-on-scroll-container.html 24 25 * platform/graphics/ca/GraphicsLayerCA.cpp: 26 (WebCore::GraphicsLayerCA::updateClippingStrategy): 27 * rendering/RenderLayerBacking.cpp: 28 (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): 29 (WebCore::RenderLayerBacking::updateDescendantClippingLayer): 30 (WebCore::RenderLayerBacking::updateChildClippingStrategy): 31 1 32 2019-06-26 Antoine Quint <graouts@apple.com> 2 33 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r246471 r246845 2603 2603 } 2604 2604 2605 shapeMaskLayer->setPosition(roundedRect.rect().location() - offsetFromRenderer());2605 shapeMaskLayer->setPosition(roundedRect.rect().location()); 2606 2606 FloatRect shapeBounds({ }, roundedRect.rect().size()); 2607 2607 shapeMaskLayer->setBounds(shapeBounds); -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r246725 r246845 1173 1173 clipLayer->setOffsetFromRenderer(toLayoutSize(clippingBox.location() - snappedClippingGraphicsLayer.m_snapDelta)); 1174 1174 1175 if ((renderer().style().clipPath() || renderer().style().hasBorderRadius()) && !m_childClippingMaskLayer) { 1176 LayoutRect boxRect(LayoutPoint(), downcast<RenderBox>(renderer()).size()); 1177 FloatRoundedRect contentsClippingRect = renderer().style().getRoundedInnerBorderFor(boxRect).pixelSnappedRoundedRectForPainting(deviceScaleFactor()); 1178 contentsClippingRect.move(LayoutSize(-clipLayer->offsetFromRenderer())); 1179 clipLayer->setMasksToBoundsRect(contentsClippingRect); 1180 } 1181 1175 1182 if (m_childClippingMaskLayer && !m_scrollContainerLayer) { 1176 1183 m_childClippingMaskLayer->setSize(clipLayer->size()); … … 1869 1876 if (hasClippingLayer() && needsDescendantsClippingLayer) { 1870 1877 if (is<RenderBox>(renderer()) && (renderer().style().clipPath() || renderer().style().hasBorderRadius())) { 1878 auto* clipLayer = clippingLayer(); 1871 1879 LayoutRect boxRect(LayoutPoint(), downcast<RenderBox>(renderer()).size()); 1872 boxRect.move(contentOffsetInCompositingLayer());1873 1880 FloatRoundedRect contentsClippingRect = renderer().style().getRoundedInnerBorderFor(boxRect).pixelSnappedRoundedRectForPainting(deviceScaleFactor()); 1874 if (clippingLayer()->setMasksToBoundsRect(contentsClippingRect)) { 1875 clippingLayer()->setMaskLayer(nullptr); 1881 contentsClippingRect.move(LayoutSize(clipLayer->offsetFromRenderer())); 1882 // Note that we have to set this rounded rect again during the geometry update (clipLayer->offsetFromRenderer() may be stale here). 1883 if (clipLayer->setMasksToBoundsRect(contentsClippingRect)) { 1884 clipLayer->setMaskLayer(nullptr); 1876 1885 GraphicsLayer::clear(m_childClippingMaskLayer); 1877 1886 return; … … 1892 1901 } else 1893 1902 if (hasClippingLayer()) 1894 clippingLayer()->setMasksToBoundsRect(FloatRoundedRect(FloatRect( FloatPoint(), clippingLayer()->size())));1903 clippingLayer()->setMasksToBoundsRect(FloatRoundedRect(FloatRect({ }, clippingLayer()->size()))); 1895 1904 } 1896 1905 }
Note: See TracChangeset
for help on using the changeset viewer.