Commit 1d8a5234 authored by Alison Maher's avatar Alison Maher Committed by Commit Bot

Don't override background-images for atomic inlines in forced colors

In a previous change, we had ignored background images for all inlines
to prevent background images from being painted on top of the
readability backplate in forced colors mode.
https://chromium-review.googlesource.com/c/chromium/src/+/1757685

However, it turns out that atomic inlines paint their backgrounds
before the backplate is painted. As such, we do not want to ignore
background images for these inlines in forced colors mode.

Bug: 970285
Change-Id: Iee2463775e67a1661cbb85f0a51b5bb8f01566cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1998976
Commit-Queue: Alison Maher <almaher@microsoft.com>
Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#733014}
parent 164ab097
......@@ -132,7 +132,7 @@ BoxPainterBase::FillLayerInfo BoxModelObjectPainter::GetFillLayerInfo(
LayoutObject::ShouldRespectImageOrientation(&box_model_),
(flow_box_ ? flow_box_->IncludeLogicalLeftEdge() : true),
(flow_box_ ? flow_box_->IncludeLogicalRightEdge() : true),
box_model_.IsInline(), is_painting_scrolling_background);
box_model_.IsLayoutInline(), is_painting_scrolling_background);
}
bool BoxModelObjectPainter::IsPaintingScrollingBackground(
......
......@@ -1505,7 +1505,8 @@ BoxPainterBase::FillLayerInfo NGBoxFragmentPainter::GetFillLayerInfo(
fragment.HasOverflowClip(), color, bg_layer, bleed_avoidance,
LayoutObject::ShouldRespectImageOrientation(fragment.GetLayoutObject()),
border_edges.line_left, border_edges.line_right,
fragment.GetLayoutObject()->IsInline(), is_painting_scrolling_background);
fragment.GetLayoutObject()->IsLayoutInline(),
is_painting_scrolling_background);
}
bool NGBoxFragmentPainter::IsInSelfHitTestingPhase(HitTestAction action) const {
......
<!DOCTYPE html>
<meta charset="utf-8">
<title>Forced colors mode - atomic inline reference.
Ensures that background images are not overridden for atomic inlines.
</title>
<style>
body {
forced-color-adjust: none;
}
div {
background-image: url("resources/test-image.jpg");
height: 150px;
width: 150px;
}
</style>
<body>
<p>Four images should appear below with forced colors mode enabled and disabled.</p>
<div style="display: inline-block;"></div>
<div style="display: inline-flex;"></div>
<div style="display: inline-grid;"></div>
<div style="display: inline-table;"></div>
</body>
<!DOCTYPE html>
<meta charset="utf-8">
<title>Forced colors mode - atomic inline.
Ensures that background images are not overridden for atomic inlines.
</title>
<link rel="help" href="https://www.w3.org/TR/css-color-adjust-1/#forced-colors-properties">
<link rel=match href="forced-colors-mode-25-ref.html">
<style>
div {
background-image: url("resources/test-image.jpg");
height: 150px;
width: 150px;
}
</style>
<body>
<p>Four images should appear below with forced colors mode enabled and disabled.</p>
<div style="display: inline-block;"></div>
<div style="display: inline-flex;"></div>
<div style="display: inline-grid;"></div>
<div style="display: inline-table;"></div>
</body>
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