Title: [210330] trunk/Source/WebCore
Revision
210330
Author
[email protected]
Date
2017-01-05 08:17:22 -0800 (Thu, 05 Jan 2017)

Log Message

Remove some unnecessary page cache checks in render tree code.
<https://webkit.org/b/166728>

Reviewed by Antti Koivisto.

There is no render tree in the page cache, so we don't need to be checking
for it in renderer code.

* rendering/RenderElement.cpp:
(WebCore::shouldRepaintForImageAnimation):
(WebCore::RenderElement::newImageAnimationFrameAvailable):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageChanged):
* rendering/RenderObject.cpp:
(WebCore::printRenderTreeForLiveDocuments):
(WebCore::printLayerTreeForLiveDocuments):
* rendering/RenderView.cpp:
(WebCore::RenderView::lazyRepaintTimerFired):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (210329 => 210330)


--- trunk/Source/WebCore/ChangeLog	2017-01-05 16:02:44 UTC (rev 210329)
+++ trunk/Source/WebCore/ChangeLog	2017-01-05 16:17:22 UTC (rev 210330)
@@ -1,5 +1,26 @@
 2017-01-05  Andreas Kling  <[email protected]>
 
+        Remove some unnecessary page cache checks in render tree code.
+        <https://webkit.org/b/166728>
+
+        Reviewed by Antti Koivisto.
+
+        There is no render tree in the page cache, so we don't need to be checking
+        for it in renderer code.
+
+        * rendering/RenderElement.cpp:
+        (WebCore::shouldRepaintForImageAnimation):
+        (WebCore::RenderElement::newImageAnimationFrameAvailable):
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::imageChanged):
+        * rendering/RenderObject.cpp:
+        (WebCore::printRenderTreeForLiveDocuments):
+        (WebCore::printLayerTreeForLiveDocuments):
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::lazyRepaintTimerFired):
+
+2017-01-05  Andreas Kling  <[email protected]>
+
         REGRESSION(r210226): overflow:scroll scroll position not restored on back navigation
         <https://webkit.org/b/166724>
 

Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (210329 => 210330)


--- trunk/Source/WebCore/rendering/RenderElement.cpp	2017-01-05 16:02:44 UTC (rev 210329)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp	2017-01-05 16:17:22 UTC (rev 210330)
@@ -1432,8 +1432,6 @@
 static bool shouldRepaintForImageAnimation(const RenderElement& renderer, const IntRect& visibleRect)
 {
     const Document& document = renderer.document();
-    if (document.pageCacheState() != Document::NotInPageCache)
-        return false;
     if (document.activeDOMObjectsAreSuspended())
         return false;
     if (renderer.style().visibility() != VISIBLE)
@@ -1491,8 +1489,6 @@
 
 void RenderElement::newImageAnimationFrameAvailable(CachedImage& image)
 {
-    if (document().pageCacheState() != Document::NotInPageCache)
-        return;
     auto& frameView = view().frameView();
     auto visibleRect = frameView.windowToContents(frameView.windowClipRect());
     if (!shouldRepaintForImageAnimation(*this, visibleRect)) {

Modified: trunk/Source/WebCore/rendering/RenderImage.cpp (210329 => 210330)


--- trunk/Source/WebCore/rendering/RenderImage.cpp	2017-01-05 16:02:44 UTC (rev 210329)
+++ trunk/Source/WebCore/rendering/RenderImage.cpp	2017-01-05 16:17:22 UTC (rev 210330)
@@ -230,10 +230,7 @@
 
 void RenderImage::imageChanged(WrappedImagePtr newImage, const IntRect* rect)
 {
-    // FIXME (86669): Instead of the RenderImage determining whether its document is in the page
-    // cache, the RenderImage should remove itself as a client when its document is put into the
-    // page cache.
-    if (documentBeingDestroyed() || document().pageCacheState() != Document::NotInPageCache)
+    if (documentBeingDestroyed())
         return;
 
     if (hasVisibleBoxDecorations() || hasMask() || hasShapeOutside())

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (210329 => 210330)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2017-01-05 16:02:44 UTC (rev 210329)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2017-01-05 16:17:22 UTC (rev 210330)
@@ -2015,7 +2015,7 @@
 void printRenderTreeForLiveDocuments()
 {
     for (const auto* document : Document::allDocuments()) {
-        if (!document->renderView() || document->pageCacheState() != Document::NotInPageCache)
+        if (!document->renderView())
             continue;
         if (document->frame() && document->frame()->isMainFrame())
             fprintf(stderr, "----------------------main frame--------------------------\n");
@@ -2027,7 +2027,7 @@
 void printLayerTreeForLiveDocuments()
 {
     for (const auto* document : Document::allDocuments()) {
-        if (!document->renderView() || document->pageCacheState() != Document::NotInPageCache)
+        if (!document->renderView())
             continue;
         if (document->frame() && document->frame()->isMainFrame())
             fprintf(stderr, "----------------------main frame--------------------------\n");

Modified: trunk/Source/WebCore/rendering/RenderView.cpp (210329 => 210330)


--- trunk/Source/WebCore/rendering/RenderView.cpp	2017-01-05 16:02:44 UTC (rev 210329)
+++ trunk/Source/WebCore/rendering/RenderView.cpp	2017-01-05 16:17:22 UTC (rev 210330)
@@ -168,11 +168,8 @@
 
 void RenderView::lazyRepaintTimerFired()
 {
-    bool shouldRepaint = document().pageCacheState() == Document::NotInPageCache;
-
     for (auto& renderer : m_renderersNeedingLazyRepaint) {
-        if (shouldRepaint)
-            renderer->repaint();
+        renderer->repaint();
         renderer->setRenderBoxNeedsLazyRepaint(false);
     }
     m_renderersNeedingLazyRepaint.clear();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to