Bug 1839315: part 4) Link from `SheetLoadData::mWasAlternate` to spec. r=emilio DONTBUILD
[gecko.git] / layout / style / DeclarationBlock.cpp
blob03d07049b92447f9b4e060d21d136d40046eebd9
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/. */
7 #include "mozilla/DeclarationBlock.h"
9 #include "mozilla/css/Rule.h"
11 #include "nsCSSProps.h"
12 #include "nsIMemoryReporter.h"
14 namespace mozilla {
16 MOZ_DEFINE_MALLOC_SIZE_OF(ServoDeclarationBlockMallocSizeOf)
17 MOZ_DEFINE_MALLOC_ENCLOSING_SIZE_OF(ServoDeclarationBlockEnclosingSizeOf)
19 size_t DeclarationBlock::SizeofIncludingThis(MallocSizeOf aMallocSizeOf) {
20 size_t n = aMallocSizeOf(this);
21 n += Servo_DeclarationBlock_SizeOfIncludingThis(
22 ServoDeclarationBlockMallocSizeOf, ServoDeclarationBlockEnclosingSizeOf,
23 mRaw.get());
24 return n;
27 bool DeclarationBlock::OwnerIsReadOnly() const {
28 css::Rule* rule = GetOwningRule();
29 return rule && rule->IsReadOnly();
32 } // namespace mozilla