tor-browser

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

CSSNamespaceRule.cpp (1463B)


      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 #include "mozilla/dom/CSSNamespaceRule.h"
      8 
      9 #include "mozilla/ServoBindings.h"
     10 
     11 namespace mozilla::dom {
     12 
     13 CSSNamespaceRule::~CSSNamespaceRule() = default;
     14 
     15 #ifdef DEBUG
     16 void CSSNamespaceRule::List(FILE* out, int32_t aIndent) const {
     17  nsAutoCString str;
     18  for (int32_t i = 0; i < aIndent; i++) {
     19    str.AppendLiteral("  ");
     20  }
     21  Servo_NamespaceRule_Debug(mRawRule, &str);
     22  fprintf_stderr(out, "%s\n", str.get());
     23 }
     24 #endif
     25 
     26 StyleCssRuleType CSSNamespaceRule::Type() const {
     27  return StyleCssRuleType::Namespace;
     28 }
     29 
     30 nsAtom* CSSNamespaceRule::GetPrefix() const {
     31  return Servo_NamespaceRule_GetPrefix(mRawRule);
     32 }
     33 
     34 void CSSNamespaceRule::GetURLSpec(nsString& aURLSpec) const {
     35  nsAtom* atom = Servo_NamespaceRule_GetURI(mRawRule);
     36  atom->ToString(aURLSpec);
     37 }
     38 
     39 void CSSNamespaceRule::GetCssText(nsACString& aCssText) const {
     40  Servo_NamespaceRule_GetCssText(mRawRule, &aCssText);
     41 }
     42 
     43 void CSSNamespaceRule::SetRawAfterClone(RefPtr<StyleNamespaceRule> aRaw) {
     44  mRawRule = std::move(aRaw);
     45 }
     46 
     47 size_t CSSNamespaceRule::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
     48  return aMallocSizeOf(this);
     49 }
     50 
     51 }  // namespace mozilla::dom