Skip to content

Commit

Permalink
Bug 801819. Remove nsIDOMCSS2Properties and the classinfo bits for CS…
Browse files Browse the repository at this point in the history
…S declarations. r=peterv,dbaron
  • Loading branch information
bzbarsky committed Oct 30, 2012
1 parent b384d65 commit a14a96d
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 1,001 deletions.
65 changes: 0 additions & 65 deletions dom/base/nsDOMClassInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@
#include "nsCSSRules.h"
#include "nsIDOMStyleSheet.h"
#include "nsIDOMStyleSheetList.h"
#include "nsIDOMCSSStyleDeclaration.h"
#include "nsIDOMCSSRule.h"
#include "nsICSSRuleList.h"
#include "nsIDOMRect.h"
Expand All @@ -157,7 +156,6 @@
#include "nsIFrame.h"
#include "nsIPresShell.h"
#include "nsIDOMElement.h"
#include "nsIDOMCSSStyleDeclaration.h"
#include "nsStyleContext.h"
#include "nsAutoPtr.h"
#include "nsMemory.h"
Expand Down Expand Up @@ -281,7 +279,6 @@
#include "nsIDOMMediaStream.h"
#endif
#include "nsIDOMProgressEvent.h"
#include "nsIDOMCSS2Properties.h"
#include "nsIDOMCSSCharsetRule.h"
#include "nsIDOMCSSImportRule.h"
#include "nsIDOMCSSMediaRule.h"
Expand Down Expand Up @@ -1032,8 +1029,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
ARRAY_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSStyleSheet, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSStyleDeclaration, nsCSSStyleDeclSH,
ARRAY_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(ROCSSPrimitiveValue, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)

Expand Down Expand Up @@ -1527,8 +1522,6 @@ static nsDOMClassInfoData sClassInfoData[] = {

NS_DEFINE_CLASSINFO_DATA(CSSFontFaceRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSFontFaceStyleDecl, nsCSSStyleDeclSH,
ARRAY_SCRIPTABLE_FLAGS)

#if defined(MOZ_MEDIA)
NS_DEFINE_CLASSINFO_DATA(HTMLVideoElement, nsElementSH,
Expand Down Expand Up @@ -3039,11 +3032,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleSheet)
DOM_CLASSINFO_MAP_END

DOM_CLASSINFO_MAP_BEGIN(CSSStyleDeclaration, nsIDOMCSSStyleDeclaration)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleDeclaration)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSS2Properties)
DOM_CLASSINFO_MAP_END

DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ROCSSPrimitiveValue,
nsIDOMCSSPrimitiveValue)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSPrimitiveValue)
Expand Down Expand Up @@ -4124,11 +4112,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSFontFaceRule)
DOM_CLASSINFO_MAP_END

DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(CSSFontFaceStyleDecl,
nsIDOMCSSStyleDeclaration)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleDeclaration)
DOM_CLASSINFO_MAP_END

#if defined (MOZ_MEDIA)
DOM_CLASSINFO_MAP_BEGIN(HTMLVideoElement, nsIDOMHTMLVideoElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLVideoElement)
Expand Down Expand Up @@ -10314,54 +10297,6 @@ nsCSSValueListSH::GetItemAt(nsISupports *aNative, uint32_t aIndex,
return list->GetItemAt(aIndex);
}


// CSSStyleDeclaration helper

NS_IMETHODIMP
nsCSSStyleDeclSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
JSObject *globalObj, JSObject **parentObj)
{
#ifdef DEBUG
nsWrapperCache* cache = nullptr;
CallQueryInterface(nativeObj, &cache);
MOZ_ASSERT(cache, "All CSS declarations must be wrappercached");
#endif

nsICSSDeclaration *declaration = static_cast<nsICSSDeclaration*>(nativeObj);
nsINode *native_parent = declaration->GetParentObject();
if (!native_parent) {
return nsDOMClassInfo::PreCreate(nativeObj, cx, globalObj, parentObj);
}

nsresult rv =
WrapNativeParent(cx, globalObj, native_parent, parentObj);
NS_ENSURE_SUCCESS(rv, rv);

return NS_SUCCESS_ALLOW_SLIM_WRAPPERS;
}

nsresult
nsCSSStyleDeclSH::GetStringAt(nsISupports *aNative, int32_t aIndex,
nsAString& aResult)
{
if (aIndex < 0) {
return NS_ERROR_DOM_INDEX_SIZE_ERR;
}

nsCOMPtr<nsIDOMCSSStyleDeclaration> style_decl(do_QueryInterface(aNative));

nsresult rv = style_decl->Item(uint32_t(aIndex), aResult);
#ifdef DEBUG
if (DOMStringIsNull(aResult)) {
uint32_t length = 0;
style_decl->GetLength(&length);
NS_ASSERTION(uint32_t(aIndex) >= length, "Item should only return null for out-of-bounds access");
}
#endif
return rv;
}


// CSSRuleList scriptable helper

nsISupports*
Expand Down
28 changes: 0 additions & 28 deletions dom/base/nsDOMClassInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -1162,34 +1162,6 @@ class nsCSSValueListSH : public nsArraySH
}
};


// CSSStyleDeclaration helper

class nsCSSStyleDeclSH : public nsStringArraySH
{
protected:
nsCSSStyleDeclSH(nsDOMClassInfoData* aData) : nsStringArraySH(aData)
{
}

virtual ~nsCSSStyleDeclSH()
{
}

virtual nsresult GetStringAt(nsISupports *aNative, int32_t aIndex,
nsAString& aResult);

public:
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
JSObject *globalObj, JSObject **parentObj);

static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
{
return new nsCSSStyleDeclSH(aData);
}
};


// CSSRuleList helper

class nsCSSRuleListSH : public nsArraySH
Expand Down
2 changes: 0 additions & 2 deletions dom/base/nsDOMClassInfoClasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ DOMCI_CLASS(CSSGroupRuleRuleList)
DOMCI_CLASS(MediaList)
DOMCI_CLASS(StyleSheetList)
DOMCI_CLASS(CSSStyleSheet)
DOMCI_CLASS(CSSStyleDeclaration)
DOMCI_CLASS(ROCSSPrimitiveValue)

// Range classes
Expand Down Expand Up @@ -414,7 +413,6 @@ DOMCI_CLASS(DataErrorEvent)

// @font-face in CSS
DOMCI_CLASS(CSSFontFaceRule)
DOMCI_CLASS(CSSFontFaceStyleDecl)

#if defined(MOZ_MEDIA)
// WhatWG Video Element
Expand Down
1 change: 0 additions & 1 deletion dom/interfaces/css/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ SDK_XPIDLSRCS = \
$(NULL)

XPIDLSRCS = \
nsIDOMCSS2Properties.idl \
nsIDOMCSSCharsetRule.idl \
nsIDOMCSSFontFaceRule.idl \
nsIDOMCSSImportRule.idl \
Expand Down
Loading

0 comments on commit a14a96d

Please sign in to comment.