2017-10-27 20:33:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-10-01 20:49:41 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
/* DOM object representing values in DOM computed style */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_CSSValue_h_
|
|
|
|
#define mozilla_dom_CSSValue_h_
|
|
|
|
|
2014-05-09 19:23:14 +04:00
|
|
|
#include "nsStringFwd.h"
|
2018-05-08 10:20:43 +03:00
|
|
|
#include "mozilla/RefCounted.h"
|
2012-10-01 20:49:41 +04:00
|
|
|
|
|
|
|
class nsROCSSPrimitiveValue;
|
2014-05-09 19:23:14 +04:00
|
|
|
namespace mozilla {
|
|
|
|
class ErrorResult;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace mozilla
|
2012-10-01 20:49:41 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* CSSValue - a DOM object representing values in DOM computed style.
|
|
|
|
*/
|
2018-05-08 10:20:43 +03:00
|
|
|
class CSSValue : public RefCounted<CSSValue> {
|
2012-10-01 20:49:41 +04:00
|
|
|
public:
|
2018-05-08 10:20:43 +03:00
|
|
|
MOZ_DECLARE_REFCOUNTED_TYPENAME(CSSValue);
|
|
|
|
enum : uint16_t {
|
|
|
|
CSS_INHERIT,
|
|
|
|
CSS_PRIMITIVE_VALUE,
|
|
|
|
CSS_VALUE_LIST,
|
|
|
|
CSS_CUSTOM,
|
|
|
|
};
|
|
|
|
|
2012-10-01 20:49:41 +04:00
|
|
|
// CSSValue
|
2019-11-30 14:57:10 +03:00
|
|
|
virtual void GetCssText(nsString& aText, ErrorResult& aRv) = 0;
|
2012-10-01 20:49:41 +04:00
|
|
|
virtual uint16_t CssValueType() const = 0;
|
2012-10-25 03:38:52 +04:00
|
|
|
|
2020-03-17 12:38:32 +03:00
|
|
|
virtual ~CSSValue() = default;
|
2018-05-08 10:20:43 +03:00
|
|
|
|
2012-10-25 03:38:52 +04:00
|
|
|
// Downcasting
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return this as a nsROCSSPrimitiveValue* if its a primitive value, and null
|
|
|
|
* otherwise.
|
2018-01-11 11:17:57 +03:00
|
|
|
*
|
|
|
|
* Defined in nsROCSSPrimitiveValue.h.
|
2012-10-25 03:38:52 +04:00
|
|
|
*/
|
2018-01-11 11:17:57 +03:00
|
|
|
inline nsROCSSPrimitiveValue* AsPrimitiveValue();
|
2012-10-01 20:49:41 +04:00
|
|
|
};
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2012-10-01 20:49:41 +04:00
|
|
|
|
|
|
|
#endif
|