chromium/third_party/blink/renderer/core/style/style_crossfade_image.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

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

#include "third_party/blink/renderer/core/css/css_crossfade_value.h"
#include "third_party/blink/renderer/core/css/css_numeric_literal_value.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/core/style/style_generated_image.h"
#include "third_party/blink/renderer/platform/graphics/crossfade_generated_image.h"

namespace blink {

StyleCrossfadeImage::StyleCrossfadeImage(cssvalue::CSSCrossfadeValue& value,
                                         HeapVector<Member<StyleImage>> images)
    :{}

StyleCrossfadeImage::~StyleCrossfadeImage() = default;

bool StyleCrossfadeImage::IsEqual(const StyleImage& other) const {}

CSSValue* StyleCrossfadeImage::CssValue() const {}

CSSValue* StyleCrossfadeImage::ComputedCSSValue(
    const ComputedStyle& style,
    bool allow_visited_style,
    CSSValuePhase value_phase) const {}

bool StyleCrossfadeImage::CanRender() const {}

bool StyleCrossfadeImage::IsLoading() const {}

bool StyleCrossfadeImage::IsLoaded() const {}

bool StyleCrossfadeImage::ErrorOccurred() const {}

bool StyleCrossfadeImage::IsAccessAllowed(String& failing_url) const {}

bool StyleCrossfadeImage::AnyImageIsNone() const {}

// Only <image> values participate in the sizing (§2.6.1.2).
// In this aspect, the standard seems to indicate everything
// that is not a <color> is an <image>.
static bool ParticipatesInSizing(const CSSValue* image) {}

static bool ParticipatesInSizing(const StyleImage& image) {}

// https://drafts.csswg.org/css-images-4/#cross-fade-sizing
IntrinsicSizingInfo StyleCrossfadeImage::GetNaturalSizingInfo(
    float multiplier,
    RespectImageOrientationEnum respect_orientation) const {}

gfx::SizeF StyleCrossfadeImage::ImageSize(float multiplier,
                                          const gfx::SizeF& default_object_size,
                                          RespectImageOrientationEnum) const {}

bool StyleCrossfadeImage::HasIntrinsicSize() const {}

void StyleCrossfadeImage::AddClient(ImageResourceObserver* observer) {}

void StyleCrossfadeImage::RemoveClient(ImageResourceObserver* observer) {}

scoped_refptr<Image> StyleCrossfadeImage::GetImage(
    const ImageResourceObserver& observer,
    const Document& document,
    const ComputedStyle& style,
    const gfx::SizeF& target_size) const {}

WrappedImagePtr StyleCrossfadeImage::Data() const {}

bool StyleCrossfadeImage::KnownToBeOpaque(const Document& document,
                                          const ComputedStyle& style) const {}

// Calculates the actual value of the percentage for each image,
// and converts to 0..1 weights. See
// https://drafts.csswg.org/css-images-4/#cross-fade-function:
//
// “If any percentages are omitted, all the specified percentages are summed
// together and subtracted from 100%, the result is floored at 0%, then divided
// equally between all images with omitted percentages at computed-value time.”
std::vector<float> StyleCrossfadeImage::ComputeWeights(bool for_sizing) const {}

void StyleCrossfadeImage::Trace(Visitor* visitor) const {}

}  // namespace blink