Commit bcfd4f0a authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

Invalidate viewport paint properties when related settings change

Change-Id: I0e1ccb72d54caacec495f003e0a61c974354e4c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2514801Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823319}
parent 470eaa02
......@@ -413,6 +413,7 @@
{
name: "mainFrameClipsContent",
initial: true,
invalidate: "ViewportPaintProperties",
},
// For android.webkit.WebSettings.setUseWideViewport()
......@@ -835,7 +836,7 @@
{
name: "hideScrollbars",
initial: false,
invalidate: "ViewportScrollbar",
invalidate: "ViewportPaintProperties",
},
// Spellchecking is enabled by default for elements that do not specify it explicitly
......
......@@ -54,7 +54,7 @@ class CORE_EXPORT SettingsDelegate {
kStyleChange,
kViewportDescriptionChange,
kViewportRuleChange,
kViewportScrollbarChange,
kViewportPaintPropertiesChange,
kDNSPrefetchingChange,
kImageLoadingChange,
kTextAutosizingChange,
......
......@@ -644,8 +644,13 @@ void Page::SettingsChanged(SettingsDelegate::ChangeType change_type) {
TextAutosizer::UpdatePageInfoInAllFrames(MainFrame());
}
break;
case SettingsDelegate::kViewportScrollbarChange:
case SettingsDelegate::kViewportPaintPropertiesChange:
GetVisualViewport().SetNeedsPaintPropertyUpdate();
GetVisualViewport().InitializeScrollbars();
if (auto* local_frame = DynamicTo<LocalFrame>(MainFrame())) {
if (LocalFrameView* view = local_frame->View())
view->SetNeedsPaintPropertyUpdate();
}
break;
case SettingsDelegate::kDNSPrefetchingChange:
for (Frame* frame = MainFrame(); frame;
......
......@@ -6436,7 +6436,6 @@ TEST_P(PaintPropertyTreeBuilderTest, TableColOpacity) {
// Test the WebView API that allows rendering the whole page. In this case, we
// shouldn't create a clip node for the main frame.
TEST_P(PaintPropertyTreeBuilderTest, MainFrameDoesntClipContent) {
GetPage().GetSettings().SetMainFrameClipsContent(false);
SetBodyInnerHTML(R"HTML(
<!DOCTYPE html>
<style>
......@@ -6448,11 +6447,18 @@ TEST_P(PaintPropertyTreeBuilderTest, MainFrameDoesntClipContent) {
</style>
)HTML");
EXPECT_FALSE(GetDocument()
.GetLayoutView()
->FirstFragment()
.PaintProperties()
->OverflowClip());
EXPECT_TRUE(
GetLayoutView().FirstFragment().PaintProperties()->OverflowClip());
GetPage().GetSettings().SetMainFrameClipsContent(false);
UpdateAllLifecyclePhasesForTest();
EXPECT_FALSE(
GetLayoutView().FirstFragment().PaintProperties()->OverflowClip());
GetPage().GetSettings().SetMainFrameClipsContent(true);
UpdateAllLifecyclePhasesForTest();
EXPECT_TRUE(
GetLayoutView().FirstFragment().PaintProperties()->OverflowClip());
}
TEST_P(PaintPropertyTreeBuilderTest, SVGRootCompositedClipPath) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment