tor-browser

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

CSSPropertyRule.h (1724B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      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 mozilla_dom_CSSPropertyRule_h
      8 #define mozilla_dom_CSSPropertyRule_h
      9 
     10 #include "mozilla/ServoBindingTypes.h"
     11 #include "mozilla/css/Rule.h"
     12 #include "nsICSSDeclaration.h"
     13 
     14 struct StylePropertyRule;
     15 
     16 namespace mozilla::dom {
     17 
     18 class CSSPropertyRule final : public css::Rule {
     19 public:
     20  CSSPropertyRule(already_AddRefed<StylePropertyRule> aRawRule,
     21                  StyleSheet* aSheet, css::Rule* aParentRule, uint32_t aLine,
     22                  uint32_t aColumn)
     23      : css::Rule(aSheet, aParentRule, aLine, aColumn),
     24        mRawRule(std::move(aRawRule)) {}
     25 
     26  bool IsCCLeaf() const final;
     27 
     28  StylePropertyRule* Raw() const { return mRawRule; }
     29  void SetRawAfterClone(RefPtr<StylePropertyRule> aRaw);
     30 
     31  JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) final;
     32 
     33 #ifdef DEBUG
     34  void List(FILE* out = stdout, int32_t aIndent = 0) const final;
     35 #endif
     36 
     37  size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const final;
     38 
     39  // WebIDL interfaces
     40  StyleCssRuleType Type() const final;
     41 
     42  void GetName(nsACString& aName) const;
     43 
     44  void GetSyntax(nsACString& aSyntax) const;
     45 
     46  bool Inherits() const;
     47 
     48  void GetInitialValue(nsACString& aInitialValueStr) const;
     49 
     50  void GetCssText(nsACString& aCssText) const final;
     51 
     52 private:
     53  ~CSSPropertyRule() = default;
     54 
     55  RefPtr<StylePropertyRule> mRawRule;
     56 };
     57 
     58 }  // namespace mozilla::dom
     59 
     60 #endif  // mozilla_dom_CSSPropertyRule_h