2013-03-14 01:41:20 +04:00
|
|
|
/* a*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-12-09 06:52:54 +04:00
|
|
|
#include "mozilla/ArrayUtils.h"
|
2011-10-11 09:50:08 +04:00
|
|
|
|
2005-09-07 02:30:40 +04:00
|
|
|
#include "nsSVGElement.h"
|
2006-07-28 22:10:48 +04:00
|
|
|
#include "nsGkAtoms.h"
|
2006-12-26 20:47:52 +03:00
|
|
|
#include "nsSVGNumber2.h"
|
2011-07-01 11:19:52 +04:00
|
|
|
#include "nsSVGNumberPair.h"
|
2007-09-18 16:09:26 +04:00
|
|
|
#include "nsSVGInteger.h"
|
2011-07-01 11:19:52 +04:00
|
|
|
#include "nsSVGIntegerPair.h"
|
2007-09-26 13:22:08 +04:00
|
|
|
#include "nsSVGBoolean.h"
|
2005-09-07 02:30:40 +04:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsSVGFilterInstance.h"
|
|
|
|
#include "nsSVGEnum.h"
|
2010-12-03 19:40:23 +03:00
|
|
|
#include "SVGNumberList.h"
|
|
|
|
#include "SVGAnimatedNumberList.h"
|
|
|
|
#include "DOMSVGAnimatedNumberList.h"
|
2006-04-14 19:09:39 +04:00
|
|
|
#include "nsSVGFilters.h"
|
2009-04-11 21:57:58 +04:00
|
|
|
#include "nsLayoutUtils.h"
|
2006-06-29 01:54:12 +04:00
|
|
|
#include "nsSVGUtils.h"
|
2007-01-08 19:48:56 +03:00
|
|
|
#include "nsStyleContext.h"
|
|
|
|
#include "nsIFrame.h"
|
2008-01-02 23:49:13 +03:00
|
|
|
#include "imgIContainer.h"
|
2008-08-07 18:03:58 +04:00
|
|
|
#include "nsNetUtil.h"
|
2013-02-18 03:28:47 +04:00
|
|
|
#include "mozilla/dom/SVGFilterElement.h"
|
2008-07-14 05:21:25 +04:00
|
|
|
#include "nsSVGString.h"
|
2012-09-22 23:26:05 +04:00
|
|
|
#include "SVGContentUtils.h"
|
2013-01-15 16:22:03 +04:00
|
|
|
#include <algorithm>
|
2013-03-07 11:17:00 +04:00
|
|
|
#include "mozilla/dom/SVGAnimatedLength.h"
|
2013-02-12 14:01:17 +04:00
|
|
|
#include "mozilla/dom/SVGComponentTransferFunctionElement.h"
|
2013-03-15 12:20:30 +04:00
|
|
|
#include "mozilla/dom/SVGFEDistantLightElement.h"
|
2013-02-12 14:10:24 +04:00
|
|
|
#include "mozilla/dom/SVGFEFuncAElementBinding.h"
|
|
|
|
#include "mozilla/dom/SVGFEFuncBElementBinding.h"
|
|
|
|
#include "mozilla/dom/SVGFEFuncGElementBinding.h"
|
|
|
|
#include "mozilla/dom/SVGFEFuncRElementBinding.h"
|
2013-03-14 01:41:20 +04:00
|
|
|
#include "mozilla/dom/SVGFEPointLightElement.h"
|
2013-03-25 10:26:04 +04:00
|
|
|
#include "mozilla/dom/SVGFESpotLightElement.h"
|
2008-07-14 05:21:25 +04:00
|
|
|
|
2013-03-25 10:26:04 +04:00
|
|
|
#if defined(XP_WIN)
|
2008-01-08 01:23:01 +03:00
|
|
|
// Prevent Windows redefining LoadImage
|
|
|
|
#undef LoadImage
|
|
|
|
#endif
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2010-12-03 19:40:23 +03:00
|
|
|
using namespace mozilla;
|
2010-12-05 14:37:45 +03:00
|
|
|
using namespace mozilla::dom;
|
2013-11-27 15:25:29 +04:00
|
|
|
using namespace mozilla::gfx;
|
2012-04-13 11:01:55 +04:00
|
|
|
|
2007-07-26 10:57:42 +04:00
|
|
|
//--------------------Filter Element Base Class-----------------------
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2007-07-26 10:57:42 +04:00
|
|
|
nsSVGElement::LengthInfo nsSVGFE::sLengthInfo[4] =
|
2006-07-28 22:10:48 +04:00
|
|
|
{
|
2012-09-22 23:26:05 +04:00
|
|
|
{ &nsGkAtoms::x, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, SVGContentUtils::X },
|
|
|
|
{ &nsGkAtoms::y, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, SVGContentUtils::Y },
|
|
|
|
{ &nsGkAtoms::width, 100, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, SVGContentUtils::X },
|
|
|
|
{ &nsGkAtoms::height, 100, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE, SVGContentUtils::Y }
|
2006-07-28 22:10:48 +04:00
|
|
|
};
|
|
|
|
|
2005-09-07 02:30:40 +04:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISupports methods
|
|
|
|
|
2007-07-26 10:57:42 +04:00
|
|
|
NS_IMPL_ADDREF_INHERITED(nsSVGFE,nsSVGFEBase)
|
|
|
|
NS_IMPL_RELEASE_INHERITED(nsSVGFE,nsSVGFEBase)
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2007-07-26 10:57:42 +04:00
|
|
|
NS_INTERFACE_MAP_BEGIN(nsSVGFE)
|
2008-02-18 10:29:00 +03:00
|
|
|
// nsISupports is an ambiguous base of nsSVGFE so we have to work
|
|
|
|
// around that
|
|
|
|
if ( aIID.Equals(NS_GET_IID(nsSVGFE)) )
|
2008-02-20 05:11:53 +03:00
|
|
|
foundInterface = static_cast<nsISupports*>(static_cast<void*>(this));
|
2008-02-18 10:29:00 +03:00
|
|
|
else
|
2007-07-26 10:57:42 +04:00
|
|
|
NS_INTERFACE_MAP_END_INHERITING(nsSVGFEBase)
|
2005-09-07 02:30:40 +04:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// Implementation
|
|
|
|
|
2008-02-18 10:29:00 +03:00
|
|
|
void
|
2009-01-22 03:56:51 +03:00
|
|
|
nsSVGFE::GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources)
|
2008-02-18 10:29:00 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-01-08 13:30:03 +04:00
|
|
|
bool
|
|
|
|
nsSVGFE::OutputIsTainted(const nsTArray<bool>& aInputsAreTainted,
|
|
|
|
nsIPrincipal* aReferencePrincipal)
|
|
|
|
{
|
|
|
|
// This is the default implementation for OutputIsTainted.
|
|
|
|
// Our output is tainted if we have at least one tainted input.
|
|
|
|
for (uint32_t i = 0; i < aInputsAreTainted.Length(); i++) {
|
|
|
|
if (aInputsAreTainted[i]) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2011-11-19 21:53:52 +04:00
|
|
|
bool
|
2012-08-22 19:56:38 +04:00
|
|
|
nsSVGFE::AttributeAffectsRendering(int32_t aNameSpaceID,
|
2011-11-19 21:53:52 +04:00
|
|
|
nsIAtom* aAttribute) const
|
|
|
|
{
|
|
|
|
return aNameSpaceID == kNameSpaceID_None &&
|
|
|
|
(aAttribute == nsGkAtoms::x ||
|
|
|
|
aAttribute == nsGkAtoms::y ||
|
|
|
|
aAttribute == nsGkAtoms::width ||
|
|
|
|
aAttribute == nsGkAtoms::height ||
|
|
|
|
aAttribute == nsGkAtoms::result);
|
|
|
|
}
|
|
|
|
|
2013-03-07 11:17:00 +04:00
|
|
|
already_AddRefed<SVGAnimatedLength>
|
|
|
|
nsSVGFE::X()
|
|
|
|
{
|
|
|
|
return mLengthAttributes[ATTR_X].ToDOMAnimatedLength(this);
|
2007-07-26 10:57:42 +04:00
|
|
|
}
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-03-07 11:17:00 +04:00
|
|
|
already_AddRefed<SVGAnimatedLength>
|
|
|
|
nsSVGFE::Y()
|
|
|
|
{
|
|
|
|
return mLengthAttributes[ATTR_Y].ToDOMAnimatedLength(this);
|
2005-09-07 02:30:40 +04:00
|
|
|
}
|
|
|
|
|
2013-03-07 11:17:00 +04:00
|
|
|
already_AddRefed<SVGAnimatedLength>
|
|
|
|
nsSVGFE::Width()
|
|
|
|
{
|
|
|
|
return mLengthAttributes[ATTR_WIDTH].ToDOMAnimatedLength(this);
|
2007-07-26 10:57:42 +04:00
|
|
|
}
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-03-07 11:17:00 +04:00
|
|
|
already_AddRefed<SVGAnimatedLength>
|
|
|
|
nsSVGFE::Height()
|
|
|
|
{
|
|
|
|
return mLengthAttributes[ATTR_HEIGHT].ToDOMAnimatedLength(this);
|
2005-09-07 02:30:40 +04:00
|
|
|
}
|
|
|
|
|
2013-06-15 02:37:27 +04:00
|
|
|
already_AddRefed<SVGAnimatedString>
|
2013-03-07 11:17:00 +04:00
|
|
|
nsSVGFE::Result()
|
|
|
|
{
|
|
|
|
return GetResultImageName().ToDOMAnimatedString(this);
|
2005-09-07 02:30:40 +04:00
|
|
|
}
|
|
|
|
|
2011-08-20 17:02:41 +04:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsIContent methods
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_IMETHODIMP_(bool)
|
2011-08-20 17:02:41 +04:00
|
|
|
nsSVGFE::IsAttributeMapped(const nsIAtom* name) const
|
|
|
|
{
|
|
|
|
static const MappedAttributeEntry* const map[] = {
|
|
|
|
sFiltersMap
|
|
|
|
};
|
|
|
|
|
2011-12-18 14:09:27 +04:00
|
|
|
return FindAttributeDependence(name, map) ||
|
2011-08-20 17:02:41 +04:00
|
|
|
nsSVGFEBase::IsAttributeMapped(name);
|
|
|
|
}
|
|
|
|
|
2006-07-28 22:10:48 +04:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsSVGElement methods
|
|
|
|
|
2013-11-27 15:25:29 +04:00
|
|
|
|
|
|
|
bool
|
|
|
|
nsSVGFE::StyleIsSetToSRGB()
|
|
|
|
{
|
|
|
|
nsIFrame* frame = GetPrimaryFrame();
|
|
|
|
if (!frame) return false;
|
|
|
|
|
|
|
|
nsStyleContext* style = frame->StyleContext();
|
|
|
|
return style->StyleSVG()->mColorInterpolationFilters ==
|
|
|
|
NS_STYLE_COLOR_INTERPOLATION_SRGB;
|
|
|
|
}
|
|
|
|
|
2012-03-03 13:21:09 +04:00
|
|
|
/* virtual */ bool
|
|
|
|
nsSVGFE::HasValidDimensions() const
|
|
|
|
{
|
2013-03-07 11:17:00 +04:00
|
|
|
return (!mLengthAttributes[ATTR_WIDTH].IsExplicitlySet() ||
|
|
|
|
mLengthAttributes[ATTR_WIDTH].GetAnimValInSpecifiedUnits() > 0) &&
|
|
|
|
(!mLengthAttributes[ATTR_HEIGHT].IsExplicitlySet() ||
|
|
|
|
mLengthAttributes[ATTR_HEIGHT].GetAnimValInSpecifiedUnits() > 0);
|
2012-03-03 13:21:09 +04:00
|
|
|
}
|
|
|
|
|
2013-11-27 15:25:29 +04:00
|
|
|
Size
|
|
|
|
nsSVGFE::GetKernelUnitLength(nsSVGFilterInstance* aInstance,
|
|
|
|
nsSVGNumberPair *aKernelUnitLength)
|
|
|
|
{
|
|
|
|
if (!aKernelUnitLength->IsExplicitlySet()) {
|
|
|
|
return Size(1, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
float kernelX = aInstance->GetPrimitiveNumber(SVGContentUtils::X,
|
|
|
|
aKernelUnitLength,
|
|
|
|
nsSVGNumberPair::eFirst);
|
|
|
|
float kernelY = aInstance->GetPrimitiveNumber(SVGContentUtils::Y,
|
|
|
|
aKernelUnitLength,
|
|
|
|
nsSVGNumberPair::eSecond);
|
|
|
|
return Size(kernelX, kernelY);
|
|
|
|
}
|
|
|
|
|
2007-07-26 10:57:42 +04:00
|
|
|
nsSVGElement::LengthAttributesInfo
|
|
|
|
nsSVGFE::GetLengthInfo()
|
2006-07-28 22:10:48 +04:00
|
|
|
{
|
2007-07-26 10:57:42 +04:00
|
|
|
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
|
2011-10-11 09:50:08 +04:00
|
|
|
ArrayLength(sLengthInfo));
|
2006-07-28 22:10:48 +04:00
|
|
|
}
|
|
|
|
|
2013-02-12 13:56:55 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
nsSVGElement::NumberListInfo SVGComponentTransferFunctionElement::sNumberListInfo[1] =
|
2010-12-03 19:40:23 +03:00
|
|
|
{
|
|
|
|
{ &nsGkAtoms::tableValues }
|
|
|
|
};
|
|
|
|
|
2013-02-12 13:56:55 +04:00
|
|
|
nsSVGElement::NumberInfo SVGComponentTransferFunctionElement::sNumberInfo[5] =
|
2006-07-28 22:10:48 +04:00
|
|
|
{
|
2011-10-17 18:59:28 +04:00
|
|
|
{ &nsGkAtoms::slope, 1, false },
|
|
|
|
{ &nsGkAtoms::intercept, 0, false },
|
|
|
|
{ &nsGkAtoms::amplitude, 1, false },
|
|
|
|
{ &nsGkAtoms::exponent, 1, false },
|
|
|
|
{ &nsGkAtoms::offset, 0, false }
|
2005-09-07 02:30:40 +04:00
|
|
|
};
|
|
|
|
|
2013-02-12 13:56:55 +04:00
|
|
|
nsSVGEnumMapping SVGComponentTransferFunctionElement::sTypeMap[] = {
|
2007-08-28 03:11:14 +04:00
|
|
|
{&nsGkAtoms::identity,
|
2013-03-18 21:54:04 +04:00
|
|
|
SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY},
|
2007-08-28 03:11:14 +04:00
|
|
|
{&nsGkAtoms::table,
|
2013-03-18 21:54:04 +04:00
|
|
|
SVG_FECOMPONENTTRANSFER_TYPE_TABLE},
|
2007-08-28 03:11:14 +04:00
|
|
|
{&nsGkAtoms::discrete,
|
2013-03-18 21:54:04 +04:00
|
|
|
SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE},
|
2007-08-28 03:11:14 +04:00
|
|
|
{&nsGkAtoms::linear,
|
2013-03-18 21:54:04 +04:00
|
|
|
SVG_FECOMPONENTTRANSFER_TYPE_LINEAR},
|
2007-08-28 03:11:14 +04:00
|
|
|
{&nsGkAtoms::gamma,
|
2013-03-18 21:54:04 +04:00
|
|
|
SVG_FECOMPONENTTRANSFER_TYPE_GAMMA},
|
2012-07-30 18:20:58 +04:00
|
|
|
{nullptr, 0}
|
2007-08-28 03:11:14 +04:00
|
|
|
};
|
|
|
|
|
2013-02-12 13:56:55 +04:00
|
|
|
nsSVGElement::EnumInfo SVGComponentTransferFunctionElement::sEnumInfo[1] =
|
2007-08-28 03:11:14 +04:00
|
|
|
{
|
|
|
|
{ &nsGkAtoms::type,
|
|
|
|
sTypeMap,
|
2013-03-18 21:54:04 +04:00
|
|
|
SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY
|
2007-08-28 03:11:14 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2005-09-07 02:30:40 +04:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISupports methods
|
|
|
|
|
2013-02-12 13:56:55 +04:00
|
|
|
NS_IMPL_ADDREF_INHERITED(SVGComponentTransferFunctionElement,SVGComponentTransferFunctionElementBase)
|
|
|
|
NS_IMPL_RELEASE_INHERITED(SVGComponentTransferFunctionElement,SVGComponentTransferFunctionElementBase)
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-02-12 13:56:55 +04:00
|
|
|
NS_INTERFACE_MAP_BEGIN(SVGComponentTransferFunctionElement)
|
2008-02-20 05:11:53 +03:00
|
|
|
// nsISupports is an ambiguous base of nsSVGFE so we have to work
|
|
|
|
// around that
|
2013-02-12 13:56:55 +04:00
|
|
|
if ( aIID.Equals(NS_GET_IID(SVGComponentTransferFunctionElement)) )
|
2008-02-20 05:11:53 +03:00
|
|
|
foundInterface = static_cast<nsISupports*>(static_cast<void*>(this));
|
|
|
|
else
|
2013-02-12 13:56:55 +04:00
|
|
|
NS_INTERFACE_MAP_END_INHERITING(SVGComponentTransferFunctionElementBase)
|
2005-09-07 02:30:40 +04:00
|
|
|
|
|
|
|
|
2011-11-19 21:53:52 +04:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsFEUnstyledElement methods
|
|
|
|
|
|
|
|
bool
|
2013-02-12 13:56:55 +04:00
|
|
|
SVGComponentTransferFunctionElement::AttributeAffectsRendering(int32_t aNameSpaceID,
|
2013-03-18 21:54:04 +04:00
|
|
|
nsIAtom* aAttribute) const
|
2011-11-19 21:53:52 +04:00
|
|
|
{
|
|
|
|
return aNameSpaceID == kNameSpaceID_None &&
|
|
|
|
(aAttribute == nsGkAtoms::tableValues ||
|
|
|
|
aAttribute == nsGkAtoms::slope ||
|
|
|
|
aAttribute == nsGkAtoms::intercept ||
|
|
|
|
aAttribute == nsGkAtoms::amplitude ||
|
|
|
|
aAttribute == nsGkAtoms::exponent ||
|
|
|
|
aAttribute == nsGkAtoms::offset ||
|
|
|
|
aAttribute == nsGkAtoms::type);
|
|
|
|
}
|
|
|
|
|
2005-09-07 02:30:40 +04:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2013-07-01 11:02:46 +04:00
|
|
|
already_AddRefed<SVGAnimatedEnumeration>
|
2013-02-12 14:10:24 +04:00
|
|
|
SVGComponentTransferFunctionElement::Type()
|
|
|
|
{
|
|
|
|
return mEnumAttributes[TYPE].ToDOMAnimatedEnum(this);
|
|
|
|
}
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-02-12 14:10:24 +04:00
|
|
|
already_AddRefed<DOMSVGAnimatedNumberList>
|
|
|
|
SVGComponentTransferFunctionElement::TableValues()
|
|
|
|
{
|
|
|
|
return DOMSVGAnimatedNumberList::GetDOMWrapper(
|
|
|
|
&mNumberListAttributes[TABLEVALUES], this, TABLEVALUES);
|
|
|
|
}
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-07-01 11:03:04 +04:00
|
|
|
already_AddRefed<SVGAnimatedNumber>
|
2013-02-12 14:10:24 +04:00
|
|
|
SVGComponentTransferFunctionElement::Slope()
|
|
|
|
{
|
|
|
|
return mNumberAttributes[SLOPE].ToDOMAnimatedNumber(this);
|
|
|
|
}
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-07-01 11:03:04 +04:00
|
|
|
already_AddRefed<SVGAnimatedNumber>
|
2013-02-12 14:10:24 +04:00
|
|
|
SVGComponentTransferFunctionElement::Intercept()
|
|
|
|
{
|
|
|
|
return mNumberAttributes[INTERCEPT].ToDOMAnimatedNumber(this);
|
|
|
|
}
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-07-01 11:03:04 +04:00
|
|
|
already_AddRefed<SVGAnimatedNumber>
|
2013-02-12 14:10:24 +04:00
|
|
|
SVGComponentTransferFunctionElement::Amplitude()
|
|
|
|
{
|
|
|
|
return mNumberAttributes[AMPLITUDE].ToDOMAnimatedNumber(this);
|
|
|
|
}
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-07-01 11:03:04 +04:00
|
|
|
already_AddRefed<SVGAnimatedNumber>
|
2013-02-12 14:10:24 +04:00
|
|
|
SVGComponentTransferFunctionElement::Exponent()
|
|
|
|
{
|
|
|
|
return mNumberAttributes[EXPONENT].ToDOMAnimatedNumber(this);
|
|
|
|
}
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-07-01 11:03:04 +04:00
|
|
|
already_AddRefed<SVGAnimatedNumber>
|
2013-02-12 14:10:24 +04:00
|
|
|
SVGComponentTransferFunctionElement::Offset()
|
|
|
|
{
|
|
|
|
return mNumberAttributes[OFFSET].ToDOMAnimatedNumber(this);
|
|
|
|
}
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-11-27 15:25:29 +04:00
|
|
|
AttributeMap
|
|
|
|
SVGComponentTransferFunctionElement::ComputeAttributes()
|
2005-09-07 02:30:40 +04:00
|
|
|
{
|
2013-11-27 15:25:29 +04:00
|
|
|
uint32_t type = mEnumAttributes[TYPE].GetAnimValue();
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2006-07-28 22:10:48 +04:00
|
|
|
float slope, intercept, amplitude, exponent, offset;
|
|
|
|
GetAnimatedNumberValues(&slope, &intercept, &litude,
|
2012-07-30 18:20:58 +04:00
|
|
|
&exponent, &offset, nullptr);
|
2006-07-28 22:10:48 +04:00
|
|
|
|
2010-12-03 19:40:23 +03:00
|
|
|
const SVGNumberList &tableValues =
|
2011-07-01 11:19:52 +04:00
|
|
|
mNumberListAttributes[TABLEVALUES].GetAnimValue();
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-11-27 15:25:29 +04:00
|
|
|
AttributeMap map;
|
|
|
|
map.Set(eComponentTransferFunctionType, type);
|
|
|
|
map.Set(eComponentTransferFunctionSlope, slope);
|
|
|
|
map.Set(eComponentTransferFunctionIntercept, intercept);
|
|
|
|
map.Set(eComponentTransferFunctionAmplitude, amplitude);
|
|
|
|
map.Set(eComponentTransferFunctionExponent, exponent);
|
|
|
|
map.Set(eComponentTransferFunctionOffset, offset);
|
|
|
|
if (tableValues.Length()) {
|
|
|
|
map.Set(eComponentTransferFunctionTableValues, &tableValues[0], tableValues.Length());
|
|
|
|
} else {
|
|
|
|
map.Set(eComponentTransferFunctionTableValues, nullptr, 0);
|
2005-09-07 02:30:40 +04:00
|
|
|
}
|
2013-11-27 15:25:29 +04:00
|
|
|
return map;
|
2005-09-07 02:30:40 +04:00
|
|
|
}
|
|
|
|
|
2006-07-28 22:10:48 +04:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsSVGElement methods
|
|
|
|
|
2010-12-03 19:40:23 +03:00
|
|
|
nsSVGElement::NumberListAttributesInfo
|
2013-02-12 13:56:55 +04:00
|
|
|
SVGComponentTransferFunctionElement::GetNumberListInfo()
|
2010-12-03 19:40:23 +03:00
|
|
|
{
|
|
|
|
return NumberListAttributesInfo(mNumberListAttributes, sNumberListInfo,
|
2011-10-11 09:50:08 +04:00
|
|
|
ArrayLength(sNumberListInfo));
|
2010-12-03 19:40:23 +03:00
|
|
|
}
|
|
|
|
|
2007-09-18 16:09:26 +04:00
|
|
|
nsSVGElement::EnumAttributesInfo
|
2013-02-12 13:56:55 +04:00
|
|
|
SVGComponentTransferFunctionElement::GetEnumInfo()
|
2007-09-18 16:09:26 +04:00
|
|
|
{
|
|
|
|
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
|
2011-10-11 09:50:08 +04:00
|
|
|
ArrayLength(sEnumInfo));
|
2007-09-18 16:09:26 +04:00
|
|
|
}
|
|
|
|
|
2006-07-28 22:10:48 +04:00
|
|
|
nsSVGElement::NumberAttributesInfo
|
2013-02-12 13:56:55 +04:00
|
|
|
SVGComponentTransferFunctionElement::GetNumberInfo()
|
2006-07-28 22:10:48 +04:00
|
|
|
{
|
|
|
|
return NumberAttributesInfo(mNumberAttributes, sNumberInfo,
|
2011-10-11 09:50:08 +04:00
|
|
|
ArrayLength(sNumberInfo));
|
2006-07-28 22:10:48 +04:00
|
|
|
}
|
|
|
|
|
2013-02-12 14:10:24 +04:00
|
|
|
/* virtual */ JSObject*
|
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The
rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 17:13:33 +03:00
|
|
|
SVGFEFuncRElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
2013-02-12 14:10:24 +04:00
|
|
|
{
|
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The
rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 17:13:33 +03:00
|
|
|
return SVGFEFuncRElementBinding::Wrap(aCx, this, aGivenProto);
|
2013-02-12 14:10:24 +04:00
|
|
|
}
|
|
|
|
|
2013-02-12 13:56:55 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-02-12 13:56:55 +04:00
|
|
|
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(FEFuncR)
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-02-12 13:56:55 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEFuncRElement)
|
|
|
|
|
2013-02-12 14:10:24 +04:00
|
|
|
/* virtual */ JSObject*
|
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The
rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 17:13:33 +03:00
|
|
|
SVGFEFuncGElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
2013-02-12 14:10:24 +04:00
|
|
|
{
|
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The
rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 17:13:33 +03:00
|
|
|
return SVGFEFuncGElementBinding::Wrap(aCx, this, aGivenProto);
|
2013-02-12 14:10:24 +04:00
|
|
|
}
|
|
|
|
|
2013-02-12 13:56:55 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-02-12 13:56:55 +04:00
|
|
|
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(FEFuncG)
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-02-12 13:56:55 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-02-12 13:56:55 +04:00
|
|
|
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEFuncGElement)
|
|
|
|
|
2013-02-12 14:10:24 +04:00
|
|
|
/* virtual */ JSObject*
|
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The
rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 17:13:33 +03:00
|
|
|
SVGFEFuncBElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
2013-02-12 14:10:24 +04:00
|
|
|
{
|
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The
rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 17:13:33 +03:00
|
|
|
return SVGFEFuncBElementBinding::Wrap(aCx, this, aGivenProto);
|
2013-02-12 14:10:24 +04:00
|
|
|
}
|
|
|
|
|
2013-02-12 13:56:55 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(FEFuncB)
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-02-12 13:56:55 +04:00
|
|
|
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEFuncBElement)
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-02-12 14:10:24 +04:00
|
|
|
/* virtual */ JSObject*
|
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The
rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 17:13:33 +03:00
|
|
|
SVGFEFuncAElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
2013-02-12 14:10:24 +04:00
|
|
|
{
|
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The
rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 17:13:33 +03:00
|
|
|
return SVGFEFuncAElementBinding::Wrap(aCx, this, aGivenProto);
|
2013-02-12 14:10:24 +04:00
|
|
|
}
|
|
|
|
|
2013-02-12 13:56:55 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(FEFuncA)
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEFuncAElement)
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-02-12 13:56:55 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2013-03-25 10:26:05 +04:00
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//
|
2011-07-01 11:19:52 +04:00
|
|
|
nsSVGElement::NumberInfo nsSVGFELightingElement::sNumberInfo[4] =
|
2007-06-27 23:02:58 +04:00
|
|
|
{
|
2011-10-17 18:59:28 +04:00
|
|
|
{ &nsGkAtoms::surfaceScale, 1, false },
|
|
|
|
{ &nsGkAtoms::diffuseConstant, 1, false },
|
|
|
|
{ &nsGkAtoms::specularConstant, 1, false },
|
|
|
|
{ &nsGkAtoms::specularExponent, 1, false }
|
2011-07-01 11:19:52 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
nsSVGElement::NumberPairInfo nsSVGFELightingElement::sNumberPairInfo[1] =
|
|
|
|
{
|
|
|
|
{ &nsGkAtoms::kernelUnitLength, 0, 0 }
|
2007-07-26 10:57:42 +04:00
|
|
|
};
|
2007-06-27 23:02:58 +04:00
|
|
|
|
2008-06-14 13:01:02 +04:00
|
|
|
nsSVGElement::StringInfo nsSVGFELightingElement::sStringInfo[2] =
|
|
|
|
{
|
2011-10-17 18:59:28 +04:00
|
|
|
{ &nsGkAtoms::result, kNameSpaceID_None, true },
|
|
|
|
{ &nsGkAtoms::in, kNameSpaceID_None, true }
|
2008-06-14 13:01:02 +04:00
|
|
|
};
|
|
|
|
|
2007-08-31 18:44:28 +04:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISupports methods
|
|
|
|
|
|
|
|
NS_IMPL_ADDREF_INHERITED(nsSVGFELightingElement,nsSVGFELightingElementBase)
|
|
|
|
NS_IMPL_RELEASE_INHERITED(nsSVGFELightingElement,nsSVGFELightingElementBase)
|
|
|
|
|
2008-07-23 06:15:27 +04:00
|
|
|
NS_INTERFACE_MAP_BEGIN(nsSVGFELightingElement)
|
2007-08-31 18:44:28 +04:00
|
|
|
NS_INTERFACE_MAP_END_INHERITING(nsSVGFELightingElementBase)
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// Implementation
|
2007-06-27 23:02:58 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_IMETHODIMP_(bool)
|
2007-07-26 10:57:42 +04:00
|
|
|
nsSVGFELightingElement::IsAttributeMapped(const nsIAtom* name) const
|
2007-06-27 23:02:58 +04:00
|
|
|
{
|
2007-07-26 10:57:42 +04:00
|
|
|
static const MappedAttributeEntry* const map[] = {
|
|
|
|
sLightingEffectsMap
|
|
|
|
};
|
2007-06-27 23:02:58 +04:00
|
|
|
|
2011-12-18 14:09:27 +04:00
|
|
|
return FindAttributeDependence(name, map) ||
|
2007-07-26 10:57:42 +04:00
|
|
|
nsSVGFELightingElementBase::IsAttributeMapped(name);
|
2007-06-27 23:02:58 +04:00
|
|
|
}
|
|
|
|
|
2008-02-18 10:29:00 +03:00
|
|
|
void
|
2009-01-22 03:56:51 +03:00
|
|
|
nsSVGFELightingElement::GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources)
|
2008-02-18 04:10:14 +03:00
|
|
|
{
|
2009-01-22 03:56:51 +03:00
|
|
|
aSources.AppendElement(nsSVGStringInfo(&mStringAttributes[IN1], this));
|
2008-02-18 10:29:00 +03:00
|
|
|
}
|
|
|
|
|
2013-11-27 15:25:29 +04:00
|
|
|
AttributeMap
|
|
|
|
nsSVGFELightingElement::ComputeLightAttributes(nsSVGFilterInstance* aInstance)
|
|
|
|
{
|
2013-03-14 01:41:20 +04:00
|
|
|
// find specified light
|
2011-09-27 11:54:58 +04:00
|
|
|
for (nsCOMPtr<nsIContent> child = nsINode::GetFirstChild();
|
|
|
|
child;
|
|
|
|
child = child->GetNextSibling()) {
|
2015-03-03 14:08:59 +03:00
|
|
|
if (child->IsAnyOfSVGElements(nsGkAtoms::feDistantLight,
|
|
|
|
nsGkAtoms::fePointLight,
|
|
|
|
nsGkAtoms::feSpotLight)) {
|
2013-11-27 15:25:29 +04:00
|
|
|
return static_cast<SVGFELightElement*>(child.get())->ComputeLightAttributes(aInstance);
|
2007-06-27 23:02:58 +04:00
|
|
|
}
|
2007-07-26 10:57:42 +04:00
|
|
|
}
|
2007-06-27 23:02:58 +04:00
|
|
|
|
2013-11-27 15:25:29 +04:00
|
|
|
AttributeMap map;
|
|
|
|
map.Set(eLightType, (uint32_t)eLightTypeNone);
|
|
|
|
return map;
|
|
|
|
}
|
2007-06-27 23:02:58 +04:00
|
|
|
|
2013-11-27 15:25:29 +04:00
|
|
|
FilterPrimitiveDescription
|
|
|
|
nsSVGFELightingElement::AddLightingAttributes(FilterPrimitiveDescription aDescription,
|
|
|
|
nsSVGFilterInstance* aInstance)
|
|
|
|
{
|
|
|
|
nsIFrame* frame = GetPrimaryFrame();
|
|
|
|
if (!frame) {
|
2014-03-20 06:12:43 +04:00
|
|
|
return FilterPrimitiveDescription(PrimitiveType::Empty);
|
2007-06-27 23:02:58 +04:00
|
|
|
}
|
|
|
|
|
2013-11-27 15:25:29 +04:00
|
|
|
nsStyleContext* style = frame->StyleContext();
|
2014-10-17 15:53:16 +04:00
|
|
|
Color color(Color::FromABGR(style->StyleSVGReset()->mLightingColor));
|
|
|
|
color.a = 1.f;
|
2013-11-27 15:25:29 +04:00
|
|
|
float surfaceScale = mNumberAttributes[SURFACE_SCALE].GetAnimValue();
|
|
|
|
Size kernelUnitLength =
|
|
|
|
GetKernelUnitLength(aInstance, &mNumberPairAttributes[KERNEL_UNIT_LENGTH]);
|
|
|
|
|
|
|
|
FilterPrimitiveDescription& descr = aDescription;
|
|
|
|
descr.Attributes().Set(eLightingLight, ComputeLightAttributes(aInstance));
|
|
|
|
descr.Attributes().Set(eLightingSurfaceScale, surfaceScale);
|
|
|
|
descr.Attributes().Set(eLightingKernelUnitLength, kernelUnitLength);
|
|
|
|
descr.Attributes().Set(eLightingColor, color);
|
|
|
|
return descr;
|
2007-06-27 23:02:58 +04:00
|
|
|
}
|
|
|
|
|
2011-11-19 21:53:52 +04:00
|
|
|
bool
|
2012-08-22 19:56:38 +04:00
|
|
|
nsSVGFELightingElement::AttributeAffectsRendering(int32_t aNameSpaceID,
|
2011-11-19 21:53:52 +04:00
|
|
|
nsIAtom* aAttribute) const
|
|
|
|
{
|
|
|
|
return nsSVGFELightingElementBase::AttributeAffectsRendering(aNameSpaceID, aAttribute) ||
|
|
|
|
(aNameSpaceID == kNameSpaceID_None &&
|
|
|
|
(aAttribute == nsGkAtoms::in ||
|
|
|
|
aAttribute == nsGkAtoms::surfaceScale ||
|
|
|
|
aAttribute == nsGkAtoms::kernelUnitLength));
|
|
|
|
}
|
|
|
|
|
2008-06-14 13:01:02 +04:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsSVGElement methods
|
|
|
|
|
|
|
|
nsSVGElement::NumberAttributesInfo
|
|
|
|
nsSVGFELightingElement::GetNumberInfo()
|
|
|
|
{
|
|
|
|
return NumberAttributesInfo(mNumberAttributes, sNumberInfo,
|
2011-10-11 09:50:08 +04:00
|
|
|
ArrayLength(sNumberInfo));
|
2008-06-14 13:01:02 +04:00
|
|
|
}
|
|
|
|
|
2011-07-01 11:19:52 +04:00
|
|
|
nsSVGElement::NumberPairAttributesInfo
|
|
|
|
nsSVGFELightingElement::GetNumberPairInfo()
|
|
|
|
{
|
|
|
|
return NumberPairAttributesInfo(mNumberPairAttributes, sNumberPairInfo,
|
2011-10-11 09:50:08 +04:00
|
|
|
ArrayLength(sNumberPairInfo));
|
2011-07-01 11:19:52 +04:00
|
|
|
}
|
|
|
|
|
2008-06-14 13:01:02 +04:00
|
|
|
nsSVGElement::StringAttributesInfo
|
|
|
|
nsSVGFELightingElement::GetStringInfo()
|
|
|
|
{
|
|
|
|
return StringAttributesInfo(mStringAttributes, sStringInfo,
|
2011-10-11 09:50:08 +04:00
|
|
|
ArrayLength(sStringInfo));
|
2008-06-14 13:01:02 +04:00
|
|
|
}
|