Changeset 202536 in webkit
- Timestamp:
- Jun 27, 2016 7:58:16 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r202532 r202536 1 2016-06-27 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS] -webkit-overflow-scrolling: touch prevents repaint with RTL 4 https://bugs.webkit.org/show_bug.cgi?id=159186 5 rdar://problem/26659341 6 7 Reviewed by Zalan Bujtas. 8 9 * compositing/scrolling/touch-scrolling-repaint-expected.html: Added. 10 * compositing/scrolling/touch-scrolling-repaint-spans-expected.html: Added. 11 * compositing/scrolling/touch-scrolling-repaint-spans.html: Added. 12 * compositing/scrolling/touch-scrolling-repaint.html: Added. 13 1 14 2016-06-27 Simon Fraser <simon.fraser@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r202533 r202536 1 2016-06-27 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS] -webkit-overflow-scrolling: touch prevents repaint with RTL 4 https://bugs.webkit.org/show_bug.cgi?id=159186 5 rdar://problem/26659341 6 7 Reviewed by Zalan Bujtas. 8 9 There were two issues with repaints in -webkit-overflow-scrolling:touch scrolling 10 layers. 11 12 First, if the scrolled contents were inline (e.g. a <span>), then repaints were 13 broken because RenderInline didn't call shouldApplyClipAndScrollPositionForRepaint(). 14 Fix by making shouldApplyClipAndScrollPositionForRepaint() a member function of RenderBox 15 and calling it from RenderBox::computeRectForRepaint() and RenderInline::clippedOverflowRectForRepaint(). 16 17 Second, repaints were broken in RTL because RenderLayerBacking::setContentsNeedDisplayInRect() 18 confused scroll offset and scroll position; it needs to subtract scrollPosition. 19 20 Finally renamed to applyCachedClipAndScrollOffsetForRepaint() to applyCachedClipAndScrollPositionForRepaint() 21 to make it clear that it uses scrollPosition, not scrollOffset. 22 23 Tests: compositing/scrolling/touch-scrolling-repaint-spans.html 24 compositing/scrolling/touch-scrolling-repaint.html 25 26 * rendering/RenderBox.cpp: 27 (WebCore::RenderBox::applyCachedClipAndScrollPositionForRepaint): 28 (WebCore::RenderBox::shouldApplyClipAndScrollPositionForRepaint): 29 (WebCore::RenderBox::computeRectForRepaint): 30 (WebCore::RenderBox::applyCachedClipAndScrollOffsetForRepaint): Deleted. 31 (WebCore::shouldApplyContainersClipAndOffset): Deleted. 32 * rendering/RenderBox.h: 33 * rendering/RenderInline.cpp: 34 (WebCore::RenderInline::clippedOverflowRectForRepaint): 35 (WebCore::RenderInline::computeRectForRepaint): 36 * rendering/RenderLayerBacking.cpp: 37 (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect): 38 * rendering/RenderObject.cpp: 39 (WebCore::RenderObject::computeRectForRepaint): 40 1 41 2016-06-27 Commit Queue <commit-queue@webkit.org> 2 42 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r202103 r202536 1013 1013 } 1014 1014 1015 void RenderBox::applyCachedClipAndScroll OffsetForRepaint(LayoutRect& paintRect) const1015 void RenderBox::applyCachedClipAndScrollPositionForRepaint(LayoutRect& paintRect) const 1016 1016 { 1017 1017 flipForWritingMode(paintRect); … … 2195 2195 } 2196 2196 2197 static inline bool shouldApplyContainersClipAndOffset(const RenderLayerModelObject* repaintContainer, RenderBox* containerBox) 2197 bool RenderBox::shouldApplyClipAndScrollPositionForRepaint(const RenderLayerModelObject* repaintContainer) const 2198 2198 { 2199 2199 #if PLATFORM(IOS) 2200 if (!repaintContainer || repaintContainer != containerBox)2200 if (!repaintContainer || repaintContainer != this) 2201 2201 return true; 2202 2202 2203 return ! containerBox->hasLayer() || !containerBox->layer()->usesCompositedScrolling();2203 return !hasLayer() || !layer()->usesCompositedScrolling(); 2204 2204 #else 2205 2205 UNUSED_PARAM(repaintContainer); 2206 UNUSED_PARAM(containerBox);2207 2206 return true; 2208 2207 #endif … … 2310 2309 if (container->hasOverflowClip()) { 2311 2310 RenderBox& containerBox = downcast<RenderBox>(*container); 2312 if ( shouldApplyContainersClipAndOffset(repaintContainer, &containerBox)) {2313 containerBox.applyCachedClipAndScroll OffsetForRepaint(adjustedRect);2311 if (containerBox.shouldApplyClipAndScrollPositionForRepaint(repaintContainer)) { 2312 containerBox.applyCachedClipAndScrollPositionForRepaint(adjustedRect); 2314 2313 if (adjustedRect.isEmpty()) 2315 2314 return adjustedRect; -
trunk/Source/WebCore/rendering/RenderBox.h
r201701 r202536 578 578 ScrollPosition scrollPosition() const; 579 579 LayoutSize cachedSizeForOverflowClip() const; 580 void applyCachedClipAndScrollOffsetForRepaint(LayoutRect& paintRect) const; 580 581 bool shouldApplyClipAndScrollPositionForRepaint(const RenderLayerModelObject* repaintContainer) const; 582 void applyCachedClipAndScrollPositionForRepaint(LayoutRect& paintRect) const; 581 583 582 584 virtual bool hasRelativeDimensions() const; -
trunk/Source/WebCore/rendering/RenderInline.cpp
r201635 r202536 1235 1235 return repaintRect; 1236 1236 1237 if (containingBlock->hasOverflowClip() )1238 containingBlock->applyCachedClipAndScroll OffsetForRepaint(repaintRect);1237 if (containingBlock->hasOverflowClip() && containingBlock->shouldApplyClipAndScrollPositionForRepaint(repaintContainer)) 1238 containingBlock->applyCachedClipAndScrollPositionForRepaint(repaintRect); 1239 1239 1240 1240 repaintRect = containingBlock->computeRectForRepaint(repaintRect, repaintContainer); … … 1297 1297 adjustedRect.setLocation(topLeft); 1298 1298 if (container->hasOverflowClip()) { 1299 downcast<RenderBox>(*container).applyCachedClipAndScroll OffsetForRepaint(adjustedRect);1299 downcast<RenderBox>(*container).applyCachedClipAndScrollPositionForRepaint(adjustedRect); 1300 1300 if (adjustedRect.isEmpty()) 1301 1301 return adjustedRect; -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r202005 r202536 2285 2285 layerDirtyRect.move(-m_scrollingContentsLayer->offsetFromRenderer() + m_devicePixelFractionFromRenderer); 2286 2286 #if PLATFORM(IOS) 2287 // Account for the fact that RenderLayerBacking::updateGeometry() bakes scrollOffset into offsetFromRenderer on iOS. 2288 layerDirtyRect.moveBy(-m_owningLayer.scrollOffset() + m_devicePixelFractionFromRenderer); 2287 // Account for the fact that RenderLayerBacking::updateGeometry() bakes scrollOffset into offsetFromRenderer on iOS, 2288 // but the repaint rect is computed without taking the scroll position into account (see shouldApplyClipAndScrollPositionForRepaint()). 2289 layerDirtyRect.moveBy(-m_owningLayer.scrollPosition()); 2289 2290 #endif 2290 2291 m_scrollingContentsLayer->setNeedsDisplayInRect(layerDirtyRect, shouldClip); -
trunk/Source/WebCore/rendering/RenderObject.cpp
r202292 r202536 979 979 LayoutRect adjustedRect = rect; 980 980 if (parent->hasOverflowClip()) { 981 downcast<RenderBox>(*parent).applyCachedClipAndScroll OffsetForRepaint(adjustedRect);981 downcast<RenderBox>(*parent).applyCachedClipAndScrollPositionForRepaint(adjustedRect); 982 982 if (adjustedRect.isEmpty()) 983 983 return adjustedRect;
Note: See TracChangeset
for help on using the changeset viewer.