本文整理汇总了C++中nsAttrValue::ParseIntWithBounds方法的典型用法代码示例。如果您正苦于以下问题:C++ nsAttrValue::ParseIntWithBounds方法的具体用法?C++ nsAttrValue::ParseIntWithBounds怎么用?C++ nsAttrValue::ParseIntWithBounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsAttrValue
的用法示例。
在下文中一共展示了nsAttrValue::ParseIntWithBounds方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseAttribute
PRBool
nsHTMLPreElement::ParseAttribute(nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
if (aAttribute == nsHTMLAtoms::cols) {
return aResult.ParseIntWithBounds(aValue, 0);
}
if (aAttribute == nsHTMLAtoms::width) {
return aResult.ParseIntWithBounds(aValue, 0);
}
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
}
示例2: ParseBackgroundAttribute
bool
HTMLBodyElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
if (aNamespaceID == kNameSpaceID_None) {
if (aAttribute == nsGkAtoms::bgcolor ||
aAttribute == nsGkAtoms::text ||
aAttribute == nsGkAtoms::link ||
aAttribute == nsGkAtoms::alink ||
aAttribute == nsGkAtoms::vlink) {
return aResult.ParseColor(aValue);
}
if (aAttribute == nsGkAtoms::marginwidth ||
aAttribute == nsGkAtoms::marginheight ||
aAttribute == nsGkAtoms::topmargin ||
aAttribute == nsGkAtoms::bottommargin ||
aAttribute == nsGkAtoms::leftmargin ||
aAttribute == nsGkAtoms::rightmargin) {
return aResult.ParseIntWithBounds(aValue, 0);
}
}
return nsGenericHTMLElement::ParseBackgroundAttribute(aNamespaceID,
aAttribute, aValue,
aResult) ||
nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aResult);
}
示例3: ParseDivAlignValue
PRBool
nsHTMLDivElement::ParseAttribute(PRInt32 aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
if (aNamespaceID == kNameSpaceID_None) {
if (mNodeInfo->Equals(nsGkAtoms::marquee)) {
if ((aAttribute == nsGkAtoms::width) ||
(aAttribute == nsGkAtoms::height)) {
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
}
if (aAttribute == nsGkAtoms::bgcolor) {
return aResult.ParseColor(aValue, GetOwnerDoc());
}
if ((aAttribute == nsGkAtoms::hspace) ||
(aAttribute == nsGkAtoms::vspace)) {
return aResult.ParseIntWithBounds(aValue, 0);
}
}
if (mNodeInfo->Equals(nsGkAtoms::div) &&
aAttribute == nsGkAtoms::align) {
return ParseDivAlignValue(aValue, aResult);
}
}
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aResult);
}
示例4: ParseTableCellHAlignValue
PRBool
nsHTMLTableSectionElement::ParseAttribute(PRInt32 aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
if (aNamespaceID == kNameSpaceID_None) {
/* ignore these attributes, stored simply as strings
ch
*/
if (aAttribute == nsGkAtoms::charoff) {
return aResult.ParseIntWithBounds(aValue, 0);
}
if (aAttribute == nsGkAtoms::height) {
return aResult.ParseSpecialIntValue(aValue, PR_TRUE);
}
if (aAttribute == nsGkAtoms::align) {
return ParseTableCellHAlignValue(aValue, aResult);
}
if (aAttribute == nsGkAtoms::bgcolor) {
return aResult.ParseColor(aValue, GetOwnerDoc());
}
if (aAttribute == nsGkAtoms::valign) {
return ParseTableVAlignValue(aValue, aResult);
}
}
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aResult);
}
示例5: ParseTableCellHAlignValue
bool
nsHTMLTableColElement::ParseAttribute(PRInt32 aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
if (aNamespaceID == kNameSpaceID_None) {
/* ignore these attributes, stored simply as strings ch */
if (aAttribute == nsGkAtoms::charoff) {
return aResult.ParseSpecialIntValue(aValue);
}
if (aAttribute == nsGkAtoms::span) {
/* protection from unrealistic large colspan values */
return aResult.ParseIntWithBounds(aValue, 1, MAX_COLSPAN);
}
if (aAttribute == nsGkAtoms::width) {
return aResult.ParseSpecialIntValue(aValue);
}
if (aAttribute == nsGkAtoms::align) {
return ParseTableCellHAlignValue(aValue, aResult);
}
if (aAttribute == nsGkAtoms::valign) {
return ParseTableVAlignValue(aValue, aResult);
}
}
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aResult);
}
示例6: ParseAttribute
PRBool
nsHTMLTextAreaElement::ParseAttribute(PRInt32 aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
if (aNamespaceID == kNameSpaceID_None) {
if (aAttribute == nsGkAtoms::cols) {
return aResult.ParseIntWithBounds(aValue, 0);
}
if (aAttribute == nsGkAtoms::rows) {
return aResult.ParseIntWithBounds(aValue, 0);
}
}
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aResult);
}
示例7: ParseAttribute
PRBool
nsHTMLLIElement::ParseAttribute(nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
if (aAttribute == nsHTMLAtoms::type) {
return aResult.ParseEnumValue(aValue, kOrderedListItemTypeTable, PR_TRUE) ||
aResult.ParseEnumValue(aValue, kUnorderedListItemTypeTable);
}
if (aAttribute == nsHTMLAtoms::value) {
return aResult.ParseIntWithBounds(aValue, 0);
}
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
}
示例8: ParseAttribute
bool
nsHTMLSharedElement::ParseAttribute(PRInt32 aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
if (aNamespaceID == kNameSpaceID_None &&
mNodeInfo->Equals(nsGkAtoms::dir)) {
if (aAttribute == nsGkAtoms::type) {
return aResult.ParseEnumValue(aValue, kListTypeTable, false);
}
if (aAttribute == nsGkAtoms::start) {
return aResult.ParseIntWithBounds(aValue, 1);
}
}
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aResult);
}
示例9: ParseAttribute
PRBool
nsHTMLLIElement::ParseAttribute(PRInt32 aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
if (aNamespaceID == kNameSpaceID_None) {
if (aAttribute == nsGkAtoms::type) {
return aResult.ParseEnumValue(aValue, kOrderedListItemTypeTable,
PR_TRUE) ||
aResult.ParseEnumValue(aValue, kUnorderedListItemTypeTable, PR_FALSE);
}
if (aAttribute == nsGkAtoms::value) {
return aResult.ParseIntWithBounds(aValue, 0);
}
}
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aResult);
}
示例10: ParseFrameborderValue
bool
HTMLFrameSetElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
if (aNamespaceID == kNameSpaceID_None) {
if (aAttribute == nsGkAtoms::bordercolor) {
return aResult.ParseColor(aValue);
}
if (aAttribute == nsGkAtoms::frameborder) {
return nsGenericHTMLElement::ParseFrameborderValue(aValue, aResult);
}
if (aAttribute == nsGkAtoms::border) {
return aResult.ParseIntWithBounds(aValue, 0, 100);
}
}
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aResult);
}
示例11: ParseAttribute
bool HTMLMarqueeElement::ParseAttribute(int32_t aNamespaceID,
nsAtom* aAttribute,
const nsAString& aValue,
nsIPrincipal* aMaybeScriptedPrincipal,
nsAttrValue& aResult) {
if (aNamespaceID == kNameSpaceID_None) {
if ((aAttribute == nsGkAtoms::width) || (aAttribute == nsGkAtoms::height)) {
return aResult.ParseSpecialIntValue(aValue);
}
if (aAttribute == nsGkAtoms::bgcolor) {
return aResult.ParseColor(aValue);
}
if (aAttribute == nsGkAtoms::behavior) {
return aResult.ParseEnumValue(aValue, kBehaviorTable, false,
kDefaultBehavior);
}
if (aAttribute == nsGkAtoms::direction) {
return aResult.ParseEnumValue(aValue, kDirectionTable, false,
kDefaultDirection);
}
if ((aAttribute == nsGkAtoms::hspace) ||
(aAttribute == nsGkAtoms::vspace)) {
return aResult.ParseIntWithBounds(aValue, 0);
}
if (aAttribute == nsGkAtoms::loop) {
return aResult.ParseIntValue(aValue);
}
if (aAttribute == nsGkAtoms::scrollamount ||
aAttribute == nsGkAtoms::scrolldelay) {
return aResult.ParseNonNegativeIntValue(aValue);
}
}
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aMaybeScriptedPrincipal, aResult);
}
示例12: ParseAttribute
PRBool
nsHTMLHRElement::ParseAttribute(PRInt32 aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
if (aNamespaceID == kNameSpaceID_None) {
if (aAttribute == nsGkAtoms::width) {
return aResult.ParseSpecialIntValue(aValue);
}
if (aAttribute == nsGkAtoms::size) {
return aResult.ParseIntWithBounds(aValue, 1, 1000);
}
if (aAttribute == nsGkAtoms::align) {
return aResult.ParseEnumValue(aValue, kAlignTable, PR_FALSE);
}
if (aAttribute == nsGkAtoms::color) {
return aResult.ParseColor(aValue);
}
}
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aResult);
}
示例13: ParseTableCellHAlignValue
bool
HTMLTableCellElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
if (aNamespaceID == kNameSpaceID_None) {
/* ignore these attributes, stored simply as strings
abbr, axis, ch, headers
*/
if (aAttribute == nsGkAtoms::charoff) {
/* attributes that resolve to integers with a min of 0 */
return aResult.ParseIntWithBounds(aValue, 0);
}
if (aAttribute == nsGkAtoms::colspan) {
bool res = aResult.ParseIntWithBounds(aValue, -1);
if (res) {
int32_t val = aResult.GetIntegerValue();
// reset large colspan values as IE and opera do
// quirks mode does not honor the special html 4 value of 0
if (val > MAX_COLSPAN || val < 0 ||
(0 == val && InNavQuirksMode(OwnerDoc()))) {
aResult.SetTo(1);
}
}
return res;
}
if (aAttribute == nsGkAtoms::rowspan) {
bool res = aResult.ParseIntWithBounds(aValue, -1, MAX_ROWSPAN);
if (res) {
int32_t val = aResult.GetIntegerValue();
// quirks mode does not honor the special html 4 value of 0
if (val < 0 || (0 == val && InNavQuirksMode(OwnerDoc()))) {
aResult.SetTo(1);
}
}
return res;
}
if (aAttribute == nsGkAtoms::height) {
return aResult.ParseSpecialIntValue(aValue);
}
if (aAttribute == nsGkAtoms::width) {
return aResult.ParseSpecialIntValue(aValue);
}
if (aAttribute == nsGkAtoms::align) {
return ParseTableCellHAlignValue(aValue, aResult);
}
if (aAttribute == nsGkAtoms::bgcolor) {
return aResult.ParseColor(aValue);
}
if (aAttribute == nsGkAtoms::scope) {
return aResult.ParseEnumValue(aValue, kCellScopeTable, false);
}
if (aAttribute == nsGkAtoms::valign) {
return ParseTableVAlignValue(aValue, aResult);
}
}
return nsGenericHTMLElement::ParseBackgroundAttribute(aNamespaceID,
aAttribute, aValue,
aResult) ||
nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aResult);
}