2002-03-22 20:18:42 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2006-03-25 05:47:31 +00:00
|
|
|
/* DOM object returned from element.getComputedStyle() */
|
|
|
|
|
2002-03-22 20:18:42 +00:00
|
|
|
#ifndef nsComputedDOMStyle_h__
|
|
|
|
#define nsComputedDOMStyle_h__
|
|
|
|
|
2010-07-14 20:58:56 +00:00
|
|
|
#include "nsDOMCSSDeclaration.h"
|
2002-03-22 20:18:42 +00:00
|
|
|
|
|
|
|
#include "nsROCSSPrimitiveValue.h"
|
|
|
|
#include "nsDOMCSSRGBColor.h"
|
2002-07-08 07:11:59 +00:00
|
|
|
#include "nsDOMCSSValueList.h"
|
2002-10-08 01:53:31 +00:00
|
|
|
#include "nsCSSProps.h"
|
2002-03-22 20:18:42 +00:00
|
|
|
|
|
|
|
#include "nsIContent.h"
|
|
|
|
#include "nsIFrame.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsWeakReference.h"
|
2003-02-22 00:32:13 +00:00
|
|
|
#include "nsAutoPtr.h"
|
2009-02-20 05:29:21 +00:00
|
|
|
#include "nsStyleStruct.h"
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2010-04-10 20:09:38 +00:00
|
|
|
class nsIPresShell;
|
|
|
|
|
2010-07-14 20:58:56 +00:00
|
|
|
class nsComputedDOMStyle : public nsDOMCSSDeclaration,
|
2009-07-13 11:14:57 +00:00
|
|
|
public nsWrapperCache
|
2002-03-22 20:18:42 +00:00
|
|
|
{
|
|
|
|
public:
|
2008-11-27 17:44:26 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2012-02-15 23:29:53 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_CLASS_AMBIGUOUS(nsComputedDOMStyle,
|
|
|
|
nsICSSDeclaration)
|
2002-03-22 20:18:42 +00:00
|
|
|
|
|
|
|
NS_IMETHOD Init(nsIDOMElement *aElement,
|
2002-03-24 01:08:17 +00:00
|
|
|
const nsAString& aPseudoElt,
|
2002-03-22 20:18:42 +00:00
|
|
|
nsIPresShell *aPresShell);
|
|
|
|
|
2004-06-08 01:32:29 +00:00
|
|
|
NS_DECL_NSICSSDECLARATION
|
|
|
|
|
2002-03-22 20:18:42 +00:00
|
|
|
NS_DECL_NSIDOMCSSSTYLEDECLARATION
|
|
|
|
|
|
|
|
nsComputedDOMStyle();
|
|
|
|
virtual ~nsComputedDOMStyle();
|
|
|
|
|
2002-07-08 07:11:59 +00:00
|
|
|
static void Shutdown();
|
|
|
|
|
2009-10-05 23:16:22 +00:00
|
|
|
virtual nsINode *GetParentObject()
|
2009-07-13 11:14:57 +00:00
|
|
|
{
|
|
|
|
return mContent;
|
|
|
|
}
|
|
|
|
|
2009-08-10 22:52:29 +00:00
|
|
|
static already_AddRefed<nsStyleContext>
|
2010-04-30 13:12:06 +00:00
|
|
|
GetStyleContextForElement(mozilla::dom::Element* aElement, nsIAtom* aPseudo,
|
2009-08-10 22:52:29 +00:00
|
|
|
nsIPresShell* aPresShell);
|
|
|
|
|
2009-08-20 21:52:47 +00:00
|
|
|
static already_AddRefed<nsStyleContext>
|
2010-04-30 13:12:06 +00:00
|
|
|
GetStyleContextForElementNoFlush(mozilla::dom::Element* aElement,
|
|
|
|
nsIAtom* aPseudo,
|
2009-08-20 21:52:47 +00:00
|
|
|
nsIPresShell* aPresShell);
|
|
|
|
|
|
|
|
static nsIPresShell*
|
|
|
|
GetPresShellForContent(nsIContent* aContent);
|
|
|
|
|
2010-04-03 01:58:25 +00:00
|
|
|
// Helper for nsDOMWindowUtils::GetVisitedDependentComputedStyle
|
2011-09-29 06:19:26 +00:00
|
|
|
void SetExposeVisitedStyle(bool aExpose) {
|
2010-04-03 01:58:25 +00:00
|
|
|
NS_ASSERTION(aExpose != mExposeVisitedStyle, "should always be changing");
|
|
|
|
mExposeVisitedStyle = aExpose;
|
|
|
|
}
|
|
|
|
|
2010-07-14 20:58:56 +00:00
|
|
|
// nsDOMCSSDeclaration abstract methods which should never be called
|
|
|
|
// on a nsComputedDOMStyle object, but must be defined to avoid
|
|
|
|
// compile errors.
|
2011-09-29 06:19:26 +00:00
|
|
|
virtual mozilla::css::Declaration* GetCSSDeclaration(bool);
|
2010-07-23 18:00:47 +00:00
|
|
|
virtual nsresult SetCSSDeclaration(mozilla::css::Declaration*);
|
2010-07-14 20:58:56 +00:00
|
|
|
virtual nsIDocument* DocToUpdate();
|
2011-04-27 20:53:49 +00:00
|
|
|
virtual void GetCSSParsingEnvironment(CSSParsingEnvironment& aCSSParseEnv);
|
2010-07-14 20:58:56 +00:00
|
|
|
|
2002-03-22 20:18:42 +00:00
|
|
|
private:
|
2009-02-25 00:14:45 +00:00
|
|
|
void AssertFlushedPendingReflows() {
|
|
|
|
NS_ASSERTION(mFlushedPendingReflows,
|
|
|
|
"property getter should have been marked layout-dependent");
|
|
|
|
}
|
2010-04-27 16:15:01 +00:00
|
|
|
|
2006-12-19 04:16:09 +00:00
|
|
|
#define STYLE_STRUCT(name_, checkdata_cb_, ctor_args_) \
|
2006-12-22 06:10:32 +00:00
|
|
|
const nsStyle##name_ * GetStyle##name_() { \
|
2007-05-05 05:30:10 +00:00
|
|
|
return mStyleContextHolder->GetStyle##name_(); \
|
2006-12-19 04:16:09 +00:00
|
|
|
}
|
|
|
|
#include "nsStyleStructList.h"
|
|
|
|
#undef STYLE_STRUCT
|
|
|
|
|
2011-03-04 17:28:57 +00:00
|
|
|
// All of the property getters below return a pointer to a refcounted object
|
|
|
|
// that has just been created, but the refcount is still 0. Caller must take
|
|
|
|
// ownership.
|
2008-10-01 05:50:52 +00:00
|
|
|
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* GetEllipseRadii(const nsStyleCorners& aRadius,
|
|
|
|
PRUint8 aFullCorner,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aIsBorder); // else outline
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* GetOffsetWidthFor(mozilla::css::Side aSide);
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* GetAbsoluteOffset(mozilla::css::Side aSide);
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* GetRelativeOffset(mozilla::css::Side aSide);
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* GetStaticOffset(mozilla::css::Side aSide);
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* GetPaddingWidthFor(mozilla::css::Side aSide);
|
2002-07-08 07:11:59 +00:00
|
|
|
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* GetBorderColorsFor(mozilla::css::Side aSide);
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* GetBorderStyleFor(mozilla::css::Side aSide);
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* GetBorderWidthFor(mozilla::css::Side aSide);
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* GetBorderColorFor(mozilla::css::Side aSide);
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* GetMarginWidthFor(mozilla::css::Side aSide);
|
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
nsIDOMCSSValue* GetSVGPaintFor(bool aFill);
|
2010-07-14 20:58:55 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool GetLineHeightCoord(nscoord& aCoord);
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* GetCSSShadowArray(nsCSSShadowArray* aArray,
|
|
|
|
const nscolor& aDefaultColor,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aIsBoxShadow);
|
2008-07-08 00:56:52 +00:00
|
|
|
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* GetBackgroundList(PRUint8 nsStyleBackground::Layer::* aMember,
|
|
|
|
PRUint32 nsStyleBackground::* aCount,
|
|
|
|
const PRInt32 aTable[]);
|
2009-02-20 05:29:21 +00:00
|
|
|
|
2011-03-04 17:28:57 +00:00
|
|
|
void GetCSSGradientString(const nsStyleGradient* aGradient,
|
|
|
|
nsAString& aString);
|
|
|
|
void GetImageRectString(nsIURI* aURI,
|
|
|
|
const nsStyleSides& aCropRect,
|
|
|
|
nsString& aString);
|
2011-04-12 06:18:42 +00:00
|
|
|
void AppendTimingFunction(nsDOMCSSValueList *aValueList,
|
|
|
|
const nsTimingFunction& aTimingFunction);
|
2009-08-01 15:53:40 +00:00
|
|
|
|
2010-07-14 20:58:55 +00:00
|
|
|
/* Properties queryable as CSSValues.
|
|
|
|
* To avoid a name conflict with nsIDOM*CSS2Properties, these are all
|
|
|
|
* DoGetXXX instead of GetXXX.
|
|
|
|
*/
|
2002-04-20 14:30:57 +00:00
|
|
|
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetAppearance();
|
2002-04-20 14:30:57 +00:00
|
|
|
|
|
|
|
/* Box properties */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetBoxAlign();
|
|
|
|
nsIDOMCSSValue* DoGetBoxDirection();
|
|
|
|
nsIDOMCSSValue* DoGetBoxFlex();
|
|
|
|
nsIDOMCSSValue* DoGetBoxOrdinalGroup();
|
|
|
|
nsIDOMCSSValue* DoGetBoxOrient();
|
|
|
|
nsIDOMCSSValue* DoGetBoxPack();
|
|
|
|
nsIDOMCSSValue* DoGetBoxSizing();
|
|
|
|
|
|
|
|
nsIDOMCSSValue* DoGetWidth();
|
|
|
|
nsIDOMCSSValue* DoGetHeight();
|
|
|
|
nsIDOMCSSValue* DoGetMaxHeight();
|
|
|
|
nsIDOMCSSValue* DoGetMaxWidth();
|
|
|
|
nsIDOMCSSValue* DoGetMinHeight();
|
|
|
|
nsIDOMCSSValue* DoGetMinWidth();
|
|
|
|
nsIDOMCSSValue* DoGetLeft();
|
|
|
|
nsIDOMCSSValue* DoGetTop();
|
|
|
|
nsIDOMCSSValue* DoGetRight();
|
|
|
|
nsIDOMCSSValue* DoGetBottom();
|
|
|
|
nsIDOMCSSValue* DoGetStackSizing();
|
2002-03-22 20:18:42 +00:00
|
|
|
|
|
|
|
/* Font properties */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetColor();
|
|
|
|
nsIDOMCSSValue* DoGetFontFamily();
|
2012-05-18 12:51:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetFontFeatureSettings();
|
|
|
|
nsIDOMCSSValue* DoGetFontLanguageOverride();
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetFontSize();
|
|
|
|
nsIDOMCSSValue* DoGetFontSizeAdjust();
|
|
|
|
nsIDOMCSSValue* DoGetFontStretch();
|
|
|
|
nsIDOMCSSValue* DoGetFontStyle();
|
|
|
|
nsIDOMCSSValue* DoGetFontWeight();
|
|
|
|
nsIDOMCSSValue* DoGetFontVariant();
|
2002-03-22 20:18:42 +00:00
|
|
|
|
|
|
|
/* Background properties */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetBackgroundAttachment();
|
|
|
|
nsIDOMCSSValue* DoGetBackgroundColor();
|
|
|
|
nsIDOMCSSValue* DoGetBackgroundImage();
|
|
|
|
nsIDOMCSSValue* DoGetBackgroundPosition();
|
|
|
|
nsIDOMCSSValue* DoGetBackgroundRepeat();
|
|
|
|
nsIDOMCSSValue* DoGetBackgroundClip();
|
|
|
|
nsIDOMCSSValue* DoGetBackgroundInlinePolicy();
|
|
|
|
nsIDOMCSSValue* DoGetBackgroundOrigin();
|
2012-05-18 12:51:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetBackgroundSize();
|
2002-03-22 20:18:42 +00:00
|
|
|
|
|
|
|
/* Padding properties */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetPaddingTop();
|
|
|
|
nsIDOMCSSValue* DoGetPaddingBottom();
|
|
|
|
nsIDOMCSSValue* DoGetPaddingLeft();
|
|
|
|
nsIDOMCSSValue* DoGetPaddingRight();
|
2002-03-22 20:18:42 +00:00
|
|
|
|
|
|
|
/* Table Properties */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetBorderCollapse();
|
|
|
|
nsIDOMCSSValue* DoGetBorderSpacing();
|
|
|
|
nsIDOMCSSValue* DoGetCaptionSide();
|
|
|
|
nsIDOMCSSValue* DoGetEmptyCells();
|
|
|
|
nsIDOMCSSValue* DoGetTableLayout();
|
|
|
|
nsIDOMCSSValue* DoGetVerticalAlign();
|
2002-03-22 20:18:42 +00:00
|
|
|
|
|
|
|
/* Border Properties */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetBorderTopStyle();
|
|
|
|
nsIDOMCSSValue* DoGetBorderBottomStyle();
|
|
|
|
nsIDOMCSSValue* DoGetBorderLeftStyle();
|
|
|
|
nsIDOMCSSValue* DoGetBorderRightStyle();
|
|
|
|
nsIDOMCSSValue* DoGetBorderTopWidth();
|
|
|
|
nsIDOMCSSValue* DoGetBorderBottomWidth();
|
|
|
|
nsIDOMCSSValue* DoGetBorderLeftWidth();
|
|
|
|
nsIDOMCSSValue* DoGetBorderRightWidth();
|
|
|
|
nsIDOMCSSValue* DoGetBorderTopColor();
|
|
|
|
nsIDOMCSSValue* DoGetBorderBottomColor();
|
|
|
|
nsIDOMCSSValue* DoGetBorderLeftColor();
|
|
|
|
nsIDOMCSSValue* DoGetBorderRightColor();
|
|
|
|
nsIDOMCSSValue* DoGetBorderBottomColors();
|
|
|
|
nsIDOMCSSValue* DoGetBorderLeftColors();
|
|
|
|
nsIDOMCSSValue* DoGetBorderRightColors();
|
|
|
|
nsIDOMCSSValue* DoGetBorderTopColors();
|
|
|
|
nsIDOMCSSValue* DoGetBorderBottomLeftRadius();
|
|
|
|
nsIDOMCSSValue* DoGetBorderBottomRightRadius();
|
|
|
|
nsIDOMCSSValue* DoGetBorderTopLeftRadius();
|
|
|
|
nsIDOMCSSValue* DoGetBorderTopRightRadius();
|
|
|
|
nsIDOMCSSValue* DoGetFloatEdge();
|
2011-12-22 23:34:45 +00:00
|
|
|
|
|
|
|
/* Border Image */
|
|
|
|
nsIDOMCSSValue* DoGetBorderImageSource();
|
|
|
|
nsIDOMCSSValue* DoGetBorderImageSlice();
|
|
|
|
nsIDOMCSSValue* DoGetBorderImageWidth();
|
|
|
|
nsIDOMCSSValue* DoGetBorderImageOutset();
|
|
|
|
nsIDOMCSSValue* DoGetBorderImageRepeat();
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2008-07-08 00:56:52 +00:00
|
|
|
/* Box Shadow */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetBoxShadow();
|
2008-07-08 00:56:52 +00:00
|
|
|
|
2008-10-14 14:44:25 +00:00
|
|
|
/* Window Shadow */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetWindowShadow();
|
2008-10-14 14:44:25 +00:00
|
|
|
|
2002-03-22 20:18:42 +00:00
|
|
|
/* Margin Properties */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetMarginTopWidth();
|
|
|
|
nsIDOMCSSValue* DoGetMarginBottomWidth();
|
|
|
|
nsIDOMCSSValue* DoGetMarginLeftWidth();
|
|
|
|
nsIDOMCSSValue* DoGetMarginRightWidth();
|
2002-03-22 20:18:42 +00:00
|
|
|
|
|
|
|
/* Outline Properties */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetOutlineWidth();
|
|
|
|
nsIDOMCSSValue* DoGetOutlineStyle();
|
|
|
|
nsIDOMCSSValue* DoGetOutlineColor();
|
|
|
|
nsIDOMCSSValue* DoGetOutlineOffset();
|
|
|
|
nsIDOMCSSValue* DoGetOutlineRadiusBottomLeft();
|
|
|
|
nsIDOMCSSValue* DoGetOutlineRadiusBottomRight();
|
|
|
|
nsIDOMCSSValue* DoGetOutlineRadiusTopLeft();
|
|
|
|
nsIDOMCSSValue* DoGetOutlineRadiusTopRight();
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2005-04-01 23:07:00 +00:00
|
|
|
/* Content Properties */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetContent();
|
|
|
|
nsIDOMCSSValue* DoGetCounterIncrement();
|
|
|
|
nsIDOMCSSValue* DoGetCounterReset();
|
|
|
|
nsIDOMCSSValue* DoGetMarkerOffset();
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2007-07-22 17:58:37 +00:00
|
|
|
/* Quotes Properties */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetQuotes();
|
2007-07-22 17:58:37 +00:00
|
|
|
|
2002-03-22 20:18:42 +00:00
|
|
|
/* z-index */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetZIndex();
|
2002-03-22 20:18:42 +00:00
|
|
|
|
|
|
|
/* List properties */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetListStyleImage();
|
|
|
|
nsIDOMCSSValue* DoGetListStylePosition();
|
|
|
|
nsIDOMCSSValue* DoGetListStyleType();
|
|
|
|
nsIDOMCSSValue* DoGetImageRegion();
|
2002-03-22 20:18:42 +00:00
|
|
|
|
|
|
|
/* Text Properties */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetLineHeight();
|
|
|
|
nsIDOMCSSValue* DoGetTextAlign();
|
2012-01-12 17:52:21 +00:00
|
|
|
nsIDOMCSSValue* DoGetTextAlignLast();
|
2011-04-23 05:16:41 +00:00
|
|
|
nsIDOMCSSValue* DoGetMozTextBlink();
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetTextDecoration();
|
2012-05-18 12:51:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetTextDecorationColor();
|
|
|
|
nsIDOMCSSValue* DoGetTextDecorationLine();
|
|
|
|
nsIDOMCSSValue* DoGetTextDecorationStyle();
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetTextIndent();
|
2011-06-22 18:11:47 +00:00
|
|
|
nsIDOMCSSValue* DoGetTextOverflow();
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetTextTransform();
|
|
|
|
nsIDOMCSSValue* DoGetTextShadow();
|
|
|
|
nsIDOMCSSValue* DoGetLetterSpacing();
|
|
|
|
nsIDOMCSSValue* DoGetWordSpacing();
|
|
|
|
nsIDOMCSSValue* DoGetWhiteSpace();
|
2012-05-07 19:18:23 +00:00
|
|
|
nsIDOMCSSValue* DoGetWordBreak();
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetWordWrap();
|
2011-05-04 11:14:50 +00:00
|
|
|
nsIDOMCSSValue* DoGetHyphens();
|
2012-05-18 12:51:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetTabSize();
|
2011-11-24 02:48:23 +00:00
|
|
|
nsIDOMCSSValue* DoGetTextSizeAdjust();
|
2002-03-22 20:18:42 +00:00
|
|
|
|
|
|
|
/* Visibility properties */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetOpacity();
|
|
|
|
nsIDOMCSSValue* DoGetPointerEvents();
|
|
|
|
nsIDOMCSSValue* DoGetVisibility();
|
2002-03-22 20:18:42 +00:00
|
|
|
|
|
|
|
/* Direction properties */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetDirection();
|
|
|
|
nsIDOMCSSValue* DoGetUnicodeBidi();
|
2002-03-22 20:18:42 +00:00
|
|
|
|
|
|
|
/* Display properties */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetBinding();
|
|
|
|
nsIDOMCSSValue* DoGetClear();
|
|
|
|
nsIDOMCSSValue* DoGetCssFloat();
|
|
|
|
nsIDOMCSSValue* DoGetDisplay();
|
|
|
|
nsIDOMCSSValue* DoGetPosition();
|
|
|
|
nsIDOMCSSValue* DoGetClip();
|
|
|
|
nsIDOMCSSValue* DoGetOverflow();
|
|
|
|
nsIDOMCSSValue* DoGetOverflowX();
|
|
|
|
nsIDOMCSSValue* DoGetOverflowY();
|
|
|
|
nsIDOMCSSValue* DoGetResize();
|
|
|
|
nsIDOMCSSValue* DoGetPageBreakAfter();
|
|
|
|
nsIDOMCSSValue* DoGetPageBreakBefore();
|
2012-05-05 09:00:04 +00:00
|
|
|
nsIDOMCSSValue* DoGetTransform();
|
|
|
|
nsIDOMCSSValue* DoGetTransformOrigin();
|
|
|
|
nsIDOMCSSValue* DoGetPerspective();
|
|
|
|
nsIDOMCSSValue* DoGetBackfaceVisibility();
|
|
|
|
nsIDOMCSSValue* DoGetPerspectiveOrigin();
|
|
|
|
nsIDOMCSSValue* DoGetTransformStyle();
|
2011-05-10 13:47:46 +00:00
|
|
|
nsIDOMCSSValue* DoGetOrient();
|
2002-03-22 20:18:42 +00:00
|
|
|
|
|
|
|
/* User interface properties */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetCursor();
|
|
|
|
nsIDOMCSSValue* DoGetForceBrokenImageIcon();
|
|
|
|
nsIDOMCSSValue* DoGetIMEMode();
|
|
|
|
nsIDOMCSSValue* DoGetUserFocus();
|
|
|
|
nsIDOMCSSValue* DoGetUserInput();
|
|
|
|
nsIDOMCSSValue* DoGetUserModify();
|
|
|
|
nsIDOMCSSValue* DoGetUserSelect();
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2004-06-17 11:57:37 +00:00
|
|
|
/* Column properties */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetColumnCount();
|
2011-12-26 05:25:59 +00:00
|
|
|
nsIDOMCSSValue* DoGetColumnFill();
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetColumnWidth();
|
|
|
|
nsIDOMCSSValue* DoGetColumnGap();
|
|
|
|
nsIDOMCSSValue* DoGetColumnRuleWidth();
|
|
|
|
nsIDOMCSSValue* DoGetColumnRuleStyle();
|
|
|
|
nsIDOMCSSValue* DoGetColumnRuleColor();
|
2004-06-17 11:57:37 +00:00
|
|
|
|
2009-08-20 21:52:47 +00:00
|
|
|
/* CSS Transitions */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetTransitionProperty();
|
|
|
|
nsIDOMCSSValue* DoGetTransitionDuration();
|
|
|
|
nsIDOMCSSValue* DoGetTransitionDelay();
|
|
|
|
nsIDOMCSSValue* DoGetTransitionTimingFunction();
|
2009-08-20 21:52:47 +00:00
|
|
|
|
2011-04-12 06:18:42 +00:00
|
|
|
/* CSS Animations */
|
|
|
|
nsIDOMCSSValue* DoGetAnimationName();
|
|
|
|
nsIDOMCSSValue* DoGetAnimationDuration();
|
|
|
|
nsIDOMCSSValue* DoGetAnimationDelay();
|
|
|
|
nsIDOMCSSValue* DoGetAnimationTimingFunction();
|
|
|
|
nsIDOMCSSValue* DoGetAnimationDirection();
|
|
|
|
nsIDOMCSSValue* DoGetAnimationFillMode();
|
|
|
|
nsIDOMCSSValue* DoGetAnimationIterationCount();
|
|
|
|
nsIDOMCSSValue* DoGetAnimationPlayState();
|
|
|
|
|
2007-07-21 14:20:25 +00:00
|
|
|
/* SVG properties */
|
2011-03-04 17:28:57 +00:00
|
|
|
nsIDOMCSSValue* DoGetFill();
|
|
|
|
nsIDOMCSSValue* DoGetStroke();
|
|
|
|
nsIDOMCSSValue* DoGetMarkerEnd();
|
|
|
|
nsIDOMCSSValue* DoGetMarkerMid();
|
|
|
|
nsIDOMCSSValue* DoGetMarkerStart();
|
|
|
|
nsIDOMCSSValue* DoGetStrokeDasharray();
|
|
|
|
|
|
|
|
nsIDOMCSSValue* DoGetStrokeDashoffset();
|
|
|
|
nsIDOMCSSValue* DoGetStrokeWidth();
|
2012-05-18 08:33:40 +00:00
|
|
|
nsIDOMCSSValue* DoGetVectorEffect();
|
2011-03-04 17:28:57 +00:00
|
|
|
|
|
|
|
nsIDOMCSSValue* DoGetFillOpacity();
|
|
|
|
nsIDOMCSSValue* DoGetFloodOpacity();
|
|
|
|
nsIDOMCSSValue* DoGetStopOpacity();
|
|
|
|
nsIDOMCSSValue* DoGetStrokeMiterlimit();
|
|
|
|
nsIDOMCSSValue* DoGetStrokeOpacity();
|
|
|
|
|
|
|
|
nsIDOMCSSValue* DoGetClipRule();
|
|
|
|
nsIDOMCSSValue* DoGetFillRule();
|
|
|
|
nsIDOMCSSValue* DoGetStrokeLinecap();
|
|
|
|
nsIDOMCSSValue* DoGetStrokeLinejoin();
|
|
|
|
nsIDOMCSSValue* DoGetTextAnchor();
|
|
|
|
|
|
|
|
nsIDOMCSSValue* DoGetColorInterpolation();
|
|
|
|
nsIDOMCSSValue* DoGetColorInterpolationFilters();
|
|
|
|
nsIDOMCSSValue* DoGetDominantBaseline();
|
|
|
|
nsIDOMCSSValue* DoGetImageRendering();
|
|
|
|
nsIDOMCSSValue* DoGetShapeRendering();
|
|
|
|
nsIDOMCSSValue* DoGetTextRendering();
|
|
|
|
|
|
|
|
nsIDOMCSSValue* DoGetFloodColor();
|
|
|
|
nsIDOMCSSValue* DoGetLightingColor();
|
|
|
|
nsIDOMCSSValue* DoGetStopColor();
|
|
|
|
|
|
|
|
nsIDOMCSSValue* DoGetClipPath();
|
|
|
|
nsIDOMCSSValue* DoGetFilter();
|
|
|
|
nsIDOMCSSValue* DoGetMask();
|
2007-07-21 14:20:25 +00:00
|
|
|
|
2002-03-22 20:18:42 +00:00
|
|
|
nsROCSSPrimitiveValue* GetROCSSPrimitiveValue();
|
2011-09-29 06:19:26 +00:00
|
|
|
nsDOMCSSValueList* GetROCSSValueList(bool aCommaDelimited);
|
2011-03-04 17:28:57 +00:00
|
|
|
void SetToRGBAColor(nsROCSSPrimitiveValue* aValue, nscolor aColor);
|
2011-03-04 17:28:57 +00:00
|
|
|
void SetValueToStyleImage(const nsStyleImage& aStyleImage,
|
|
|
|
nsROCSSPrimitiveValue* aValue);
|
2010-04-27 16:15:01 +00:00
|
|
|
|
2007-02-20 18:43:16 +00:00
|
|
|
/**
|
2011-10-17 14:59:28 +00:00
|
|
|
* A method to get a percentage base for a percentage value. Returns true
|
|
|
|
* if a percentage base value was determined, false otherwise.
|
2007-02-20 18:43:16 +00:00
|
|
|
*/
|
2011-09-29 06:19:26 +00:00
|
|
|
typedef bool (nsComputedDOMStyle::*PercentageBaseGetter)(nscoord&);
|
2007-02-20 18:43:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Method to set aValue to aCoord. If aCoord is a percentage value and
|
|
|
|
* aPercentageBaseGetter is not null, aPercentageBaseGetter is called. If it
|
2011-10-17 14:59:28 +00:00
|
|
|
* returns true, the percentage base it outputs in its out param is used
|
|
|
|
* to compute an nscoord value. If the getter is null or returns false,
|
2007-02-20 18:43:16 +00:00
|
|
|
* the percent value of aCoord is set as a percent value on aValue. aTable,
|
|
|
|
* if not null, is the keyword table to handle eStyleUnit_Enumerated. When
|
|
|
|
* calling SetAppUnits on aValue (for coord or percent values), the value
|
2011-10-28 18:33:28 +00:00
|
|
|
* passed in will be clamped to be no less than aMinAppUnits and no more than
|
|
|
|
* aMaxAppUnits.
|
2007-02-20 18:43:16 +00:00
|
|
|
*
|
|
|
|
* XXXbz should caller pass in some sort of bitfield indicating which units
|
|
|
|
* can be expected or something?
|
|
|
|
*/
|
2007-04-23 07:04:33 +00:00
|
|
|
void SetValueToCoord(nsROCSSPrimitiveValue* aValue,
|
|
|
|
const nsStyleCoord& aCoord,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aClampNegativeCalc,
|
2007-02-20 18:43:16 +00:00
|
|
|
PercentageBaseGetter aPercentageBaseGetter = nsnull,
|
|
|
|
const PRInt32 aTable[] = nsnull,
|
2007-04-23 07:04:33 +00:00
|
|
|
nscoord aMinAppUnits = nscoord_MIN,
|
|
|
|
nscoord aMaxAppUnits = nscoord_MAX);
|
2007-02-20 18:43:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If aCoord is a eStyleUnit_Coord returns the nscoord. If it's
|
2007-04-23 07:04:33 +00:00
|
|
|
* eStyleUnit_Percent, attempts to resolve the percentage base and returns
|
|
|
|
* the resulting nscoord. If it's some other unit or a percentge base can't
|
|
|
|
* be determined, returns aDefaultValue.
|
2007-02-20 18:43:16 +00:00
|
|
|
*/
|
2007-04-23 07:04:33 +00:00
|
|
|
nscoord StyleCoordToNSCoord(const nsStyleCoord& aCoord,
|
|
|
|
PercentageBaseGetter aPercentageBaseGetter,
|
2010-09-09 15:21:46 +00:00
|
|
|
nscoord aDefaultValue,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aClampNegativeCalc);
|
2007-02-20 18:43:16 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool GetCBContentWidth(nscoord& aWidth);
|
|
|
|
bool GetCBContentHeight(nscoord& aWidth);
|
|
|
|
bool GetFrameBoundsWidthForTransform(nscoord &aWidth);
|
|
|
|
bool GetFrameBoundsHeightForTransform(nscoord &aHeight);
|
|
|
|
bool GetFrameBorderRectWidth(nscoord& aWidth);
|
|
|
|
bool GetFrameBorderRectHeight(nscoord& aHeight);
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2002-10-08 01:53:31 +00:00
|
|
|
struct ComputedStyleMapEntry
|
|
|
|
{
|
|
|
|
// Create a pointer-to-member-function type.
|
2011-03-04 17:28:57 +00:00
|
|
|
typedef nsIDOMCSSValue* (nsComputedDOMStyle::*ComputeMethod)();
|
2002-10-08 01:53:31 +00:00
|
|
|
|
2002-10-08 03:03:56 +00:00
|
|
|
nsCSSProperty mProperty;
|
|
|
|
ComputeMethod mGetter;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mNeedsLayoutFlush;
|
2002-10-08 01:53:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const ComputedStyleMapEntry* GetQueryablePropertyMap(PRUint32* aLength);
|
|
|
|
|
2005-06-03 01:51:15 +00:00
|
|
|
// We don't really have a good immutable representation of "presentation".
|
|
|
|
// Given the way GetComputedStyle is currently used, we should just grab the
|
|
|
|
// 0th presshell, if any, from the document.
|
|
|
|
nsWeakPtr mDocumentWeak;
|
2002-03-22 20:18:42 +00:00
|
|
|
nsCOMPtr<nsIContent> mContent;
|
|
|
|
|
|
|
|
/*
|
2007-05-05 05:30:10 +00:00
|
|
|
* Strong reference to the style context while we're accessing the data from
|
|
|
|
* it. This can be either a style context we resolved ourselves or a style
|
|
|
|
* context we got from our frame.
|
2002-03-22 20:18:42 +00:00
|
|
|
*/
|
2003-02-22 00:32:13 +00:00
|
|
|
nsRefPtr<nsStyleContext> mStyleContextHolder;
|
2002-03-22 20:18:42 +00:00
|
|
|
nsCOMPtr<nsIAtom> mPseudo;
|
|
|
|
|
2006-12-22 06:10:32 +00:00
|
|
|
/*
|
2008-01-29 21:53:09 +00:00
|
|
|
* While computing style data, the primary frame for mContent --- named "outer"
|
|
|
|
* because we should use it to compute positioning data. Null
|
2006-12-22 06:10:32 +00:00
|
|
|
* otherwise.
|
|
|
|
*/
|
2008-01-29 21:53:09 +00:00
|
|
|
nsIFrame* mOuterFrame;
|
|
|
|
/*
|
|
|
|
* While computing style data, the "inner frame" for mContent --- the frame
|
|
|
|
* which we should use to compute margin, border, padding and content data. Null
|
|
|
|
* otherwise.
|
|
|
|
*/
|
|
|
|
nsIFrame* mInnerFrame;
|
2007-05-05 05:30:10 +00:00
|
|
|
/*
|
|
|
|
* While computing style data, the presshell we're working with. Null
|
|
|
|
* otherwise.
|
|
|
|
*/
|
|
|
|
nsIPresShell* mPresShell;
|
2006-12-22 06:10:32 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mExposeVisitedStyle;
|
2010-04-03 01:58:25 +00:00
|
|
|
|
2009-02-25 00:14:45 +00:00
|
|
|
#ifdef DEBUG
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mFlushedPendingReflows;
|
2009-02-25 00:14:45 +00:00
|
|
|
#endif
|
2002-03-22 20:18:42 +00:00
|
|
|
};
|
|
|
|
|
2010-04-27 16:15:01 +00:00
|
|
|
nsresult
|
2009-07-13 11:14:57 +00:00
|
|
|
NS_NewComputedDOMStyle(nsIDOMElement *aElement, const nsAString &aPseudoElt,
|
|
|
|
nsIPresShell *aPresShell,
|
|
|
|
nsComputedDOMStyle **aComputedStyle);
|
|
|
|
|
2002-03-22 20:18:42 +00:00
|
|
|
#endif /* nsComputedDOMStyle_h__ */
|
|
|
|
|