Bug 1774879 part 3: Add 'const' to local var ComputedStyle pointers that we pass to DetermineBackgroundColor and IsTransparent (which now accept const). r=emilio

This patch does not affect behavior; it's just a const-correctness fix.

Differential Revision: https://phabricator.services.mozilla.com/D149676
This commit is contained in:
Daniel Holbert 2022-06-18 00:45:20 +00:00
parent b99919ed77
commit 92b1de01bb
4 changed files with 4 additions and 4 deletions

View File

@ -14778,7 +14778,7 @@ void Document::GetWireframeWithoutFlushing(bool aIncludeNodes,
}
bool drawImage = false;
bool drawColor = false;
if (auto* bgStyle = nsCSSRendering::FindBackground(frame)) {
if (const auto* bgStyle = nsCSSRendering::FindBackground(frame)) {
const nscolor color = nsCSSRendering::DetermineBackgroundColor(
pc, bgStyle, frame, drawImage, drawColor);
if (drawImage &&

View File

@ -5462,7 +5462,7 @@ PresShell::CanvasBackground PresShell::ComputeCanvasBackground() const {
return {GetDefaultBackgroundColorToDraw(), false};
}
ComputedStyle* bgStyle =
const ComputedStyle* bgStyle =
nsCSSRendering::FindRootFrameBackground(rootStyleFrame);
// XXX We should really be passing the canvasframe, not the root element
// style frame but we don't have access to the canvasframe here. It isn't

View File

@ -237,7 +237,7 @@ static nscolor GetBackplateColor(nsIFrame* aFrame) {
// colors with the non-native theme, and native system colors should also
// match the native theme), then we're alright and we should compute an
// appropriate backplate color.
auto* style = frame->Style();
const auto* style = frame->Style();
if (style->StyleBackground()->IsTransparent(style)) {
continue;
}

View File

@ -3104,7 +3104,7 @@ AppendedBackgroundType nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
const nsRect& aBackgroundOriginRect, nsIFrame* aSecondaryReferenceFrame,
Maybe<nsDisplayListBuilder::AutoBuildingDisplayList>*
aAutoBuildingDisplayList) {
ComputedStyle* bgSC = aComputedStyle;
const ComputedStyle* bgSC = aComputedStyle;
const nsStyleBackground* bg = nullptr;
nsRect bgRect = aBackgroundRect;
nsRect bgOriginRect = bgRect;