michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* DOM object returned from element.getComputedStyle() */ michael@0: michael@0: #ifndef nsComputedDOMStyle_h__ michael@0: #define nsComputedDOMStyle_h__ michael@0: michael@0: #include "nsAutoPtr.h" michael@0: #include "mozilla/Attributes.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nscore.h" michael@0: #include "nsCSSProperty.h" michael@0: #include "nsCSSProps.h" michael@0: #include "nsDOMCSSDeclaration.h" michael@0: #include "nsStyleContext.h" michael@0: #include "nsIWeakReferenceUtils.h" michael@0: #include "mozilla/gfx/Types.h" michael@0: #include "nsCoord.h" michael@0: #include "nsColor.h" michael@0: #include "nsIContent.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: class Element; michael@0: } michael@0: } michael@0: michael@0: struct nsComputedStyleMap; michael@0: class nsIFrame; michael@0: class nsIPresShell; michael@0: class nsDOMCSSValueList; michael@0: class nsMargin; michael@0: class nsROCSSPrimitiveValue; michael@0: class nsStyleBackground; michael@0: class nsStyleBorder; michael@0: class nsStyleContent; michael@0: class nsStyleColumn; michael@0: class nsStyleColor; michael@0: class nsStyleCoord; michael@0: class nsStyleCorners; michael@0: class nsStyleDisplay; michael@0: class nsStyleFilter; michael@0: class nsStyleFont; michael@0: class nsStyleGradient; michael@0: class nsStyleImage; michael@0: class nsStyleList; michael@0: class nsStyleMargin; michael@0: class nsStyleOutline; michael@0: class nsStylePadding; michael@0: class nsStylePosition; michael@0: class nsStyleQuotes; michael@0: class nsStyleSides; michael@0: class nsStyleSVG; michael@0: class nsStyleSVGReset; michael@0: class nsStyleTable; michael@0: class nsStyleText; michael@0: class nsStyleTextReset; michael@0: class nsStyleTimingFunction; michael@0: class nsStyleUIReset; michael@0: class nsStyleVisibility; michael@0: class nsStyleXUL; michael@0: class nsTimingFunction; michael@0: class gfx3DMatrix; michael@0: michael@0: class nsComputedDOMStyle MOZ_FINAL : public nsDOMCSSDeclaration michael@0: { michael@0: public: michael@0: typedef nsCSSProps::KTableValue KTableValue; michael@0: michael@0: NS_DECL_CYCLE_COLLECTING_ISUPPORTS michael@0: NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsComputedDOMStyle, michael@0: nsICSSDeclaration) michael@0: michael@0: NS_DECL_NSICSSDECLARATION michael@0: michael@0: NS_DECL_NSIDOMCSSSTYLEDECLARATION_HELPER michael@0: virtual already_AddRefed michael@0: GetPropertyCSSValue(const nsAString& aProp, mozilla::ErrorResult& aRv) michael@0: MOZ_OVERRIDE; michael@0: using nsICSSDeclaration::GetPropertyCSSValue; michael@0: virtual void IndexedGetter(uint32_t aIndex, bool& aFound, nsAString& aPropName) MOZ_OVERRIDE; michael@0: michael@0: enum StyleType { michael@0: eDefaultOnly, // Only includes UA and user sheets michael@0: eAll // Includes all stylesheets michael@0: }; michael@0: michael@0: nsComputedDOMStyle(mozilla::dom::Element* aElement, michael@0: const nsAString& aPseudoElt, michael@0: nsIPresShell* aPresShell, michael@0: StyleType aStyleType); michael@0: virtual ~nsComputedDOMStyle(); michael@0: michael@0: static void Shutdown(); michael@0: michael@0: virtual nsINode *GetParentObject() MOZ_OVERRIDE michael@0: { michael@0: return mContent; michael@0: } michael@0: michael@0: static already_AddRefed michael@0: GetStyleContextForElement(mozilla::dom::Element* aElement, nsIAtom* aPseudo, michael@0: nsIPresShell* aPresShell, michael@0: StyleType aStyleType = eAll); michael@0: michael@0: static already_AddRefed michael@0: GetStyleContextForElementNoFlush(mozilla::dom::Element* aElement, michael@0: nsIAtom* aPseudo, michael@0: nsIPresShell* aPresShell, michael@0: StyleType aStyleType = eAll); michael@0: michael@0: static nsIPresShell* michael@0: GetPresShellForContent(nsIContent* aContent); michael@0: michael@0: // Helper for nsDOMWindowUtils::GetVisitedDependentComputedStyle michael@0: void SetExposeVisitedStyle(bool aExpose) { michael@0: NS_ASSERTION(aExpose != mExposeVisitedStyle, "should always be changing"); michael@0: mExposeVisitedStyle = aExpose; michael@0: } michael@0: michael@0: // nsDOMCSSDeclaration abstract methods which should never be called michael@0: // on a nsComputedDOMStyle object, but must be defined to avoid michael@0: // compile errors. michael@0: virtual mozilla::css::Declaration* GetCSSDeclaration(bool) MOZ_OVERRIDE; michael@0: virtual nsresult SetCSSDeclaration(mozilla::css::Declaration*) MOZ_OVERRIDE; michael@0: virtual nsIDocument* DocToUpdate() MOZ_OVERRIDE; michael@0: virtual void GetCSSParsingEnvironment(CSSParsingEnvironment& aCSSParseEnv) MOZ_OVERRIDE; michael@0: michael@0: static nsROCSSPrimitiveValue* MatrixToCSSValue(gfx3DMatrix& aMatrix); michael@0: michael@0: static void RegisterPrefChangeCallbacks(); michael@0: static void UnregisterPrefChangeCallbacks(); michael@0: michael@0: private: michael@0: void AssertFlushedPendingReflows() { michael@0: NS_ASSERTION(mFlushedPendingReflows, michael@0: "property getter should have been marked layout-dependent"); michael@0: } michael@0: michael@0: nsMargin GetAdjustedValuesForBoxSizing(); michael@0: michael@0: // Helper method for DoGetTextAlign[Last]. michael@0: mozilla::dom::CSSValue* CreateTextAlignValue(uint8_t aAlign, michael@0: bool aAlignTrue, michael@0: const KTableValue aTable[]); michael@0: // This indicates error by leaving mStyleContextHolder null. michael@0: void UpdateCurrentStyleSources(bool aNeedsLayoutFlush); michael@0: void ClearCurrentStyleSources(); michael@0: michael@0: #define STYLE_STRUCT(name_, checkdata_cb_) \ michael@0: const nsStyle##name_ * Style##name_() { \ michael@0: return mStyleContextHolder->Style##name_(); \ michael@0: } michael@0: #include "nsStyleStructList.h" michael@0: #undef STYLE_STRUCT michael@0: michael@0: // All of the property getters below return a pointer to a refcounted object michael@0: // that has just been created, but the refcount is still 0. Caller must take michael@0: // ownership. michael@0: michael@0: mozilla::dom::CSSValue* GetEllipseRadii(const nsStyleCorners& aRadius, michael@0: uint8_t aFullCorner, michael@0: bool aIsBorder); // else outline michael@0: michael@0: mozilla::dom::CSSValue* GetOffsetWidthFor(mozilla::css::Side aSide); michael@0: michael@0: mozilla::dom::CSSValue* GetAbsoluteOffset(mozilla::css::Side aSide); michael@0: michael@0: mozilla::dom::CSSValue* GetRelativeOffset(mozilla::css::Side aSide); michael@0: michael@0: mozilla::dom::CSSValue* GetStickyOffset(mozilla::css::Side aSide); michael@0: michael@0: mozilla::dom::CSSValue* GetStaticOffset(mozilla::css::Side aSide); michael@0: michael@0: mozilla::dom::CSSValue* GetPaddingWidthFor(mozilla::css::Side aSide); michael@0: michael@0: mozilla::dom::CSSValue* GetBorderColorsFor(mozilla::css::Side aSide); michael@0: michael@0: mozilla::dom::CSSValue* GetBorderStyleFor(mozilla::css::Side aSide); michael@0: michael@0: mozilla::dom::CSSValue* GetBorderWidthFor(mozilla::css::Side aSide); michael@0: michael@0: mozilla::dom::CSSValue* GetBorderColorFor(mozilla::css::Side aSide); michael@0: michael@0: mozilla::dom::CSSValue* GetMarginWidthFor(mozilla::css::Side aSide); michael@0: michael@0: mozilla::dom::CSSValue* GetSVGPaintFor(bool aFill); michael@0: michael@0: mozilla::dom::CSSValue* GetGridLineNames(const nsTArray& aLineNames); michael@0: mozilla::dom::CSSValue* GetGridTrackSize(const nsStyleCoord& aMinSize, michael@0: const nsStyleCoord& aMaxSize); michael@0: mozilla::dom::CSSValue* GetGridTemplateColumnsRows(const nsStyleGridTemplate& aTrackList); michael@0: mozilla::dom::CSSValue* GetGridLine(const nsStyleGridLine& aGridLine); michael@0: michael@0: bool GetLineHeightCoord(nscoord& aCoord); michael@0: michael@0: mozilla::dom::CSSValue* GetCSSShadowArray(nsCSSShadowArray* aArray, michael@0: const nscolor& aDefaultColor, michael@0: bool aIsBoxShadow); michael@0: michael@0: mozilla::dom::CSSValue* GetBackgroundList(uint8_t nsStyleBackground::Layer::* aMember, michael@0: uint32_t nsStyleBackground::* aCount, michael@0: const KTableValue aTable[]); michael@0: michael@0: void GetCSSGradientString(const nsStyleGradient* aGradient, michael@0: nsAString& aString); michael@0: void GetImageRectString(nsIURI* aURI, michael@0: const nsStyleSides& aCropRect, michael@0: nsString& aString); michael@0: void AppendTimingFunction(nsDOMCSSValueList *aValueList, michael@0: const nsTimingFunction& aTimingFunction); michael@0: michael@0: /* Properties queryable as CSSValues. michael@0: * To avoid a name conflict with nsIDOM*CSS2Properties, these are all michael@0: * DoGetXXX instead of GetXXX. michael@0: */ michael@0: michael@0: mozilla::dom::CSSValue* DoGetAppearance(); michael@0: michael@0: /* Box properties */ michael@0: mozilla::dom::CSSValue* DoGetBoxAlign(); michael@0: mozilla::dom::CSSValue* DoGetBoxDirection(); michael@0: mozilla::dom::CSSValue* DoGetBoxFlex(); michael@0: mozilla::dom::CSSValue* DoGetBoxOrdinalGroup(); michael@0: mozilla::dom::CSSValue* DoGetBoxOrient(); michael@0: mozilla::dom::CSSValue* DoGetBoxPack(); michael@0: mozilla::dom::CSSValue* DoGetBoxSizing(); michael@0: michael@0: mozilla::dom::CSSValue* DoGetWidth(); michael@0: mozilla::dom::CSSValue* DoGetHeight(); michael@0: mozilla::dom::CSSValue* DoGetMaxHeight(); michael@0: mozilla::dom::CSSValue* DoGetMaxWidth(); michael@0: mozilla::dom::CSSValue* DoGetMinHeight(); michael@0: mozilla::dom::CSSValue* DoGetMinWidth(); michael@0: mozilla::dom::CSSValue* DoGetMixBlendMode(); michael@0: mozilla::dom::CSSValue* DoGetLeft(); michael@0: mozilla::dom::CSSValue* DoGetTop(); michael@0: mozilla::dom::CSSValue* DoGetRight(); michael@0: mozilla::dom::CSSValue* DoGetBottom(); michael@0: mozilla::dom::CSSValue* DoGetStackSizing(); michael@0: michael@0: /* Font properties */ michael@0: mozilla::dom::CSSValue* DoGetColor(); michael@0: mozilla::dom::CSSValue* DoGetFontFamily(); michael@0: mozilla::dom::CSSValue* DoGetFontFeatureSettings(); michael@0: mozilla::dom::CSSValue* DoGetFontKerning(); michael@0: mozilla::dom::CSSValue* DoGetFontLanguageOverride(); michael@0: mozilla::dom::CSSValue* DoGetFontSize(); michael@0: mozilla::dom::CSSValue* DoGetFontSizeAdjust(); michael@0: mozilla::dom::CSSValue* DoGetOSXFontSmoothing(); michael@0: mozilla::dom::CSSValue* DoGetFontStretch(); michael@0: mozilla::dom::CSSValue* DoGetFontStyle(); michael@0: mozilla::dom::CSSValue* DoGetFontSynthesis(); michael@0: mozilla::dom::CSSValue* DoGetFontVariant(); michael@0: mozilla::dom::CSSValue* DoGetFontVariantAlternates(); michael@0: mozilla::dom::CSSValue* DoGetFontVariantCaps(); michael@0: mozilla::dom::CSSValue* DoGetFontVariantEastAsian(); michael@0: mozilla::dom::CSSValue* DoGetFontVariantLigatures(); michael@0: mozilla::dom::CSSValue* DoGetFontVariantNumeric(); michael@0: mozilla::dom::CSSValue* DoGetFontVariantPosition(); michael@0: mozilla::dom::CSSValue* DoGetFontWeight(); michael@0: michael@0: /* Grid properties */ michael@0: mozilla::dom::CSSValue* DoGetGridAutoFlow(); michael@0: mozilla::dom::CSSValue* DoGetGridAutoColumns(); michael@0: mozilla::dom::CSSValue* DoGetGridAutoRows(); michael@0: mozilla::dom::CSSValue* DoGetGridAutoPosition(); michael@0: mozilla::dom::CSSValue* DoGetGridTemplateAreas(); michael@0: mozilla::dom::CSSValue* DoGetGridTemplateColumns(); michael@0: mozilla::dom::CSSValue* DoGetGridTemplateRows(); michael@0: mozilla::dom::CSSValue* DoGetGridColumnStart(); michael@0: mozilla::dom::CSSValue* DoGetGridColumnEnd(); michael@0: mozilla::dom::CSSValue* DoGetGridRowStart(); michael@0: mozilla::dom::CSSValue* DoGetGridRowEnd(); michael@0: michael@0: /* Background properties */ michael@0: mozilla::dom::CSSValue* DoGetBackgroundAttachment(); michael@0: mozilla::dom::CSSValue* DoGetBackgroundColor(); michael@0: mozilla::dom::CSSValue* DoGetBackgroundImage(); michael@0: mozilla::dom::CSSValue* DoGetBackgroundPosition(); michael@0: mozilla::dom::CSSValue* DoGetBackgroundRepeat(); michael@0: mozilla::dom::CSSValue* DoGetBackgroundClip(); michael@0: mozilla::dom::CSSValue* DoGetBackgroundInlinePolicy(); michael@0: mozilla::dom::CSSValue* DoGetBackgroundBlendMode(); michael@0: mozilla::dom::CSSValue* DoGetBackgroundOrigin(); michael@0: mozilla::dom::CSSValue* DoGetBackgroundSize(); michael@0: michael@0: /* Padding properties */ michael@0: mozilla::dom::CSSValue* DoGetPaddingTop(); michael@0: mozilla::dom::CSSValue* DoGetPaddingBottom(); michael@0: mozilla::dom::CSSValue* DoGetPaddingLeft(); michael@0: mozilla::dom::CSSValue* DoGetPaddingRight(); michael@0: michael@0: /* Table Properties */ michael@0: mozilla::dom::CSSValue* DoGetBorderCollapse(); michael@0: mozilla::dom::CSSValue* DoGetBorderSpacing(); michael@0: mozilla::dom::CSSValue* DoGetCaptionSide(); michael@0: mozilla::dom::CSSValue* DoGetEmptyCells(); michael@0: mozilla::dom::CSSValue* DoGetTableLayout(); michael@0: mozilla::dom::CSSValue* DoGetVerticalAlign(); michael@0: michael@0: /* Border Properties */ michael@0: mozilla::dom::CSSValue* DoGetBorderTopStyle(); michael@0: mozilla::dom::CSSValue* DoGetBorderBottomStyle(); michael@0: mozilla::dom::CSSValue* DoGetBorderLeftStyle(); michael@0: mozilla::dom::CSSValue* DoGetBorderRightStyle(); michael@0: mozilla::dom::CSSValue* DoGetBorderTopWidth(); michael@0: mozilla::dom::CSSValue* DoGetBorderBottomWidth(); michael@0: mozilla::dom::CSSValue* DoGetBorderLeftWidth(); michael@0: mozilla::dom::CSSValue* DoGetBorderRightWidth(); michael@0: mozilla::dom::CSSValue* DoGetBorderTopColor(); michael@0: mozilla::dom::CSSValue* DoGetBorderBottomColor(); michael@0: mozilla::dom::CSSValue* DoGetBorderLeftColor(); michael@0: mozilla::dom::CSSValue* DoGetBorderRightColor(); michael@0: mozilla::dom::CSSValue* DoGetBorderBottomColors(); michael@0: mozilla::dom::CSSValue* DoGetBorderLeftColors(); michael@0: mozilla::dom::CSSValue* DoGetBorderRightColors(); michael@0: mozilla::dom::CSSValue* DoGetBorderTopColors(); michael@0: mozilla::dom::CSSValue* DoGetBorderBottomLeftRadius(); michael@0: mozilla::dom::CSSValue* DoGetBorderBottomRightRadius(); michael@0: mozilla::dom::CSSValue* DoGetBorderTopLeftRadius(); michael@0: mozilla::dom::CSSValue* DoGetBorderTopRightRadius(); michael@0: mozilla::dom::CSSValue* DoGetFloatEdge(); michael@0: michael@0: /* Border Image */ michael@0: mozilla::dom::CSSValue* DoGetBorderImageSource(); michael@0: mozilla::dom::CSSValue* DoGetBorderImageSlice(); michael@0: mozilla::dom::CSSValue* DoGetBorderImageWidth(); michael@0: mozilla::dom::CSSValue* DoGetBorderImageOutset(); michael@0: mozilla::dom::CSSValue* DoGetBorderImageRepeat(); michael@0: michael@0: /* Box Shadow */ michael@0: mozilla::dom::CSSValue* DoGetBoxShadow(); michael@0: michael@0: /* Window Shadow */ michael@0: mozilla::dom::CSSValue* DoGetWindowShadow(); michael@0: michael@0: /* Margin Properties */ michael@0: mozilla::dom::CSSValue* DoGetMarginTopWidth(); michael@0: mozilla::dom::CSSValue* DoGetMarginBottomWidth(); michael@0: mozilla::dom::CSSValue* DoGetMarginLeftWidth(); michael@0: mozilla::dom::CSSValue* DoGetMarginRightWidth(); michael@0: michael@0: /* Outline Properties */ michael@0: mozilla::dom::CSSValue* DoGetOutlineWidth(); michael@0: mozilla::dom::CSSValue* DoGetOutlineStyle(); michael@0: mozilla::dom::CSSValue* DoGetOutlineColor(); michael@0: mozilla::dom::CSSValue* DoGetOutlineOffset(); michael@0: mozilla::dom::CSSValue* DoGetOutlineRadiusBottomLeft(); michael@0: mozilla::dom::CSSValue* DoGetOutlineRadiusBottomRight(); michael@0: mozilla::dom::CSSValue* DoGetOutlineRadiusTopLeft(); michael@0: mozilla::dom::CSSValue* DoGetOutlineRadiusTopRight(); michael@0: michael@0: /* Content Properties */ michael@0: mozilla::dom::CSSValue* DoGetContent(); michael@0: mozilla::dom::CSSValue* DoGetCounterIncrement(); michael@0: mozilla::dom::CSSValue* DoGetCounterReset(); michael@0: mozilla::dom::CSSValue* DoGetMarkerOffset(); michael@0: michael@0: /* Quotes Properties */ michael@0: mozilla::dom::CSSValue* DoGetQuotes(); michael@0: michael@0: /* z-index */ michael@0: mozilla::dom::CSSValue* DoGetZIndex(); michael@0: michael@0: /* List properties */ michael@0: mozilla::dom::CSSValue* DoGetListStyleImage(); michael@0: mozilla::dom::CSSValue* DoGetListStylePosition(); michael@0: mozilla::dom::CSSValue* DoGetListStyleType(); michael@0: mozilla::dom::CSSValue* DoGetImageRegion(); michael@0: michael@0: /* Text Properties */ michael@0: mozilla::dom::CSSValue* DoGetLineHeight(); michael@0: mozilla::dom::CSSValue* DoGetTextAlign(); michael@0: mozilla::dom::CSSValue* DoGetTextAlignLast(); michael@0: mozilla::dom::CSSValue* DoGetTextCombineUpright(); michael@0: mozilla::dom::CSSValue* DoGetTextDecoration(); michael@0: mozilla::dom::CSSValue* DoGetTextDecorationColor(); michael@0: mozilla::dom::CSSValue* DoGetTextDecorationLine(); michael@0: mozilla::dom::CSSValue* DoGetTextDecorationStyle(); michael@0: mozilla::dom::CSSValue* DoGetTextIndent(); michael@0: mozilla::dom::CSSValue* DoGetTextOrientation(); michael@0: mozilla::dom::CSSValue* DoGetTextOverflow(); michael@0: mozilla::dom::CSSValue* DoGetTextTransform(); michael@0: mozilla::dom::CSSValue* DoGetTextShadow(); michael@0: mozilla::dom::CSSValue* DoGetLetterSpacing(); michael@0: mozilla::dom::CSSValue* DoGetWordSpacing(); michael@0: mozilla::dom::CSSValue* DoGetWhiteSpace(); michael@0: mozilla::dom::CSSValue* DoGetWordBreak(); michael@0: mozilla::dom::CSSValue* DoGetWordWrap(); michael@0: mozilla::dom::CSSValue* DoGetHyphens(); michael@0: mozilla::dom::CSSValue* DoGetTabSize(); michael@0: mozilla::dom::CSSValue* DoGetTextSizeAdjust(); michael@0: michael@0: /* Visibility properties */ michael@0: mozilla::dom::CSSValue* DoGetOpacity(); michael@0: mozilla::dom::CSSValue* DoGetPointerEvents(); michael@0: mozilla::dom::CSSValue* DoGetVisibility(); michael@0: mozilla::dom::CSSValue* DoGetWritingMode(); michael@0: michael@0: /* Direction properties */ michael@0: mozilla::dom::CSSValue* DoGetDirection(); michael@0: mozilla::dom::CSSValue* DoGetUnicodeBidi(); michael@0: michael@0: /* Display properties */ michael@0: mozilla::dom::CSSValue* DoGetBinding(); michael@0: mozilla::dom::CSSValue* DoGetClear(); michael@0: mozilla::dom::CSSValue* DoGetFloat(); michael@0: mozilla::dom::CSSValue* DoGetDisplay(); michael@0: mozilla::dom::CSSValue* DoGetPosition(); michael@0: mozilla::dom::CSSValue* DoGetClip(); michael@0: mozilla::dom::CSSValue* DoGetImageOrientation(); michael@0: mozilla::dom::CSSValue* DoGetWillChange(); michael@0: mozilla::dom::CSSValue* DoGetOverflow(); michael@0: mozilla::dom::CSSValue* DoGetOverflowX(); michael@0: mozilla::dom::CSSValue* DoGetOverflowY(); michael@0: mozilla::dom::CSSValue* DoGetOverflowClipBox(); michael@0: mozilla::dom::CSSValue* DoGetResize(); michael@0: mozilla::dom::CSSValue* DoGetPageBreakAfter(); michael@0: mozilla::dom::CSSValue* DoGetPageBreakBefore(); michael@0: mozilla::dom::CSSValue* DoGetPageBreakInside(); michael@0: mozilla::dom::CSSValue* DoGetTouchAction(); michael@0: mozilla::dom::CSSValue* DoGetTransform(); michael@0: mozilla::dom::CSSValue* DoGetTransformOrigin(); michael@0: mozilla::dom::CSSValue* DoGetPerspective(); michael@0: mozilla::dom::CSSValue* DoGetBackfaceVisibility(); michael@0: mozilla::dom::CSSValue* DoGetPerspectiveOrigin(); michael@0: mozilla::dom::CSSValue* DoGetTransformStyle(); michael@0: mozilla::dom::CSSValue* DoGetOrient(); michael@0: michael@0: /* User interface properties */ michael@0: mozilla::dom::CSSValue* DoGetCursor(); michael@0: mozilla::dom::CSSValue* DoGetForceBrokenImageIcon(); michael@0: mozilla::dom::CSSValue* DoGetIMEMode(); michael@0: mozilla::dom::CSSValue* DoGetUserFocus(); michael@0: mozilla::dom::CSSValue* DoGetUserInput(); michael@0: mozilla::dom::CSSValue* DoGetUserModify(); michael@0: mozilla::dom::CSSValue* DoGetUserSelect(); michael@0: michael@0: /* Column properties */ michael@0: mozilla::dom::CSSValue* DoGetColumnCount(); michael@0: mozilla::dom::CSSValue* DoGetColumnFill(); michael@0: mozilla::dom::CSSValue* DoGetColumnWidth(); michael@0: mozilla::dom::CSSValue* DoGetColumnGap(); michael@0: mozilla::dom::CSSValue* DoGetColumnRuleWidth(); michael@0: mozilla::dom::CSSValue* DoGetColumnRuleStyle(); michael@0: mozilla::dom::CSSValue* DoGetColumnRuleColor(); michael@0: michael@0: /* CSS Transitions */ michael@0: mozilla::dom::CSSValue* DoGetTransitionProperty(); michael@0: mozilla::dom::CSSValue* DoGetTransitionDuration(); michael@0: mozilla::dom::CSSValue* DoGetTransitionDelay(); michael@0: mozilla::dom::CSSValue* DoGetTransitionTimingFunction(); michael@0: michael@0: /* CSS Animations */ michael@0: mozilla::dom::CSSValue* DoGetAnimationName(); michael@0: mozilla::dom::CSSValue* DoGetAnimationDuration(); michael@0: mozilla::dom::CSSValue* DoGetAnimationDelay(); michael@0: mozilla::dom::CSSValue* DoGetAnimationTimingFunction(); michael@0: mozilla::dom::CSSValue* DoGetAnimationDirection(); michael@0: mozilla::dom::CSSValue* DoGetAnimationFillMode(); michael@0: mozilla::dom::CSSValue* DoGetAnimationIterationCount(); michael@0: mozilla::dom::CSSValue* DoGetAnimationPlayState(); michael@0: michael@0: /* CSS Flexbox properties */ michael@0: mozilla::dom::CSSValue* DoGetAlignContent(); michael@0: mozilla::dom::CSSValue* DoGetAlignItems(); michael@0: mozilla::dom::CSSValue* DoGetAlignSelf(); michael@0: mozilla::dom::CSSValue* DoGetFlexBasis(); michael@0: mozilla::dom::CSSValue* DoGetFlexDirection(); michael@0: mozilla::dom::CSSValue* DoGetFlexGrow(); michael@0: mozilla::dom::CSSValue* DoGetFlexShrink(); michael@0: mozilla::dom::CSSValue* DoGetFlexWrap(); michael@0: mozilla::dom::CSSValue* DoGetOrder(); michael@0: mozilla::dom::CSSValue* DoGetJustifyContent(); michael@0: michael@0: /* SVG properties */ michael@0: mozilla::dom::CSSValue* DoGetFill(); michael@0: mozilla::dom::CSSValue* DoGetStroke(); michael@0: mozilla::dom::CSSValue* DoGetMarkerEnd(); michael@0: mozilla::dom::CSSValue* DoGetMarkerMid(); michael@0: mozilla::dom::CSSValue* DoGetMarkerStart(); michael@0: mozilla::dom::CSSValue* DoGetStrokeDasharray(); michael@0: michael@0: mozilla::dom::CSSValue* DoGetStrokeDashoffset(); michael@0: mozilla::dom::CSSValue* DoGetStrokeWidth(); michael@0: mozilla::dom::CSSValue* DoGetVectorEffect(); michael@0: michael@0: mozilla::dom::CSSValue* DoGetFillOpacity(); michael@0: mozilla::dom::CSSValue* DoGetFloodOpacity(); michael@0: mozilla::dom::CSSValue* DoGetStopOpacity(); michael@0: mozilla::dom::CSSValue* DoGetStrokeMiterlimit(); michael@0: mozilla::dom::CSSValue* DoGetStrokeOpacity(); michael@0: michael@0: mozilla::dom::CSSValue* DoGetClipRule(); michael@0: mozilla::dom::CSSValue* DoGetFillRule(); michael@0: mozilla::dom::CSSValue* DoGetStrokeLinecap(); michael@0: mozilla::dom::CSSValue* DoGetStrokeLinejoin(); michael@0: mozilla::dom::CSSValue* DoGetTextAnchor(); michael@0: michael@0: mozilla::dom::CSSValue* DoGetColorInterpolation(); michael@0: mozilla::dom::CSSValue* DoGetColorInterpolationFilters(); michael@0: mozilla::dom::CSSValue* DoGetDominantBaseline(); michael@0: mozilla::dom::CSSValue* DoGetImageRendering(); michael@0: mozilla::dom::CSSValue* DoGetShapeRendering(); michael@0: mozilla::dom::CSSValue* DoGetTextRendering(); michael@0: michael@0: mozilla::dom::CSSValue* DoGetFloodColor(); michael@0: mozilla::dom::CSSValue* DoGetLightingColor(); michael@0: mozilla::dom::CSSValue* DoGetStopColor(); michael@0: michael@0: mozilla::dom::CSSValue* DoGetClipPath(); michael@0: mozilla::dom::CSSValue* DoGetFilter(); michael@0: mozilla::dom::CSSValue* DoGetMask(); michael@0: mozilla::dom::CSSValue* DoGetMaskType(); michael@0: mozilla::dom::CSSValue* DoGetPaintOrder(); michael@0: michael@0: /* Custom properties */ michael@0: mozilla::dom::CSSValue* DoGetCustomProperty(const nsAString& aPropertyName); michael@0: michael@0: nsDOMCSSValueList* GetROCSSValueList(bool aCommaDelimited); michael@0: void SetToRGBAColor(nsROCSSPrimitiveValue* aValue, nscolor aColor); michael@0: void SetValueToStyleImage(const nsStyleImage& aStyleImage, michael@0: nsROCSSPrimitiveValue* aValue); michael@0: michael@0: /** michael@0: * A method to get a percentage base for a percentage value. Returns true michael@0: * if a percentage base value was determined, false otherwise. michael@0: */ michael@0: typedef bool (nsComputedDOMStyle::*PercentageBaseGetter)(nscoord&); michael@0: michael@0: /** michael@0: * Method to set aValue to aCoord. If aCoord is a percentage value and michael@0: * aPercentageBaseGetter is not null, aPercentageBaseGetter is called. If it michael@0: * returns true, the percentage base it outputs in its out param is used michael@0: * to compute an nscoord value. If the getter is null or returns false, michael@0: * the percent value of aCoord is set as a percent value on aValue. aTable, michael@0: * if not null, is the keyword table to handle eStyleUnit_Enumerated. When michael@0: * calling SetAppUnits on aValue (for coord or percent values), the value michael@0: * passed in will be clamped to be no less than aMinAppUnits and no more than michael@0: * aMaxAppUnits. michael@0: * michael@0: * XXXbz should caller pass in some sort of bitfield indicating which units michael@0: * can be expected or something? michael@0: */ michael@0: void SetValueToCoord(nsROCSSPrimitiveValue* aValue, michael@0: const nsStyleCoord& aCoord, michael@0: bool aClampNegativeCalc, michael@0: PercentageBaseGetter aPercentageBaseGetter = nullptr, michael@0: const KTableValue aTable[] = nullptr, michael@0: nscoord aMinAppUnits = nscoord_MIN, michael@0: nscoord aMaxAppUnits = nscoord_MAX); michael@0: michael@0: /** michael@0: * If aCoord is a eStyleUnit_Coord returns the nscoord. If it's michael@0: * eStyleUnit_Percent, attempts to resolve the percentage base and returns michael@0: * the resulting nscoord. If it's some other unit or a percentge base can't michael@0: * be determined, returns aDefaultValue. michael@0: */ michael@0: nscoord StyleCoordToNSCoord(const nsStyleCoord& aCoord, michael@0: PercentageBaseGetter aPercentageBaseGetter, michael@0: nscoord aDefaultValue, michael@0: bool aClampNegativeCalc); michael@0: michael@0: bool GetCBContentWidth(nscoord& aWidth); michael@0: bool GetCBContentHeight(nscoord& aWidth); michael@0: bool GetScrollFrameContentWidth(nscoord& aWidth); michael@0: bool GetScrollFrameContentHeight(nscoord& aHeight); michael@0: bool GetFrameBoundsWidthForTransform(nscoord &aWidth); michael@0: bool GetFrameBoundsHeightForTransform(nscoord &aHeight); michael@0: bool GetFrameBorderRectWidth(nscoord& aWidth); michael@0: bool GetFrameBorderRectHeight(nscoord& aHeight); michael@0: michael@0: /* Helper functions for computing the filter property style. */ michael@0: void SetCssTextToCoord(nsAString& aCssText, const nsStyleCoord& aCoord); michael@0: mozilla::dom::CSSValue* CreatePrimitiveValueForStyleFilter( michael@0: const nsStyleFilter& aStyleFilter); michael@0: michael@0: static nsComputedStyleMap* GetComputedStyleMap(); michael@0: michael@0: // We don't really have a good immutable representation of "presentation". michael@0: // Given the way GetComputedStyle is currently used, we should just grab the michael@0: // 0th presshell, if any, from the document. michael@0: nsWeakPtr mDocumentWeak; michael@0: nsCOMPtr mContent; michael@0: michael@0: /* michael@0: * Strong reference to the style context while we're accessing the data from michael@0: * it. This can be either a style context we resolved ourselves or a style michael@0: * context we got from our frame. michael@0: */ michael@0: nsRefPtr mStyleContextHolder; michael@0: nsCOMPtr mPseudo; michael@0: michael@0: /* michael@0: * While computing style data, the primary frame for mContent --- named "outer" michael@0: * because we should use it to compute positioning data. Null michael@0: * otherwise. michael@0: */ michael@0: nsIFrame* mOuterFrame; michael@0: /* michael@0: * While computing style data, the "inner frame" for mContent --- the frame michael@0: * which we should use to compute margin, border, padding and content data. Null michael@0: * otherwise. michael@0: */ michael@0: nsIFrame* mInnerFrame; michael@0: /* michael@0: * While computing style data, the presshell we're working with. Null michael@0: * otherwise. michael@0: */ michael@0: nsIPresShell* mPresShell; michael@0: michael@0: /* michael@0: * The kind of styles we should be returning. michael@0: */ michael@0: StyleType mStyleType; michael@0: michael@0: bool mExposeVisitedStyle; michael@0: michael@0: #ifdef DEBUG michael@0: bool mFlushedPendingReflows; michael@0: #endif michael@0: }; michael@0: michael@0: already_AddRefed michael@0: NS_NewComputedDOMStyle(mozilla::dom::Element* aElement, michael@0: const nsAString& aPseudoElt, michael@0: nsIPresShell* aPresShell, michael@0: nsComputedDOMStyle::StyleType aStyleType = michael@0: nsComputedDOMStyle::eAll); michael@0: michael@0: #endif /* nsComputedDOMStyle_h__ */ michael@0: