Index: third_party/WebKit/Source/core/frame/FrameView.cpp |
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp |
index cd578f3903f9ac16aa8302409e85ce03aed6351b..f3e44321aee8adaeda80a8e733aa22f810215c96 100644 |
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp |
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp |
@@ -159,6 +159,24 @@ constexpr int kLetterPortraitPageHeight = 792; |
namespace blink { |
+namespace { |
+ |
+HighContrastSettings InitHighContrastSettingsFromSettings(Settings* settings) { |
+ HighContrastSettings result; |
+ if (settings) { |
+ result.mode = settings->GetHighContrastMode(); |
+ result.grayscale = settings->GetHighContrastGrayscale(); |
+ result.contrast = settings->GetHighContrastContrast(); |
+ } else { |
+ result.mode = HighContrastMode::kOff; |
+ result.grayscale = false; |
+ result.contrast = 0.0; |
+ } |
+ return result; |
+} |
+ |
+} // namespace |
+ |
using namespace HTMLNames; |
// The maximum number of updatePlugins iterations that should be done before |
@@ -3266,6 +3284,9 @@ void FrameView::PaintTree() { |
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
if (GetLayoutView()->Layer()->NeedsRepaint()) { |
GraphicsContext graphics_context(*paint_controller_); |
+ HighContrastSettings high_contrast_settings = |
+ InitHighContrastSettingsFromSettings(frame_->GetSettings()); |
+ graphics_context.SetHighContrast(high_contrast_settings); |
if (RuntimeEnabledFeatures::printBrowserEnabled()) |
graphics_context.SetPrinting(true); |
Paint(graphics_context, CullRect(LayoutRect::InfiniteIntRect())); |
@@ -3311,7 +3332,9 @@ void FrameView::PaintTree() { |
void FrameView::PaintGraphicsLayerRecursively(GraphicsLayer* graphics_layer) { |
DCHECK(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
if (graphics_layer->DrawsContent()) { |
- graphics_layer->Paint(nullptr); |
+ HighContrastSettings high_contrast_settings = |
+ InitHighContrastSettingsFromSettings(frame_->GetSettings()); |
+ graphics_layer->Paint(nullptr, &high_contrast_settings); |
NotifyPaint(graphics_layer->GetPaintController()); |
} |