Bug 1427512 - Part 28: Remove nsIDOMCSSValue. r=xidorn,bz

MozReview-Commit-ID: 6DasjoMa6C8
This commit is contained in:
Cameron McCormack 2018-01-11 16:17:57 +08:00
parent 66141a0c03
commit 6716a7e0eb
12 changed files with 20 additions and 112 deletions

View File

@ -57,7 +57,6 @@ interface nsIDOMHTMLFormElement;
interface nsIDOMHTMLHeadElement;
// CSS
interface nsIDOMCSSValue;
interface nsIDOMCSSStyleDeclaration;
// Range

View File

@ -9,7 +9,6 @@ with Files("**"):
XPIDL_SOURCES += [
'nsIDOMCSSStyleDeclaration.idl',
'nsIDOMCSSValue.idl',
]
XPIDL_MODULE = 'dom_css'

View File

@ -33,7 +33,6 @@ interface nsIDOMCSSStyleDeclaration : nsISupports
%}
DOMString getPropertyValue(in DOMString propertyName);
nsIDOMCSSValue getPropertyCSSValue(in DOMString propertyName);
DOMString removeProperty(in DOMString propertyName)
raises(DOMException);
DOMString getPropertyPriority(in DOMString propertyName);

View File

@ -1,29 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#include "domstubs.idl"
/**
* The nsIDOMCSSValue interface is a datatype for a CSS value in the
* Document Object Model.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Style
*/
[uuid(009f7ea5-9e80-41be-b008-db62f10823f2)]
interface nsIDOMCSSValue : nsISupports
{
// UnitTypes
const unsigned short CSS_INHERIT = 0;
const unsigned short CSS_PRIMITIVE_VALUE = 1;
const unsigned short CSS_VALUE_LIST = 2;
const unsigned short CSS_CUSTOM = 3;
attribute DOMString cssText;
// raises(DOMException) on setting
readonly attribute unsigned short cssValueType;
};

View File

@ -6,8 +6,6 @@
#include "nsIDOMElement.idl"
interface nsIDOMCSSStyleDeclaration;
interface nsIDOMCSSValue;
[uuid(c63517c5-8bab-4cd1-8694-bccafc32a195)]
interface nsIDOMSVGElement : nsIDOMElement

View File

@ -23,7 +23,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=790732
is(Ci.nsIXMLHttpRequest.HEADERS_RECEIVED, XMLHttpRequest.HEADERS_RECEIVED);
is(Ci.nsIDOMDOMException.DATA_CLONE_ERR, DOMException.DATA_CLONE_ERR);
is(Ci.nsIDOMNode.DOCUMENT_NODE, Node.DOCUMENT_NODE);
is(Ci.nsIDOMCSSValue.CSS_PRIMITIVE_VALUE, CSSValue.CSS_PRIMITIVE_VALUE);
is(Ci.nsIDOMEvent.FOCUS, Event.FOCUS);
is(Ci.nsIDOMNSEvent.CLICK, Event.CLICK);
is(Ci.nsIDOMKeyEvent, KeyEvent);

View File

@ -7,10 +7,12 @@
/* DOM object representing lists of values in DOM computed style */
#include "nsDOMCSSValueList.h"
#include "mozilla/dom/CSSValueBinding.h"
#include "mozilla/dom/CSSValueListBinding.h"
#include "mozilla/Move.h"
using namespace mozilla;
using namespace mozilla::dom;
nsDOMCSSValueList::nsDOMCSSValueList(bool aCommaDelimited, bool aReadonly)
: CSSValue(), mCommaDelimited(aCommaDelimited), mReadonly(aReadonly)
@ -27,7 +29,6 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMCSSValueList)
// QueryInterface implementation for nsDOMCSSValueList
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMCSSValueList)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsIDOMCSSValue)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, CSSValue)
NS_INTERFACE_MAP_END
@ -46,9 +47,7 @@ nsDOMCSSValueList::AppendCSSValue(already_AddRefed<CSSValue> aValue)
mCSSValues.AppendElement(Move(val));
}
// nsIDOMCSSValue
NS_IMETHODIMP
void
nsDOMCSSValueList::GetCssText(nsAString& aCssText)
{
aCssText.Truncate();
@ -88,43 +87,27 @@ nsDOMCSSValueList::GetCssText(nsAString& aCssText)
aCssText.Append(tmpStr);
}
}
return NS_OK;
}
void
nsDOMCSSValueList::GetCssText(nsString& aText, ErrorResult& aRv)
nsDOMCSSValueList::GetCssText(nsString& aCssText, ErrorResult& aRv)
{
aRv = GetCssText(aText);
}
NS_IMETHODIMP
nsDOMCSSValueList::SetCssText(const nsAString& aCssText)
{
if (mReadonly) {
return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;
}
MOZ_ASSERT_UNREACHABLE("Can't SetCssText yet: please write me!");
return NS_OK;
GetCssText(aCssText);
}
void
nsDOMCSSValueList::SetCssText(const nsAString& aText, ErrorResult& aRv)
{
aRv = SetCssText(aText);
}
if (mReadonly) {
aRv.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
return;
}
NS_IMETHODIMP
nsDOMCSSValueList::GetCssValueType(uint16_t* aValueType)
{
NS_ENSURE_ARG_POINTER(aValueType);
*aValueType = nsIDOMCSSValue::CSS_VALUE_LIST;
return NS_OK;
MOZ_ASSERT_UNREACHABLE("Can't SetCssText yet: please write me!");
}
uint16_t
nsDOMCSSValueList::CssValueType() const
{
return nsIDOMCSSValue::CSS_VALUE_LIST;
return CSSValueBinding::CSS_VALUE_LIST;
}

View File

@ -13,14 +13,10 @@
#include "nsTArray.h"
class nsDOMCSSValueList final : public mozilla::dom::CSSValue
, public nsIDOMCSSValue
{
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsDOMCSSValueList, mozilla::dom::CSSValue)
// nsIDOMCSSValue
NS_DECL_NSIDOMCSSVALUE
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMCSSValueList)
// nsDOMCSSValueList
nsDOMCSSValueList(bool aCommaDelimited, bool aReadonly);
@ -36,6 +32,8 @@ public:
mozilla::ErrorResult& aRv) override final;
virtual uint16_t CssValueType() const override final;
void GetCssText(nsAString& aText);
CSSValue* IndexedGetter(uint32_t aIdx, bool& aFound) const
{
aFound = aIdx <= Length();

View File

@ -26,7 +26,6 @@
#include "mozilla/dom/CSSValue.h"
#include "nsWrapperCache.h"
#include "nsString.h"
#include "nsIDOMCSSValue.h"
#include "mozilla/ErrorResult.h"
#include "nsCOMPtr.h"
@ -81,18 +80,6 @@ public:
virtual already_AddRefed<mozilla::dom::CSSValue>
GetPropertyCSSValue(const nsAString& aPropertyName,
mozilla::ErrorResult& aRv) = 0;
NS_IMETHOD GetPropertyCSSValue(const nsAString& aProp, nsIDOMCSSValue** aVal) override
{
mozilla::ErrorResult error;
RefPtr<mozilla::dom::CSSValue> val = GetPropertyCSSValue(aProp, error);
if (error.Failed()) {
return error.StealNSResult();
}
nsCOMPtr<nsIDOMCSSValue> xpVal = do_QueryInterface(val);
xpVal.forget(aVal);
return NS_OK;
}
NS_IMETHOD RemoveProperty(const nsAString& aPropertyName,
nsAString& aReturn) override = 0;
NS_IMETHOD GetPropertyPriority(const nsAString& aPropertyName,

View File

@ -46,7 +46,6 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(nsROCSSPrimitiveValue)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsROCSSPrimitiveValue)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsIDOMCSSValue)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, CSSValue)
NS_INTERFACE_MAP_END
@ -75,10 +74,7 @@ nsROCSSPrimitiveValue::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenPro
return dom::CSSPrimitiveValueBinding::Wrap(cx, this, aGivenProto);
}
// nsIDOMCSSValue
NS_IMETHODIMP
nsresult
nsROCSSPrimitiveValue::GetCssText(nsAString& aCssText)
{
nsAutoString tmpStr;
@ -281,31 +277,16 @@ nsROCSSPrimitiveValue::GetCssText(nsString& aText, ErrorResult& aRv)
aRv = GetCssText(aText);
}
NS_IMETHODIMP
nsROCSSPrimitiveValue::SetCssText(const nsAString& aCssText)
{
return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;
}
void
nsROCSSPrimitiveValue::SetCssText(const nsAString& aText, ErrorResult& aRv)
{
aRv = SetCssText(aText);
}
NS_IMETHODIMP
nsROCSSPrimitiveValue::GetCssValueType(uint16_t* aValueType)
{
NS_ENSURE_ARG_POINTER(aValueType);
*aValueType = nsIDOMCSSValue::CSS_PRIMITIVE_VALUE;
return NS_OK;
aRv.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
}
uint16_t
nsROCSSPrimitiveValue::CssValueType() const
{
return nsIDOMCSSValue::CSS_PRIMITIVE_VALUE;
return CSSValueBinding::CSS_PRIMITIVE_VALUE;
}
void

View File

@ -9,7 +9,6 @@
#ifndef nsROCSSPrimitiveValue_h___
#define nsROCSSPrimitiveValue_h___
#include "nsIDOMCSSValue.h"
#include "mozilla/dom/CSSPrimitiveValueBinding.h"
#include "mozilla/dom/CSSValueBinding.h"
@ -26,15 +25,11 @@ class nsDOMCSSRGBColor;
* Read-only CSS primitive value - a DOM object representing values in DOM
* computed style.
*/
class nsROCSSPrimitiveValue final : public mozilla::dom::CSSValue,
public nsIDOMCSSValue
class nsROCSSPrimitiveValue final : public mozilla::dom::CSSValue
{
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsROCSSPrimitiveValue, mozilla::dom::CSSValue)
// nsIDOMCSSValue
NS_DECL_NSIDOMCSSVALUE
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsROCSSPrimitiveValue)
// CSSValue
virtual void GetCssText(nsString& aText, mozilla::ErrorResult& aRv) override final;
@ -56,6 +51,7 @@ public:
// nsROCSSPrimitiveValue
nsROCSSPrimitiveValue();
nsresult GetCssText(nsAString& aText);
void SetNumber(float aValue);
void SetNumber(int32_t aValue);
void SetNumber(uint32_t aValue);

View File

@ -20,7 +20,6 @@
#include "nsIDOMCommandEvent.h"
#include "nsIDOMComment.h"
#include "nsIDOMCSSStyleDeclaration.h"
#include "nsIDOMCSSValue.h"
#include "nsIDOMCustomEvent.h"
#ifdef MOZ_WEBRTC
#include "nsIDOMDataChannel.h"
@ -257,7 +256,6 @@ const ComponentsInterfaceShimEntry kComponentsInterfaceShimMap[] =
DEFINE_SHIM(Comment),
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIContainerBoxObject, ContainerBoxObject),
DEFINE_SHIM(CSSStyleDeclaration),
DEFINE_SHIM(CSSValue),
DEFINE_SHIM(CustomEvent),
#ifdef MOZ_WEBRTC
DEFINE_SHIM(DataChannel),