Commit 41b464fd authored by Renee Wright's avatar Renee Wright Committed by Commit Bot

[Ribbon] Move ID accessors from CSSUnresolvedProperty to CSSProperty

These accessors are not needed in CSSUnresolvedProperty at this stage.
We want to constrain the functionality of CSSUnresolvedProperty to the
bare minimum so as to discourage its usage. It is useful to know that
a property representation is strictly a resolved property; thus we do
not want CSSUnresolvedProperty used except where absolutely necessary.
If it turns out that these are needed on CSSUnresolvedProperty in
future then they can be moved back.

Change-Id: I4bb8c0714d5cfffe8f4b0d353ae0b0931e665f8f
Reviewed-on: https://chromium-review.googlesource.com/831375Reviewed-by: default avatarnainar <nainar@chromium.org>
Commit-Queue: Renée Wright <rjwright@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526923}
parent 9ac44846
......@@ -35,6 +35,14 @@ class CSSProperty : public CSSUnresolvedProperty {
public:
CORE_EXPORT static const CSSProperty& Get(CSSPropertyID);
// For backwards compatibility when passing around CSSUnresolvedProperty
// references. In case we need to call a function that hasn't been converted
// to using property classes yet.
virtual CSSPropertyID PropertyID() const {
NOTREACHED();
return CSSPropertyInvalid;
}
bool IDEquals(CSSPropertyID id) const { return PropertyID() == id; }
bool IsResolvedProperty() const override { return true; }
WTF::String GetJSPropertyName() const;
virtual bool IsInterpolable() const { return false; }
......
......@@ -31,13 +31,13 @@ class {{property_classname}} final : public {{property.namespace_group}} {
public:
constexpr {{property_classname}}() : {{property.namespace_group}}() {}
{% endif %}
CSSPropertyID PropertyID() const override { return {{property.property_id}}; }
const char* GetPropertyName() const override { return "{{property.name}}\0"; }
const WTF::AtomicString& GetPropertyNameAtomicString() const override {
static const WTF::AtomicString& name = WTF::AtomicString("{{property.name}}\0");
return name;
}
{% if property.alias_for == None %}
CSSPropertyID PropertyID() const override { return {{property.property_id}}; }
{% for property_method in property.property_methods %}
{{property_method.return_type}} {{property_method.name}}{{property_method.parameters}} const override;
{% endfor %}
......
......@@ -21,14 +21,6 @@ class CSSUnresolvedProperty {
public:
CORE_EXPORT static const CSSUnresolvedProperty& Get(CSSPropertyID);
// For backwards compatibility when passing around CSSUnresolvedProperty
// references. In case we need to call a function that hasn't been converted
// to using property classes yet.
virtual CSSPropertyID PropertyID() const {
NOTREACHED();
return CSSPropertyInvalid;
}
bool IDEquals(CSSPropertyID id) const { return PropertyID() == id; }
virtual bool IsResolvedProperty() const { return false; }
virtual const char* GetPropertyName() const {
NOTREACHED();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment