2017-10-27 20:33:53 +03: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 15:12:37 +04: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 08:47:31 +03:00
|
|
|
|
|
|
|
/* atom list for CSS anonymous boxes */
|
|
|
|
|
2013-12-09 06:52:54 +04:00
|
|
|
#include "mozilla/ArrayUtils.h"
|
2011-10-11 09:50:08 +04:00
|
|
|
|
2002-11-17 18:37:56 +03:00
|
|
|
#include "nsCSSAnonBoxes.h"
|
2018-08-15 08:46:39 +03:00
|
|
|
#include "nsGkAtomConsts.h"
|
2018-08-15 08:46:42 +03:00
|
|
|
#include "nsStaticAtomUtils.h"
|
1998-12-11 05:51:05 +03:00
|
|
|
|
2011-10-11 09:50:08 +04:00
|
|
|
using namespace mozilla;
|
|
|
|
|
2009-10-08 07:22:42 +04:00
|
|
|
#ifdef MOZ_XUL
|
2019-02-26 01:09:24 +03:00
|
|
|
/* static */
|
|
|
|
bool nsCSSAnonBoxes::IsTreePseudoElement(nsAtom* aPseudo) {
|
2010-03-08 18:45:00 +03:00
|
|
|
return StringBeginsWith(nsDependentAtomString(aPseudo), u":-moz-tree-"_ns);
|
2009-10-08 07:22:42 +04:00
|
|
|
}
|
|
|
|
#endif
|
2017-03-08 08:18:39 +03:00
|
|
|
|
2019-02-19 16:44:33 +03:00
|
|
|
#ifdef DEBUG
|
2019-03-06 07:41:13 +03:00
|
|
|
/* static */
|
|
|
|
nsStaticAtom* nsCSSAnonBoxes::GetAtomBase() {
|
2019-02-19 16:44:33 +03:00
|
|
|
return const_cast<nsStaticAtom*>(
|
|
|
|
nsGkAtoms::GetAtomByIndex(kAtomIndex_AnonBoxes));
|
2017-03-09 07:39:47 +03:00
|
|
|
}
|
2018-08-15 08:46:39 +03:00
|
|
|
|
2019-02-26 01:09:24 +03:00
|
|
|
/* static */
|
|
|
|
void nsCSSAnonBoxes::AssertAtoms() {
|
2018-08-15 08:46:39 +03: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
|