Avoid backing store for layers with empty text nodes in a few more cases
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Mar 2017 02:48:20 +0000 (02:48 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Mar 2017 02:48:20 +0000 (02:48 +0000)
commit7f1c63f11e477987ae0100d528a8e36e9fd2d803
treebf6811767f05dce8825ed918f6e89f2046af51a5
parent8881352f5b3c910e2b060a466f9b787cfe9a1aea
Avoid backing store for layers with empty text nodes in a few more cases
https://bugs.webkit.org/show_bug.cgi?id=169185

Reviewed by Dan Bernstein.

Source/WebCore:

In hasPaintingNonLayerDescendants() we can check whether the RenderText's linesBoundingBox()
is empty to avoid backing store in a few more cases. Also use containsOnlyWhitespace() rather
than isAllCollapsibleWhitespace(), because there's no need for backing store for non-selectable
whitespace text.

Covered by existing tests.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):

LayoutTests:

inline-block-no-backing.html enhanced to have a layer with non-collapsible whitespace (an &nbsp;).

Rebaselined other tests.

* compositing/backing/inline-block-no-backing-expected.txt:
* compositing/backing/inline-block-no-backing.html:
* compositing/iframes/page-cache-layer-tree-expected.txt:
* css3/blending/blend-mode-clip-accelerated-blending-canvas-expected.txt:
* platform/ios-simulator-wk2/compositing/backing/inline-block-no-backing-expected.txt:
* platform/ios-simulator-wk2/compositing/iframes/page-cache-layer-tree-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213440 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/compositing/backing/inline-block-no-backing-expected.txt
LayoutTests/compositing/backing/inline-block-no-backing.html
LayoutTests/compositing/iframes/page-cache-layer-tree-expected.txt
LayoutTests/css3/blending/blend-mode-clip-accelerated-blending-canvas-expected.txt
LayoutTests/platform/ios-simulator-wk2/compositing/backing/inline-block-no-backing-expected.txt
LayoutTests/platform/ios-simulator-wk2/compositing/iframes/page-cache-layer-tree-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp