本文整理汇总了C++中nsSMILValue::IsNull方法的典型用法代码示例。如果您正苦于以下问题:C++ nsSMILValue::IsNull方法的具体用法?C++ nsSMILValue::IsNull怎么用?C++ nsSMILValue::IsNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsSMILValue
的用法示例。
在下文中一共展示了nsSMILValue::IsNull方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseValue
nsresult
nsSVGTransformSMILAttr::ValueFromString(const nsAString& aStr,
const nsISMILAnimationElement* aSrcElement,
nsSMILValue& aValue,
PRBool& aPreventCachingOfSandwich) const
{
NS_ENSURE_TRUE(aSrcElement, NS_ERROR_FAILURE);
NS_ASSERTION(aValue.IsNull(),
"aValue should have been cleared before calling ValueFromString");
const nsAttrValue* typeAttr = aSrcElement->GetAnimAttr(nsGkAtoms::type);
const nsIAtom* transformType = nsGkAtoms::translate;
if (typeAttr) {
if (typeAttr->Type() != nsAttrValue::eAtom) {
// Recognized values of |type| are parsed as an atom -- so if we have
// something other than an atom, then it means our |type| was invalid.
return NS_ERROR_FAILURE;
}
transformType = typeAttr->GetAtomValue();
}
ParseValue(aStr, transformType, aValue);
aPreventCachingOfSandwich = PR_FALSE;
return aValue.IsNull() ? NS_ERROR_FAILURE : NS_OK;
}
示例2: ParseValue
nsresult
nsSVGAnimatedTransformList::SMILAnimatedTransformList::ValueFromString(
const nsAString& aStr,
const dom::SVGAnimationElement* aSrcElement,
nsSMILValue& aValue,
bool& aPreventCachingOfSandwich) const
{
NS_ENSURE_TRUE(aSrcElement, NS_ERROR_FAILURE);
MOZ_ASSERT(aValue.IsNull(),
"aValue should have been cleared before calling ValueFromString");
const nsAttrValue* typeAttr = aSrcElement->GetAnimAttr(nsGkAtoms::type);
const nsIAtom* transformType = nsGkAtoms::translate; // default val
if (typeAttr) {
if (typeAttr->Type() != nsAttrValue::eAtom) {
// Recognized values of |type| are parsed as an atom -- so if we have
// something other than an atom, then we know already our |type| is
// invalid.
return NS_ERROR_FAILURE;
}
transformType = typeAttr->GetAtomValue();
}
ParseValue(aStr, transformType, aValue);
aPreventCachingOfSandwich = false;
return aValue.IsNull() ? NS_ERROR_FAILURE : NS_OK;
}
示例3:
void
nsSMILFloatType::Init(nsSMILValue& aValue) const
{
NS_PRECONDITION(aValue.IsNull(), "Unexpected value type");
aValue.mU.mDouble = 0.0;
aValue.mType = this;
}
示例4:
void
SMILEnumType::Init(nsSMILValue& aValue) const
{
NS_PRECONDITION(aValue.IsNull(), "Unexpected value type");
aValue.mU.mUint = 0;
aValue.mType = this;
}
示例5: nsString
void
SMILStringType::Init(nsSMILValue& aValue) const
{
NS_PRECONDITION(aValue.IsNull(), "Unexpected value type");
aValue.mU.mPtr = new nsString();
aValue.mType = this;
}
示例6:
void
SMILBoolType::Init(nsSMILValue& aValue) const
{
NS_PRECONDITION(aValue.IsNull(), "Unexpected value type");
aValue.mU.mBool = false;
aValue.mType = this;
}
示例7: GetPresContextForElement
// static
void
nsSMILCSSValueType::ValueFromString(nsCSSPropertyID aPropID,
Element* aTargetElement,
const nsAString& aString,
nsSMILValue& aValue,
bool* aIsContextSensitive)
{
MOZ_ASSERT(aValue.IsNull(), "Outparam should be null-typed");
nsPresContext* presContext = GetPresContextForElement(aTargetElement);
if (!presContext) {
NS_WARNING("Not parsing animation value; unable to get PresContext");
return;
}
nsIDocument* doc = aTargetElement->GetUncomposedDoc();
if (doc && !nsStyleUtil::CSPAllowsInlineStyle(nullptr,
doc->NodePrincipal(),
doc->GetDocumentURI(),
0, aString, nullptr)) {
return;
}
StyleAnimationValue parsedValue;
if (ValueFromStringHelper(aPropID, aTargetElement, presContext,
aString, parsedValue, aIsContextSensitive)) {
sSingleton.Init(aValue);
aValue.mU.mPtr = new ValueWrapper(aPropID, parsedValue);
}
}
示例8:
void
SMILIntegerType::Init(nsSMILValue& aValue) const
{
NS_ABORT_IF_FALSE(aValue.IsNull(), "Unexpected value type");
aValue.mU.mInt = 0;
aValue.mType = this;
}
示例9:
void
SMILIntegerType::Init(nsSMILValue& aValue) const
{
MOZ_ASSERT(aValue.IsNull(), "Unexpected value type");
aValue.mU.mInt = 0;
aValue.mType = this;
}
示例10:
// Class methods
// -------------
void
nsSMILCSSValueType::Init(nsSMILValue& aValue) const
{
MOZ_ASSERT(aValue.IsNull(), "Unexpected SMIL value type");
aValue.mU.mPtr = nullptr;
aValue.mType = this;
}
示例11:
// Class methods
// -------------
void
nsSMILCSSValueType::Init(nsSMILValue& aValue) const
{
NS_ABORT_IF_FALSE(aValue.IsNull(), "Unexpected SMIL value type");
aValue.mU.mPtr = nsnull;
aValue.mType = this;
}
示例12: MotionSegmentArray
void
SVGMotionSMILType::Init(nsSMILValue& aValue) const
{
NS_ABORT_IF_FALSE(aValue.IsNull(), "Unexpected SMIL type");
aValue.mType = this;
aValue.mU.mPtr = new MotionSegmentArray(1);
}
示例13: MotionSegmentArray
void
SVGMotionSMILType::Init(nsSMILValue& aValue) const
{
MOZ_ASSERT(aValue.IsNull(), "Unexpected SMIL type");
aValue.mType = this;
aValue.mU.mPtr = new MotionSegmentArray(1);
}
示例14: val
void
nsSVGAnimatedTransformList::SMILAnimatedTransformList::ParseValue(
const nsAString& aSpec,
const nsIAtom* aTransformType,
nsSMILValue& aResult)
{
MOZ_ASSERT(aResult.IsNull(), "Unexpected type for SMIL value");
static_assert(SVGTransformSMILData::NUM_SIMPLE_PARAMS == 3,
"nsSVGSMILTransform constructor should be expecting array "
"with 3 params");
float params[3] = { 0.f };
int32_t numParsed = ParseParameterList(aSpec, params, 3);
uint16_t transformType;
if (aTransformType == nsGkAtoms::translate) {
// tx [ty=0]
if (numParsed != 1 && numParsed != 2)
return;
transformType = SVG_TRANSFORM_TRANSLATE;
} else if (aTransformType == nsGkAtoms::scale) {
// sx [sy=sx]
if (numParsed != 1 && numParsed != 2)
return;
if (numParsed == 1) {
params[1] = params[0];
}
transformType = SVG_TRANSFORM_SCALE;
} else if (aTransformType == nsGkAtoms::rotate) {
// r [cx=0 cy=0]
if (numParsed != 1 && numParsed != 3)
return;
transformType = SVG_TRANSFORM_ROTATE;
} else if (aTransformType == nsGkAtoms::skewX) {
// x-angle
if (numParsed != 1)
return;
transformType = SVG_TRANSFORM_SKEWX;
} else if (aTransformType == nsGkAtoms::skewY) {
// y-angle
if (numParsed != 1)
return;
transformType = SVG_TRANSFORM_SKEWY;
} else {
return;
}
nsSMILValue val(SVGTransformListSMILType::Singleton());
SVGTransformSMILData transform(transformType, params);
if (NS_FAILED(SVGTransformListSMILType::AppendTransform(transform, val))) {
return; // OOM
}
// Success! Populate our outparam with parsed value.
aResult.Swap(val);
}
示例15:
void
SVGNumberPairSMILType::Init(nsSMILValue& aValue) const
{
NS_ABORT_IF_FALSE(aValue.IsNull(), "Unexpected value type");
aValue.mU.mNumberPair[0] = 0;
aValue.mU.mNumberPair[1] = 0;
aValue.mType = this;
}