Too much repainting on scrolling with fixed backgrounds
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 12 Apr 2015 17:30:58 +0000 (17:30 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 12 Apr 2015 17:30:58 +0000 (17:30 +0000)
commit4b81748d8f37a3778c77fb6d35a655c8da905ca5
tree14c2938607a423292c7f11c5ec8c584d1fd8af80
parent9d80c05e70d80cad4a7e26c549070d9f37d53384
Too much repainting on scrolling with fixed backgrounds
https://bugs.webkit.org/show_bug.cgi?id=143637
rdar://problem/20245243

Reviewed by Darin Adler.

Source/WebCore:

FrameView::scrollContentsSlowPath() would repaint the entire viewport if there were
any slow-repaint objects (those with background-attachment: fixed) and the contents
were using compositing for scrolling.

This is wrong; we only need to issue repaint for the slow-repaint renderers,
and, if the frame is hosted in a compositing layer and not using compositing for scrolling,
repaint that hosting layer.

Tests: compositing/repaint/iframes/composited-iframe-with-fixed-background-doc-repaint.html
       compositing/repaint/iframes/compositing-iframe-scroll-repaint.html
       compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint.html
       platform/mac-wk2/tiled-drawing/fixed-background-scroll-repaint.html

* page/FrameView.cpp:
(WebCore::FrameView::scrollContentsSlowPath):

LayoutTests:

Tests with various configurations of iframes and compositing, which dump layer trees with
repaint rectangles.

Also tiled-scrolling test that exercises the simple case.

Put WebKit1-specific results in platform/mac-wk1, since they are very different from
WK2 and other platforms, due to WK1-specific layer hosting and repaint behaviors.

* compositing/repaint/iframes/composited-iframe-with-fixed-background-doc-repaint-expected.txt: Added.
* compositing/repaint/iframes/composited-iframe-with-fixed-background-doc-repaint.html: Added.
* compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt: Added.
* compositing/repaint/iframes/compositing-iframe-scroll-repaint.html: Added.
* compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt: Added.
* compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint.html: Added.
* compositing/repaint/iframes/resources/compositing-document.html: Added.
* compositing/repaint/iframes/resources/compositing-fixed-background-document.html: Added.
* compositing/repaint/iframes/resources/fixed-background-document.html: Added.
* platform/mac-wk1/compositing/repaint/iframes/composited-iframe-with-fixed-background-doc-repaint-expected.txt: Added.
* platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt: Added.
* platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt: Added.
* platform/mac-wk2/compositing/repaint/fixed-background-scroll-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background-scroll-repaint-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/fixed-background-scroll-repaint.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182669 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
LayoutTests/ChangeLog
LayoutTests/compositing/repaint/iframes/composited-iframe-with-fixed-background-doc-repaint-expected.txt [new file with mode: 0644]
LayoutTests/compositing/repaint/iframes/composited-iframe-with-fixed-background-doc-repaint.html [new file with mode: 0644]
LayoutTests/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt [new file with mode: 0644]
LayoutTests/compositing/repaint/iframes/compositing-iframe-scroll-repaint.html [new file with mode: 0644]
LayoutTests/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt [new file with mode: 0644]
LayoutTests/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint.html [new file with mode: 0644]
LayoutTests/compositing/repaint/iframes/resources/compositing-document.html [new file with mode: 0644]
LayoutTests/compositing/repaint/iframes/resources/compositing-fixed-background-document.html [new file with mode: 0644]
LayoutTests/compositing/repaint/iframes/resources/fixed-background-document.html [new file with mode: 0644]
LayoutTests/platform/mac-wk1/compositing/repaint/iframes/composited-iframe-with-fixed-background-doc-repaint-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk2/compositing/repaint/fixed-background-scroll-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed-background-scroll-repaint-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk2/tiled-drawing/fixed-background-scroll-repaint.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp