2002-03-22 23:18:42 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2005-02-01 18:28:15 +03:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Christopher A. Aillon <christopher@aillon.com>
|
2002-03-22 23:18:42 +03:00
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2002
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Christopher A. Aillon <christopher@aillon.com>
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
2006-03-25 08:47:31 +03:00
|
|
|
/* DOM object returned from element.getComputedStyle() */
|
|
|
|
|
2002-03-22 23:18:42 +03:00
|
|
|
#ifndef nsComputedDOMStyle_h__
|
|
|
|
#define nsComputedDOMStyle_h__
|
|
|
|
|
2009-07-13 15:14:57 +04:00
|
|
|
#include "nsICSSDeclaration.h"
|
2002-03-22 23:18:42 +03:00
|
|
|
|
|
|
|
#include "nsROCSSPrimitiveValue.h"
|
2002-10-03 23:41:42 +04:00
|
|
|
#include "nsDOMCSSDeclaration.h"
|
2002-03-22 23:18:42 +03:00
|
|
|
#include "nsDOMCSSRGBColor.h"
|
2002-07-08 11:11:59 +04:00
|
|
|
#include "nsDOMCSSValueList.h"
|
2002-10-08 05:53:31 +04:00
|
|
|
#include "nsCSSProps.h"
|
2002-03-22 23:18:42 +03:00
|
|
|
|
|
|
|
#include "nsIPresShell.h"
|
|
|
|
#include "nsIContent.h"
|
|
|
|
#include "nsIFrame.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsWeakReference.h"
|
2003-02-22 03:32:13 +03:00
|
|
|
#include "nsAutoPtr.h"
|
2009-02-20 08:29:21 +03:00
|
|
|
#include "nsStyleStruct.h"
|
2002-03-22 23:18:42 +03:00
|
|
|
|
2009-07-13 15:14:57 +04:00
|
|
|
class nsComputedDOMStyle : public nsICSSDeclaration,
|
|
|
|
public nsWrapperCache
|
2002-03-22 23:18:42 +03:00
|
|
|
{
|
|
|
|
public:
|
2008-11-27 20:44:26 +03:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2009-07-13 15:14:57 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsComputedDOMStyle)
|
2002-03-22 23:18:42 +03:00
|
|
|
|
|
|
|
NS_IMETHOD Init(nsIDOMElement *aElement,
|
2002-03-24 04:08:17 +03:00
|
|
|
const nsAString& aPseudoElt,
|
2002-03-22 23:18:42 +03:00
|
|
|
nsIPresShell *aPresShell);
|
|
|
|
|
2004-06-08 05:32:29 +04:00
|
|
|
NS_DECL_NSICSSDECLARATION
|
|
|
|
|
2002-03-22 23:18:42 +03:00
|
|
|
NS_DECL_NSIDOMCSSSTYLEDECLARATION
|
|
|
|
|
|
|
|
nsComputedDOMStyle();
|
|
|
|
virtual ~nsComputedDOMStyle();
|
|
|
|
|
2002-07-08 11:11:59 +04:00
|
|
|
static void Shutdown();
|
|
|
|
|
2009-07-13 15:14:57 +04:00
|
|
|
virtual nsISupports *GetParentObject()
|
|
|
|
{
|
|
|
|
return mContent;
|
|
|
|
}
|
|
|
|
|
2002-03-22 23:18:42 +03:00
|
|
|
private:
|
2009-02-25 03:14:45 +03:00
|
|
|
void AssertFlushedPendingReflows() {
|
|
|
|
NS_ASSERTION(mFlushedPendingReflows,
|
|
|
|
"property getter should have been marked layout-dependent");
|
|
|
|
}
|
2002-10-16 07:38:52 +04:00
|
|
|
|
2006-12-19 07:16:09 +03:00
|
|
|
#define STYLE_STRUCT(name_, checkdata_cb_, ctor_args_) \
|
2006-12-22 09:10:32 +03:00
|
|
|
const nsStyle##name_ * GetStyle##name_() { \
|
2007-05-05 09:30:10 +04:00
|
|
|
return mStyleContextHolder->GetStyle##name_(); \
|
2006-12-19 07:16:09 +03:00
|
|
|
}
|
|
|
|
#include "nsStyleStructList.h"
|
|
|
|
#undef STYLE_STRUCT
|
|
|
|
|
2008-10-01 09:50:52 +04:00
|
|
|
nsresult GetEllipseRadii(const nsStyleCorners& aRadius,
|
|
|
|
PRUint8 aFullCorner,
|
|
|
|
nsIDOMCSSValue** aValue);
|
|
|
|
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetOffsetWidthFor(PRUint8 aSide, nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetAbsoluteOffset(PRUint8 aSide, nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetRelativeOffset(PRUint8 aSide, nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetStaticOffset(PRUint8 aSide, nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetPaddingWidthFor(PRUint8 aSide, nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetBorderColorsFor(PRUint8 aSide, nsIDOMCSSValue** aValue);
|
2002-07-08 11:11:59 +04:00
|
|
|
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetBorderStyleFor(PRUint8 aSide, nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetBorderWidthFor(PRUint8 aSide, nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetBorderColorFor(PRUint8 aSide, nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetMarginWidthFor(PRUint8 aSide, nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
2007-02-20 21:43:16 +03:00
|
|
|
PRBool GetLineHeightCoord(nscoord& aCoord);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
2008-07-08 04:56:52 +04:00
|
|
|
nsresult GetCSSShadowArray(nsCSSShadowArray* aArray,
|
|
|
|
const nscolor& aDefaultColor,
|
2009-02-10 11:45:13 +03:00
|
|
|
PRBool aIsBoxShadow,
|
2008-07-08 04:56:52 +04:00
|
|
|
nsIDOMCSSValue** aValue);
|
|
|
|
|
2009-02-20 08:29:21 +03:00
|
|
|
nsresult GetBackgroundList(PRUint8 nsStyleBackground::Layer::* aMember,
|
|
|
|
PRUint32 nsStyleBackground::* aCount,
|
|
|
|
const PRInt32 aTable[],
|
|
|
|
nsIDOMCSSValue** aResult);
|
|
|
|
|
2009-08-01 19:53:40 +04:00
|
|
|
nsresult GetCSSGradientString(const nsStyleGradient* aGradient,
|
|
|
|
nsAString& aString);
|
|
|
|
|
2002-03-22 23:18:42 +03:00
|
|
|
/* Properties Queryable as CSSValues */
|
2002-04-20 18:30:57 +04:00
|
|
|
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetAppearance(nsIDOMCSSValue** aValue);
|
2002-04-20 18:30:57 +04:00
|
|
|
|
|
|
|
/* Box properties */
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetBoxAlign(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBoxDirection(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBoxFlex(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBoxOrdinalGroup(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBoxOrient(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBoxPack(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBoxSizing(nsIDOMCSSValue** aValue);
|
|
|
|
|
|
|
|
nsresult GetWidth(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetHeight(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetMaxHeight(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetMaxWidth(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetMinHeight(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetMinWidth(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetLeft(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetTop(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetRight(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBottom(nsIDOMCSSValue** aValue);
|
2008-06-05 10:46:24 +04:00
|
|
|
nsresult GetStackSizing(nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
|
|
|
/* Font properties */
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetColor(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetFontFamily(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetFontSize(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetFontSizeAdjust(nsIDOMCSSValue** aValue);
|
2009-01-29 23:39:18 +03:00
|
|
|
nsresult GetFontStretch(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetFontStyle(nsIDOMCSSValue** aValue);
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetFontWeight(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetFontVariant(nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
|
|
|
/* Background properties */
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetBackgroundAttachment(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBackgroundColor(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBackgroundImage(nsIDOMCSSValue** aValue);
|
2007-07-22 21:58:37 +04:00
|
|
|
nsresult GetBackgroundPosition(nsIDOMCSSValue** aValue);
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetBackgroundRepeat(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBackgroundClip(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBackgroundInlinePolicy(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBackgroundOrigin(nsIDOMCSSValue** aValue);
|
2009-05-28 22:09:05 +04:00
|
|
|
nsresult GetMozBackgroundSize(nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
|
|
|
/* Padding properties */
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetPadding(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetPaddingTop(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetPaddingBottom(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetPaddingLeft(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetPaddingRight(nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
|
|
|
/* Table Properties */
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetBorderCollapse(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderSpacing(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetCaptionSide(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetEmptyCells(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetTableLayout(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetVerticalAlign(nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
|
|
|
/* Border Properties */
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetBorderStyle(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderWidth(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderTopStyle(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderBottomStyle(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderLeftStyle(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderRightStyle(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderTopWidth(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderBottomWidth(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderLeftWidth(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderRightWidth(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderTopColor(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderBottomColor(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderLeftColor(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderRightColor(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderBottomColors(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderLeftColors(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderRightColors(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderTopColors(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderRadiusBottomLeft(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderRadiusBottomRight(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderRadiusTopLeft(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetBorderRadiusTopRight(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetFloatEdge(nsIDOMCSSValue** aValue);
|
2008-07-17 10:30:25 +04:00
|
|
|
nsresult GetBorderImage(nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
2008-07-08 04:56:52 +04:00
|
|
|
/* Box Shadow */
|
|
|
|
nsresult GetBoxShadow(nsIDOMCSSValue** aValue);
|
|
|
|
|
2008-10-14 18:44:25 +04:00
|
|
|
/* Window Shadow */
|
|
|
|
nsresult GetWindowShadow(nsIDOMCSSValue** aValue);
|
|
|
|
|
2002-03-22 23:18:42 +03:00
|
|
|
/* Margin Properties */
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetMarginWidth(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetMarginTopWidth(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetMarginBottomWidth(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetMarginLeftWidth(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetMarginRightWidth(nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
|
|
|
/* Outline Properties */
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetOutline(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetOutlineWidth(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetOutlineStyle(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetOutlineColor(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetOutlineOffset(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetOutlineRadiusBottomLeft(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetOutlineRadiusBottomRight(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetOutlineRadiusTopLeft(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetOutlineRadiusTopRight(nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
2005-04-02 03:07:00 +04:00
|
|
|
/* Content Properties */
|
2007-07-22 21:58:37 +04:00
|
|
|
nsresult GetContent(nsIDOMCSSValue** aValue);
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetCounterIncrement(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetCounterReset(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetMarkerOffset(nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
2007-07-22 21:58:37 +04:00
|
|
|
/* Quotes Properties */
|
|
|
|
nsresult GetQuotes(nsIDOMCSSValue** aValue);
|
|
|
|
|
2002-03-22 23:18:42 +03:00
|
|
|
/* z-index */
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetZIndex(nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
|
|
|
/* List properties */
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetListStyleImage(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetListStylePosition(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetListStyleType(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetImageRegion(nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
|
|
|
/* Text Properties */
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetLineHeight(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetTextAlign(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetTextDecoration(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetTextIndent(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetTextTransform(nsIDOMCSSValue** aValue);
|
2008-06-06 03:06:34 +04:00
|
|
|
nsresult GetTextShadow(nsIDOMCSSValue** aValue);
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetLetterSpacing(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetWordSpacing(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetWhiteSpace(nsIDOMCSSValue** aValue);
|
2008-07-24 11:16:18 +04:00
|
|
|
nsresult GetWordWrap(nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
|
|
|
/* Visibility properties */
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetOpacity(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetVisibility(nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
|
|
|
/* Direction properties */
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetDirection(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetUnicodeBidi(nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
|
|
|
/* Display properties */
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetBinding(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetClear(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetCssFloat(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetDisplay(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetPosition(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetClip(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetOverflow(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetOverflowX(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetOverflowY(nsIDOMCSSValue** aValue);
|
2007-07-22 21:58:37 +04:00
|
|
|
nsresult GetPageBreakAfter(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetPageBreakBefore(nsIDOMCSSValue** aValue);
|
2008-09-13 13:42:11 +04:00
|
|
|
nsresult GetMozTransform(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetMozTransformOrigin(nsIDOMCSSValue **aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
|
|
|
/* User interface properties */
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetCursor(nsIDOMCSSValue** aValue);
|
2007-07-22 21:58:37 +04:00
|
|
|
nsresult GetForceBrokenImageIcon(nsIDOMCSSValue** aValue);
|
2007-05-16 19:51:37 +04:00
|
|
|
nsresult GetIMEMode(nsIDOMCSSValue** aValue);
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetUserFocus(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetUserInput(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetUserModify(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetUserSelect(nsIDOMCSSValue** aValue);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
2004-06-17 15:57:37 +04:00
|
|
|
/* Column properties */
|
2006-12-22 09:10:32 +03:00
|
|
|
nsresult GetColumnCount(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetColumnWidth(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetColumnGap(nsIDOMCSSValue** aValue);
|
2008-07-19 14:38:25 +04:00
|
|
|
nsresult GetColumnRuleWidth(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetColumnRuleStyle(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetColumnRuleColor(nsIDOMCSSValue** aValue);
|
2004-06-17 15:57:37 +04:00
|
|
|
|
2007-07-21 18:20:25 +04:00
|
|
|
#ifdef MOZ_SVG
|
|
|
|
/* SVG properties */
|
|
|
|
nsresult GetSVGPaintFor(PRBool aFill, nsIDOMCSSValue** aValue);
|
|
|
|
|
|
|
|
nsresult GetFill(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetStroke(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetMarkerEnd(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetMarkerMid(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetMarkerStart(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetStrokeDasharray(nsIDOMCSSValue** aValue);
|
|
|
|
|
|
|
|
nsresult GetStrokeDashoffset(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetStrokeWidth(nsIDOMCSSValue** aValue);
|
|
|
|
|
|
|
|
nsresult GetFillOpacity(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetFloodOpacity(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetStopOpacity(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetStrokeMiterlimit(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetStrokeOpacity(nsIDOMCSSValue** aValue);
|
|
|
|
|
|
|
|
nsresult GetClipRule(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetFillRule(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetStrokeLinecap(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetStrokeLinejoin(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetTextAnchor(nsIDOMCSSValue** aValue);
|
|
|
|
|
|
|
|
nsresult GetColorInterpolation(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetColorInterpolationFilters(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetDominantBaseline(nsIDOMCSSValue** aValue);
|
2009-03-21 18:36:38 +03:00
|
|
|
nsresult GetImageRendering(nsIDOMCSSValue** aValue);
|
2007-07-21 18:20:25 +04:00
|
|
|
nsresult GetPointerEvents(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetShapeRendering(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetTextRendering(nsIDOMCSSValue** aValue);
|
|
|
|
|
|
|
|
nsresult GetFloodColor(nsIDOMCSSValue** aValue);
|
2007-07-26 10:57:42 +04:00
|
|
|
nsresult GetLightingColor(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetStopColor(nsIDOMCSSValue** aValue);
|
2007-07-21 18:20:25 +04:00
|
|
|
|
|
|
|
nsresult GetClipPath(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetFilter(nsIDOMCSSValue** aValue);
|
|
|
|
nsresult GetMask(nsIDOMCSSValue** aValue);
|
|
|
|
#endif // MOZ_SVG
|
|
|
|
|
2002-03-22 23:18:42 +03:00
|
|
|
nsROCSSPrimitiveValue* GetROCSSPrimitiveValue();
|
2002-07-08 11:11:59 +04:00
|
|
|
nsDOMCSSValueList* GetROCSSValueList(PRBool aCommaDelimited);
|
2007-01-25 05:03:02 +03:00
|
|
|
nsresult SetToRGBAColor(nsROCSSPrimitiveValue* aValue, nscolor aColor);
|
2007-02-20 21:43:16 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A method to get a percentage base for a percentage value. Returns PR_TRUE
|
|
|
|
* if a percentage base value was determined, PR_FALSE otherwise.
|
|
|
|
*/
|
|
|
|
typedef PRBool (nsComputedDOMStyle::*PercentageBaseGetter)(nscoord&);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Method to set aValue to aCoord. If aCoord is a percentage value and
|
|
|
|
* aPercentageBaseGetter is not null, aPercentageBaseGetter is called. If it
|
|
|
|
* returns PR_TRUE, the percentage base it outputs in its out param is used
|
|
|
|
* to compute an nscoord value. If the getter is null or returns PR_FALSE,
|
|
|
|
* 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
|
2007-04-23 11:04:33 +04:00
|
|
|
* passed in will be PR_MAX of the value in aMinAppUnits and the PR_MIN of
|
|
|
|
* the actual value in aCoord and the value in aMaxAppUnits.
|
2007-02-20 21:43:16 +03:00
|
|
|
*
|
|
|
|
* XXXbz should caller pass in some sort of bitfield indicating which units
|
|
|
|
* can be expected or something?
|
|
|
|
*/
|
2007-04-23 11:04:33 +04:00
|
|
|
void SetValueToCoord(nsROCSSPrimitiveValue* aValue,
|
|
|
|
const nsStyleCoord& aCoord,
|
2007-02-20 21:43:16 +03:00
|
|
|
PercentageBaseGetter aPercentageBaseGetter = nsnull,
|
|
|
|
const PRInt32 aTable[] = nsnull,
|
2007-04-23 11:04:33 +04:00
|
|
|
nscoord aMinAppUnits = nscoord_MIN,
|
|
|
|
nscoord aMaxAppUnits = nscoord_MAX);
|
2007-02-20 21:43:16 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If aCoord is a eStyleUnit_Coord returns the nscoord. If it's
|
2007-04-23 11:04:33 +04: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 21:43:16 +03:00
|
|
|
*/
|
2007-04-23 11:04:33 +04:00
|
|
|
nscoord StyleCoordToNSCoord(const nsStyleCoord& aCoord,
|
|
|
|
PercentageBaseGetter aPercentageBaseGetter,
|
|
|
|
nscoord aDefaultValue);
|
2007-02-20 21:43:16 +03:00
|
|
|
|
|
|
|
PRBool GetCBContentWidth(nscoord& aWidth);
|
|
|
|
PRBool GetCBContentHeight(nscoord& aWidth);
|
2008-09-13 13:42:11 +04:00
|
|
|
PRBool GetFrameBoundsWidthForTransform(nscoord &aWidth);
|
|
|
|
PRBool GetFrameBoundsHeightForTransform(nscoord &aHeight);
|
2007-02-20 21:43:16 +03:00
|
|
|
PRBool GetFrameBorderRectWidth(nscoord& aWidth);
|
2002-03-22 23:18:42 +03:00
|
|
|
|
2002-10-08 05:53:31 +04:00
|
|
|
struct ComputedStyleMapEntry
|
|
|
|
{
|
|
|
|
// Create a pointer-to-member-function type.
|
2006-12-22 09:10:32 +03:00
|
|
|
typedef nsresult (nsComputedDOMStyle::*ComputeMethod)(nsIDOMCSSValue**);
|
2002-10-08 05:53:31 +04:00
|
|
|
|
2002-10-08 07:03:56 +04:00
|
|
|
nsCSSProperty mProperty;
|
|
|
|
ComputeMethod mGetter;
|
2009-02-25 03:14:45 +03:00
|
|
|
PRBool mNeedsLayoutFlush;
|
2002-10-08 05:53:31 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
static const ComputedStyleMapEntry* GetQueryablePropertyMap(PRUint32* aLength);
|
|
|
|
|
2003-07-12 00:44:25 +04:00
|
|
|
CSS2PropertiesTearoff mInner;
|
2002-10-03 23:41:42 +04:00
|
|
|
|
2005-06-03 05:51:15 +04: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 23:18:42 +03:00
|
|
|
nsCOMPtr<nsIContent> mContent;
|
|
|
|
|
|
|
|
/*
|
2007-05-05 09:30:10 +04: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 23:18:42 +03:00
|
|
|
*/
|
2003-02-22 03:32:13 +03:00
|
|
|
nsRefPtr<nsStyleContext> mStyleContextHolder;
|
2002-03-22 23:18:42 +03:00
|
|
|
nsCOMPtr<nsIAtom> mPseudo;
|
|
|
|
|
2006-12-22 09:10:32 +03:00
|
|
|
/*
|
2008-01-30 00:53:09 +03:00
|
|
|
* While computing style data, the primary frame for mContent --- named "outer"
|
|
|
|
* because we should use it to compute positioning data. Null
|
2007-05-05 09:30:10 +04:00
|
|
|
* otherwise.
|
|
|
|
*/
|
2008-01-30 00:53:09 +03: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 09:30:10 +04:00
|
|
|
/*
|
|
|
|
* While computing style data, the presshell we're working with. Null
|
|
|
|
* otherwise.
|
|
|
|
*/
|
|
|
|
nsIPresShell* mPresShell;
|
2006-12-22 09:10:32 +03:00
|
|
|
|
2007-02-07 10:46:44 +03:00
|
|
|
PRInt32 mAppUnitsPerInch; /* For unit conversions */
|
2009-02-25 03:14:45 +03:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
PRBool mFlushedPendingReflows;
|
|
|
|
#endif
|
2002-03-22 23:18:42 +03:00
|
|
|
};
|
|
|
|
|
2009-07-13 15:14:57 +04:00
|
|
|
nsresult
|
|
|
|
NS_NewComputedDOMStyle(nsIDOMElement *aElement, const nsAString &aPseudoElt,
|
|
|
|
nsIPresShell *aPresShell,
|
|
|
|
nsComputedDOMStyle **aComputedStyle);
|
|
|
|
|
2002-03-22 23:18:42 +03:00
|
|
|
#endif /* nsComputedDOMStyle_h__ */
|
|
|
|
|