editor/libeditor/html/nsEditProperty.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/editor/libeditor/html/nsEditProperty.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,53 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsMemory.h"
    1.10 +#include "nsStaticAtom.h"
    1.11 +#include "nsEditProperty.h"
    1.12 +
    1.13 +using namespace mozilla;
    1.14 +
    1.15 +#define EDITOR_ATOM(name_, value_) nsIAtom* nsEditProperty::name_ = 0;
    1.16 +#include "nsEditPropertyAtomList.h" // IWYU pragma: keep
    1.17 +#undef EDITOR_ATOM
    1.18 +
    1.19 +/* From the HTML 4.0 DTD, 
    1.20 +
    1.21 +INLINE:
    1.22 +<!-- %inline; covers inline or "text-level" elements -->
    1.23 + <!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; | %formctrl;">
    1.24 + <!ENTITY % fontstyle "TT | I | B | BIG | SMALL">
    1.25 + <!ENTITY % phrase "EM | STRONG | DFN | CODE |
    1.26 +                    SAMP | KBD | VAR | CITE | ABBR | ACRONYM" >
    1.27 + <!ENTITY % special
    1.28 +    "A | IMG | OBJECT | BR | SCRIPT | MAP | Q | SUB | SUP | SPAN | BDO">
    1.29 + <!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON">
    1.30 +
    1.31 +BLOCK:
    1.32 +<!ENTITY % block
    1.33 +      "P | %heading (h1-h6); | %list (UL | OL); | %preformatted (PRE); | DL | DIV | NOSCRIPT |
    1.34 +       BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">
    1.35 +
    1.36 +But what about BODY, TR, TD, TH, CAPTION, COL, COLGROUP, THEAD, TFOOT, LI, DT, DD, LEGEND, etc.?
    1.37 + 
    1.38 +
    1.39 +*/
    1.40 +
    1.41 +#define EDITOR_ATOM(name_, value_) NS_STATIC_ATOM_BUFFER(name_##_buffer, value_)
    1.42 +#include "nsEditPropertyAtomList.h" // IWYU pragma: keep
    1.43 +#undef EDITOR_ATOM
    1.44 +
    1.45 +void
    1.46 +nsEditProperty::RegisterAtoms()
    1.47 +{
    1.48 +  // inline tags
    1.49 +  static const nsStaticAtom property_atoms[] = {
    1.50 +#define EDITOR_ATOM(name_, value_) NS_STATIC_ATOM(name_##_buffer, &name_),
    1.51 +#include "nsEditPropertyAtomList.h" // IWYU pragma: keep
    1.52 +#undef EDITOR_ATOM
    1.53 +  };
    1.54 +  
    1.55 +  NS_RegisterStaticAtoms(property_atoms);
    1.56 +}

mercurial