summaryrefslogtreecommitdiffstats
path: root/dom/base/nsAttrValue.h
diff options
context:
space:
mode:
Diffstat (limited to 'dom/base/nsAttrValue.h')
-rw-r--r--dom/base/nsAttrValue.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/dom/base/nsAttrValue.h b/dom/base/nsAttrValue.h
index 655e4ca61..23f61a614 100644
--- a/dom/base/nsAttrValue.h
+++ b/dom/base/nsAttrValue.h
@@ -362,6 +362,19 @@ public:
*/
bool ParseNonNegativeIntValue(const nsAString& aString);
+ /**
+ * Parse a string value into a clamped non-negative integer.
+ * This method follows the rules for parsing non-negative integer from:
+ * https://html.spec.whatwg.org/multipage/infrastructure.html#clamped-to-the-range
+ *
+ * @param aString the string to parse
+ * @param aDefault value to return for negative or invalid values
+ * @param aMin minimum value
+ * @param aMax maximum value
+ */
+ void ParseClampedNonNegativeInt(const nsAString& aString, int32_t aDefault,
+ int32_t aMin, int32_t aMax);
+
/**
* Parse a string value into a positive integer.
* This method follows the rules for parsing non-negative integer from: