tor-browser

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

DeclarationBlock.cpp (1032B)


      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/DeclarationBlock.h"
      8 
      9 #include "mozilla/css/Rule.h"
     10 #include "nsCSSProps.h"
     11 #include "nsIMemoryReporter.h"
     12 
     13 namespace mozilla {
     14 
     15 MOZ_DEFINE_MALLOC_SIZE_OF(ServoDeclarationBlockMallocSizeOf)
     16 MOZ_DEFINE_MALLOC_ENCLOSING_SIZE_OF(ServoDeclarationBlockEnclosingSizeOf)
     17 
     18 size_t DeclarationBlock::SizeofIncludingThis(MallocSizeOf aMallocSizeOf) {
     19  size_t n = aMallocSizeOf(this);
     20  n += Servo_DeclarationBlock_SizeOfIncludingThis(
     21      ServoDeclarationBlockMallocSizeOf, ServoDeclarationBlockEnclosingSizeOf,
     22      mRaw.get());
     23  return n;
     24 }
     25 
     26 bool DeclarationBlock::OwnerIsReadOnly() const {
     27  css::Rule* rule = GetOwningRule();
     28  return rule && rule->IsReadOnly();
     29 }
     30 
     31 }  // namespace mozilla