2017-10-27 17:33:53 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2006-03-25 05:47:31 +00:00
|
|
|
|
|
|
|
/* atom list for CSS anonymous boxes */
|
|
|
|
|
2013-12-09 02:52:54 +00:00
|
|
|
#include "mozilla/ArrayUtils.h"
|
2011-10-11 05:50:08 +00:00
|
|
|
|
2002-11-17 15:37:56 +00:00
|
|
|
#include "nsCSSAnonBoxes.h"
|
2018-08-15 05:46:39 +00:00
|
|
|
#include "nsGkAtomConsts.h"
|
2018-08-15 05:46:42 +00:00
|
|
|
#include "nsStaticAtomUtils.h"
|
1998-12-11 02:51:05 +00:00
|
|
|
|
2011-10-11 05:50:08 +00:00
|
|
|
using namespace mozilla;
|
|
|
|
|
2009-10-08 03:22:42 +00:00
|
|
|
#ifdef MOZ_XUL
|
2019-02-25 22:09:24 +00:00
|
|
|
/* static */
|
|
|
|
bool nsCSSAnonBoxes::IsTreePseudoElement(nsAtom* aPseudo) {
|
2010-03-08 15:45:00 +00:00
|
|
|
return StringBeginsWith(nsDependentAtomString(aPseudo), u":-moz-tree-"_ns);
|
2009-10-08 03:22:42 +00:00
|
|
|
}
|
|
|
|
#endif
|
2017-03-08 05:18:39 +00:00
|
|
|
|
2019-02-19 13:44:33 +00:00
|
|
|
#ifdef DEBUG
|
2019-03-06 04:41:13 +00:00
|
|
|
/* static */
|
|
|
|
nsStaticAtom* nsCSSAnonBoxes::GetAtomBase() {
|
2019-02-19 13:44:33 +00:00
|
|
|
return const_cast<nsStaticAtom*>(
|
|
|
|
nsGkAtoms::GetAtomByIndex(kAtomIndex_AnonBoxes));
|
2017-03-09 04:39:47 +00:00
|
|
|
}
|
2018-08-15 05:46:39 +00:00
|
|
|
|
2019-02-25 22:09:24 +00:00
|
|
|
/* static */
|
|
|
|
void nsCSSAnonBoxes::AssertAtoms() {
|
2018-08-15 05:46:39 +00:00
|
|
|
nsStaticAtom* base = GetAtomBase();
|
|
|
|
size_t index = 0;
|
|
|
|
# define CSS_ANON_BOX(name_, value_) \
|
|
|
|
{ \
|
|
|
|
RefPtr<nsAtom> atom = NS_Atomize(value_); \
|
|
|
|
MOZ_ASSERT(atom == nsGkAtoms::AnonBox_##name_, \
|
|
|
|
"Static atom for " #name_ " has incorrect value"); \
|
|
|
|
MOZ_ASSERT(atom == &base[index], \
|
|
|
|
"Static atom for " #name_ " not at expected index"); \
|
|
|
|
++index; \
|
|
|
|
}
|
|
|
|
# include "nsCSSAnonBoxList.h"
|
|
|
|
# undef CSS_ANON_BOX
|
|
|
|
}
|
|
|
|
#endif
|