Bug 1228280 - Part 8. Keep style consistent and stop doing null check for return value of operator new

MozReview-Commit-ID: GoK0xuCWTP
This commit is contained in:
CJKu 2016-05-19 15:44:42 +08:00
Родитель 5e2e2b7e08
Коммит fb8594dce2
2 изменённых файлов: 24 добавлений и 16 удалений

Просмотреть файл

@ -475,8 +475,6 @@ GetEffectProperty(nsIURI *aURI, nsIFrame *aFrame,
if (prop)
return prop;
prop = aCreate(aURI, aFrame, false);
if (!prop)
return nullptr;
NS_ADDREF(prop);
props.Set(aProperty, static_cast<nsISupports*>(prop));
return prop;
@ -494,8 +492,6 @@ GetOrCreateFilterProperty(nsIFrame *aFrame)
if (prop)
return prop;
prop = new nsSVGFilterProperty(effects->mFilters, aFrame);
if (!prop)
return nullptr;
NS_ADDREF(prop);
props.Set(nsSVGEffects::FilterProperty(), prop);
return prop;

Просмотреть файл

@ -43,7 +43,8 @@ class nsSVGFilterChainObserver;
* constructor and destructor, which should call StartListening and
* StopListening, respectively.
*/
class nsSVGRenderingObserver : public nsStubMutationObserver {
class nsSVGRenderingObserver : public nsStubMutationObserver
{
protected:
virtual ~nsSVGRenderingObserver()
@ -108,7 +109,8 @@ protected:
* object derived from nsSVGIDRenderingObserver to manage the relationship. The
* property object is attached to the referencing frame.
*/
class nsSVGIDRenderingObserver : public nsSVGRenderingObserver {
class nsSVGIDRenderingObserver : public nsSVGRenderingObserver
{
public:
typedef mozilla::dom::Element Element;
nsSVGIDRenderingObserver(nsIURI* aURI, nsIContent* aObservingContent,
@ -121,7 +123,8 @@ protected:
// This is called when the referenced resource changes.
virtual void DoUpdate() override;
class SourceReference : public nsReferencedElement {
class SourceReference : public nsReferencedElement
{
public:
explicit SourceReference(nsSVGIDRenderingObserver* aContainer) : mContainer(aContainer) {}
protected:
@ -169,7 +172,8 @@ private:
nsIPresShell *mFramePresShell;
};
class nsSVGRenderingObserverProperty : public nsSVGIDRenderingObserver {
class nsSVGRenderingObserverProperty : public nsSVGIDRenderingObserver
{
public:
NS_DECL_ISUPPORTS
@ -200,7 +204,8 @@ protected:
* The nsSVGFilterChainObserver class manages a list of nsSVGFilterReferences.
*/
class nsSVGFilterReference final : public nsSVGIDRenderingObserver
, public nsISVGFilterReference {
, public nsISVGFilterReference
{
public:
nsSVGFilterReference(nsIURI* aURI,
nsIContent* aObservingContent,
@ -246,7 +251,8 @@ private:
* "blur(10px)" don't reference filter elements, so they don't need an
* nsSVGFilterReference. The style system invalidates changes to CSS filters.
*/
class nsSVGFilterChainObserver : public nsISupports {
class nsSVGFilterChainObserver : public nsISupports
{
public:
nsSVGFilterChainObserver(const nsTArray<nsStyleFilter>& aFilters,
nsIContent* aFilteredElement);
@ -268,7 +274,8 @@ private:
nsTArray<RefPtr<nsSVGFilterReference>> mReferences;
};
class nsSVGFilterProperty : public nsSVGFilterChainObserver {
class nsSVGFilterProperty : public nsSVGFilterChainObserver
{
public:
nsSVGFilterProperty(const nsTArray<nsStyleFilter> &aFilters,
nsIFrame *aFilteredFrame)
@ -284,7 +291,8 @@ protected:
nsSVGFrameReferenceFromProperty mFrameReference;
};
class nsSVGMarkerProperty final : public nsSVGRenderingObserverProperty {
class nsSVGMarkerProperty final: public nsSVGRenderingObserverProperty
{
public:
nsSVGMarkerProperty(nsIURI *aURI, nsIFrame *aFrame, bool aReferenceImage)
: nsSVGRenderingObserverProperty(aURI, aFrame, aReferenceImage) {}
@ -293,7 +301,8 @@ protected:
virtual void DoUpdate() override;
};
class nsSVGTextPathProperty final : public nsSVGRenderingObserverProperty {
class nsSVGTextPathProperty final : public nsSVGRenderingObserverProperty
{
public:
nsSVGTextPathProperty(nsIURI *aURI, nsIFrame *aFrame, bool aReferenceImage)
: nsSVGRenderingObserverProperty(aURI, aFrame, aReferenceImage)
@ -313,7 +322,8 @@ private:
bool mValid;
};
class nsSVGPaintingProperty final : public nsSVGRenderingObserverProperty {
class nsSVGPaintingProperty final : public nsSVGRenderingObserverProperty
{
public:
nsSVGPaintingProperty(nsIURI *aURI, nsIFrame *aFrame, bool aReferenceImage)
: nsSVGRenderingObserverProperty(aURI, aFrame, aReferenceImage) {}
@ -356,7 +366,8 @@ private:
* via nsSVGContainerFrame::RemoveFrame, since only frames in the frame
* tree should be referenced.
*/
class nsSVGRenderingObserverList {
class nsSVGRenderingObserverList
{
public:
nsSVGRenderingObserverList()
: mObservers(4)
@ -402,7 +413,8 @@ private:
nsTHashtable<nsPtrHashKey<nsSVGRenderingObserver> > mObservers;
};
class nsSVGEffects {
class nsSVGEffects
{
public:
typedef mozilla::dom::Element Element;
typedef nsInterfaceHashtable<nsURIHashKey, nsIMutationObserver>