Bumping manifests a=b2g-bump
[gecko.git] / layout / style / nsComputedDOMStyle.h
blobb42dbdfcb040b794f443249cbecc206658260947
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /* DOM object returned from element.getComputedStyle() */
8 #ifndef nsComputedDOMStyle_h__
9 #define nsComputedDOMStyle_h__
11 #include "nsAutoPtr.h"
12 #include "mozilla/Attributes.h"
13 #include "nsCOMPtr.h"
14 #include "nscore.h"
15 #include "nsCSSProps.h"
16 #include "nsDOMCSSDeclaration.h"
17 #include "nsStyleContext.h"
18 #include "nsIWeakReferenceUtils.h"
19 #include "mozilla/gfx/Types.h"
20 #include "nsCoord.h"
21 #include "nsColor.h"
22 #include "nsIContent.h"
24 namespace mozilla {
25 namespace dom {
26 class Element;
30 struct nsComputedStyleMap;
31 class nsIFrame;
32 class nsIPresShell;
33 class nsDOMCSSValueList;
34 struct nsMargin;
35 class nsROCSSPrimitiveValue;
36 struct nsStyleBackground;
37 struct nsStyleBorder;
38 struct nsStyleContent;
39 struct nsStyleColumn;
40 struct nsStyleColor;
41 class nsStyleCoord;
42 class nsStyleCorners;
43 struct nsStyleDisplay;
44 struct nsStyleFilter;
45 struct nsStyleFont;
46 class nsStyleGradient;
47 struct nsStyleImage;
48 struct nsStyleList;
49 struct nsStyleMargin;
50 struct nsStyleOutline;
51 struct nsStylePadding;
52 struct nsStylePosition;
53 struct nsStyleQuotes;
54 class nsStyleSides;
55 struct nsStyleSVG;
56 struct nsStyleSVGReset;
57 struct nsStyleTable;
58 struct nsStyleText;
59 struct nsStyleTextReset;
60 class nsStyleTimingFunction;
61 struct nsStyleUIReset;
62 struct nsStyleVisibility;
63 struct nsStyleXUL;
64 struct nsTimingFunction;
65 class gfx3DMatrix;
67 class nsComputedDOMStyle MOZ_FINAL : public nsDOMCSSDeclaration
69 public:
70 typedef nsCSSProps::KTableValue KTableValue;
72 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
73 NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsComputedDOMStyle,
74 nsICSSDeclaration)
76 NS_DECL_NSICSSDECLARATION
78 NS_DECL_NSIDOMCSSSTYLEDECLARATION_HELPER
79 virtual already_AddRefed<mozilla::dom::CSSValue>
80 GetPropertyCSSValue(const nsAString& aProp, mozilla::ErrorResult& aRv)
81 MOZ_OVERRIDE;
82 using nsICSSDeclaration::GetPropertyCSSValue;
83 virtual void IndexedGetter(uint32_t aIndex, bool& aFound, nsAString& aPropName) MOZ_OVERRIDE;
85 enum StyleType {
86 eDefaultOnly, // Only includes UA and user sheets
87 eAll // Includes all stylesheets
90 nsComputedDOMStyle(mozilla::dom::Element* aElement,
91 const nsAString& aPseudoElt,
92 nsIPresShell* aPresShell,
93 StyleType aStyleType);
95 virtual nsINode *GetParentObject() MOZ_OVERRIDE
97 return mContent;
100 static already_AddRefed<nsStyleContext>
101 GetStyleContextForElement(mozilla::dom::Element* aElement, nsIAtom* aPseudo,
102 nsIPresShell* aPresShell,
103 StyleType aStyleType = eAll);
105 static already_AddRefed<nsStyleContext>
106 GetStyleContextForElementNoFlush(mozilla::dom::Element* aElement,
107 nsIAtom* aPseudo,
108 nsIPresShell* aPresShell,
109 StyleType aStyleType = eAll);
111 static nsIPresShell*
112 GetPresShellForContent(nsIContent* aContent);
114 // Helper for nsDOMWindowUtils::GetVisitedDependentComputedStyle
115 void SetExposeVisitedStyle(bool aExpose) {
116 NS_ASSERTION(aExpose != mExposeVisitedStyle, "should always be changing");
117 mExposeVisitedStyle = aExpose;
120 // nsDOMCSSDeclaration abstract methods which should never be called
121 // on a nsComputedDOMStyle object, but must be defined to avoid
122 // compile errors.
123 virtual mozilla::css::Declaration* GetCSSDeclaration(bool) MOZ_OVERRIDE;
124 virtual nsresult SetCSSDeclaration(mozilla::css::Declaration*) MOZ_OVERRIDE;
125 virtual nsIDocument* DocToUpdate() MOZ_OVERRIDE;
126 virtual void GetCSSParsingEnvironment(CSSParsingEnvironment& aCSSParseEnv) MOZ_OVERRIDE;
128 static nsROCSSPrimitiveValue* MatrixToCSSValue(gfx3DMatrix& aMatrix);
130 static void RegisterPrefChangeCallbacks();
131 static void UnregisterPrefChangeCallbacks();
133 private:
134 virtual ~nsComputedDOMStyle();
136 void AssertFlushedPendingReflows() {
137 NS_ASSERTION(mFlushedPendingReflows,
138 "property getter should have been marked layout-dependent");
141 nsMargin GetAdjustedValuesForBoxSizing();
143 // Helper method for DoGetTextAlign[Last].
144 mozilla::dom::CSSValue* CreateTextAlignValue(uint8_t aAlign,
145 bool aAlignTrue,
146 const KTableValue aTable[]);
147 // This indicates error by leaving mStyleContextHolder null.
148 void UpdateCurrentStyleSources(bool aNeedsLayoutFlush);
149 void ClearCurrentStyleSources();
151 #define STYLE_STRUCT(name_, checkdata_cb_) \
152 const nsStyle##name_ * Style##name_() { \
153 return mStyleContextHolder->Style##name_(); \
155 #include "nsStyleStructList.h"
156 #undef STYLE_STRUCT
158 // All of the property getters below return a pointer to a refcounted object
159 // that has just been created, but the refcount is still 0. Caller must take
160 // ownership.
162 mozilla::dom::CSSValue* GetEllipseRadii(const nsStyleCorners& aRadius,
163 uint8_t aFullCorner,
164 bool aIsBorder); // else outline
166 mozilla::dom::CSSValue* GetOffsetWidthFor(mozilla::css::Side aSide);
168 mozilla::dom::CSSValue* GetAbsoluteOffset(mozilla::css::Side aSide);
170 mozilla::dom::CSSValue* GetRelativeOffset(mozilla::css::Side aSide);
172 mozilla::dom::CSSValue* GetStickyOffset(mozilla::css::Side aSide);
174 mozilla::dom::CSSValue* GetStaticOffset(mozilla::css::Side aSide);
176 mozilla::dom::CSSValue* GetPaddingWidthFor(mozilla::css::Side aSide);
178 mozilla::dom::CSSValue* GetBorderColorsFor(mozilla::css::Side aSide);
180 mozilla::dom::CSSValue* GetBorderStyleFor(mozilla::css::Side aSide);
182 mozilla::dom::CSSValue* GetBorderWidthFor(mozilla::css::Side aSide);
184 mozilla::dom::CSSValue* GetBorderColorFor(mozilla::css::Side aSide);
186 mozilla::dom::CSSValue* GetMarginWidthFor(mozilla::css::Side aSide);
188 mozilla::dom::CSSValue* GetSVGPaintFor(bool aFill);
190 mozilla::dom::CSSValue* GetGridLineNames(const nsTArray<nsString>& aLineNames);
191 mozilla::dom::CSSValue* GetGridTrackSize(const nsStyleCoord& aMinSize,
192 const nsStyleCoord& aMaxSize);
193 mozilla::dom::CSSValue* GetGridTemplateColumnsRows(const nsStyleGridTemplate& aTrackList);
194 mozilla::dom::CSSValue* GetGridLine(const nsStyleGridLine& aGridLine);
196 bool GetLineHeightCoord(nscoord& aCoord);
198 mozilla::dom::CSSValue* GetCSSShadowArray(nsCSSShadowArray* aArray,
199 const nscolor& aDefaultColor,
200 bool aIsBoxShadow);
202 mozilla::dom::CSSValue* GetBackgroundList(uint8_t nsStyleBackground::Layer::* aMember,
203 uint32_t nsStyleBackground::* aCount,
204 const KTableValue aTable[]);
206 void GetCSSGradientString(const nsStyleGradient* aGradient,
207 nsAString& aString);
208 void GetImageRectString(nsIURI* aURI,
209 const nsStyleSides& aCropRect,
210 nsString& aString);
211 void AppendTimingFunction(nsDOMCSSValueList *aValueList,
212 const nsTimingFunction& aTimingFunction);
214 /* Properties queryable as CSSValues.
215 * To avoid a name conflict with nsIDOM*CSS2Properties, these are all
216 * DoGetXXX instead of GetXXX.
219 mozilla::dom::CSSValue* DoGetAppearance();
221 /* Box properties */
222 mozilla::dom::CSSValue* DoGetBoxAlign();
223 mozilla::dom::CSSValue* DoGetBoxDecorationBreak();
224 mozilla::dom::CSSValue* DoGetBoxDirection();
225 mozilla::dom::CSSValue* DoGetBoxFlex();
226 mozilla::dom::CSSValue* DoGetBoxOrdinalGroup();
227 mozilla::dom::CSSValue* DoGetBoxOrient();
228 mozilla::dom::CSSValue* DoGetBoxPack();
229 mozilla::dom::CSSValue* DoGetBoxSizing();
231 mozilla::dom::CSSValue* DoGetWidth();
232 mozilla::dom::CSSValue* DoGetHeight();
233 mozilla::dom::CSSValue* DoGetMaxHeight();
234 mozilla::dom::CSSValue* DoGetMaxWidth();
235 mozilla::dom::CSSValue* DoGetMinHeight();
236 mozilla::dom::CSSValue* DoGetMinWidth();
237 mozilla::dom::CSSValue* DoGetMixBlendMode();
238 mozilla::dom::CSSValue* DoGetLeft();
239 mozilla::dom::CSSValue* DoGetTop();
240 mozilla::dom::CSSValue* DoGetRight();
241 mozilla::dom::CSSValue* DoGetBottom();
242 mozilla::dom::CSSValue* DoGetStackSizing();
244 /* Font properties */
245 mozilla::dom::CSSValue* DoGetColor();
246 mozilla::dom::CSSValue* DoGetFontFamily();
247 mozilla::dom::CSSValue* DoGetFontFeatureSettings();
248 mozilla::dom::CSSValue* DoGetFontKerning();
249 mozilla::dom::CSSValue* DoGetFontLanguageOverride();
250 mozilla::dom::CSSValue* DoGetFontSize();
251 mozilla::dom::CSSValue* DoGetFontSizeAdjust();
252 mozilla::dom::CSSValue* DoGetOSXFontSmoothing();
253 mozilla::dom::CSSValue* DoGetFontStretch();
254 mozilla::dom::CSSValue* DoGetFontStyle();
255 mozilla::dom::CSSValue* DoGetFontSynthesis();
256 mozilla::dom::CSSValue* DoGetFontVariant();
257 mozilla::dom::CSSValue* DoGetFontVariantAlternates();
258 mozilla::dom::CSSValue* DoGetFontVariantCaps();
259 mozilla::dom::CSSValue* DoGetFontVariantEastAsian();
260 mozilla::dom::CSSValue* DoGetFontVariantLigatures();
261 mozilla::dom::CSSValue* DoGetFontVariantNumeric();
262 mozilla::dom::CSSValue* DoGetFontVariantPosition();
263 mozilla::dom::CSSValue* DoGetFontWeight();
265 /* Grid properties */
266 mozilla::dom::CSSValue* DoGetGridAutoFlow();
267 mozilla::dom::CSSValue* DoGetGridAutoColumns();
268 mozilla::dom::CSSValue* DoGetGridAutoRows();
269 mozilla::dom::CSSValue* DoGetGridTemplateAreas();
270 mozilla::dom::CSSValue* DoGetGridTemplateColumns();
271 mozilla::dom::CSSValue* DoGetGridTemplateRows();
272 mozilla::dom::CSSValue* DoGetGridColumnStart();
273 mozilla::dom::CSSValue* DoGetGridColumnEnd();
274 mozilla::dom::CSSValue* DoGetGridRowStart();
275 mozilla::dom::CSSValue* DoGetGridRowEnd();
277 /* Background properties */
278 mozilla::dom::CSSValue* DoGetBackgroundAttachment();
279 mozilla::dom::CSSValue* DoGetBackgroundColor();
280 mozilla::dom::CSSValue* DoGetBackgroundImage();
281 mozilla::dom::CSSValue* DoGetBackgroundPosition();
282 mozilla::dom::CSSValue* DoGetBackgroundRepeat();
283 mozilla::dom::CSSValue* DoGetBackgroundClip();
284 mozilla::dom::CSSValue* DoGetBackgroundBlendMode();
285 mozilla::dom::CSSValue* DoGetBackgroundOrigin();
286 mozilla::dom::CSSValue* DoGetBackgroundSize();
288 /* Padding properties */
289 mozilla::dom::CSSValue* DoGetPaddingTop();
290 mozilla::dom::CSSValue* DoGetPaddingBottom();
291 mozilla::dom::CSSValue* DoGetPaddingLeft();
292 mozilla::dom::CSSValue* DoGetPaddingRight();
294 /* Table Properties */
295 mozilla::dom::CSSValue* DoGetBorderCollapse();
296 mozilla::dom::CSSValue* DoGetBorderSpacing();
297 mozilla::dom::CSSValue* DoGetCaptionSide();
298 mozilla::dom::CSSValue* DoGetEmptyCells();
299 mozilla::dom::CSSValue* DoGetTableLayout();
300 mozilla::dom::CSSValue* DoGetVerticalAlign();
302 /* Border Properties */
303 mozilla::dom::CSSValue* DoGetBorderTopStyle();
304 mozilla::dom::CSSValue* DoGetBorderBottomStyle();
305 mozilla::dom::CSSValue* DoGetBorderLeftStyle();
306 mozilla::dom::CSSValue* DoGetBorderRightStyle();
307 mozilla::dom::CSSValue* DoGetBorderTopWidth();
308 mozilla::dom::CSSValue* DoGetBorderBottomWidth();
309 mozilla::dom::CSSValue* DoGetBorderLeftWidth();
310 mozilla::dom::CSSValue* DoGetBorderRightWidth();
311 mozilla::dom::CSSValue* DoGetBorderTopColor();
312 mozilla::dom::CSSValue* DoGetBorderBottomColor();
313 mozilla::dom::CSSValue* DoGetBorderLeftColor();
314 mozilla::dom::CSSValue* DoGetBorderRightColor();
315 mozilla::dom::CSSValue* DoGetBorderBottomColors();
316 mozilla::dom::CSSValue* DoGetBorderLeftColors();
317 mozilla::dom::CSSValue* DoGetBorderRightColors();
318 mozilla::dom::CSSValue* DoGetBorderTopColors();
319 mozilla::dom::CSSValue* DoGetBorderBottomLeftRadius();
320 mozilla::dom::CSSValue* DoGetBorderBottomRightRadius();
321 mozilla::dom::CSSValue* DoGetBorderTopLeftRadius();
322 mozilla::dom::CSSValue* DoGetBorderTopRightRadius();
323 mozilla::dom::CSSValue* DoGetFloatEdge();
325 /* Border Image */
326 mozilla::dom::CSSValue* DoGetBorderImageSource();
327 mozilla::dom::CSSValue* DoGetBorderImageSlice();
328 mozilla::dom::CSSValue* DoGetBorderImageWidth();
329 mozilla::dom::CSSValue* DoGetBorderImageOutset();
330 mozilla::dom::CSSValue* DoGetBorderImageRepeat();
332 /* Box Shadow */
333 mozilla::dom::CSSValue* DoGetBoxShadow();
335 /* Window Shadow */
336 mozilla::dom::CSSValue* DoGetWindowShadow();
338 /* Margin Properties */
339 mozilla::dom::CSSValue* DoGetMarginTopWidth();
340 mozilla::dom::CSSValue* DoGetMarginBottomWidth();
341 mozilla::dom::CSSValue* DoGetMarginLeftWidth();
342 mozilla::dom::CSSValue* DoGetMarginRightWidth();
344 /* Outline Properties */
345 mozilla::dom::CSSValue* DoGetOutlineWidth();
346 mozilla::dom::CSSValue* DoGetOutlineStyle();
347 mozilla::dom::CSSValue* DoGetOutlineColor();
348 mozilla::dom::CSSValue* DoGetOutlineOffset();
349 mozilla::dom::CSSValue* DoGetOutlineRadiusBottomLeft();
350 mozilla::dom::CSSValue* DoGetOutlineRadiusBottomRight();
351 mozilla::dom::CSSValue* DoGetOutlineRadiusTopLeft();
352 mozilla::dom::CSSValue* DoGetOutlineRadiusTopRight();
354 /* Content Properties */
355 mozilla::dom::CSSValue* DoGetContent();
356 mozilla::dom::CSSValue* DoGetCounterIncrement();
357 mozilla::dom::CSSValue* DoGetCounterReset();
358 mozilla::dom::CSSValue* DoGetMarkerOffset();
360 /* Quotes Properties */
361 mozilla::dom::CSSValue* DoGetQuotes();
363 /* z-index */
364 mozilla::dom::CSSValue* DoGetZIndex();
366 /* List properties */
367 mozilla::dom::CSSValue* DoGetListStyleImage();
368 mozilla::dom::CSSValue* DoGetListStylePosition();
369 mozilla::dom::CSSValue* DoGetListStyleType();
370 mozilla::dom::CSSValue* DoGetImageRegion();
372 /* Text Properties */
373 mozilla::dom::CSSValue* DoGetLineHeight();
374 mozilla::dom::CSSValue* DoGetTextAlign();
375 mozilla::dom::CSSValue* DoGetTextAlignLast();
376 mozilla::dom::CSSValue* DoGetTextCombineUpright();
377 mozilla::dom::CSSValue* DoGetTextDecoration();
378 mozilla::dom::CSSValue* DoGetTextDecorationColor();
379 mozilla::dom::CSSValue* DoGetTextDecorationLine();
380 mozilla::dom::CSSValue* DoGetTextDecorationStyle();
381 mozilla::dom::CSSValue* DoGetTextIndent();
382 mozilla::dom::CSSValue* DoGetTextOrientation();
383 mozilla::dom::CSSValue* DoGetTextOverflow();
384 mozilla::dom::CSSValue* DoGetTextTransform();
385 mozilla::dom::CSSValue* DoGetTextShadow();
386 mozilla::dom::CSSValue* DoGetLetterSpacing();
387 mozilla::dom::CSSValue* DoGetWordSpacing();
388 mozilla::dom::CSSValue* DoGetWhiteSpace();
389 mozilla::dom::CSSValue* DoGetWordBreak();
390 mozilla::dom::CSSValue* DoGetWordWrap();
391 mozilla::dom::CSSValue* DoGetHyphens();
392 mozilla::dom::CSSValue* DoGetTabSize();
393 mozilla::dom::CSSValue* DoGetTextSizeAdjust();
395 /* Visibility properties */
396 mozilla::dom::CSSValue* DoGetOpacity();
397 mozilla::dom::CSSValue* DoGetPointerEvents();
398 mozilla::dom::CSSValue* DoGetVisibility();
399 mozilla::dom::CSSValue* DoGetWritingMode();
401 /* Direction properties */
402 mozilla::dom::CSSValue* DoGetDirection();
403 mozilla::dom::CSSValue* DoGetUnicodeBidi();
405 /* Display properties */
406 mozilla::dom::CSSValue* DoGetBinding();
407 mozilla::dom::CSSValue* DoGetClear();
408 mozilla::dom::CSSValue* DoGetFloat();
409 mozilla::dom::CSSValue* DoGetDisplay();
410 mozilla::dom::CSSValue* DoGetPosition();
411 mozilla::dom::CSSValue* DoGetClip();
412 mozilla::dom::CSSValue* DoGetImageOrientation();
413 mozilla::dom::CSSValue* DoGetWillChange();
414 mozilla::dom::CSSValue* DoGetOverflow();
415 mozilla::dom::CSSValue* DoGetOverflowX();
416 mozilla::dom::CSSValue* DoGetOverflowY();
417 mozilla::dom::CSSValue* DoGetOverflowClipBox();
418 mozilla::dom::CSSValue* DoGetResize();
419 mozilla::dom::CSSValue* DoGetPageBreakAfter();
420 mozilla::dom::CSSValue* DoGetPageBreakBefore();
421 mozilla::dom::CSSValue* DoGetPageBreakInside();
422 mozilla::dom::CSSValue* DoGetTouchAction();
423 mozilla::dom::CSSValue* DoGetTransform();
424 mozilla::dom::CSSValue* DoGetTransformOrigin();
425 mozilla::dom::CSSValue* DoGetPerspective();
426 mozilla::dom::CSSValue* DoGetBackfaceVisibility();
427 mozilla::dom::CSSValue* DoGetPerspectiveOrigin();
428 mozilla::dom::CSSValue* DoGetTransformStyle();
429 mozilla::dom::CSSValue* DoGetOrient();
431 /* User interface properties */
432 mozilla::dom::CSSValue* DoGetCursor();
433 mozilla::dom::CSSValue* DoGetForceBrokenImageIcon();
434 mozilla::dom::CSSValue* DoGetIMEMode();
435 mozilla::dom::CSSValue* DoGetUserFocus();
436 mozilla::dom::CSSValue* DoGetUserInput();
437 mozilla::dom::CSSValue* DoGetUserModify();
438 mozilla::dom::CSSValue* DoGetUserSelect();
440 /* Column properties */
441 mozilla::dom::CSSValue* DoGetColumnCount();
442 mozilla::dom::CSSValue* DoGetColumnFill();
443 mozilla::dom::CSSValue* DoGetColumnWidth();
444 mozilla::dom::CSSValue* DoGetColumnGap();
445 mozilla::dom::CSSValue* DoGetColumnRuleWidth();
446 mozilla::dom::CSSValue* DoGetColumnRuleStyle();
447 mozilla::dom::CSSValue* DoGetColumnRuleColor();
449 /* CSS Transitions */
450 mozilla::dom::CSSValue* DoGetTransitionProperty();
451 mozilla::dom::CSSValue* DoGetTransitionDuration();
452 mozilla::dom::CSSValue* DoGetTransitionDelay();
453 mozilla::dom::CSSValue* DoGetTransitionTimingFunction();
455 /* CSS Animations */
456 mozilla::dom::CSSValue* DoGetAnimationName();
457 mozilla::dom::CSSValue* DoGetAnimationDuration();
458 mozilla::dom::CSSValue* DoGetAnimationDelay();
459 mozilla::dom::CSSValue* DoGetAnimationTimingFunction();
460 mozilla::dom::CSSValue* DoGetAnimationDirection();
461 mozilla::dom::CSSValue* DoGetAnimationFillMode();
462 mozilla::dom::CSSValue* DoGetAnimationIterationCount();
463 mozilla::dom::CSSValue* DoGetAnimationPlayState();
465 /* CSS Flexbox properties */
466 mozilla::dom::CSSValue* DoGetAlignContent();
467 mozilla::dom::CSSValue* DoGetAlignItems();
468 mozilla::dom::CSSValue* DoGetAlignSelf();
469 mozilla::dom::CSSValue* DoGetFlexBasis();
470 mozilla::dom::CSSValue* DoGetFlexDirection();
471 mozilla::dom::CSSValue* DoGetFlexGrow();
472 mozilla::dom::CSSValue* DoGetFlexShrink();
473 mozilla::dom::CSSValue* DoGetFlexWrap();
474 mozilla::dom::CSSValue* DoGetOrder();
475 mozilla::dom::CSSValue* DoGetJustifyContent();
477 /* SVG properties */
478 mozilla::dom::CSSValue* DoGetFill();
479 mozilla::dom::CSSValue* DoGetStroke();
480 mozilla::dom::CSSValue* DoGetMarkerEnd();
481 mozilla::dom::CSSValue* DoGetMarkerMid();
482 mozilla::dom::CSSValue* DoGetMarkerStart();
483 mozilla::dom::CSSValue* DoGetStrokeDasharray();
485 mozilla::dom::CSSValue* DoGetStrokeDashoffset();
486 mozilla::dom::CSSValue* DoGetStrokeWidth();
487 mozilla::dom::CSSValue* DoGetVectorEffect();
489 mozilla::dom::CSSValue* DoGetFillOpacity();
490 mozilla::dom::CSSValue* DoGetFloodOpacity();
491 mozilla::dom::CSSValue* DoGetStopOpacity();
492 mozilla::dom::CSSValue* DoGetStrokeMiterlimit();
493 mozilla::dom::CSSValue* DoGetStrokeOpacity();
495 mozilla::dom::CSSValue* DoGetClipRule();
496 mozilla::dom::CSSValue* DoGetFillRule();
497 mozilla::dom::CSSValue* DoGetStrokeLinecap();
498 mozilla::dom::CSSValue* DoGetStrokeLinejoin();
499 mozilla::dom::CSSValue* DoGetTextAnchor();
501 mozilla::dom::CSSValue* DoGetColorInterpolation();
502 mozilla::dom::CSSValue* DoGetColorInterpolationFilters();
503 mozilla::dom::CSSValue* DoGetDominantBaseline();
504 mozilla::dom::CSSValue* DoGetImageRendering();
505 mozilla::dom::CSSValue* DoGetShapeRendering();
506 mozilla::dom::CSSValue* DoGetTextRendering();
508 mozilla::dom::CSSValue* DoGetFloodColor();
509 mozilla::dom::CSSValue* DoGetLightingColor();
510 mozilla::dom::CSSValue* DoGetStopColor();
512 mozilla::dom::CSSValue* DoGetClipPath();
513 mozilla::dom::CSSValue* DoGetFilter();
514 mozilla::dom::CSSValue* DoGetMask();
515 mozilla::dom::CSSValue* DoGetMaskType();
516 mozilla::dom::CSSValue* DoGetPaintOrder();
518 /* Custom properties */
519 mozilla::dom::CSSValue* DoGetCustomProperty(const nsAString& aPropertyName);
521 nsDOMCSSValueList* GetROCSSValueList(bool aCommaDelimited);
522 void SetToRGBAColor(nsROCSSPrimitiveValue* aValue, nscolor aColor);
523 void SetValueToStyleImage(const nsStyleImage& aStyleImage,
524 nsROCSSPrimitiveValue* aValue);
527 * A method to get a percentage base for a percentage value. Returns true
528 * if a percentage base value was determined, false otherwise.
530 typedef bool (nsComputedDOMStyle::*PercentageBaseGetter)(nscoord&);
533 * Method to set aValue to aCoord. If aCoord is a percentage value and
534 * aPercentageBaseGetter is not null, aPercentageBaseGetter is called. If it
535 * returns true, the percentage base it outputs in its out param is used
536 * to compute an nscoord value. If the getter is null or returns false,
537 * the percent value of aCoord is set as a percent value on aValue. aTable,
538 * if not null, is the keyword table to handle eStyleUnit_Enumerated. When
539 * calling SetAppUnits on aValue (for coord or percent values), the value
540 * passed in will be clamped to be no less than aMinAppUnits and no more than
541 * aMaxAppUnits.
543 * XXXbz should caller pass in some sort of bitfield indicating which units
544 * can be expected or something?
546 void SetValueToCoord(nsROCSSPrimitiveValue* aValue,
547 const nsStyleCoord& aCoord,
548 bool aClampNegativeCalc,
549 PercentageBaseGetter aPercentageBaseGetter = nullptr,
550 const KTableValue aTable[] = nullptr,
551 nscoord aMinAppUnits = nscoord_MIN,
552 nscoord aMaxAppUnits = nscoord_MAX);
555 * If aCoord is a eStyleUnit_Coord returns the nscoord. If it's
556 * eStyleUnit_Percent, attempts to resolve the percentage base and returns
557 * the resulting nscoord. If it's some other unit or a percentge base can't
558 * be determined, returns aDefaultValue.
560 nscoord StyleCoordToNSCoord(const nsStyleCoord& aCoord,
561 PercentageBaseGetter aPercentageBaseGetter,
562 nscoord aDefaultValue,
563 bool aClampNegativeCalc);
565 bool GetCBContentWidth(nscoord& aWidth);
566 bool GetCBContentHeight(nscoord& aWidth);
567 bool GetScrollFrameContentWidth(nscoord& aWidth);
568 bool GetScrollFrameContentHeight(nscoord& aHeight);
569 bool GetFrameBoundsWidthForTransform(nscoord &aWidth);
570 bool GetFrameBoundsHeightForTransform(nscoord &aHeight);
571 bool GetFrameBorderRectWidth(nscoord& aWidth);
572 bool GetFrameBorderRectHeight(nscoord& aHeight);
574 /* Helper functions for computing the filter property style. */
575 void SetCssTextToCoord(nsAString& aCssText, const nsStyleCoord& aCoord);
576 mozilla::dom::CSSValue* CreatePrimitiveValueForStyleFilter(
577 const nsStyleFilter& aStyleFilter);
579 static nsComputedStyleMap* GetComputedStyleMap();
581 // We don't really have a good immutable representation of "presentation".
582 // Given the way GetComputedStyle is currently used, we should just grab the
583 // 0th presshell, if any, from the document.
584 nsWeakPtr mDocumentWeak;
585 nsCOMPtr<nsIContent> mContent;
588 * Strong reference to the style context while we're accessing the data from
589 * it. This can be either a style context we resolved ourselves or a style
590 * context we got from our frame.
592 nsRefPtr<nsStyleContext> mStyleContextHolder;
593 nsCOMPtr<nsIAtom> mPseudo;
596 * While computing style data, the primary frame for mContent --- named "outer"
597 * because we should use it to compute positioning data. Null
598 * otherwise.
600 nsIFrame* mOuterFrame;
602 * While computing style data, the "inner frame" for mContent --- the frame
603 * which we should use to compute margin, border, padding and content data. Null
604 * otherwise.
606 nsIFrame* mInnerFrame;
608 * While computing style data, the presshell we're working with. Null
609 * otherwise.
611 nsIPresShell* mPresShell;
614 * The kind of styles we should be returning.
616 StyleType mStyleType;
618 bool mExposeVisitedStyle;
620 #ifdef DEBUG
621 bool mFlushedPendingReflows;
622 #endif
625 already_AddRefed<nsComputedDOMStyle>
626 NS_NewComputedDOMStyle(mozilla::dom::Element* aElement,
627 const nsAString& aPseudoElt,
628 nsIPresShell* aPresShell,
629 nsComputedDOMStyle::StyleType aStyleType =
630 nsComputedDOMStyle::eAll);
632 #endif /* nsComputedDOMStyle_h__ */