1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/style/nsComputedDOMStyle.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,636 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +/* DOM object returned from element.getComputedStyle() */ 1.10 + 1.11 +#ifndef nsComputedDOMStyle_h__ 1.12 +#define nsComputedDOMStyle_h__ 1.13 + 1.14 +#include "nsAutoPtr.h" 1.15 +#include "mozilla/Attributes.h" 1.16 +#include "nsCOMPtr.h" 1.17 +#include "nscore.h" 1.18 +#include "nsCSSProperty.h" 1.19 +#include "nsCSSProps.h" 1.20 +#include "nsDOMCSSDeclaration.h" 1.21 +#include "nsStyleContext.h" 1.22 +#include "nsIWeakReferenceUtils.h" 1.23 +#include "mozilla/gfx/Types.h" 1.24 +#include "nsCoord.h" 1.25 +#include "nsColor.h" 1.26 +#include "nsIContent.h" 1.27 + 1.28 +namespace mozilla { 1.29 +namespace dom { 1.30 +class Element; 1.31 +} 1.32 +} 1.33 + 1.34 +struct nsComputedStyleMap; 1.35 +class nsIFrame; 1.36 +class nsIPresShell; 1.37 +class nsDOMCSSValueList; 1.38 +class nsMargin; 1.39 +class nsROCSSPrimitiveValue; 1.40 +class nsStyleBackground; 1.41 +class nsStyleBorder; 1.42 +class nsStyleContent; 1.43 +class nsStyleColumn; 1.44 +class nsStyleColor; 1.45 +class nsStyleCoord; 1.46 +class nsStyleCorners; 1.47 +class nsStyleDisplay; 1.48 +class nsStyleFilter; 1.49 +class nsStyleFont; 1.50 +class nsStyleGradient; 1.51 +class nsStyleImage; 1.52 +class nsStyleList; 1.53 +class nsStyleMargin; 1.54 +class nsStyleOutline; 1.55 +class nsStylePadding; 1.56 +class nsStylePosition; 1.57 +class nsStyleQuotes; 1.58 +class nsStyleSides; 1.59 +class nsStyleSVG; 1.60 +class nsStyleSVGReset; 1.61 +class nsStyleTable; 1.62 +class nsStyleText; 1.63 +class nsStyleTextReset; 1.64 +class nsStyleTimingFunction; 1.65 +class nsStyleUIReset; 1.66 +class nsStyleVisibility; 1.67 +class nsStyleXUL; 1.68 +class nsTimingFunction; 1.69 +class gfx3DMatrix; 1.70 + 1.71 +class nsComputedDOMStyle MOZ_FINAL : public nsDOMCSSDeclaration 1.72 +{ 1.73 +public: 1.74 + typedef nsCSSProps::KTableValue KTableValue; 1.75 + 1.76 + NS_DECL_CYCLE_COLLECTING_ISUPPORTS 1.77 + NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsComputedDOMStyle, 1.78 + nsICSSDeclaration) 1.79 + 1.80 + NS_DECL_NSICSSDECLARATION 1.81 + 1.82 + NS_DECL_NSIDOMCSSSTYLEDECLARATION_HELPER 1.83 + virtual already_AddRefed<mozilla::dom::CSSValue> 1.84 + GetPropertyCSSValue(const nsAString& aProp, mozilla::ErrorResult& aRv) 1.85 + MOZ_OVERRIDE; 1.86 + using nsICSSDeclaration::GetPropertyCSSValue; 1.87 + virtual void IndexedGetter(uint32_t aIndex, bool& aFound, nsAString& aPropName) MOZ_OVERRIDE; 1.88 + 1.89 + enum StyleType { 1.90 + eDefaultOnly, // Only includes UA and user sheets 1.91 + eAll // Includes all stylesheets 1.92 + }; 1.93 + 1.94 + nsComputedDOMStyle(mozilla::dom::Element* aElement, 1.95 + const nsAString& aPseudoElt, 1.96 + nsIPresShell* aPresShell, 1.97 + StyleType aStyleType); 1.98 + virtual ~nsComputedDOMStyle(); 1.99 + 1.100 + static void Shutdown(); 1.101 + 1.102 + virtual nsINode *GetParentObject() MOZ_OVERRIDE 1.103 + { 1.104 + return mContent; 1.105 + } 1.106 + 1.107 + static already_AddRefed<nsStyleContext> 1.108 + GetStyleContextForElement(mozilla::dom::Element* aElement, nsIAtom* aPseudo, 1.109 + nsIPresShell* aPresShell, 1.110 + StyleType aStyleType = eAll); 1.111 + 1.112 + static already_AddRefed<nsStyleContext> 1.113 + GetStyleContextForElementNoFlush(mozilla::dom::Element* aElement, 1.114 + nsIAtom* aPseudo, 1.115 + nsIPresShell* aPresShell, 1.116 + StyleType aStyleType = eAll); 1.117 + 1.118 + static nsIPresShell* 1.119 + GetPresShellForContent(nsIContent* aContent); 1.120 + 1.121 + // Helper for nsDOMWindowUtils::GetVisitedDependentComputedStyle 1.122 + void SetExposeVisitedStyle(bool aExpose) { 1.123 + NS_ASSERTION(aExpose != mExposeVisitedStyle, "should always be changing"); 1.124 + mExposeVisitedStyle = aExpose; 1.125 + } 1.126 + 1.127 + // nsDOMCSSDeclaration abstract methods which should never be called 1.128 + // on a nsComputedDOMStyle object, but must be defined to avoid 1.129 + // compile errors. 1.130 + virtual mozilla::css::Declaration* GetCSSDeclaration(bool) MOZ_OVERRIDE; 1.131 + virtual nsresult SetCSSDeclaration(mozilla::css::Declaration*) MOZ_OVERRIDE; 1.132 + virtual nsIDocument* DocToUpdate() MOZ_OVERRIDE; 1.133 + virtual void GetCSSParsingEnvironment(CSSParsingEnvironment& aCSSParseEnv) MOZ_OVERRIDE; 1.134 + 1.135 + static nsROCSSPrimitiveValue* MatrixToCSSValue(gfx3DMatrix& aMatrix); 1.136 + 1.137 + static void RegisterPrefChangeCallbacks(); 1.138 + static void UnregisterPrefChangeCallbacks(); 1.139 + 1.140 +private: 1.141 + void AssertFlushedPendingReflows() { 1.142 + NS_ASSERTION(mFlushedPendingReflows, 1.143 + "property getter should have been marked layout-dependent"); 1.144 + } 1.145 + 1.146 + nsMargin GetAdjustedValuesForBoxSizing(); 1.147 + 1.148 + // Helper method for DoGetTextAlign[Last]. 1.149 + mozilla::dom::CSSValue* CreateTextAlignValue(uint8_t aAlign, 1.150 + bool aAlignTrue, 1.151 + const KTableValue aTable[]); 1.152 + // This indicates error by leaving mStyleContextHolder null. 1.153 + void UpdateCurrentStyleSources(bool aNeedsLayoutFlush); 1.154 + void ClearCurrentStyleSources(); 1.155 + 1.156 +#define STYLE_STRUCT(name_, checkdata_cb_) \ 1.157 + const nsStyle##name_ * Style##name_() { \ 1.158 + return mStyleContextHolder->Style##name_(); \ 1.159 + } 1.160 +#include "nsStyleStructList.h" 1.161 +#undef STYLE_STRUCT 1.162 + 1.163 + // All of the property getters below return a pointer to a refcounted object 1.164 + // that has just been created, but the refcount is still 0. Caller must take 1.165 + // ownership. 1.166 + 1.167 + mozilla::dom::CSSValue* GetEllipseRadii(const nsStyleCorners& aRadius, 1.168 + uint8_t aFullCorner, 1.169 + bool aIsBorder); // else outline 1.170 + 1.171 + mozilla::dom::CSSValue* GetOffsetWidthFor(mozilla::css::Side aSide); 1.172 + 1.173 + mozilla::dom::CSSValue* GetAbsoluteOffset(mozilla::css::Side aSide); 1.174 + 1.175 + mozilla::dom::CSSValue* GetRelativeOffset(mozilla::css::Side aSide); 1.176 + 1.177 + mozilla::dom::CSSValue* GetStickyOffset(mozilla::css::Side aSide); 1.178 + 1.179 + mozilla::dom::CSSValue* GetStaticOffset(mozilla::css::Side aSide); 1.180 + 1.181 + mozilla::dom::CSSValue* GetPaddingWidthFor(mozilla::css::Side aSide); 1.182 + 1.183 + mozilla::dom::CSSValue* GetBorderColorsFor(mozilla::css::Side aSide); 1.184 + 1.185 + mozilla::dom::CSSValue* GetBorderStyleFor(mozilla::css::Side aSide); 1.186 + 1.187 + mozilla::dom::CSSValue* GetBorderWidthFor(mozilla::css::Side aSide); 1.188 + 1.189 + mozilla::dom::CSSValue* GetBorderColorFor(mozilla::css::Side aSide); 1.190 + 1.191 + mozilla::dom::CSSValue* GetMarginWidthFor(mozilla::css::Side aSide); 1.192 + 1.193 + mozilla::dom::CSSValue* GetSVGPaintFor(bool aFill); 1.194 + 1.195 + mozilla::dom::CSSValue* GetGridLineNames(const nsTArray<nsString>& aLineNames); 1.196 + mozilla::dom::CSSValue* GetGridTrackSize(const nsStyleCoord& aMinSize, 1.197 + const nsStyleCoord& aMaxSize); 1.198 + mozilla::dom::CSSValue* GetGridTemplateColumnsRows(const nsStyleGridTemplate& aTrackList); 1.199 + mozilla::dom::CSSValue* GetGridLine(const nsStyleGridLine& aGridLine); 1.200 + 1.201 + bool GetLineHeightCoord(nscoord& aCoord); 1.202 + 1.203 + mozilla::dom::CSSValue* GetCSSShadowArray(nsCSSShadowArray* aArray, 1.204 + const nscolor& aDefaultColor, 1.205 + bool aIsBoxShadow); 1.206 + 1.207 + mozilla::dom::CSSValue* GetBackgroundList(uint8_t nsStyleBackground::Layer::* aMember, 1.208 + uint32_t nsStyleBackground::* aCount, 1.209 + const KTableValue aTable[]); 1.210 + 1.211 + void GetCSSGradientString(const nsStyleGradient* aGradient, 1.212 + nsAString& aString); 1.213 + void GetImageRectString(nsIURI* aURI, 1.214 + const nsStyleSides& aCropRect, 1.215 + nsString& aString); 1.216 + void AppendTimingFunction(nsDOMCSSValueList *aValueList, 1.217 + const nsTimingFunction& aTimingFunction); 1.218 + 1.219 + /* Properties queryable as CSSValues. 1.220 + * To avoid a name conflict with nsIDOM*CSS2Properties, these are all 1.221 + * DoGetXXX instead of GetXXX. 1.222 + */ 1.223 + 1.224 + mozilla::dom::CSSValue* DoGetAppearance(); 1.225 + 1.226 + /* Box properties */ 1.227 + mozilla::dom::CSSValue* DoGetBoxAlign(); 1.228 + mozilla::dom::CSSValue* DoGetBoxDirection(); 1.229 + mozilla::dom::CSSValue* DoGetBoxFlex(); 1.230 + mozilla::dom::CSSValue* DoGetBoxOrdinalGroup(); 1.231 + mozilla::dom::CSSValue* DoGetBoxOrient(); 1.232 + mozilla::dom::CSSValue* DoGetBoxPack(); 1.233 + mozilla::dom::CSSValue* DoGetBoxSizing(); 1.234 + 1.235 + mozilla::dom::CSSValue* DoGetWidth(); 1.236 + mozilla::dom::CSSValue* DoGetHeight(); 1.237 + mozilla::dom::CSSValue* DoGetMaxHeight(); 1.238 + mozilla::dom::CSSValue* DoGetMaxWidth(); 1.239 + mozilla::dom::CSSValue* DoGetMinHeight(); 1.240 + mozilla::dom::CSSValue* DoGetMinWidth(); 1.241 + mozilla::dom::CSSValue* DoGetMixBlendMode(); 1.242 + mozilla::dom::CSSValue* DoGetLeft(); 1.243 + mozilla::dom::CSSValue* DoGetTop(); 1.244 + mozilla::dom::CSSValue* DoGetRight(); 1.245 + mozilla::dom::CSSValue* DoGetBottom(); 1.246 + mozilla::dom::CSSValue* DoGetStackSizing(); 1.247 + 1.248 + /* Font properties */ 1.249 + mozilla::dom::CSSValue* DoGetColor(); 1.250 + mozilla::dom::CSSValue* DoGetFontFamily(); 1.251 + mozilla::dom::CSSValue* DoGetFontFeatureSettings(); 1.252 + mozilla::dom::CSSValue* DoGetFontKerning(); 1.253 + mozilla::dom::CSSValue* DoGetFontLanguageOverride(); 1.254 + mozilla::dom::CSSValue* DoGetFontSize(); 1.255 + mozilla::dom::CSSValue* DoGetFontSizeAdjust(); 1.256 + mozilla::dom::CSSValue* DoGetOSXFontSmoothing(); 1.257 + mozilla::dom::CSSValue* DoGetFontStretch(); 1.258 + mozilla::dom::CSSValue* DoGetFontStyle(); 1.259 + mozilla::dom::CSSValue* DoGetFontSynthesis(); 1.260 + mozilla::dom::CSSValue* DoGetFontVariant(); 1.261 + mozilla::dom::CSSValue* DoGetFontVariantAlternates(); 1.262 + mozilla::dom::CSSValue* DoGetFontVariantCaps(); 1.263 + mozilla::dom::CSSValue* DoGetFontVariantEastAsian(); 1.264 + mozilla::dom::CSSValue* DoGetFontVariantLigatures(); 1.265 + mozilla::dom::CSSValue* DoGetFontVariantNumeric(); 1.266 + mozilla::dom::CSSValue* DoGetFontVariantPosition(); 1.267 + mozilla::dom::CSSValue* DoGetFontWeight(); 1.268 + 1.269 + /* Grid properties */ 1.270 + mozilla::dom::CSSValue* DoGetGridAutoFlow(); 1.271 + mozilla::dom::CSSValue* DoGetGridAutoColumns(); 1.272 + mozilla::dom::CSSValue* DoGetGridAutoRows(); 1.273 + mozilla::dom::CSSValue* DoGetGridAutoPosition(); 1.274 + mozilla::dom::CSSValue* DoGetGridTemplateAreas(); 1.275 + mozilla::dom::CSSValue* DoGetGridTemplateColumns(); 1.276 + mozilla::dom::CSSValue* DoGetGridTemplateRows(); 1.277 + mozilla::dom::CSSValue* DoGetGridColumnStart(); 1.278 + mozilla::dom::CSSValue* DoGetGridColumnEnd(); 1.279 + mozilla::dom::CSSValue* DoGetGridRowStart(); 1.280 + mozilla::dom::CSSValue* DoGetGridRowEnd(); 1.281 + 1.282 + /* Background properties */ 1.283 + mozilla::dom::CSSValue* DoGetBackgroundAttachment(); 1.284 + mozilla::dom::CSSValue* DoGetBackgroundColor(); 1.285 + mozilla::dom::CSSValue* DoGetBackgroundImage(); 1.286 + mozilla::dom::CSSValue* DoGetBackgroundPosition(); 1.287 + mozilla::dom::CSSValue* DoGetBackgroundRepeat(); 1.288 + mozilla::dom::CSSValue* DoGetBackgroundClip(); 1.289 + mozilla::dom::CSSValue* DoGetBackgroundInlinePolicy(); 1.290 + mozilla::dom::CSSValue* DoGetBackgroundBlendMode(); 1.291 + mozilla::dom::CSSValue* DoGetBackgroundOrigin(); 1.292 + mozilla::dom::CSSValue* DoGetBackgroundSize(); 1.293 + 1.294 + /* Padding properties */ 1.295 + mozilla::dom::CSSValue* DoGetPaddingTop(); 1.296 + mozilla::dom::CSSValue* DoGetPaddingBottom(); 1.297 + mozilla::dom::CSSValue* DoGetPaddingLeft(); 1.298 + mozilla::dom::CSSValue* DoGetPaddingRight(); 1.299 + 1.300 + /* Table Properties */ 1.301 + mozilla::dom::CSSValue* DoGetBorderCollapse(); 1.302 + mozilla::dom::CSSValue* DoGetBorderSpacing(); 1.303 + mozilla::dom::CSSValue* DoGetCaptionSide(); 1.304 + mozilla::dom::CSSValue* DoGetEmptyCells(); 1.305 + mozilla::dom::CSSValue* DoGetTableLayout(); 1.306 + mozilla::dom::CSSValue* DoGetVerticalAlign(); 1.307 + 1.308 + /* Border Properties */ 1.309 + mozilla::dom::CSSValue* DoGetBorderTopStyle(); 1.310 + mozilla::dom::CSSValue* DoGetBorderBottomStyle(); 1.311 + mozilla::dom::CSSValue* DoGetBorderLeftStyle(); 1.312 + mozilla::dom::CSSValue* DoGetBorderRightStyle(); 1.313 + mozilla::dom::CSSValue* DoGetBorderTopWidth(); 1.314 + mozilla::dom::CSSValue* DoGetBorderBottomWidth(); 1.315 + mozilla::dom::CSSValue* DoGetBorderLeftWidth(); 1.316 + mozilla::dom::CSSValue* DoGetBorderRightWidth(); 1.317 + mozilla::dom::CSSValue* DoGetBorderTopColor(); 1.318 + mozilla::dom::CSSValue* DoGetBorderBottomColor(); 1.319 + mozilla::dom::CSSValue* DoGetBorderLeftColor(); 1.320 + mozilla::dom::CSSValue* DoGetBorderRightColor(); 1.321 + mozilla::dom::CSSValue* DoGetBorderBottomColors(); 1.322 + mozilla::dom::CSSValue* DoGetBorderLeftColors(); 1.323 + mozilla::dom::CSSValue* DoGetBorderRightColors(); 1.324 + mozilla::dom::CSSValue* DoGetBorderTopColors(); 1.325 + mozilla::dom::CSSValue* DoGetBorderBottomLeftRadius(); 1.326 + mozilla::dom::CSSValue* DoGetBorderBottomRightRadius(); 1.327 + mozilla::dom::CSSValue* DoGetBorderTopLeftRadius(); 1.328 + mozilla::dom::CSSValue* DoGetBorderTopRightRadius(); 1.329 + mozilla::dom::CSSValue* DoGetFloatEdge(); 1.330 + 1.331 + /* Border Image */ 1.332 + mozilla::dom::CSSValue* DoGetBorderImageSource(); 1.333 + mozilla::dom::CSSValue* DoGetBorderImageSlice(); 1.334 + mozilla::dom::CSSValue* DoGetBorderImageWidth(); 1.335 + mozilla::dom::CSSValue* DoGetBorderImageOutset(); 1.336 + mozilla::dom::CSSValue* DoGetBorderImageRepeat(); 1.337 + 1.338 + /* Box Shadow */ 1.339 + mozilla::dom::CSSValue* DoGetBoxShadow(); 1.340 + 1.341 + /* Window Shadow */ 1.342 + mozilla::dom::CSSValue* DoGetWindowShadow(); 1.343 + 1.344 + /* Margin Properties */ 1.345 + mozilla::dom::CSSValue* DoGetMarginTopWidth(); 1.346 + mozilla::dom::CSSValue* DoGetMarginBottomWidth(); 1.347 + mozilla::dom::CSSValue* DoGetMarginLeftWidth(); 1.348 + mozilla::dom::CSSValue* DoGetMarginRightWidth(); 1.349 + 1.350 + /* Outline Properties */ 1.351 + mozilla::dom::CSSValue* DoGetOutlineWidth(); 1.352 + mozilla::dom::CSSValue* DoGetOutlineStyle(); 1.353 + mozilla::dom::CSSValue* DoGetOutlineColor(); 1.354 + mozilla::dom::CSSValue* DoGetOutlineOffset(); 1.355 + mozilla::dom::CSSValue* DoGetOutlineRadiusBottomLeft(); 1.356 + mozilla::dom::CSSValue* DoGetOutlineRadiusBottomRight(); 1.357 + mozilla::dom::CSSValue* DoGetOutlineRadiusTopLeft(); 1.358 + mozilla::dom::CSSValue* DoGetOutlineRadiusTopRight(); 1.359 + 1.360 + /* Content Properties */ 1.361 + mozilla::dom::CSSValue* DoGetContent(); 1.362 + mozilla::dom::CSSValue* DoGetCounterIncrement(); 1.363 + mozilla::dom::CSSValue* DoGetCounterReset(); 1.364 + mozilla::dom::CSSValue* DoGetMarkerOffset(); 1.365 + 1.366 + /* Quotes Properties */ 1.367 + mozilla::dom::CSSValue* DoGetQuotes(); 1.368 + 1.369 + /* z-index */ 1.370 + mozilla::dom::CSSValue* DoGetZIndex(); 1.371 + 1.372 + /* List properties */ 1.373 + mozilla::dom::CSSValue* DoGetListStyleImage(); 1.374 + mozilla::dom::CSSValue* DoGetListStylePosition(); 1.375 + mozilla::dom::CSSValue* DoGetListStyleType(); 1.376 + mozilla::dom::CSSValue* DoGetImageRegion(); 1.377 + 1.378 + /* Text Properties */ 1.379 + mozilla::dom::CSSValue* DoGetLineHeight(); 1.380 + mozilla::dom::CSSValue* DoGetTextAlign(); 1.381 + mozilla::dom::CSSValue* DoGetTextAlignLast(); 1.382 + mozilla::dom::CSSValue* DoGetTextCombineUpright(); 1.383 + mozilla::dom::CSSValue* DoGetTextDecoration(); 1.384 + mozilla::dom::CSSValue* DoGetTextDecorationColor(); 1.385 + mozilla::dom::CSSValue* DoGetTextDecorationLine(); 1.386 + mozilla::dom::CSSValue* DoGetTextDecorationStyle(); 1.387 + mozilla::dom::CSSValue* DoGetTextIndent(); 1.388 + mozilla::dom::CSSValue* DoGetTextOrientation(); 1.389 + mozilla::dom::CSSValue* DoGetTextOverflow(); 1.390 + mozilla::dom::CSSValue* DoGetTextTransform(); 1.391 + mozilla::dom::CSSValue* DoGetTextShadow(); 1.392 + mozilla::dom::CSSValue* DoGetLetterSpacing(); 1.393 + mozilla::dom::CSSValue* DoGetWordSpacing(); 1.394 + mozilla::dom::CSSValue* DoGetWhiteSpace(); 1.395 + mozilla::dom::CSSValue* DoGetWordBreak(); 1.396 + mozilla::dom::CSSValue* DoGetWordWrap(); 1.397 + mozilla::dom::CSSValue* DoGetHyphens(); 1.398 + mozilla::dom::CSSValue* DoGetTabSize(); 1.399 + mozilla::dom::CSSValue* DoGetTextSizeAdjust(); 1.400 + 1.401 + /* Visibility properties */ 1.402 + mozilla::dom::CSSValue* DoGetOpacity(); 1.403 + mozilla::dom::CSSValue* DoGetPointerEvents(); 1.404 + mozilla::dom::CSSValue* DoGetVisibility(); 1.405 + mozilla::dom::CSSValue* DoGetWritingMode(); 1.406 + 1.407 + /* Direction properties */ 1.408 + mozilla::dom::CSSValue* DoGetDirection(); 1.409 + mozilla::dom::CSSValue* DoGetUnicodeBidi(); 1.410 + 1.411 + /* Display properties */ 1.412 + mozilla::dom::CSSValue* DoGetBinding(); 1.413 + mozilla::dom::CSSValue* DoGetClear(); 1.414 + mozilla::dom::CSSValue* DoGetFloat(); 1.415 + mozilla::dom::CSSValue* DoGetDisplay(); 1.416 + mozilla::dom::CSSValue* DoGetPosition(); 1.417 + mozilla::dom::CSSValue* DoGetClip(); 1.418 + mozilla::dom::CSSValue* DoGetImageOrientation(); 1.419 + mozilla::dom::CSSValue* DoGetWillChange(); 1.420 + mozilla::dom::CSSValue* DoGetOverflow(); 1.421 + mozilla::dom::CSSValue* DoGetOverflowX(); 1.422 + mozilla::dom::CSSValue* DoGetOverflowY(); 1.423 + mozilla::dom::CSSValue* DoGetOverflowClipBox(); 1.424 + mozilla::dom::CSSValue* DoGetResize(); 1.425 + mozilla::dom::CSSValue* DoGetPageBreakAfter(); 1.426 + mozilla::dom::CSSValue* DoGetPageBreakBefore(); 1.427 + mozilla::dom::CSSValue* DoGetPageBreakInside(); 1.428 + mozilla::dom::CSSValue* DoGetTouchAction(); 1.429 + mozilla::dom::CSSValue* DoGetTransform(); 1.430 + mozilla::dom::CSSValue* DoGetTransformOrigin(); 1.431 + mozilla::dom::CSSValue* DoGetPerspective(); 1.432 + mozilla::dom::CSSValue* DoGetBackfaceVisibility(); 1.433 + mozilla::dom::CSSValue* DoGetPerspectiveOrigin(); 1.434 + mozilla::dom::CSSValue* DoGetTransformStyle(); 1.435 + mozilla::dom::CSSValue* DoGetOrient(); 1.436 + 1.437 + /* User interface properties */ 1.438 + mozilla::dom::CSSValue* DoGetCursor(); 1.439 + mozilla::dom::CSSValue* DoGetForceBrokenImageIcon(); 1.440 + mozilla::dom::CSSValue* DoGetIMEMode(); 1.441 + mozilla::dom::CSSValue* DoGetUserFocus(); 1.442 + mozilla::dom::CSSValue* DoGetUserInput(); 1.443 + mozilla::dom::CSSValue* DoGetUserModify(); 1.444 + mozilla::dom::CSSValue* DoGetUserSelect(); 1.445 + 1.446 + /* Column properties */ 1.447 + mozilla::dom::CSSValue* DoGetColumnCount(); 1.448 + mozilla::dom::CSSValue* DoGetColumnFill(); 1.449 + mozilla::dom::CSSValue* DoGetColumnWidth(); 1.450 + mozilla::dom::CSSValue* DoGetColumnGap(); 1.451 + mozilla::dom::CSSValue* DoGetColumnRuleWidth(); 1.452 + mozilla::dom::CSSValue* DoGetColumnRuleStyle(); 1.453 + mozilla::dom::CSSValue* DoGetColumnRuleColor(); 1.454 + 1.455 + /* CSS Transitions */ 1.456 + mozilla::dom::CSSValue* DoGetTransitionProperty(); 1.457 + mozilla::dom::CSSValue* DoGetTransitionDuration(); 1.458 + mozilla::dom::CSSValue* DoGetTransitionDelay(); 1.459 + mozilla::dom::CSSValue* DoGetTransitionTimingFunction(); 1.460 + 1.461 + /* CSS Animations */ 1.462 + mozilla::dom::CSSValue* DoGetAnimationName(); 1.463 + mozilla::dom::CSSValue* DoGetAnimationDuration(); 1.464 + mozilla::dom::CSSValue* DoGetAnimationDelay(); 1.465 + mozilla::dom::CSSValue* DoGetAnimationTimingFunction(); 1.466 + mozilla::dom::CSSValue* DoGetAnimationDirection(); 1.467 + mozilla::dom::CSSValue* DoGetAnimationFillMode(); 1.468 + mozilla::dom::CSSValue* DoGetAnimationIterationCount(); 1.469 + mozilla::dom::CSSValue* DoGetAnimationPlayState(); 1.470 + 1.471 + /* CSS Flexbox properties */ 1.472 + mozilla::dom::CSSValue* DoGetAlignContent(); 1.473 + mozilla::dom::CSSValue* DoGetAlignItems(); 1.474 + mozilla::dom::CSSValue* DoGetAlignSelf(); 1.475 + mozilla::dom::CSSValue* DoGetFlexBasis(); 1.476 + mozilla::dom::CSSValue* DoGetFlexDirection(); 1.477 + mozilla::dom::CSSValue* DoGetFlexGrow(); 1.478 + mozilla::dom::CSSValue* DoGetFlexShrink(); 1.479 + mozilla::dom::CSSValue* DoGetFlexWrap(); 1.480 + mozilla::dom::CSSValue* DoGetOrder(); 1.481 + mozilla::dom::CSSValue* DoGetJustifyContent(); 1.482 + 1.483 + /* SVG properties */ 1.484 + mozilla::dom::CSSValue* DoGetFill(); 1.485 + mozilla::dom::CSSValue* DoGetStroke(); 1.486 + mozilla::dom::CSSValue* DoGetMarkerEnd(); 1.487 + mozilla::dom::CSSValue* DoGetMarkerMid(); 1.488 + mozilla::dom::CSSValue* DoGetMarkerStart(); 1.489 + mozilla::dom::CSSValue* DoGetStrokeDasharray(); 1.490 + 1.491 + mozilla::dom::CSSValue* DoGetStrokeDashoffset(); 1.492 + mozilla::dom::CSSValue* DoGetStrokeWidth(); 1.493 + mozilla::dom::CSSValue* DoGetVectorEffect(); 1.494 + 1.495 + mozilla::dom::CSSValue* DoGetFillOpacity(); 1.496 + mozilla::dom::CSSValue* DoGetFloodOpacity(); 1.497 + mozilla::dom::CSSValue* DoGetStopOpacity(); 1.498 + mozilla::dom::CSSValue* DoGetStrokeMiterlimit(); 1.499 + mozilla::dom::CSSValue* DoGetStrokeOpacity(); 1.500 + 1.501 + mozilla::dom::CSSValue* DoGetClipRule(); 1.502 + mozilla::dom::CSSValue* DoGetFillRule(); 1.503 + mozilla::dom::CSSValue* DoGetStrokeLinecap(); 1.504 + mozilla::dom::CSSValue* DoGetStrokeLinejoin(); 1.505 + mozilla::dom::CSSValue* DoGetTextAnchor(); 1.506 + 1.507 + mozilla::dom::CSSValue* DoGetColorInterpolation(); 1.508 + mozilla::dom::CSSValue* DoGetColorInterpolationFilters(); 1.509 + mozilla::dom::CSSValue* DoGetDominantBaseline(); 1.510 + mozilla::dom::CSSValue* DoGetImageRendering(); 1.511 + mozilla::dom::CSSValue* DoGetShapeRendering(); 1.512 + mozilla::dom::CSSValue* DoGetTextRendering(); 1.513 + 1.514 + mozilla::dom::CSSValue* DoGetFloodColor(); 1.515 + mozilla::dom::CSSValue* DoGetLightingColor(); 1.516 + mozilla::dom::CSSValue* DoGetStopColor(); 1.517 + 1.518 + mozilla::dom::CSSValue* DoGetClipPath(); 1.519 + mozilla::dom::CSSValue* DoGetFilter(); 1.520 + mozilla::dom::CSSValue* DoGetMask(); 1.521 + mozilla::dom::CSSValue* DoGetMaskType(); 1.522 + mozilla::dom::CSSValue* DoGetPaintOrder(); 1.523 + 1.524 + /* Custom properties */ 1.525 + mozilla::dom::CSSValue* DoGetCustomProperty(const nsAString& aPropertyName); 1.526 + 1.527 + nsDOMCSSValueList* GetROCSSValueList(bool aCommaDelimited); 1.528 + void SetToRGBAColor(nsROCSSPrimitiveValue* aValue, nscolor aColor); 1.529 + void SetValueToStyleImage(const nsStyleImage& aStyleImage, 1.530 + nsROCSSPrimitiveValue* aValue); 1.531 + 1.532 + /** 1.533 + * A method to get a percentage base for a percentage value. Returns true 1.534 + * if a percentage base value was determined, false otherwise. 1.535 + */ 1.536 + typedef bool (nsComputedDOMStyle::*PercentageBaseGetter)(nscoord&); 1.537 + 1.538 + /** 1.539 + * Method to set aValue to aCoord. If aCoord is a percentage value and 1.540 + * aPercentageBaseGetter is not null, aPercentageBaseGetter is called. If it 1.541 + * returns true, the percentage base it outputs in its out param is used 1.542 + * to compute an nscoord value. If the getter is null or returns false, 1.543 + * the percent value of aCoord is set as a percent value on aValue. aTable, 1.544 + * if not null, is the keyword table to handle eStyleUnit_Enumerated. When 1.545 + * calling SetAppUnits on aValue (for coord or percent values), the value 1.546 + * passed in will be clamped to be no less than aMinAppUnits and no more than 1.547 + * aMaxAppUnits. 1.548 + * 1.549 + * XXXbz should caller pass in some sort of bitfield indicating which units 1.550 + * can be expected or something? 1.551 + */ 1.552 + void SetValueToCoord(nsROCSSPrimitiveValue* aValue, 1.553 + const nsStyleCoord& aCoord, 1.554 + bool aClampNegativeCalc, 1.555 + PercentageBaseGetter aPercentageBaseGetter = nullptr, 1.556 + const KTableValue aTable[] = nullptr, 1.557 + nscoord aMinAppUnits = nscoord_MIN, 1.558 + nscoord aMaxAppUnits = nscoord_MAX); 1.559 + 1.560 + /** 1.561 + * If aCoord is a eStyleUnit_Coord returns the nscoord. If it's 1.562 + * eStyleUnit_Percent, attempts to resolve the percentage base and returns 1.563 + * the resulting nscoord. If it's some other unit or a percentge base can't 1.564 + * be determined, returns aDefaultValue. 1.565 + */ 1.566 + nscoord StyleCoordToNSCoord(const nsStyleCoord& aCoord, 1.567 + PercentageBaseGetter aPercentageBaseGetter, 1.568 + nscoord aDefaultValue, 1.569 + bool aClampNegativeCalc); 1.570 + 1.571 + bool GetCBContentWidth(nscoord& aWidth); 1.572 + bool GetCBContentHeight(nscoord& aWidth); 1.573 + bool GetScrollFrameContentWidth(nscoord& aWidth); 1.574 + bool GetScrollFrameContentHeight(nscoord& aHeight); 1.575 + bool GetFrameBoundsWidthForTransform(nscoord &aWidth); 1.576 + bool GetFrameBoundsHeightForTransform(nscoord &aHeight); 1.577 + bool GetFrameBorderRectWidth(nscoord& aWidth); 1.578 + bool GetFrameBorderRectHeight(nscoord& aHeight); 1.579 + 1.580 + /* Helper functions for computing the filter property style. */ 1.581 + void SetCssTextToCoord(nsAString& aCssText, const nsStyleCoord& aCoord); 1.582 + mozilla::dom::CSSValue* CreatePrimitiveValueForStyleFilter( 1.583 + const nsStyleFilter& aStyleFilter); 1.584 + 1.585 + static nsComputedStyleMap* GetComputedStyleMap(); 1.586 + 1.587 + // We don't really have a good immutable representation of "presentation". 1.588 + // Given the way GetComputedStyle is currently used, we should just grab the 1.589 + // 0th presshell, if any, from the document. 1.590 + nsWeakPtr mDocumentWeak; 1.591 + nsCOMPtr<nsIContent> mContent; 1.592 + 1.593 + /* 1.594 + * Strong reference to the style context while we're accessing the data from 1.595 + * it. This can be either a style context we resolved ourselves or a style 1.596 + * context we got from our frame. 1.597 + */ 1.598 + nsRefPtr<nsStyleContext> mStyleContextHolder; 1.599 + nsCOMPtr<nsIAtom> mPseudo; 1.600 + 1.601 + /* 1.602 + * While computing style data, the primary frame for mContent --- named "outer" 1.603 + * because we should use it to compute positioning data. Null 1.604 + * otherwise. 1.605 + */ 1.606 + nsIFrame* mOuterFrame; 1.607 + /* 1.608 + * While computing style data, the "inner frame" for mContent --- the frame 1.609 + * which we should use to compute margin, border, padding and content data. Null 1.610 + * otherwise. 1.611 + */ 1.612 + nsIFrame* mInnerFrame; 1.613 + /* 1.614 + * While computing style data, the presshell we're working with. Null 1.615 + * otherwise. 1.616 + */ 1.617 + nsIPresShell* mPresShell; 1.618 + 1.619 + /* 1.620 + * The kind of styles we should be returning. 1.621 + */ 1.622 + StyleType mStyleType; 1.623 + 1.624 + bool mExposeVisitedStyle; 1.625 + 1.626 +#ifdef DEBUG 1.627 + bool mFlushedPendingReflows; 1.628 +#endif 1.629 +}; 1.630 + 1.631 +already_AddRefed<nsComputedDOMStyle> 1.632 +NS_NewComputedDOMStyle(mozilla::dom::Element* aElement, 1.633 + const nsAString& aPseudoElt, 1.634 + nsIPresShell* aPresShell, 1.635 + nsComputedDOMStyle::StyleType aStyleType = 1.636 + nsComputedDOMStyle::eAll); 1.637 + 1.638 +#endif /* nsComputedDOMStyle_h__ */ 1.639 +