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
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.
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
);
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
))
72 PRBool
operator!=(const nsCSSCornerSizes
& aOther
) const {
73 NS_FOR_CSS_FULL_CORNERS(corner
) {
74 if (this->GetCorner(corner
) != aOther
.GetCorner(corner
))
80 PRBool
HasValue() const {
81 NS_FOR_CSS_FULL_CORNERS(corner
) {
82 if (this->GetCorner(corner
).GetUnit() != eCSSUnit_Null
)
92 nsCSSValue mBottomRight
;
93 nsCSSValue mBottomLeft
;
96 typedef nsCSSValue
nsCSSCornerSizes::*corner_type
;
97 static const corner_type corners
[4];
100 /****************************************************************************/
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
{
121 nsCSSValue mSystemFont
;
127 nsCSSValue mSizeAdjust
; // NEW
128 nsCSSValue mStretch
; // NEW
129 nsCSSValue mFontFeatureSettings
;
130 nsCSSValue mFontLanguageOverride
;
133 nsCSSValue mScriptLevel
; // Integer values mean "relative", Number values mean "absolute"
134 nsCSSValue mScriptSizeMultiplier
;
135 nsCSSValue mScriptMinSize
;
139 nsCSSFont(const nsCSSFont
& aOther
); // NOT IMPLEMENTED
142 struct nsRuleDataFont
: public nsCSSFont
{
143 PRBool mFamilyFromHTML
; // Is the family from an HTML FONT element
146 nsRuleDataFont(const nsRuleDataFont
& aOther
); // NOT IMPLEMENTED
149 struct nsCSSColor
: public nsCSSStruct
{
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
;
164 nsCSSColor(const nsCSSColor
& aOther
); // NOT IMPLEMENTED
167 struct nsRuleDataColor
: public nsCSSColor
{
170 nsRuleDataColor(const nsRuleDataColor
& aOther
); // NOT IMPLEMENTED
173 struct nsCSSText
: public nsCSSStruct
{
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
;
191 nsCSSText(const nsCSSText
& aOther
); // NOT IMPLEMENTED
194 struct nsRuleDataText
: public nsCSSText
{
197 nsRuleDataText(const nsRuleDataText
& aOther
); // NOT IMPLEMENTED
200 struct nsCSSDisplay
: public nsCSSStruct
{
204 nsCSSValue mDirection
;
207 nsCSSValue mAppearance
;
208 nsCSSValue mPosition
;
212 nsCSSValue mOverflowX
;
213 nsCSSValue mOverflowY
;
215 nsCSSValue mPointerEvents
;
216 nsCSSValue mVisibility
;
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
;
230 nsCSSDisplay(const nsCSSDisplay
& aOther
); // NOT IMPLEMENTED
233 struct nsRuleDataDisplay
: public nsCSSDisplay
{
235 nsRuleDataDisplay() {}
237 nsRuleDataDisplay(const nsRuleDataDisplay
& aOther
); // NOT IMPLEMENTED
240 struct nsCSSMargin
: public nsCSSStruct
{
245 nsCSSValue mMarginStart
;
246 nsCSSValue mMarginEnd
;
247 nsCSSValue mMarginLeftLTRSource
;
248 nsCSSValue mMarginLeftRTLSource
;
249 nsCSSValue mMarginRightLTRSource
;
250 nsCSSValue mMarginRightRTLSource
;
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
;
290 nsCSSMargin(const nsCSSMargin
& aOther
); // NOT IMPLEMENTED
293 struct nsRuleDataMargin
: public nsCSSMargin
{
294 nsRuleDataMargin() {}
296 nsRuleDataMargin(const nsRuleDataMargin
& aOther
); // NOT IMPLEMENTED
299 struct nsCSSPosition
: public nsCSSStruct
{
301 ~nsCSSPosition(void);
304 nsCSSValue mMinWidth
;
305 nsCSSValue mMaxWidth
;
307 nsCSSValue mMinHeight
;
308 nsCSSValue mMaxHeight
;
309 nsCSSValue mBoxSizing
; // NEW
313 nsCSSPosition(const nsCSSPosition
& aOther
); // NOT IMPLEMENTED
316 struct nsRuleDataPosition
: public nsCSSPosition
{
317 nsRuleDataPosition() {}
319 nsRuleDataPosition(const nsRuleDataPosition
& aOther
); // NOT IMPLEMENTED
322 struct nsCSSList
: public nsCSSStruct
{
328 nsCSSValue mPosition
;
329 nsCSSValue mImageRegion
;
331 nsCSSList(const nsCSSList
& aOther
); // NOT IMPLEMENTED
334 struct nsRuleDataList
: public nsCSSList
{
337 nsRuleDataList(const nsRuleDataList
& aOther
); // NOT IMPLEMENTED
340 struct nsCSSTable
: public nsCSSStruct
{ // NEW
344 nsCSSValue mBorderCollapse
;
345 nsCSSValue mBorderSpacing
;
346 nsCSSValue mCaptionSide
;
347 nsCSSValue mEmptyCells
;
350 nsCSSValue mSpan
; // Not mappable via CSS, only using HTML4 table attrs.
351 nsCSSValue mCols
; // Not mappable via CSS, only using HTML4 table attrs.
353 nsCSSTable(const nsCSSTable
& aOther
); // NOT IMPLEMENTED
356 struct nsRuleDataTable
: public nsCSSTable
{
359 nsRuleDataTable(const nsRuleDataTable
& aOther
); // NOT IMPLEMENTED
362 struct nsCSSBreaks
: public nsCSSStruct
{ // NEW
369 // temp fix for bug 24000
370 //nsCSSValue mPageBreakAfter;
371 //nsCSSValue mPageBreakBefore;
372 nsCSSValue mPageBreakInside
;
374 nsCSSBreaks(const nsCSSBreaks
& aOther
); // NOT IMPLEMENTED
377 struct nsRuleDataBreaks
: public nsCSSBreaks
{
378 nsRuleDataBreaks() {}
380 nsRuleDataBreaks(const nsRuleDataBreaks
& aOther
); // NOT IMPLEMENTED
383 struct nsCSSPage
: public nsCSSStruct
{ // NEW
390 nsCSSPage(const nsCSSPage
& aOther
); // NOT IMPLEMENTED
393 struct nsRuleDataPage
: public nsCSSPage
{
396 nsRuleDataPage(const nsRuleDataPage
& aOther
); // NOT IMPLEMENTED
399 struct nsCSSContent
: public nsCSSStruct
{
404 nsCSSValue mCounterIncrement
;
405 nsCSSValue mCounterReset
;
406 nsCSSValue mMarkerOffset
;
409 nsCSSContent(const nsCSSContent
& aOther
); // NOT IMPLEMENTED
412 struct nsRuleDataContent
: public nsCSSContent
{
413 nsRuleDataContent() {}
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
;
428 nsCSSValue mForceBrokenImageIcon
;
430 nsCSSValue mWindowShadow
;
432 nsCSSUserInterface(const nsCSSUserInterface
& aOther
); // NOT IMPLEMENTED
435 struct nsRuleDataUserInterface
: public nsCSSUserInterface
{
436 nsRuleDataUserInterface() {}
438 nsRuleDataUserInterface(const nsRuleDataUserInterface
& aOther
); // NOT IMPLEMENTED
441 struct nsCSSAural
: public nsCSSStruct
{ // NEW
446 nsCSSValue mElevation
;
447 nsCSSValue mCueAfter
;
448 nsCSSValue mCueBefore
;
449 nsCSSValue mPauseAfter
;
450 nsCSSValue mPauseBefore
;
452 nsCSSValue mPitchRange
;
453 nsCSSValue mRichness
;
455 nsCSSValue mSpeakHeader
;
456 nsCSSValue mSpeakNumeral
;
457 nsCSSValue mSpeakPunctuation
;
458 nsCSSValue mSpeechRate
;
460 nsCSSValue mVoiceFamily
;
463 nsCSSAural(const nsCSSAural
& aOther
); // NOT IMPLEMENTED
466 struct nsRuleDataAural
: public nsCSSAural
{
469 nsRuleDataAural(const nsRuleDataAural
& aOther
); // NOT IMPLEMENTED
472 struct nsCSSXUL
: public nsCSSStruct
{
476 nsCSSValue mBoxAlign
;
477 nsCSSValue mBoxDirection
;
479 nsCSSValue mBoxOrient
;
481 nsCSSValue mBoxOrdinal
;
482 nsCSSValue mStackSizing
;
484 nsCSSXUL(const nsCSSXUL
& aOther
); // NOT IMPLEMENTED
487 struct nsRuleDataXUL
: public nsCSSXUL
{
490 nsRuleDataXUL(const nsRuleDataXUL
& aOther
); // NOT IMPLEMENTED
493 struct nsCSSColumn
: public nsCSSStruct
{
497 nsCSSValue mColumnCount
;
498 nsCSSValue mColumnWidth
;
499 nsCSSValue mColumnGap
;
500 nsCSSValue mColumnRuleColor
;
501 nsCSSValue mColumnRuleWidth
;
502 nsCSSValue mColumnRuleStyle
;
504 nsCSSColumn(const nsCSSColumn
& aOther
); // NOT IMPLEMENTED
507 struct nsRuleDataColumn
: public nsCSSColumn
{
508 nsRuleDataColumn() {}
510 nsRuleDataColumn(const nsRuleDataColumn
& aOther
); // NOT IMPLEMENTED
513 struct nsCSSSVG
: public nsCSSStruct
{
517 nsCSSValue mClipPath
;
518 nsCSSValue mClipRule
;
519 nsCSSValue mColorInterpolation
;
520 nsCSSValue mColorInterpolationFilters
;
521 nsCSSValue mDominantBaseline
;
523 nsCSSValue mFillOpacity
;
524 nsCSSValue mFillRule
;
526 nsCSSValue mFloodColor
;
527 nsCSSValue mFloodOpacity
;
528 nsCSSValue mImageRendering
;
529 nsCSSValue mLightingColor
;
530 nsCSSValue mMarkerEnd
;
531 nsCSSValue mMarkerMid
;
532 nsCSSValue mMarkerStart
;
534 nsCSSValue mShapeRendering
;
535 nsCSSValue mStopColor
;
536 nsCSSValue mStopOpacity
;
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
;
548 nsCSSSVG(const nsCSSSVG
& aOther
); // NOT IMPLEMENTED
551 struct nsRuleDataSVG
: public nsCSSSVG
{
554 nsRuleDataSVG(const nsRuleDataSVG
& aOther
); // NOT IMPLEMENTED
557 #endif /* nsCSSStruct_h___ */