blob: 972a4c3c0bd8065ab9499513fbbc360f4c18f042 [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 THIRD_PARTY_BLINK_RENDERER_CORE_CSS_STYLE_RULE_KEYFRAME_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_STYLE_RULE_KEYFRAME_H_
#include <memory>
#include "third_party/blink/renderer/core/css/style_rule.h"
#include "third_party/blink/renderer/platform/wtf/casting.h"
namespace blink {
class MutableCSSPropertyValueSet;
class CSSPropertyValueSet;
class StyleRuleKeyframe final : public StyleRuleBase {
public:
static StyleRuleKeyframe* Create(std::unique_ptr<Vector<double>> keys,
CSSPropertyValueSet* properties) {
return MakeGarbageCollected<StyleRuleKeyframe>(std::move(keys), properties);
}
StyleRuleKeyframe(std::unique_ptr<Vector<double>>, CSSPropertyValueSet*);
// Exposed to JavaScript.
String KeyText() const;
bool SetKeyText(const String&);
// Used by StyleResolver.
const Vector<double>& Keys() const;
const CSSPropertyValueSet& Properties() const { return *properties_; }
MutableCSSPropertyValueSet& MutableProperties();
String CssText() const;
void TraceAfterDispatch(blink::Visitor*);
private:
Member<CSSPropertyValueSet> properties_;
Vector<double> keys_;
};
template <>
struct DowncastTraits<StyleRuleKeyframe> {
static bool AllowFrom(const StyleRuleBase& rule) {
return rule.IsKeyframeRule();
}
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_CSS_STYLE_RULE_KEYFRAME_H_