[iOS] -webkit-overflow-scrolling: touch prevents repaint with RTL
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jun 2016 02:58:16 +0000 (02:58 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jun 2016 02:58:16 +0000 (02:58 +0000)
commit1290d40e9f052ca9df520a711fd78411a82011cb
tree0d02dab3c670ba8c7c9b1e6cd875a438c6425d6c
parent1cad79ba9773d5814d2823647886987d51175952
[iOS] -webkit-overflow-scrolling: touch prevents repaint with RTL
https://bugs.webkit.org/show_bug.cgi?id=159186
rdar://problem/26659341

Reviewed by Zalan Bujtas.
Source/WebCore:

There were two issues with repaints in -webkit-overflow-scrolling:touch scrolling
layers.

First, if the scrolled contents were inline (e.g. a <span>), then repaints were
broken because RenderInline didn't call shouldApplyClipAndScrollPositionForRepaint().
Fix by making shouldApplyClipAndScrollPositionForRepaint() a member function of RenderBox
and calling it from RenderBox::computeRectForRepaint() and RenderInline::clippedOverflowRectForRepaint().

Second, repaints were broken in RTL because RenderLayerBacking::setContentsNeedDisplayInRect()
confused scroll offset and scroll position; it needs to subtract scrollPosition.

Finally renamed to applyCachedClipAndScrollOffsetForRepaint() to applyCachedClipAndScrollPositionForRepaint()
to make it clear that it uses scrollPosition, not scrollOffset.

Tests: compositing/scrolling/touch-scrolling-repaint-spans.html
       compositing/scrolling/touch-scrolling-repaint.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::applyCachedClipAndScrollPositionForRepaint):
(WebCore::RenderBox::shouldApplyClipAndScrollPositionForRepaint):
(WebCore::RenderBox::computeRectForRepaint):
(WebCore::RenderBox::applyCachedClipAndScrollOffsetForRepaint): Deleted.
(WebCore::shouldApplyContainersClipAndOffset): Deleted.
* rendering/RenderBox.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::clippedOverflowRectForRepaint):
(WebCore::RenderInline::computeRectForRepaint):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::computeRectForRepaint):

LayoutTests:

* compositing/scrolling/touch-scrolling-repaint-expected.html: Added.
* compositing/scrolling/touch-scrolling-repaint-spans-expected.html: Added.
* compositing/scrolling/touch-scrolling-repaint-spans.html: Added.
* compositing/scrolling/touch-scrolling-repaint.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@202536 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/compositing/scrolling/touch-scrolling-repaint-expected.html [new file with mode: 0644]
LayoutTests/compositing/scrolling/touch-scrolling-repaint-spans-expected.html [new file with mode: 0644]
LayoutTests/compositing/scrolling/touch-scrolling-repaint-spans.html [new file with mode: 0644]
LayoutTests/compositing/scrolling/touch-scrolling-repaint.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderObject.cpp