CLOSED TREE: TraceMonkey merge head. (a=blockers)
[mozilla-central.git] / layout / style / nsCSSStruct.h
blob804eddb852a56590f9ec77c3925e1de1882bc361
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
23 * Daniel Glazman <glazman@netscape.com>
25 * Alternatively, the contents of this file may be used under the terms of
26 * either of the GNU General Public License Version 2 or later (the "GPL"),
27 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
40 * temporary (expanded) representation of the property-value pairs
41 * within a CSS declaration using during parsing and mutation, and
42 * representation of complex values for CSS properties
45 #ifndef nsCSSStruct_h___
46 #define nsCSSStruct_h___
48 #include "nsCSSValue.h"
49 #include "nsStyleConsts.h"
51 struct nsCSSCornerSizes {
52 nsCSSCornerSizes(void);
53 nsCSSCornerSizes(const nsCSSCornerSizes& aCopy);
54 ~nsCSSCornerSizes();
56 // argument is a "full corner" constant from nsStyleConsts.h
57 nsCSSValue const & GetCorner(PRUint32 aCorner) const {
58 return this->*corners[aCorner];
60 nsCSSValue & GetCorner(PRUint32 aCorner) {
61 return this->*corners[aCorner];
64 PRBool operator==(const nsCSSCornerSizes& aOther) const {
65 NS_FOR_CSS_FULL_CORNERS(corner) {
66 if (this->GetCorner(corner) != aOther.GetCorner(corner))
67 return PR_FALSE;
69 return PR_TRUE;
72 PRBool operator!=(const nsCSSCornerSizes& aOther) const {
73 NS_FOR_CSS_FULL_CORNERS(corner) {
74 if (this->GetCorner(corner) != aOther.GetCorner(corner))
75 return PR_TRUE;
77 return PR_FALSE;
80 PRBool HasValue() const {
81 NS_FOR_CSS_FULL_CORNERS(corner) {
82 if (this->GetCorner(corner).GetUnit() != eCSSUnit_Null)
83 return PR_TRUE;
85 return PR_FALSE;
88 void Reset();
90 nsCSSValue mTopLeft;
91 nsCSSValue mTopRight;
92 nsCSSValue mBottomRight;
93 nsCSSValue mBottomLeft;
95 protected:
96 typedef nsCSSValue nsCSSCornerSizes::*corner_type;
97 static const corner_type corners[4];
100 /****************************************************************************/
102 struct nsCSSStruct {
103 // EMPTY on purpose. ABSTRACT with no virtuals (typedef void nsCSSStruct?)
106 // We use the nsCSS* structures for storing css::Declaration's
107 // *temporary* data during parsing and modification. (They are too big
108 // for permanent storage.) We also use them for nsRuleData, with some
109 // additions of things that the style system must cascade, but that
110 // aren't CSS properties. Thus we use typedefs and inheritance
111 // (forwards, when the rule data needs extra data) to make the rule data
112 // structs from the declaration structs.
113 // NOTE: For compilation speed, this typedef also appears in nsRuleNode.h
114 typedef nsCSSStruct nsRuleDataStruct;
117 struct nsCSSFont : public nsCSSStruct {
118 nsCSSFont(void);
119 ~nsCSSFont(void);
121 nsCSSValue mSystemFont;
122 nsCSSValue mFamily;
123 nsCSSValue mStyle;
124 nsCSSValue mVariant;
125 nsCSSValue mWeight;
126 nsCSSValue mSize;
127 nsCSSValue mSizeAdjust; // NEW
128 nsCSSValue mStretch; // NEW
129 nsCSSValue mFontFeatureSettings;
130 nsCSSValue mFontLanguageOverride;
132 #ifdef MOZ_MATHML
133 nsCSSValue mScriptLevel; // Integer values mean "relative", Number values mean "absolute"
134 nsCSSValue mScriptSizeMultiplier;
135 nsCSSValue mScriptMinSize;
136 #endif
138 private:
139 nsCSSFont(const nsCSSFont& aOther); // NOT IMPLEMENTED
142 struct nsRuleDataFont : public nsCSSFont {
143 PRBool mFamilyFromHTML; // Is the family from an HTML FONT element
144 nsRuleDataFont() {}
145 private:
146 nsRuleDataFont(const nsRuleDataFont& aOther); // NOT IMPLEMENTED
149 struct nsCSSColor : public nsCSSStruct {
150 nsCSSColor(void);
151 ~nsCSSColor(void);
153 nsCSSValue mColor;
154 nsCSSValue mBackColor;
155 nsCSSValue mBackImage;
156 nsCSSValue mBackRepeat;
157 nsCSSValue mBackAttachment;
158 nsCSSValue mBackPosition;
159 nsCSSValue mBackSize;
160 nsCSSValue mBackClip;
161 nsCSSValue mBackOrigin;
162 nsCSSValue mBackInlinePolicy;
163 private:
164 nsCSSColor(const nsCSSColor& aOther); // NOT IMPLEMENTED
167 struct nsRuleDataColor : public nsCSSColor {
168 nsRuleDataColor() {}
169 private:
170 nsRuleDataColor(const nsRuleDataColor& aOther); // NOT IMPLEMENTED
173 struct nsCSSText : public nsCSSStruct {
174 nsCSSText(void);
175 ~nsCSSText(void);
177 nsCSSValue mTabSize;
178 nsCSSValue mWordSpacing;
179 nsCSSValue mLetterSpacing;
180 nsCSSValue mVerticalAlign;
181 nsCSSValue mTextTransform;
182 nsCSSValue mTextAlign;
183 nsCSSValue mTextIndent;
184 nsCSSValue mDecoration;
185 nsCSSValue mTextShadow; // NEW
186 nsCSSValue mUnicodeBidi; // NEW
187 nsCSSValue mLineHeight;
188 nsCSSValue mWhiteSpace;
189 nsCSSValue mWordWrap;
190 private:
191 nsCSSText(const nsCSSText& aOther); // NOT IMPLEMENTED
194 struct nsRuleDataText : public nsCSSText {
195 nsRuleDataText() {}
196 private:
197 nsRuleDataText(const nsRuleDataText& aOther); // NOT IMPLEMENTED
200 struct nsCSSDisplay : public nsCSSStruct {
201 nsCSSDisplay(void);
202 ~nsCSSDisplay(void);
204 nsCSSValue mDirection;
205 nsCSSValue mDisplay;
206 nsCSSValue mBinding;
207 nsCSSValue mAppearance;
208 nsCSSValue mPosition;
209 nsCSSValue mFloat;
210 nsCSSValue mClear;
211 nsCSSValue mClip;
212 nsCSSValue mOverflowX;
213 nsCSSValue mOverflowY;
214 nsCSSValue mResize;
215 nsCSSValue mPointerEvents;
216 nsCSSValue mVisibility;
217 nsCSSValue mOpacity;
218 nsCSSValue mTransform; // List of Arrays containing transform information
219 nsCSSValue mTransformOrigin;
220 nsCSSValue mTransitionProperty;
221 nsCSSValue mTransitionDuration;
222 nsCSSValue mTransitionTimingFunction;
223 nsCSSValue mTransitionDelay;
225 // temp fix for bug 24000
226 nsCSSValue mBreakBefore;
227 nsCSSValue mBreakAfter;
228 // end temp fix
229 private:
230 nsCSSDisplay(const nsCSSDisplay& aOther); // NOT IMPLEMENTED
233 struct nsRuleDataDisplay : public nsCSSDisplay {
234 nsCSSValue mLang;
235 nsRuleDataDisplay() {}
236 private:
237 nsRuleDataDisplay(const nsRuleDataDisplay& aOther); // NOT IMPLEMENTED
240 struct nsCSSMargin : public nsCSSStruct {
241 nsCSSMargin(void);
242 ~nsCSSMargin(void);
244 nsCSSRect mMargin;
245 nsCSSValue mMarginStart;
246 nsCSSValue mMarginEnd;
247 nsCSSValue mMarginLeftLTRSource;
248 nsCSSValue mMarginLeftRTLSource;
249 nsCSSValue mMarginRightLTRSource;
250 nsCSSValue mMarginRightRTLSource;
251 nsCSSRect mPadding;
252 nsCSSValue mPaddingStart;
253 nsCSSValue mPaddingEnd;
254 nsCSSValue mPaddingLeftLTRSource;
255 nsCSSValue mPaddingLeftRTLSource;
256 nsCSSValue mPaddingRightLTRSource;
257 nsCSSValue mPaddingRightRTLSource;
258 nsCSSRect mBorderWidth;
259 nsCSSValue mBorderStartWidth;
260 nsCSSValue mBorderEndWidth;
261 nsCSSValue mBorderLeftWidthLTRSource;
262 nsCSSValue mBorderLeftWidthRTLSource;
263 nsCSSValue mBorderRightWidthLTRSource;
264 nsCSSValue mBorderRightWidthRTLSource;
265 nsCSSRect mBorderColor;
266 nsCSSValue mBorderStartColor;
267 nsCSSValue mBorderEndColor;
268 nsCSSValue mBorderLeftColorLTRSource;
269 nsCSSValue mBorderLeftColorRTLSource;
270 nsCSSValue mBorderRightColorLTRSource;
271 nsCSSValue mBorderRightColorRTLSource;
272 nsCSSRect mBorderColors;
273 nsCSSRect mBorderStyle;
274 nsCSSValue mBorderStartStyle;
275 nsCSSValue mBorderEndStyle;
276 nsCSSValue mBorderLeftStyleLTRSource;
277 nsCSSValue mBorderLeftStyleRTLSource;
278 nsCSSValue mBorderRightStyleLTRSource;
279 nsCSSValue mBorderRightStyleRTLSource;
280 nsCSSCornerSizes mBorderRadius;
281 nsCSSValue mOutlineWidth;
282 nsCSSValue mOutlineColor;
283 nsCSSValue mOutlineStyle;
284 nsCSSValue mOutlineOffset;
285 nsCSSCornerSizes mOutlineRadius;
286 nsCSSValue mFloatEdge; // NEW
287 nsCSSValue mBorderImage;
288 nsCSSValue mBoxShadow;
289 private:
290 nsCSSMargin(const nsCSSMargin& aOther); // NOT IMPLEMENTED
293 struct nsRuleDataMargin : public nsCSSMargin {
294 nsRuleDataMargin() {}
295 private:
296 nsRuleDataMargin(const nsRuleDataMargin& aOther); // NOT IMPLEMENTED
299 struct nsCSSPosition : public nsCSSStruct {
300 nsCSSPosition(void);
301 ~nsCSSPosition(void);
303 nsCSSValue mWidth;
304 nsCSSValue mMinWidth;
305 nsCSSValue mMaxWidth;
306 nsCSSValue mHeight;
307 nsCSSValue mMinHeight;
308 nsCSSValue mMaxHeight;
309 nsCSSValue mBoxSizing; // NEW
310 nsCSSRect mOffset;
311 nsCSSValue mZIndex;
312 private:
313 nsCSSPosition(const nsCSSPosition& aOther); // NOT IMPLEMENTED
316 struct nsRuleDataPosition : public nsCSSPosition {
317 nsRuleDataPosition() {}
318 private:
319 nsRuleDataPosition(const nsRuleDataPosition& aOther); // NOT IMPLEMENTED
322 struct nsCSSList : public nsCSSStruct {
323 nsCSSList(void);
324 ~nsCSSList(void);
326 nsCSSValue mType;
327 nsCSSValue mImage;
328 nsCSSValue mPosition;
329 nsCSSValue mImageRegion;
330 private:
331 nsCSSList(const nsCSSList& aOther); // NOT IMPLEMENTED
334 struct nsRuleDataList : public nsCSSList {
335 nsRuleDataList() {}
336 private:
337 nsRuleDataList(const nsRuleDataList& aOther); // NOT IMPLEMENTED
340 struct nsCSSTable : public nsCSSStruct { // NEW
341 nsCSSTable(void);
342 ~nsCSSTable(void);
344 nsCSSValue mBorderCollapse;
345 nsCSSValue mBorderSpacing;
346 nsCSSValue mCaptionSide;
347 nsCSSValue mEmptyCells;
349 nsCSSValue mLayout;
350 nsCSSValue mSpan; // Not mappable via CSS, only using HTML4 table attrs.
351 nsCSSValue mCols; // Not mappable via CSS, only using HTML4 table attrs.
352 private:
353 nsCSSTable(const nsCSSTable& aOther); // NOT IMPLEMENTED
356 struct nsRuleDataTable : public nsCSSTable {
357 nsRuleDataTable() {}
358 private:
359 nsRuleDataTable(const nsRuleDataTable& aOther); // NOT IMPLEMENTED
362 struct nsCSSBreaks : public nsCSSStruct { // NEW
363 nsCSSBreaks(void);
364 ~nsCSSBreaks(void);
366 nsCSSValue mOrphans;
367 nsCSSValue mWidows;
368 nsCSSValue mPage;
369 // temp fix for bug 24000
370 //nsCSSValue mPageBreakAfter;
371 //nsCSSValue mPageBreakBefore;
372 nsCSSValue mPageBreakInside;
373 private:
374 nsCSSBreaks(const nsCSSBreaks& aOther); // NOT IMPLEMENTED
377 struct nsRuleDataBreaks : public nsCSSBreaks {
378 nsRuleDataBreaks() {}
379 private:
380 nsRuleDataBreaks(const nsRuleDataBreaks& aOther); // NOT IMPLEMENTED
383 struct nsCSSPage : public nsCSSStruct { // NEW
384 nsCSSPage(void);
385 ~nsCSSPage(void);
387 nsCSSValue mMarks;
388 nsCSSValue mSize;
389 private:
390 nsCSSPage(const nsCSSPage& aOther); // NOT IMPLEMENTED
393 struct nsRuleDataPage : public nsCSSPage {
394 nsRuleDataPage() {}
395 private:
396 nsRuleDataPage(const nsRuleDataPage& aOther); // NOT IMPLEMENTED
399 struct nsCSSContent : public nsCSSStruct {
400 nsCSSContent(void);
401 ~nsCSSContent(void);
403 nsCSSValue mContent;
404 nsCSSValue mCounterIncrement;
405 nsCSSValue mCounterReset;
406 nsCSSValue mMarkerOffset;
407 nsCSSValue mQuotes;
408 private:
409 nsCSSContent(const nsCSSContent& aOther); // NOT IMPLEMENTED
412 struct nsRuleDataContent : public nsCSSContent {
413 nsRuleDataContent() {}
414 private:
415 nsRuleDataContent(const nsRuleDataContent& aOther); // NOT IMPLEMENTED
418 struct nsCSSUserInterface : public nsCSSStruct { // NEW
419 nsCSSUserInterface(void);
420 ~nsCSSUserInterface(void);
422 nsCSSValue mUserInput;
423 nsCSSValue mUserModify;
424 nsCSSValue mUserSelect;
425 nsCSSValue mUserFocus;
427 nsCSSValue mCursor;
428 nsCSSValue mForceBrokenImageIcon;
429 nsCSSValue mIMEMode;
430 nsCSSValue mWindowShadow;
431 private:
432 nsCSSUserInterface(const nsCSSUserInterface& aOther); // NOT IMPLEMENTED
435 struct nsRuleDataUserInterface : public nsCSSUserInterface {
436 nsRuleDataUserInterface() {}
437 private:
438 nsRuleDataUserInterface(const nsRuleDataUserInterface& aOther); // NOT IMPLEMENTED
441 struct nsCSSAural : public nsCSSStruct { // NEW
442 nsCSSAural(void);
443 ~nsCSSAural(void);
445 nsCSSValue mAzimuth;
446 nsCSSValue mElevation;
447 nsCSSValue mCueAfter;
448 nsCSSValue mCueBefore;
449 nsCSSValue mPauseAfter;
450 nsCSSValue mPauseBefore;
451 nsCSSValue mPitch;
452 nsCSSValue mPitchRange;
453 nsCSSValue mRichness;
454 nsCSSValue mSpeak;
455 nsCSSValue mSpeakHeader;
456 nsCSSValue mSpeakNumeral;
457 nsCSSValue mSpeakPunctuation;
458 nsCSSValue mSpeechRate;
459 nsCSSValue mStress;
460 nsCSSValue mVoiceFamily;
461 nsCSSValue mVolume;
462 private:
463 nsCSSAural(const nsCSSAural& aOther); // NOT IMPLEMENTED
466 struct nsRuleDataAural : public nsCSSAural {
467 nsRuleDataAural() {}
468 private:
469 nsRuleDataAural(const nsRuleDataAural& aOther); // NOT IMPLEMENTED
472 struct nsCSSXUL : public nsCSSStruct {
473 nsCSSXUL(void);
474 ~nsCSSXUL(void);
476 nsCSSValue mBoxAlign;
477 nsCSSValue mBoxDirection;
478 nsCSSValue mBoxFlex;
479 nsCSSValue mBoxOrient;
480 nsCSSValue mBoxPack;
481 nsCSSValue mBoxOrdinal;
482 nsCSSValue mStackSizing;
483 private:
484 nsCSSXUL(const nsCSSXUL& aOther); // NOT IMPLEMENTED
487 struct nsRuleDataXUL : public nsCSSXUL {
488 nsRuleDataXUL() {}
489 private:
490 nsRuleDataXUL(const nsRuleDataXUL& aOther); // NOT IMPLEMENTED
493 struct nsCSSColumn : public nsCSSStruct {
494 nsCSSColumn(void);
495 ~nsCSSColumn(void);
497 nsCSSValue mColumnCount;
498 nsCSSValue mColumnWidth;
499 nsCSSValue mColumnGap;
500 nsCSSValue mColumnRuleColor;
501 nsCSSValue mColumnRuleWidth;
502 nsCSSValue mColumnRuleStyle;
503 private:
504 nsCSSColumn(const nsCSSColumn& aOther); // NOT IMPLEMENTED
507 struct nsRuleDataColumn : public nsCSSColumn {
508 nsRuleDataColumn() {}
509 private:
510 nsRuleDataColumn(const nsRuleDataColumn& aOther); // NOT IMPLEMENTED
513 struct nsCSSSVG : public nsCSSStruct {
514 nsCSSSVG(void);
515 ~nsCSSSVG(void);
517 nsCSSValue mClipPath;
518 nsCSSValue mClipRule;
519 nsCSSValue mColorInterpolation;
520 nsCSSValue mColorInterpolationFilters;
521 nsCSSValue mDominantBaseline;
522 nsCSSValue mFill;
523 nsCSSValue mFillOpacity;
524 nsCSSValue mFillRule;
525 nsCSSValue mFilter;
526 nsCSSValue mFloodColor;
527 nsCSSValue mFloodOpacity;
528 nsCSSValue mImageRendering;
529 nsCSSValue mLightingColor;
530 nsCSSValue mMarkerEnd;
531 nsCSSValue mMarkerMid;
532 nsCSSValue mMarkerStart;
533 nsCSSValue mMask;
534 nsCSSValue mShapeRendering;
535 nsCSSValue mStopColor;
536 nsCSSValue mStopOpacity;
537 nsCSSValue mStroke;
538 nsCSSValue mStrokeDasharray;
539 nsCSSValue mStrokeDashoffset;
540 nsCSSValue mStrokeLinecap;
541 nsCSSValue mStrokeLinejoin;
542 nsCSSValue mStrokeMiterlimit;
543 nsCSSValue mStrokeOpacity;
544 nsCSSValue mStrokeWidth;
545 nsCSSValue mTextAnchor;
546 nsCSSValue mTextRendering;
547 private:
548 nsCSSSVG(const nsCSSSVG& aOther); // NOT IMPLEMENTED
551 struct nsRuleDataSVG : public nsCSSSVG {
552 nsRuleDataSVG() {}
553 private:
554 nsRuleDataSVG(const nsRuleDataSVG& aOther); // NOT IMPLEMENTED
557 #endif /* nsCSSStruct_h___ */