Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp

Issue 2598073003: [SPInvalidation] Update paint properties of frame subtree when unthrottled (Closed)
Patch Set: Disable the new test for non-SlimmingPaintInvalidation Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp b/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
index 24bdf713dc49dc96cec156c32d75146a0d685a4c..a8a1d766ca97bc7f19f16fc65de34b18b62327d3 100644
--- a/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
+++ b/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
@@ -13,6 +13,7 @@
#include "core/page/FocusController.h"
#include "core/page/Page.h"
#include "core/paint/PaintLayer.h"
+#include "platform/graphics/paint/TransformPaintPropertyNode.h"
#include "platform/testing/URLTestHelpers.h"
#include "platform/testing/UnitTestHelpers.h"
#include "public/platform/WebDisplayItemList.h"
@@ -930,4 +931,50 @@ TEST_F(FrameThrottlingTest, AllowOneAnimationFrame) {
EXPECT_TRUE(result->IsTrue());
}
+TEST_F(FrameThrottlingTest, UpdatePaintPropertiesOnUnthrottling) {
+ if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
+ return;
+
+ SimRequest mainResource("https://example.com/", "text/html");
+ SimRequest frameResource("https://example.com/iframe.html", "text/html");
+
+ loadURL("https://example.com/");
+ mainResource.complete("<iframe id=frame sandbox src=iframe.html></iframe>");
+ frameResource.complete("<div id='div'>Inner</div>");
+ compositeFrame();
+
+ auto* frameElement = toHTMLIFrameElement(document().getElementById("frame"));
+ auto* frameDocument = frameElement->contentDocument();
+ auto* innerDiv = frameDocument->getElementById("div");
+ auto* innerDivObject = innerDiv->layoutObject();
+ EXPECT_FALSE(frameDocument->view()->shouldThrottleRendering());
+
+ frameElement->setAttribute(HTMLNames::styleAttr,
+ "transform: translateY(1000px)");
+ compositeFrame();
+ EXPECT_TRUE(frameDocument->view()->canThrottleRendering());
+ EXPECT_FALSE(innerDivObject->paintProperties()->transform());
+
+ // Mutating the throttled frame should not cause paint property update.
+ innerDiv->setAttribute(HTMLNames::styleAttr, "transform: translateY(20px)");
+ EXPECT_FALSE(compositor().needsBeginFrame());
+ EXPECT_TRUE(frameDocument->view()->canThrottleRendering());
+ {
+ DocumentLifecycle::AllowThrottlingScope throttlingScope(
+ document().lifecycle());
+ document().view()->updateAllLifecyclePhases();
+ }
+ EXPECT_FALSE(innerDivObject->paintProperties()->transform());
+
+ // Move the frame back on screen to unthrottle it.
+ frameElement->setAttribute(HTMLNames::styleAttr, "");
+ // The first update unthrottles the frame, the second actually update layout
+ // and paint properties etc.
+ compositeFrame();
+ compositeFrame();
+ EXPECT_FALSE(frameDocument->view()->canThrottleRendering());
+ EXPECT_EQ(TransformationMatrix().translate(0, 20),
+ innerDiv->layoutObject()->paintProperties()->transform()->matrix());
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698