Bug 1698238 return default dictionary from GetUserMediaRequest#getConstraints() if...
[gecko.git] / layout / style / nsCSSAnonBoxes.cpp
blob0d320532eb1c33f148e4f687be23e7b0b22107e2
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;
17 #ifdef MOZ_XUL
18 /* static */
19 bool nsCSSAnonBoxes::IsTreePseudoElement(nsAtom* aPseudo) {
20 return StringBeginsWith(nsDependentAtomString(aPseudo), u":-moz-tree-"_ns);
22 #endif
24 #ifdef DEBUG
25 /* static */
26 nsStaticAtom* nsCSSAnonBoxes::GetAtomBase() {
27 return const_cast<nsStaticAtom*>(
28 nsGkAtoms::GetAtomByIndex(kAtomIndex_AnonBoxes));
31 /* static */
32 void nsCSSAnonBoxes::AssertAtoms() {
33 nsStaticAtom* base = GetAtomBase();
34 size_t index = 0;
35 # define CSS_ANON_BOX(name_, value_) \
36 { \
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"); \
42 ++index; \
44 # include "nsCSSAnonBoxList.h"
45 # undef CSS_ANON_BOX
47 #endif