// Copyright 2018 The Chromium Authors // 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_PROPERTIES_CSS_PROPERTY_REF_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_PROPERTIES_CSS_PROPERTY_REF_H_ #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/properties/longhands/custom_property.h" namespace blink { class CSSPropertyName; class Document; // Use this class to acquire a reference to a CSSProperty instance. The // reference returned by GetProperty() may point to the embedded CustomProperty // object, hence this reference is only valid for the lifetime of the // CSSPropertyRef object. // // Usage: // // CSSPropertyRef ref(some_string, document); // // if (ref.IsValid()) { // LOG(INFO) << ref.GetProperty().GetName(); // } // // Note that any CSSPropertyRef constructor may produce an invalid // CSSPropertyRef (e.g. if a non-existent property name is provided), so be // sure to always check IsValid() before calling GetProperty(). class CORE_EXPORT CSSPropertyRef { … }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_CORE_CSS_PROPERTIES_CSS_PROPERTY_REF_H_