parser/htmlparser/nsElementTable.h
author Nicholas Nethercote <nnethercote@mozilla.com>
Tue, 19 Sep 2017 11:08:39 +1000
changeset 433129 2b23e3f158dd747de9c40c068d4e9a5da583cf98
parent 433128 5835c5943a4881567e2d1e9ce1a8a6b0f97cf200
child 433130 2de6882645603af89ea672180239825dce408918
permissions -rw-r--r--
Bug 1400777 (part 2) - De-expose HTML group constants[]. r=mrbkap. The patch also removes some low-value comments.

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */


/**
 * MODULE NOTES:
 * @update  gess 4/1/98
 * 
 */



#ifndef _NSELEMENTABLE
#define _NSELEMENTABLE

#include "nsHTMLTags.h"
#include "nsIDTD.h"

#ifdef DEBUG
extern void CheckElementTable();
#endif


/**
 * We're asking the question: is aTest a member of bitset. 
 *
 * @param 
 * @return TRUE or FALSE
 */
inline bool TestBits(int aBitset,int aTest) {
  if(aTest) {
    int32_t result=(aBitset & aTest);
    return bool(result==aTest);
  }
  return false;
}

struct nsHTMLElement {
  bool            IsMemberOf(int32_t aType) const;

#ifdef DEBUG
  nsHTMLTag       mTagID;
#endif
  int             mParentBits;        //defines groups that can contain this element
  bool            mLeaf;

  static  bool    IsContainer(nsHTMLTag aTag);
  static  bool    IsBlock(nsHTMLTag aTag);
};

extern const nsHTMLElement gHTMLElements[];

#endif