RenderLayer::clipRects may return nullptr.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Sep 2016 16:52:47 +0000 (16:52 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Sep 2016 16:52:47 +0000 (16:52 +0000)
commit10d31fe0cb842909d79f522b560c58f113bd64ef
treeda5e5cbe43b8418690ff96246e58c7c89fff8487
parent162a9ee0c3e272bbda45320ebceebe975c9d1bcc
RenderLayer::clipRects may return nullptr.
https://bugs.webkit.org/show_bug.cgi?id=162729

Reviewed by Chris Dumez.

This patch refactors RenderLayer::updateClipRects(), parentClipRects() and backgroundClipRect()
so that we don't have to rely on this seemingly unsafe line: clipRects = *parent()->clipRects(clipRectsContext);
Now updateClipRects() returns the computed/cached clip rects as opposed to update and refetch them.
While this patch makes the code look more readable/safer, it also eliminates cached item tripple retrievals.

No change in functionality.

* rendering/RenderLayer.cpp:
(WebCore::ClipRectsCache::getClipRects):
(WebCore::ClipRectsCache::setClipRects):
(WebCore::RenderLayer::updateClipRects):
(WebCore::RenderLayer::clipRects):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayer.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206639 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h