forked from mirrors/gecko-dev
Bug 1856213 - remove some queryinterface calls r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D190022
This commit is contained in:
parent
22622ef99d
commit
c25d6d1667
13 changed files with 37 additions and 50 deletions
|
|
@ -868,7 +868,9 @@ class nsINode : public mozilla::dom::EventTarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool IsSVGAnimationElement() const { return false; }
|
virtual bool IsSVGAnimationElement() const { return false; }
|
||||||
|
virtual bool IsSVGComponentTransferFunctionElement() const { return false; }
|
||||||
virtual bool IsSVGFilterPrimitiveElement() const { return false; }
|
virtual bool IsSVGFilterPrimitiveElement() const { return false; }
|
||||||
|
virtual bool IsSVGFilterPrimitiveChildElement() const { return false; }
|
||||||
virtual bool IsSVGGeometryElement() const { return false; }
|
virtual bool IsSVGGeometryElement() const { return false; }
|
||||||
virtual bool IsSVGGraphicsElement() const { return false; }
|
virtual bool IsSVGGraphicsElement() const { return false; }
|
||||||
|
|
||||||
|
|
@ -909,6 +911,14 @@ class nsINode : public mozilla::dom::EventTarget {
|
||||||
nsGkAtoms::h4, nsGkAtoms::h5, nsGkAtoms::h6);
|
nsGkAtoms::h4, nsGkAtoms::h5, nsGkAtoms::h6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check whether the conditional processing attributes other than
|
||||||
|
* systemLanguage "return true" if they apply to and are specified
|
||||||
|
* on the given SVG element. Returns true if this element should be
|
||||||
|
* rendered, false if it should not.
|
||||||
|
*/
|
||||||
|
virtual bool PassesConditionalProcessingTests() const { return true; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Insert a content node before another or at the end.
|
* Insert a content node before another or at the end.
|
||||||
* This method handles calling BindToTree on the child appropriately.
|
* This method handles calling BindToTree on the child appropriately.
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,9 @@ class SVGAnimationElement : public SVGAnimationElementBase, public SVGTests {
|
||||||
SVGAnimationElementBase)
|
SVGAnimationElementBase)
|
||||||
|
|
||||||
bool IsSVGAnimationElement() const final { return true; }
|
bool IsSVGAnimationElement() const final { return true; }
|
||||||
|
bool PassesConditionalProcessingTests() const final {
|
||||||
|
return SVGTests::PassesConditionalProcessingTests();
|
||||||
|
}
|
||||||
nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override = 0;
|
nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override = 0;
|
||||||
|
|
||||||
// nsIContent specializations
|
// nsIContent specializations
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,6 @@
|
||||||
#include "SVGAnimatedNumberList.h"
|
#include "SVGAnimatedNumberList.h"
|
||||||
#include "mozilla/dom/SVGFilters.h"
|
#include "mozilla/dom/SVGFilters.h"
|
||||||
|
|
||||||
#define NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID \
|
|
||||||
{ \
|
|
||||||
0xafab106d, 0xbc18, 0x4f7f, { \
|
|
||||||
0x9e, 0x29, 0xfe, 0xb4, 0xb0, 0x16, 0x5f, 0xf4 \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace mozilla::dom {
|
namespace mozilla::dom {
|
||||||
|
|
||||||
class DOMSVGAnimatedNumberList;
|
class DOMSVGAnimatedNumberList;
|
||||||
|
|
@ -37,11 +30,10 @@ class SVGComponentTransferFunctionElement
|
||||||
public:
|
public:
|
||||||
using ComponentTransferAttributes = gfx::ComponentTransferAttributes;
|
using ComponentTransferAttributes = gfx::ComponentTransferAttributes;
|
||||||
|
|
||||||
// interfaces:
|
NS_IMPL_FROMNODE_HELPER(SVGComponentTransferFunctionElement,
|
||||||
NS_DECLARE_STATIC_IID_ACCESSOR(
|
IsSVGComponentTransferFunctionElement())
|
||||||
NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID)
|
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS_INHERITED
|
bool IsSVGComponentTransferFunctionElement() const final { return true; }
|
||||||
|
|
||||||
bool AttributeAffectsRendering(int32_t aNameSpaceID,
|
bool AttributeAffectsRendering(int32_t aNameSpaceID,
|
||||||
nsAtom* aAttribute) const override;
|
nsAtom* aAttribute) const override;
|
||||||
|
|
@ -81,9 +73,6 @@ class SVGComponentTransferFunctionElement
|
||||||
static EnumInfo sEnumInfo[1];
|
static EnumInfo sEnumInfo[1];
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_DEFINE_STATIC_IID_ACCESSOR(SVGComponentTransferFunctionElement,
|
|
||||||
NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID)
|
|
||||||
|
|
||||||
} // namespace mozilla::dom
|
} // namespace mozilla::dom
|
||||||
|
|
||||||
nsresult NS_NewSVGFEFuncRElement(
|
nsresult NS_NewSVGFEFuncRElement(
|
||||||
|
|
|
||||||
|
|
@ -57,11 +57,8 @@ SVGFEComponentTransferElement::GetPrimitiveDescription(
|
||||||
|
|
||||||
for (nsIContent* childContent = nsINode::GetFirstChild(); childContent;
|
for (nsIContent* childContent = nsINode::GetFirstChild(); childContent;
|
||||||
childContent = childContent->GetNextSibling()) {
|
childContent = childContent->GetNextSibling()) {
|
||||||
RefPtr<SVGComponentTransferFunctionElement> child;
|
if (auto* child =
|
||||||
CallQueryInterface(
|
SVGComponentTransferFunctionElement::FromNode(childContent)) {
|
||||||
childContent,
|
|
||||||
(SVGComponentTransferFunctionElement**)getter_AddRefs(child));
|
|
||||||
if (child) {
|
|
||||||
childForChannel[child->GetChannel()] = child;
|
childForChannel[child->GetChannel()] = child;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ SVGElement::NumberInfo SVGFEDistantLightElement::sNumberInfo[2] = {
|
||||||
|
|
||||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEDistantLightElement)
|
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEDistantLightElement)
|
||||||
|
|
||||||
// nsFEUnstyledElement methods
|
// SVGFilterPrimitiveChildElement methods
|
||||||
|
|
||||||
bool SVGFEDistantLightElement::AttributeAffectsRendering(
|
bool SVGFEDistantLightElement::AttributeAffectsRendering(
|
||||||
int32_t aNameSpaceID, nsAtom* aAttribute) const {
|
int32_t aNameSpaceID, nsAtom* aAttribute) const {
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ SVGElement::StringInfo SVGFEMergeNodeElement::sStringInfo[1] = {
|
||||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEMergeNodeElement)
|
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEMergeNodeElement)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// nsFEUnstyledElement methods
|
// SVGFilterPrimitiveChildElement methods
|
||||||
|
|
||||||
bool SVGFEMergeNodeElement::AttributeAffectsRendering(
|
bool SVGFEMergeNodeElement::AttributeAffectsRendering(
|
||||||
int32_t aNameSpaceID, nsAtom* aAttribute) const {
|
int32_t aNameSpaceID, nsAtom* aAttribute) const {
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ SVGElement::NumberInfo SVGFEPointLightElement::sNumberInfo[3] = {
|
||||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEPointLightElement)
|
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEPointLightElement)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// nsFEUnstyledElement methods
|
// SVGFilterPrimitiveChildElement methods
|
||||||
|
|
||||||
bool SVGFEPointLightElement::AttributeAffectsRendering(
|
bool SVGFEPointLightElement::AttributeAffectsRendering(
|
||||||
int32_t aNameSpaceID, nsAtom* aAttribute) const {
|
int32_t aNameSpaceID, nsAtom* aAttribute) const {
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ SVGElement::NumberInfo SVGFESpotLightElement::sNumberInfo[8] = {
|
||||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFESpotLightElement)
|
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFESpotLightElement)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// nsFEUnstyledElement methods
|
// SVGFilterPrimitiveChildElement methods
|
||||||
|
|
||||||
bool SVGFESpotLightElement::AttributeAffectsRendering(
|
bool SVGFESpotLightElement::AttributeAffectsRendering(
|
||||||
int32_t aNameSpaceID, nsAtom* aAttribute) const {
|
int32_t aNameSpaceID, nsAtom* aAttribute) const {
|
||||||
|
|
|
||||||
|
|
@ -162,19 +162,7 @@ SVGElement::EnumInfo SVGComponentTransferFunctionElement::sEnumInfo[1] = {
|
||||||
{nsGkAtoms::type, sTypeMap, SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY}};
|
{nsGkAtoms::type, sTypeMap, SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY}};
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// nsISupports methods
|
// nsSVGFilterPrimitiveChildElement methods
|
||||||
|
|
||||||
NS_IMPL_ADDREF_INHERITED(SVGComponentTransferFunctionElement,
|
|
||||||
SVGComponentTransferFunctionElementBase)
|
|
||||||
NS_IMPL_RELEASE_INHERITED(SVGComponentTransferFunctionElement,
|
|
||||||
SVGComponentTransferFunctionElementBase)
|
|
||||||
|
|
||||||
NS_INTERFACE_MAP_BEGIN(SVGComponentTransferFunctionElement)
|
|
||||||
NS_INTERFACE_MAP_ENTRY_CONCRETE(SVGComponentTransferFunctionElement)
|
|
||||||
NS_INTERFACE_MAP_END_INHERITING(SVGComponentTransferFunctionElementBase)
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
// nsFEUnstyledElement methods
|
|
||||||
|
|
||||||
bool SVGComponentTransferFunctionElement::AttributeAffectsRendering(
|
bool SVGComponentTransferFunctionElement::AttributeAffectsRendering(
|
||||||
int32_t aNameSpaceID, nsAtom* aAttribute) const {
|
int32_t aNameSpaceID, nsAtom* aAttribute) const {
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,11 @@ class SVGFilterPrimitiveChildElement
|
||||||
: SVGFilterPrimitiveChildElementBase(std::move(aNodeInfo)) {}
|
: SVGFilterPrimitiveChildElementBase(std::move(aNodeInfo)) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
NS_IMPL_FROMNODE_HELPER(SVGFilterPrimitiveChildElement,
|
||||||
|
IsSVGFilterPrimitiveChildElement())
|
||||||
|
|
||||||
|
bool IsSVGFilterPrimitiveChildElement() const final { return true; }
|
||||||
|
|
||||||
nsresult Clone(mozilla::dom::NodeInfo*, nsINode** aResult) const override = 0;
|
nsresult Clone(mozilla::dom::NodeInfo*, nsINode** aResult) const override = 0;
|
||||||
|
|
||||||
// returns true if changes to the attribute should cause us to
|
// returns true if changes to the attribute should cause us to
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,9 @@ class SVGGraphicsElement : public SVGGraphicsElementBase, public SVGTests {
|
||||||
|
|
||||||
using nsINode::Clone;
|
using nsINode::Clone;
|
||||||
// Overrides SVGTests.
|
// Overrides SVGTests.
|
||||||
|
bool PassesConditionalProcessingTests() const final {
|
||||||
|
return SVGTests::PassesConditionalProcessingTests();
|
||||||
|
}
|
||||||
SVGElement* AsSVGElement() final { return this; }
|
SVGElement* AsSVGElement() final { return this; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,7 @@ nsChangeHint SVGTransformableElement::GetAttributeChangeHint(
|
||||||
SVGElement::GetAttributeChangeHint(aAttribute, aModType);
|
SVGElement::GetAttributeChangeHint(aAttribute, aModType);
|
||||||
if (aAttribute == nsGkAtoms::transform ||
|
if (aAttribute == nsGkAtoms::transform ||
|
||||||
aAttribute == nsGkAtoms::mozAnimateMotionDummyAttr) {
|
aAttribute == nsGkAtoms::mozAnimateMotionDummyAttr) {
|
||||||
nsIFrame* frame =
|
nsIFrame* frame = GetPrimaryFrame();
|
||||||
const_cast<SVGTransformableElement*>(this)->GetPrimaryFrame();
|
|
||||||
retval |= nsChangeHint_InvalidateRenderingObservers;
|
retval |= nsChangeHint_InvalidateRenderingObservers;
|
||||||
if (!frame || frame->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY)) {
|
if (!frame || frame->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY)) {
|
||||||
return retval;
|
return retval;
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,6 @@
|
||||||
#undef NOISY_FIRST_LETTER
|
#undef NOISY_FIRST_LETTER
|
||||||
|
|
||||||
#include "nsMathMLParts.h"
|
#include "nsMathMLParts.h"
|
||||||
#include "mozilla/dom/SVGTests.h"
|
|
||||||
#include "mozilla/SVGGradientFrame.h"
|
#include "mozilla/SVGGradientFrame.h"
|
||||||
|
|
||||||
#include "nsRefreshDriver.h"
|
#include "nsRefreshDriver.h"
|
||||||
|
|
@ -4844,13 +4843,6 @@ nsIFrame* nsCSSFrameConstructor::ConstructMarker(
|
||||||
#define SIMPLE_SVG_CREATE(_tag, _func) \
|
#define SIMPLE_SVG_CREATE(_tag, _func) \
|
||||||
{ nsGkAtoms::_tag, SIMPLE_SVG_FCDATA(_func) }
|
{ nsGkAtoms::_tag, SIMPLE_SVG_FCDATA(_func) }
|
||||||
|
|
||||||
static bool IsFilterPrimitiveChildTag(const nsAtom* aTag) {
|
|
||||||
return aTag == nsGkAtoms::feDistantLight || aTag == nsGkAtoms::fePointLight ||
|
|
||||||
aTag == nsGkAtoms::feSpotLight || aTag == nsGkAtoms::feFuncR ||
|
|
||||||
aTag == nsGkAtoms::feFuncG || aTag == nsGkAtoms::feFuncB ||
|
|
||||||
aTag == nsGkAtoms::feFuncA || aTag == nsGkAtoms::feMergeNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
const nsCSSFrameConstructor::FrameConstructionData*
|
const nsCSSFrameConstructor::FrameConstructionData*
|
||||||
nsCSSFrameConstructor::FindSVGData(const Element& aElement,
|
nsCSSFrameConstructor::FindSVGData(const Element& aElement,
|
||||||
|
|
@ -4923,8 +4915,7 @@ nsCSSFrameConstructor::FindSVGData(const Element& aElement,
|
||||||
return &sMarkerSVGData;
|
return &sMarkerSVGData;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<SVGTests> tests = do_QueryInterface(const_cast<Element*>(&aElement));
|
if (!aElement.PassesConditionalProcessingTests()) {
|
||||||
if (tests && !tests->PassesConditionalProcessingTests()) {
|
|
||||||
// Elements with failing conditional processing attributes never get
|
// Elements with failing conditional processing attributes never get
|
||||||
// rendered. Note that this is not where we select which frame in a
|
// rendered. Note that this is not where we select which frame in a
|
||||||
// <switch> to render! That happens in SVGSwitchFrame::PaintSVG.
|
// <switch> to render! That happens in SVGSwitchFrame::PaintSVG.
|
||||||
|
|
@ -4966,8 +4957,10 @@ nsCSSFrameConstructor::FindSVGData(const Element& aElement,
|
||||||
// primitive.
|
// primitive.
|
||||||
bool parentIsFEContainerFrame =
|
bool parentIsFEContainerFrame =
|
||||||
aParentFrame && aParentFrame->IsSVGFEContainerFrame();
|
aParentFrame && aParentFrame->IsSVGFEContainerFrame();
|
||||||
if ((parentIsFEContainerFrame && !IsFilterPrimitiveChildTag(tag)) ||
|
if ((parentIsFEContainerFrame &&
|
||||||
(!parentIsFEContainerFrame && IsFilterPrimitiveChildTag(tag))) {
|
!aElement.IsSVGFilterPrimitiveChildElement()) ||
|
||||||
|
(!parentIsFEContainerFrame &&
|
||||||
|
aElement.IsSVGFilterPrimitiveChildElement())) {
|
||||||
return &sSuppressData;
|
return &sSuppressData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue