Bug 765588. Make CSSFontFaceStyleDecl an nsICSSDeclaration. r=dbaron

This commit is contained in:
Boris Zbarsky 2012-08-05 22:14:47 -04:00
parent d2c71cfa73
commit bb5cc2f15d
2 changed files with 27 additions and 1 deletions

View File

@ -1369,6 +1369,7 @@ DOMCI_DATA(CSSFontFaceStyleDecl, nsCSSFontFaceStyleDecl)
// QueryInterface implementation for nsCSSFontFaceStyleDecl
NS_INTERFACE_MAP_BEGIN(nsCSSFontFaceStyleDecl)
NS_INTERFACE_MAP_ENTRY(nsIDOMCSSStyleDeclaration)
NS_INTERFACE_MAP_ENTRY(nsICSSDeclaration)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CSSFontFaceStyleDecl)
NS_INTERFACE_MAP_END
@ -1576,6 +1577,28 @@ nsCSSFontFaceStyleDecl::GetParentRule(nsIDOMCSSRule** aParentRule)
return NS_OK;
}
NS_IMETHODIMP
nsCSSFontFaceStyleDecl::GetPropertyValue(const nsCSSProperty aPropID,
nsAString& aValue)
{
return
GetPropertyValue(NS_ConvertUTF8toUTF16(nsCSSProps::GetStringValue(aPropID)),
aValue);
}
NS_IMETHODIMP
nsCSSFontFaceStyleDecl::SetPropertyValue(const nsCSSProperty aPropID,
const nsAString& aValue)
{
return SetProperty(NS_ConvertUTF8toUTF16(nsCSSProps::GetStringValue(aPropID)),
aValue, EmptyString());
}
nsINode*
nsCSSFontFaceStyleDecl::GetParentObject()
{
return nullptr;
}
// -------------------------------------------
// nsCSSFontFaceRule

View File

@ -157,11 +157,14 @@ protected:
// A nsCSSFontFaceStyleDecl is always embedded in a nsCSSFontFaceRule.
class nsCSSFontFaceRule;
class nsCSSFontFaceStyleDecl : public nsIDOMCSSStyleDeclaration
class nsCSSFontFaceStyleDecl : public nsICSSDeclaration
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMCSSSTYLEDECLARATION
NS_DECL_NSICSSDECLARATION
virtual nsINode *GetParentObject();
nsresult GetPropertyValue(nsCSSFontDesc aFontDescID,
nsAString & aResult) const;