summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/style/style_pending_image.cc
blob: 68468ada2a832cf499ff142140c6feb724d532d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/style/style_pending_image.h"

#include "third_party/blink/renderer/core/style/computed_style.h"

namespace blink {

CSSValue* StylePendingImage::ComputedCSSValue(const ComputedStyle& style,
                                              bool allow_visited_style) const {
  DCHECK(style.IsEnsuredInDisplayNone() ||
         style.Display() == EDisplay::kContents);

  if (CSSImageValue* image_value = CssImageValue())
    return image_value->ValueWithURLMadeAbsolute();
  if (CSSImageSetValue* image_set_value = CssImageSetValue())
    return image_set_value->ValueWithURLsMadeAbsolute();
  if (CSSImageGeneratorValue* image_generator_value = CssImageGeneratorValue())
    return image_generator_value->ComputedCSSValue(style, allow_visited_style);
  NOTREACHED();
  return CssValue();
}

}  // namespace blink