1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 // vim:cindent:ts=8:et:sw=4:
3 /* ***** BEGIN LICENSE BLOCK *****
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
16 * The Original Code is mozilla.org code.
18 * The Initial Developer of the Original Code is
19 * Netscape Communications Corporation.
20 * Portions created by the Initial Developer are Copyright (C) 2002
21 * the Initial Developer. All Rights Reserved.
24 * L. David Baron <dbaron@dbaron.org> (original author)
26 * Alternatively, the contents of this file may be used under the terms of
27 * either the GNU General Public License Version 2 or later (the "GPL"), or
28 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
38 * ***** END LICENSE BLOCK ***** */
41 * list of structs that contain the data provided by nsStyleContext, the
42 * internal API for computed style data for an element
46 * This file is intended to be used by different parts of the code, with
47 * the STYLE_STRUCT macro (or the STYLE_STRUCT_INHERITED and
48 * STYLE_STRUCT_RESET pair of macros) defined in different ways.
51 #ifndef STYLE_STRUCT_INHERITED
52 #define STYLE_STRUCT_INHERITED(name, checkdata_cb, ctor_args) \
53 STYLE_STRUCT(name, checkdata_cb, ctor_args)
54 #define UNDEF_STYLE_STRUCT_INHERITED
57 #ifndef STYLE_STRUCT_RESET
58 #define STYLE_STRUCT_RESET(name, checkdata_cb, ctor_args) \
59 STYLE_STRUCT(name, checkdata_cb, ctor_args)
60 #define UNDEF_STYLE_STRUCT_RESET
63 #ifdef STYLE_STRUCT_TEST
64 #define STYLE_STRUCT_TEST_CODE(c) c
66 #define STYLE_STRUCT_TEST_CODE(c)
69 STYLE_STRUCT_TEST_CODE(if (STYLE_STRUCT_TEST
< 8) {)
70 STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST
< 4) {)
71 STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST
< 2) {)
72 STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST
== 0) {)
73 STYLE_STRUCT_INHERITED(Font
, CheckFontCallback
, (SSARG_PRESCONTEXT
))
74 STYLE_STRUCT_TEST_CODE( } else {)
75 STYLE_STRUCT_INHERITED(Color
, CheckColorCallback
, (SSARG_PRESCONTEXT
))
76 STYLE_STRUCT_TEST_CODE( })
77 STYLE_STRUCT_TEST_CODE( } else {)
78 STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST
== 2) {)
79 STYLE_STRUCT_RESET(Background
, nsnull
, ())
80 STYLE_STRUCT_TEST_CODE( } else {)
81 STYLE_STRUCT_INHERITED(List
, nsnull
, ())
82 STYLE_STRUCT_TEST_CODE( })
83 STYLE_STRUCT_TEST_CODE( })
84 STYLE_STRUCT_TEST_CODE( } else {)
85 STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST
< 6) {)
86 STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST
== 4) {)
87 STYLE_STRUCT_RESET(Position
, nsnull
, ())
88 STYLE_STRUCT_TEST_CODE( } else {)
89 STYLE_STRUCT_INHERITED(Text
, nsnull
, ())
90 STYLE_STRUCT_TEST_CODE( })
91 STYLE_STRUCT_TEST_CODE( } else {)
92 STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST
== 6) {)
93 STYLE_STRUCT_RESET(TextReset
, nsnull
, ())
94 STYLE_STRUCT_TEST_CODE( } else {)
95 STYLE_STRUCT_RESET(Display
, nsnull
, ())
96 STYLE_STRUCT_TEST_CODE( })
97 STYLE_STRUCT_TEST_CODE( })
98 STYLE_STRUCT_TEST_CODE( })
99 STYLE_STRUCT_TEST_CODE(} else if (STYLE_STRUCT_TEST
< 16) {)
100 STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST
< 12) {)
101 STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST
< 10) {)
102 STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST
== 8) {)
103 STYLE_STRUCT_INHERITED(Visibility
, nsnull
, (SSARG_PRESCONTEXT
))
104 STYLE_STRUCT_TEST_CODE( } else {)
105 STYLE_STRUCT_RESET(Content
, nsnull
, ())
106 STYLE_STRUCT_TEST_CODE( })
107 STYLE_STRUCT_TEST_CODE( } else {)
108 STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST
== 10) {)
109 STYLE_STRUCT_INHERITED(Quotes
, nsnull
, ())
110 STYLE_STRUCT_TEST_CODE( } else {)
111 STYLE_STRUCT_INHERITED(UserInterface
, nsnull
, ())
112 STYLE_STRUCT_TEST_CODE( })
113 STYLE_STRUCT_TEST_CODE( })
114 STYLE_STRUCT_TEST_CODE( } else {)
115 STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST
< 14) {)
116 STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST
== 12) {)
117 STYLE_STRUCT_RESET(UIReset
, nsnull
, ())
118 STYLE_STRUCT_TEST_CODE( } else {)
119 STYLE_STRUCT_RESET(Table
, nsnull
, ())
120 STYLE_STRUCT_TEST_CODE( })
121 STYLE_STRUCT_TEST_CODE( } else {)
122 STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST
== 14) {)
123 STYLE_STRUCT_INHERITED(TableBorder
, nsnull
, (SSARG_PRESCONTEXT
))
124 STYLE_STRUCT_TEST_CODE( } else {)
125 STYLE_STRUCT_RESET(Margin
, nsnull
, ())
126 STYLE_STRUCT_TEST_CODE( })
127 STYLE_STRUCT_TEST_CODE( })
128 STYLE_STRUCT_TEST_CODE( })
129 STYLE_STRUCT_TEST_CODE(} else if (STYLE_STRUCT_TEST
< 20) {)
130 STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST
< 18) {)
131 STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST
== 16) {)
132 STYLE_STRUCT_RESET(Padding
, nsnull
, ())
133 STYLE_STRUCT_TEST_CODE( } else {)
134 STYLE_STRUCT_RESET(Border
, nsnull
, (SSARG_PRESCONTEXT
))
135 STYLE_STRUCT_TEST_CODE( })
136 STYLE_STRUCT_TEST_CODE( } else {)
137 STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST
== 18) {)
138 STYLE_STRUCT_RESET(Outline
, nsnull
, (SSARG_PRESCONTEXT
))
139 STYLE_STRUCT_TEST_CODE( } else {)
140 STYLE_STRUCT_RESET(XUL
, nsnull
, ())
141 STYLE_STRUCT_TEST_CODE( })
142 STYLE_STRUCT_TEST_CODE( })
144 STYLE_STRUCT_TEST_CODE(} else {)
145 STYLE_STRUCT_TEST_CODE( NS_ASSERTION(STYLE_STRUCT_TEST
== 20, "out of range");)
147 STYLE_STRUCT_TEST_CODE(} else if (STYLE_STRUCT_TEST
< 22) {)
148 STYLE_STRUCT_TEST_CODE( if (STYLE_STRUCT_TEST
== 20) {)
149 STYLE_STRUCT_INHERITED(SVG
, nsnull
, ())
150 STYLE_STRUCT_TEST_CODE( } else {)
151 STYLE_STRUCT_RESET(SVGReset
,nsnull
, ())
152 STYLE_STRUCT_TEST_CODE( })
153 STYLE_STRUCT_TEST_CODE(} else {)
154 STYLE_STRUCT_TEST_CODE( NS_ASSERTION(STYLE_STRUCT_TEST
== 22, "out of range");)
156 STYLE_STRUCT_RESET(Column
, nsnull
, (SSARG_PRESCONTEXT
))
157 STYLE_STRUCT_TEST_CODE(})
159 #ifdef UNDEF_STYLE_STRUCT_INHERITED
160 #undef STYLE_STRUCT_INHERITED
161 #undef UNDEF_STYLE_STRUCT_INHERITED
164 #ifdef UNDEF_STYLE_STRUCT_RESET
165 #undef STYLE_STRUCT_RESET
166 #undef UNDEF_STYLE_STRUCT_RESET
169 #undef STYLE_STRUCT_TEST_CODE