| 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 585b1e8b770cdd16cd13057670d708ef477ca809..c9c898fa1d927b9dbacf4893b17f21ca47ef56dd 100644
|
| --- a/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
|
| +++ b/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
|
| @@ -977,4 +977,25 @@ TEST_F(FrameThrottlingTest, UpdatePaintPropertiesOnUnthrottling) {
|
| innerDiv->layoutObject()->paintProperties()->transform()->matrix());
|
| }
|
|
|
| +TEST_F(FrameThrottlingTest, DisplayNoneNotThrottled) {
|
| + SimRequest mainResource("https://example.com/", "text/html");
|
| +
|
| + loadURL("https://example.com/");
|
| + mainResource.complete(
|
| + "<style>iframe { transform: translateY(480px); }</style>"
|
| + "<iframe sandbox id=frame></iframe>");
|
| +
|
| + auto* frameElement = toHTMLIFrameElement(document().getElementById("frame"));
|
| + auto* frameDocument = frameElement->contentDocument();
|
| +
|
| + // Initially the frame is throttled as it is offscreen.
|
| + compositeFrame();
|
| + EXPECT_TRUE(frameDocument->view()->canThrottleRendering());
|
| +
|
| + // Setting display:none unthrottles the frame.
|
| + frameElement->setAttribute(styleAttr, "display: none");
|
| + compositeFrame();
|
| + EXPECT_FALSE(frameDocument->view()->canThrottleRendering());
|
| +}
|
| +
|
| } // namespace blink
|
|
|