本文整理汇总了C++中nsAttrValue::ParseAtom方法的典型用法代码示例。如果您正苦于以下问题:C++ nsAttrValue::ParseAtom方法的具体用法?C++ nsAttrValue::ParseAtom怎么用?C++ nsAttrValue::ParseAtom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsAttrValue
的用法示例。
在下文中一共展示了nsAttrValue::ParseAtom方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseAttribute
bool
nsHTMLMenuItemElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
if (aNamespaceID == kNameSpaceID_None) {
if (aAttribute == nsGkAtoms::type) {
bool success = aResult.ParseEnumValue(aValue, kMenuItemTypeTable,
false);
if (success) {
mType = aResult.GetEnumValue();
} else {
mType = kMenuItemDefaultType->value;
}
return success;
}
if (aAttribute == nsGkAtoms::radiogroup) {
aResult.ParseAtom(aValue);
return true;
}
}
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aResult);
}
示例2: ParseAttribute
bool
nsStyledElementNotElementCSSInlineStyle::ParseAttribute(PRInt32 aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
if (aNamespaceID == kNameSpaceID_None) {
if (aAttribute == nsGkAtoms::style) {
SetMayHaveStyle();
ParseStyleAttribute(aValue, aResult, false);
return true;
}
if (aAttribute == nsGkAtoms::_class) {
SetFlags(NODE_MAY_HAVE_CLASS);
aResult.ParseAtomArray(aValue);
return true;
}
if (aAttribute == nsGkAtoms::id) {
// Store id as an atom. id="" means that the element has no id,
// not that it has an emptystring as the id.
RemoveFromIdTable();
if (aValue.IsEmpty()) {
ClearHasID();
return false;
}
aResult.ParseAtom(aValue);
SetHasID();
AddToIdTable(aResult.GetAtomValue());
return true;
}
}
return nsStyledElementBase::ParseAttribute(aNamespaceID, aAttribute, aValue,
aResult);
}
示例3: ParseAttribute
bool
SVGAnimationElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
if (aNamespaceID == kNameSpaceID_None) {
// Deal with target-related attributes here
if (aAttribute == nsGkAtoms::attributeName ||
aAttribute == nsGkAtoms::attributeType) {
aResult.ParseAtom(aValue);
AnimationNeedsResample();
return true;
}
nsresult rv = NS_ERROR_FAILURE;
// First let the animation function try to parse it...
bool foundMatch =
AnimationFunction().SetAttr(aAttribute, aValue, aResult, &rv);
// ... and if that didn't recognize the attribute, let the timed element
// try to parse it.
if (!foundMatch) {
foundMatch =
mTimedElement.SetAttr(aAttribute, aValue, aResult, this, &rv);
}
if (foundMatch) {
AnimationNeedsResample();
if (NS_FAILED(rv)) {
ReportAttributeParseFailure(OwnerDoc(), aAttribute, aValue);
return false;
}
return true;
}
}
return SVGAnimationElementBase::ParseAttribute(aNamespaceID, aAttribute,
aValue, aResult);
}
示例4: ParseAttribute
bool
HTMLMenuItemElement::ParseAttribute(int32_t aNamespaceID,
nsAtom* aAttribute,
const nsAString& aValue,
nsIPrincipal* aMaybeScriptedPrincipal,
nsAttrValue& aResult)
{
if (aNamespaceID == kNameSpaceID_None) {
if (aAttribute == nsGkAtoms::type) {
return aResult.ParseEnumValue(aValue, kMenuItemTypeTable, false,
kMenuItemDefaultType);
}
if (aAttribute == nsGkAtoms::radiogroup) {
aResult.ParseAtom(aValue);
return true;
}
}
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aMaybeScriptedPrincipal, aResult);
}
示例5: RemoveFromIdTable
bool
nsXMLElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
if (aAttribute == GetIDAttributeName() &&
aNamespaceID == kNameSpaceID_None) {
// Store id as an atom. id="" means that the element has no id,
// not that it has an emptystring as the id.
RemoveFromIdTable();
if (aValue.IsEmpty()) {
ClearHasID();
return false;
}
aResult.ParseAtom(aValue);
SetHasID();
AddToIdTable(aResult.GetAtomValue());
return true;
}
return false;
}