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 /* atom list for CSS anonymous boxes */
9 #include "mozilla/ArrayUtils.h"
11 #include "nsCSSAnonBoxes.h"
12 #include "nsGkAtomConsts.h"
13 #include "nsStaticAtomUtils.h"
15 using namespace mozilla
;
19 bool nsCSSAnonBoxes::IsTreePseudoElement(nsAtom
* aPseudo
) {
20 return StringBeginsWith(nsDependentAtomString(aPseudo
), u
":-moz-tree-"_ns
);
26 nsStaticAtom
* nsCSSAnonBoxes::GetAtomBase() {
27 return const_cast<nsStaticAtom
*>(
28 nsGkAtoms::GetAtomByIndex(kAtomIndex_AnonBoxes
));
32 void nsCSSAnonBoxes::AssertAtoms() {
33 nsStaticAtom
* base
= GetAtomBase();
35 # define CSS_ANON_BOX(name_, value_) \
37 RefPtr<nsAtom> atom = NS_Atomize(value_); \
38 MOZ_ASSERT(atom == nsGkAtoms::AnonBox_##name_, \
39 "Static atom for " #name_ " has incorrect value"); \
40 MOZ_ASSERT(atom == &base[index], \
41 "Static atom for " #name_ " not at expected index"); \
44 # include "nsCSSAnonBoxList.h"