2001-09-25 05:32:19 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 01:52:36 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1998-09-25 04:51:45 +04:00
|
|
|
*
|
2004-04-18 01:52:36 +04:00
|
|
|
* 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/
|
1998-09-25 04:51:45 +04:00
|
|
|
*
|
2001-09-25 05:32:19 +04:00
|
|
|
* 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.
|
1998-09-25 04:51:45 +04:00
|
|
|
*
|
|
|
|
* The Original Code is Mozilla Communicator client code.
|
|
|
|
*
|
2004-04-18 01:52:36 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-25 05:32:19 +04:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 06:40:37 +03:00
|
|
|
*
|
2001-09-25 05:32:19 +04:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-18 01:52:36 +04:00
|
|
|
* either of 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"),
|
2001-09-25 05:32:19 +04:00
|
|
|
* 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
|
2004-04-18 01:52:36 +04:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-25 05:32:19 +04:00
|
|
|
* 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
|
2004-04-18 01:52:36 +04:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-25 05:32:19 +04:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1998-09-25 04:51:45 +04:00
|
|
|
|
1998-10-06 05:39:33 +04:00
|
|
|
#include "nsDOMCSSDeclaration.h"
|
2000-04-20 17:50:56 +04:00
|
|
|
#include "nsIDOMCSSRule.h"
|
1998-09-25 04:51:45 +04:00
|
|
|
#include "nsICSSParser.h"
|
2003-06-18 05:59:57 +04:00
|
|
|
#include "nsICSSLoader.h"
|
1998-09-25 04:51:45 +04:00
|
|
|
#include "nsIStyleRule.h"
|
2002-01-16 01:43:37 +03:00
|
|
|
#include "nsCSSDeclaration.h"
|
1998-09-25 04:51:45 +04:00
|
|
|
#include "nsCSSProps.h"
|
2000-04-20 17:50:56 +04:00
|
|
|
#include "nsCOMPtr.h"
|
1999-01-15 05:07:46 +03:00
|
|
|
#include "nsIURL.h"
|
2004-01-30 01:04:45 +03:00
|
|
|
#include "nsReadableUtils.h"
|
1998-09-25 04:51:45 +04:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 20:46:42 +04:00
|
|
|
#include "nsContentUtils.h"
|
|
|
|
|
|
|
|
|
1998-10-06 05:39:33 +04:00
|
|
|
nsDOMCSSDeclaration::nsDOMCSSDeclaration()
|
2003-07-12 00:44:25 +04:00
|
|
|
: mInner(this)
|
1998-09-25 04:51:45 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
1998-10-06 05:39:33 +04:00
|
|
|
nsDOMCSSDeclaration::~nsDOMCSSDeclaration()
|
1998-09-25 04:51:45 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-12 00:44:25 +04:00
|
|
|
// QueryInterface implementation for nsDOMCSSDeclaration
|
|
|
|
NS_INTERFACE_MAP_BEGIN(nsDOMCSSDeclaration)
|
2004-06-08 05:32:29 +04:00
|
|
|
NS_INTERFACE_MAP_ENTRY(nsICSSDeclaration)
|
2003-07-12 00:44:25 +04:00
|
|
|
NS_INTERFACE_MAP_ENTRY(nsIDOMCSSStyleDeclaration)
|
|
|
|
NS_INTERFACE_MAP_ENTRY_AGGREGATED(nsIDOMCSS2Properties, &mInner)
|
|
|
|
NS_INTERFACE_MAP_ENTRY_AGGREGATED(nsIDOMNSCSS2Properties, &mInner)
|
|
|
|
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMCSSStyleDeclaration)
|
|
|
|
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(CSSStyleDeclaration)
|
|
|
|
NS_INTERFACE_MAP_END
|
1998-09-25 04:51:45 +04:00
|
|
|
|
2004-06-08 05:32:29 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMCSSDeclaration::GetPropertyValue(const nsCSSProperty aPropID,
|
|
|
|
nsAString& aValue)
|
|
|
|
{
|
|
|
|
NS_PRECONDITION(aPropID != eCSSProperty_UNKNOWN,
|
|
|
|
"Should never pass eCSSProperty_UNKNOWN around");
|
|
|
|
|
|
|
|
nsCSSDeclaration *decl;
|
|
|
|
nsresult result = GetCSSDeclaration(&decl, PR_FALSE);
|
|
|
|
|
|
|
|
aValue.Truncate();
|
|
|
|
if (decl) {
|
|
|
|
result = decl->GetValue(aPropID, aValue);
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMCSSDeclaration::SetPropertyValue(const nsCSSProperty aPropID,
|
|
|
|
const nsAString& aValue)
|
|
|
|
{
|
|
|
|
if (aValue.IsEmpty()) {
|
|
|
|
// If the new value of the property is an empty string we remove the
|
|
|
|
// property.
|
|
|
|
return RemoveProperty(aPropID);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ParsePropertyValue(aPropID, aValue);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-04-20 17:50:56 +04:00
|
|
|
NS_IMETHODIMP
|
2002-03-24 01:56:05 +03:00
|
|
|
nsDOMCSSDeclaration::GetCssText(nsAString& aCssText)
|
1998-11-26 04:34:53 +03:00
|
|
|
{
|
2002-01-16 01:43:37 +03:00
|
|
|
nsCSSDeclaration* decl;
|
2000-04-20 17:50:56 +04:00
|
|
|
aCssText.Truncate();
|
2002-01-16 01:43:37 +03:00
|
|
|
GetCSSDeclaration(&decl, PR_FALSE);
|
2001-05-15 12:25:03 +04:00
|
|
|
|
|
|
|
if (decl) {
|
|
|
|
decl->ToString(aCssText);
|
|
|
|
}
|
|
|
|
|
1998-11-26 04:34:53 +03:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2000-04-20 17:50:56 +04:00
|
|
|
NS_IMETHODIMP
|
2002-03-24 01:56:05 +03:00
|
|
|
nsDOMCSSDeclaration::SetCssText(const nsAString& aCssText)
|
1998-11-26 04:34:53 +03:00
|
|
|
{
|
2001-12-15 07:33:11 +03:00
|
|
|
return ParseDeclaration(aCssText, PR_FALSE, PR_TRUE);
|
1998-11-26 04:34:53 +03:00
|
|
|
}
|
|
|
|
|
2000-04-20 17:50:56 +04:00
|
|
|
NS_IMETHODIMP
|
1998-10-06 05:39:33 +04:00
|
|
|
nsDOMCSSDeclaration::GetLength(PRUint32* aLength)
|
1998-09-25 04:51:45 +04:00
|
|
|
{
|
2002-01-16 01:43:37 +03:00
|
|
|
nsCSSDeclaration *decl;
|
1998-10-06 05:39:33 +04:00
|
|
|
nsresult result = GetCSSDeclaration(&decl, PR_FALSE);
|
1998-09-25 04:51:45 +04:00
|
|
|
|
2003-06-18 05:59:57 +04:00
|
|
|
if (decl) {
|
2002-01-16 01:43:37 +03:00
|
|
|
*aLength = decl->Count();
|
2003-06-18 05:59:57 +04:00
|
|
|
} else {
|
|
|
|
*aLength = 0;
|
1998-09-25 04:51:45 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2000-04-20 17:50:56 +04:00
|
|
|
NS_IMETHODIMP
|
2002-03-24 01:56:05 +03:00
|
|
|
nsDOMCSSDeclaration::GetPropertyCSSValue(const nsAString& aPropertyName,
|
2000-04-20 17:50:56 +04:00
|
|
|
nsIDOMCSSValue** aReturn)
|
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aReturn);
|
|
|
|
|
|
|
|
// We don't support CSSValue yet so we'll just return null...
|
|
|
|
*aReturn = nsnull;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2002-03-24 01:56:05 +03:00
|
|
|
nsDOMCSSDeclaration::Item(PRUint32 aIndex, nsAString& aReturn)
|
1998-09-25 04:51:45 +04:00
|
|
|
{
|
2002-01-16 01:43:37 +03:00
|
|
|
nsCSSDeclaration *decl;
|
1998-10-06 05:39:33 +04:00
|
|
|
nsresult result = GetCSSDeclaration(&decl, PR_FALSE);
|
1998-09-25 04:51:45 +04:00
|
|
|
|
|
|
|
aReturn.SetLength(0);
|
2003-06-18 05:59:57 +04:00
|
|
|
if (decl) {
|
1998-09-25 04:51:45 +04:00
|
|
|
result = decl->GetNthProperty(aIndex, aReturn);
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2002-03-24 01:56:05 +03:00
|
|
|
nsDOMCSSDeclaration::GetPropertyValue(const nsAString& aPropertyName,
|
|
|
|
nsAString& aReturn)
|
1998-09-25 04:51:45 +04:00
|
|
|
{
|
2004-06-08 05:32:29 +04:00
|
|
|
const nsCSSProperty propID = nsCSSProps::LookupProperty(aPropertyName);
|
|
|
|
if (propID == eCSSProperty_UNKNOWN) {
|
|
|
|
aReturn.Truncate();
|
|
|
|
return NS_OK;
|
1998-09-25 04:51:45 +04:00
|
|
|
}
|
2004-06-08 05:32:29 +04:00
|
|
|
|
|
|
|
return GetPropertyValue(propID, aReturn);
|
1998-09-25 04:51:45 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2002-03-24 01:56:05 +03:00
|
|
|
nsDOMCSSDeclaration::GetPropertyPriority(const nsAString& aPropertyName,
|
|
|
|
nsAString& aReturn)
|
1998-09-25 04:51:45 +04:00
|
|
|
{
|
2002-01-16 01:43:37 +03:00
|
|
|
nsCSSDeclaration *decl;
|
1998-10-06 05:39:33 +04:00
|
|
|
nsresult result = GetCSSDeclaration(&decl, PR_FALSE);
|
1998-09-25 04:51:45 +04:00
|
|
|
|
2003-06-18 05:59:57 +04:00
|
|
|
aReturn.Truncate();
|
|
|
|
if (decl && decl->GetValueIsImportant(aPropertyName)) {
|
2004-06-17 04:13:25 +04:00
|
|
|
aReturn.AssignLiteral("important");
|
1998-09-25 04:51:45 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2002-03-24 01:56:05 +03:00
|
|
|
nsDOMCSSDeclaration::SetProperty(const nsAString& aPropertyName,
|
|
|
|
const nsAString& aValue,
|
|
|
|
const nsAString& aPriority)
|
1998-09-25 04:51:45 +04:00
|
|
|
{
|
2004-06-08 05:32:29 +04:00
|
|
|
// In the common (and fast) cases we can use the property id
|
|
|
|
nsCSSProperty propID = nsCSSProps::LookupProperty(aPropertyName);
|
|
|
|
if (propID == eCSSProperty_UNKNOWN) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2001-09-28 05:38:36 +04:00
|
|
|
if (aValue.IsEmpty()) {
|
2004-06-08 05:32:29 +04:00
|
|
|
// If the new value of the property is an empty string we remove the
|
|
|
|
// property.
|
|
|
|
return RemoveProperty(propID);
|
2000-05-02 02:59:54 +04:00
|
|
|
}
|
|
|
|
|
2002-08-08 21:40:20 +04:00
|
|
|
if (aPriority.IsEmpty()) {
|
2004-06-08 05:32:29 +04:00
|
|
|
return ParsePropertyValue(propID, aValue);
|
2002-08-08 21:40:20 +04:00
|
|
|
}
|
2002-10-03 23:41:42 +04:00
|
|
|
|
2002-11-06 05:07:17 +03:00
|
|
|
// ParsePropertyValue does not handle priorities correctly -- it's
|
|
|
|
// optimized for speed. And the priority is not part of the
|
|
|
|
// property value anyway.... So we have to use the full-blown
|
|
|
|
// ParseDeclaration()
|
|
|
|
return ParseDeclaration(aPropertyName + NS_LITERAL_STRING(":") +
|
|
|
|
aValue + NS_LITERAL_STRING("!") + aPriority,
|
|
|
|
PR_TRUE, PR_FALSE);
|
1998-09-25 04:51:45 +04:00
|
|
|
}
|
|
|
|
|
2003-06-18 05:59:57 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMCSSDeclaration::RemoveProperty(const nsAString& aPropertyName,
|
|
|
|
nsAString& aReturn)
|
|
|
|
{
|
2004-06-08 05:32:29 +04:00
|
|
|
const nsCSSProperty propID = nsCSSProps::LookupProperty(aPropertyName);
|
|
|
|
if (propID == eCSSProperty_UNKNOWN) {
|
|
|
|
aReturn.Truncate();
|
2004-06-07 23:30:54 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2004-06-08 05:32:29 +04:00
|
|
|
|
|
|
|
nsresult rv = GetPropertyValue(propID, aReturn);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
rv = RemoveProperty(propID);
|
2003-06-18 05:59:57 +04:00
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
2004-06-08 05:32:29 +04:00
|
|
|
nsDOMCSSDeclaration::ParsePropertyValue(const nsCSSProperty aPropID,
|
2003-06-18 05:59:57 +04:00
|
|
|
const nsAString& aPropValue)
|
|
|
|
{
|
|
|
|
nsCSSDeclaration* decl;
|
|
|
|
nsresult result = GetCSSDeclaration(&decl, PR_TRUE);
|
|
|
|
if (!decl) {
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsICSSLoader> cssLoader;
|
|
|
|
nsCOMPtr<nsICSSParser> cssParser;
|
2004-09-11 03:31:48 +04:00
|
|
|
nsCOMPtr<nsIURI> baseURI, sheetURI;
|
2003-06-18 05:59:57 +04:00
|
|
|
|
2004-09-11 03:31:48 +04:00
|
|
|
result = GetCSSParsingEnvironment(getter_AddRefs(sheetURI),
|
|
|
|
getter_AddRefs(baseURI),
|
2003-06-18 05:59:57 +04:00
|
|
|
getter_AddRefs(cssLoader),
|
|
|
|
getter_AddRefs(cssParser));
|
|
|
|
if (NS_FAILED(result)) {
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2003-07-01 01:39:22 +04:00
|
|
|
PRBool changed;
|
2004-09-11 03:31:48 +04:00
|
|
|
result = cssParser->ParseProperty(aPropID, aPropValue, sheetURI, baseURI,
|
|
|
|
decl, &changed);
|
2003-07-01 01:39:22 +04:00
|
|
|
if (NS_SUCCEEDED(result) && changed) {
|
2003-06-18 05:59:57 +04:00
|
|
|
result = DeclarationChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cssLoader) {
|
|
|
|
cssLoader->RecycleParser(cssParser);
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsDOMCSSDeclaration::ParseDeclaration(const nsAString& aDecl,
|
|
|
|
PRBool aParseOnlyOneDecl,
|
|
|
|
PRBool aClearOldDecl)
|
|
|
|
{
|
|
|
|
nsCSSDeclaration* decl;
|
|
|
|
nsresult result = GetCSSDeclaration(&decl, PR_TRUE);
|
|
|
|
if (!decl) {
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsICSSLoader> cssLoader;
|
|
|
|
nsCOMPtr<nsICSSParser> cssParser;
|
2004-09-11 03:31:48 +04:00
|
|
|
nsCOMPtr<nsIURI> baseURI, sheetURI;
|
2003-06-18 05:59:57 +04:00
|
|
|
|
2004-09-11 03:31:48 +04:00
|
|
|
result = GetCSSParsingEnvironment(getter_AddRefs(sheetURI),
|
|
|
|
getter_AddRefs(baseURI),
|
2003-06-18 05:59:57 +04:00
|
|
|
getter_AddRefs(cssLoader),
|
|
|
|
getter_AddRefs(cssParser));
|
|
|
|
|
|
|
|
if (NS_FAILED(result)) {
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2003-07-01 01:39:22 +04:00
|
|
|
PRBool changed;
|
2004-09-11 03:31:48 +04:00
|
|
|
result = cssParser->ParseAndAppendDeclaration(aDecl, sheetURI, baseURI, decl,
|
2003-06-18 05:59:57 +04:00
|
|
|
aParseOnlyOneDecl,
|
2003-07-01 01:39:22 +04:00
|
|
|
&changed,
|
2003-06-18 05:59:57 +04:00
|
|
|
aClearOldDecl);
|
|
|
|
|
2003-07-01 01:39:22 +04:00
|
|
|
if (NS_SUCCEEDED(result) && changed) {
|
2003-06-18 05:59:57 +04:00
|
|
|
result = DeclarationChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cssLoader) {
|
|
|
|
cssLoader->RecycleParser(cssParser);
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2004-06-08 05:32:29 +04:00
|
|
|
nsresult
|
|
|
|
nsDOMCSSDeclaration::RemoveProperty(const nsCSSProperty aPropID)
|
|
|
|
{
|
|
|
|
nsCSSDeclaration* decl;
|
|
|
|
nsresult rv = GetCSSDeclaration(&decl, PR_FALSE);
|
|
|
|
if (!decl) {
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
rv = decl->RemoveProperty(aPropID);
|
|
|
|
|
|
|
|
if (NS_SUCCEEDED(rv)) {
|
|
|
|
rv = DeclarationChanged();
|
|
|
|
} else {
|
|
|
|
// RemoveProperty used to throw in all sorts of situations -- e.g.
|
|
|
|
// if the property was a shorthand one. Do not propagate its return
|
|
|
|
// value to callers. (XXX or should we propagate it again now?)
|
|
|
|
rv = NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
2003-06-18 05:59:57 +04:00
|
|
|
|
2002-10-03 23:41:42 +04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2004-06-08 05:32:29 +04:00
|
|
|
CSS2PropertiesTearoff::CSS2PropertiesTearoff(nsICSSDeclaration *aOuter)
|
2003-07-12 00:44:25 +04:00
|
|
|
: mOuter(aOuter)
|
2001-09-17 04:57:46 +04:00
|
|
|
{
|
2003-07-12 00:44:25 +04:00
|
|
|
NS_ASSERTION(mOuter, "must have outer");
|
2002-10-03 23:41:42 +04:00
|
|
|
}
|
2001-09-28 05:38:36 +04:00
|
|
|
|
2002-10-03 23:41:42 +04:00
|
|
|
CSS2PropertiesTearoff::~CSS2PropertiesTearoff()
|
|
|
|
{
|
2001-09-17 04:57:46 +04:00
|
|
|
}
|
|
|
|
|
2003-07-12 00:44:25 +04:00
|
|
|
NS_IMETHODIMP_(nsrefcnt)
|
|
|
|
CSS2PropertiesTearoff::AddRef(void)
|
|
|
|
{
|
|
|
|
return mOuter->AddRef();
|
|
|
|
}
|
2002-10-03 23:41:42 +04:00
|
|
|
|
2003-07-12 00:44:25 +04:00
|
|
|
NS_IMETHODIMP_(nsrefcnt)
|
|
|
|
CSS2PropertiesTearoff::Release(void)
|
|
|
|
{
|
|
|
|
return mOuter->Release();
|
|
|
|
}
|
2002-09-26 07:46:50 +04:00
|
|
|
|
2003-07-12 00:44:25 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
CSS2PropertiesTearoff::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|
|
|
{
|
|
|
|
return mOuter->QueryInterface(aIID, aInstancePtr);
|
|
|
|
}
|
2002-09-26 07:46:50 +04:00
|
|
|
|
2002-10-03 23:41:42 +04:00
|
|
|
// nsIDOMCSS2Properties
|
|
|
|
// nsIDOMNSCSS2Properties
|
|
|
|
|
2004-11-30 22:24:34 +03:00
|
|
|
#define CSS_PROP(name_, id_, method_, datastruct_, member_, type_, kwtable_) \
|
2004-01-30 01:04:45 +03:00
|
|
|
NS_IMETHODIMP \
|
|
|
|
CSS2PropertiesTearoff::Get##method_(nsAString& aValue) \
|
|
|
|
{ \
|
2004-06-08 05:32:29 +04:00
|
|
|
return mOuter->GetPropertyValue(eCSSProperty_##id_, aValue); \
|
2004-01-30 01:04:45 +03:00
|
|
|
} \
|
|
|
|
\
|
|
|
|
NS_IMETHODIMP \
|
|
|
|
CSS2PropertiesTearoff::Set##method_(const nsAString& aValue) \
|
|
|
|
{ \
|
2004-06-08 05:32:29 +04:00
|
|
|
return mOuter->SetPropertyValue(eCSSProperty_##id_, aValue); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define CSS_PROP_NOTIMPLEMENTED(name_, id_, method_) \
|
|
|
|
NS_IMETHODIMP \
|
|
|
|
CSS2PropertiesTearoff::Get##method_(nsAString& aValue) \
|
|
|
|
{ \
|
|
|
|
aValue.Truncate(); \
|
|
|
|
return NS_OK; \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
NS_IMETHODIMP \
|
|
|
|
CSS2PropertiesTearoff::Set##method_(const nsAString& aValue) \
|
|
|
|
{ \
|
|
|
|
return NS_OK; \
|
2001-09-17 04:57:46 +04:00
|
|
|
}
|
1998-10-28 05:04:27 +03:00
|
|
|
|
2003-06-08 02:14:42 +04:00
|
|
|
#define CSS_PROP_LIST_EXCLUDE_INTERNAL
|
2003-07-03 02:17:23 +04:00
|
|
|
#define CSS_PROP_SHORTHAND(name_, id_, method_) \
|
2004-11-30 22:24:34 +03:00
|
|
|
CSS_PROP(name_, id_, method_, , , ,)
|
2002-09-26 07:46:50 +04:00
|
|
|
#include "nsCSSPropList.h"
|
2004-02-24 09:48:25 +03:00
|
|
|
|
|
|
|
// Aliases
|
2004-11-30 22:24:34 +03:00
|
|
|
CSS_PROP(X, opacity, MozOpacity, X, X, X, X)
|
2004-02-24 09:48:25 +03:00
|
|
|
|
2003-06-08 02:14:42 +04:00
|
|
|
#undef CSS_PROP_SHORTHAND
|
|
|
|
#undef CSS_PROP_NOTIMPLEMENTED
|
|
|
|
#undef CSS_PROP_LIST_EXCLUDE_INTERNAL
|
2002-09-26 07:46:50 +04:00
|
|
|
#undef CSS_PROP
|