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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintInvalidationTest.cpp

Issue 2713773003: Add test for paint underinvalidation fix with animated transform overflow. (Closed)
Patch Set: Set style attribute in test Created 3 years, 9 months 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/frame/FrameView.h"
6 #include "core/layout/LayoutTestHelper.h"
7 #include "core/layout/LayoutView.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace blink {
11
12 namespace {
13
14 class PaintInvalidationTest : public RenderingTest {
15 public:
16 PaintInvalidationTest()
17 : RenderingTest(SingleChildLocalFrameClient::create()) {}
18 };
19
20 // Changing style in a way that changes overflow without layout should cause
21 // the layout view to possibly need a paint invalidation since we may have
22 // revealed additional background that can be scrolled into view.
23 TEST_F(PaintInvalidationTest, RecalcOverflowInvalidatesBackground) {
24 document().page()->settings().setViewportEnabled(true);
25 setBodyInnerHTML(
26 "<!DOCTYPE html>"
27 "<style type='text/css'>"
28 " body, html {"
29 " width: 100%;"
30 " height: 100%;"
31 " margin: 0px;"
32 " }"
33 " #container {"
34 " width: 100%;"
35 " height: 100%;"
36 " }"
37 "</style>"
38 "<div id='container'></div>");
39
40 document().view()->updateAllLifecyclePhases();
41
42 ScrollableArea* scrollableArea = document().view();
43 ASSERT_EQ(scrollableArea->maximumScrollOffset().height(), 0);
44 EXPECT_FALSE(document().layoutView()->mayNeedPaintInvalidation());
45
46 Element* container = document().getElementById("container");
47 container->setAttribute(HTMLNames::styleAttr,
48 "transform: translateY(1000px);");
49 document().updateStyleAndLayoutTree();
50
51 EXPECT_EQ(scrollableArea->maximumScrollOffset().height(), 1000);
52 EXPECT_TRUE(document().layoutView()->mayNeedPaintInvalidation());
53 }
54
55 } // namespace
56
57 } // namespace blink
OLDNEW
« 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