blob: 652665635bf0dac6720f0ddbf3d0acb909a6e5d6 [file] [log] [blame]
// Copyright 2014 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.
#ifndef ComputedStyleCSSValueMapping_h
#define ComputedStyleCSSValueMapping_h
#include "core/CSSPropertyNames.h"
#include "core/css/CSSValue.h"
#include "wtf/Allocator.h"
namespace blink {
class LayoutObject;
class ComputedStyle;
class FilterOperations;
class ShadowData;
class ShadowList;
class StyleColor;
class Node;
class CSSVariableData;
class ComputedStyleCSSValueMapping {
STATIC_ONLY(ComputedStyleCSSValueMapping);
public:
// FIXME: Resolve computed auto alignment in applyProperty/ComputedStyle and remove this non-const styledNode parameter.
static PassRefPtrWillBeRawPtr<CSSValue> get(CSSPropertyID, const ComputedStyle&, const LayoutObject* = nullptr, Node* styledNode = nullptr, bool allowVisitedStyle = false);
static PassRefPtrWillBeRawPtr<CSSValue> get(const AtomicString customPropertyName, const ComputedStyle&);
static const HashMap<AtomicString, RefPtr<CSSVariableData>>* getVariables(const ComputedStyle&);
private:
static PassRefPtrWillBeRawPtr<CSSValue> currentColorOrValidColor(const ComputedStyle&, const StyleColor&);
static PassRefPtrWillBeRawPtr<CSSValue> valueForShadowData(const ShadowData&, const ComputedStyle&, bool useSpread);
static PassRefPtrWillBeRawPtr<CSSValue> valueForShadowList(const ShadowList*, const ComputedStyle&, bool useSpread);
static PassRefPtrWillBeRawPtr<CSSValue> valueForFilter(const ComputedStyle&, const FilterOperations&);
static PassRefPtrWillBeRawPtr<CSSValue> valueForFont(const ComputedStyle&);
};
} // namespace blink
#endif // ComputedStyleCSSValueMapping_h