tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

CSSUnsupportedValue.h (1649B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef LAYOUT_STYLE_TYPEDOM_CSSUNSUPPORTEDVALUE_H_
      8 #define LAYOUT_STYLE_TYPEDOM_CSSUNSUPPORTEDVALUE_H_
      9 
     10 #include "mozilla/CSSPropertyId.h"
     11 #include "mozilla/RefPtr.h"
     12 #include "mozilla/dom/CSSStyleValue.h"
     13 
     14 template <class T>
     15 class nsCOMPtr;
     16 class nsISupports;
     17 
     18 namespace mozilla {
     19 
     20 class DeclarationBlock;
     21 
     22 namespace dom {
     23 
     24 // https://drafts.css-houdini.org/css-typed-om/#reify-failure
     25 //
     26 // Represents a property value that cannot be reified into any of the
     27 // supported CSSStyleValue subclasses. Per the spec, such values are still
     28 // exposed as CSSStyleValue objects tied to their originating property,
     29 // but they cannot be transferred to other properties.
     30 class CSSUnsupportedValue final : public CSSStyleValue {
     31 public:
     32  CSSUnsupportedValue(nsCOMPtr<nsISupports> aParent,
     33                      const CSSPropertyId& aPropertyId,
     34                      RefPtr<DeclarationBlock> aDeclarations);
     35 
     36  const CSSPropertyId& GetPropertyId() const { return mPropertyId; }
     37 
     38  void ToCssTextWithProperty(const CSSPropertyId& aPropertyId,
     39                             nsACString& aDest) const;
     40 
     41 private:
     42  virtual ~CSSUnsupportedValue() = default;
     43 
     44  CSSPropertyId mPropertyId;
     45  RefPtr<DeclarationBlock> mDeclarations;
     46 };
     47 
     48 }  // namespace dom
     49 }  // namespace mozilla
     50 
     51 #endif  // LAYOUT_STYLE_TYPEDOM_CSSUNSUPPORTEDVALUE_H_