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 @@ ...@@ -413,6 +413,7 @@
{ {
name: "mainFrameClipsContent", name: "mainFrameClipsContent",
initial: true, initial: true,
invalidate: "ViewportPaintProperties",
}, },
// For android.webkit.WebSettings.setUseWideViewport() // For android.webkit.WebSettings.setUseWideViewport()
...@@ -835,7 +836,7 @@ ...@@ -835,7 +836,7 @@
{ {
name: "hideScrollbars", name: "hideScrollbars",
initial: false, initial: false,
invalidate: "ViewportScrollbar", invalidate: "ViewportPaintProperties",
}, },
// Spellchecking is enabled by default for elements that do not specify it explicitly // Spellchecking is enabled by default for elements that do not specify it explicitly
......
...@@ -54,7 +54,7 @@ class CORE_EXPORT SettingsDelegate { ...@@ -54,7 +54,7 @@ class CORE_EXPORT SettingsDelegate {
kStyleChange, kStyleChange,
kViewportDescriptionChange, kViewportDescriptionChange,
kViewportRuleChange, kViewportRuleChange,
kViewportScrollbarChange, kViewportPaintPropertiesChange,
kDNSPrefetchingChange, kDNSPrefetchingChange,
kImageLoadingChange, kImageLoadingChange,
kTextAutosizingChange, kTextAutosizingChange,
......
...@@ -644,8 +644,13 @@ void Page::SettingsChanged(SettingsDelegate::ChangeType change_type) { ...@@ -644,8 +644,13 @@ void Page::SettingsChanged(SettingsDelegate::ChangeType change_type) {
TextAutosizer::UpdatePageInfoInAllFrames(MainFrame()); TextAutosizer::UpdatePageInfoInAllFrames(MainFrame());
} }
break; break;
case SettingsDelegate::kViewportScrollbarChange: case SettingsDelegate::kViewportPaintPropertiesChange:
GetVisualViewport().SetNeedsPaintPropertyUpdate();
GetVisualViewport().InitializeScrollbars(); GetVisualViewport().InitializeScrollbars();
if (auto* local_frame = DynamicTo<LocalFrame>(MainFrame())) {
if (LocalFrameView* view = local_frame->View())
view->SetNeedsPaintPropertyUpdate();
}
break; break;
case SettingsDelegate::kDNSPrefetchingChange: case SettingsDelegate::kDNSPrefetchingChange:
for (Frame* frame = MainFrame(); frame; for (Frame* frame = MainFrame(); frame;
......
...@@ -6436,7 +6436,6 @@ TEST_P(PaintPropertyTreeBuilderTest, TableColOpacity) { ...@@ -6436,7 +6436,6 @@ TEST_P(PaintPropertyTreeBuilderTest, TableColOpacity) {
// Test the WebView API that allows rendering the whole page. In this case, we // Test the WebView API that allows rendering the whole page. In this case, we
// shouldn't create a clip node for the main frame. // shouldn't create a clip node for the main frame.
TEST_P(PaintPropertyTreeBuilderTest, MainFrameDoesntClipContent) { TEST_P(PaintPropertyTreeBuilderTest, MainFrameDoesntClipContent) {
GetPage().GetSettings().SetMainFrameClipsContent(false);
SetBodyInnerHTML(R"HTML( SetBodyInnerHTML(R"HTML(
<!DOCTYPE html> <!DOCTYPE html>
<style> <style>
...@@ -6448,11 +6447,18 @@ TEST_P(PaintPropertyTreeBuilderTest, MainFrameDoesntClipContent) { ...@@ -6448,11 +6447,18 @@ TEST_P(PaintPropertyTreeBuilderTest, MainFrameDoesntClipContent) {
</style> </style>
)HTML"); )HTML");
EXPECT_FALSE(GetDocument() EXPECT_TRUE(
.GetLayoutView() GetLayoutView().FirstFragment().PaintProperties()->OverflowClip());
->FirstFragment()
.PaintProperties() GetPage().GetSettings().SetMainFrameClipsContent(false);
->OverflowClip()); UpdateAllLifecyclePhasesForTest();
EXPECT_FALSE(
GetLayoutView().FirstFragment().PaintProperties()->OverflowClip());
GetPage().GetSettings().SetMainFrameClipsContent(true);
UpdateAllLifecyclePhasesForTest();
EXPECT_TRUE(
GetLayoutView().FirstFragment().PaintProperties()->OverflowClip());
} }
TEST_P(PaintPropertyTreeBuilderTest, SVGRootCompositedClipPath) { 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