summaryrefslogtreecommitdiffstats
path: root/dom/base/nsAttrValueOrString.h
diff options
context:
space:
mode:
Diffstat (limited to 'dom/base/nsAttrValueOrString.h')
-rw-r--r--dom/base/nsAttrValueOrString.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/dom/base/nsAttrValueOrString.h b/dom/base/nsAttrValueOrString.h
index 8e6c06953..1a62a8428 100644
--- a/dom/base/nsAttrValueOrString.h
+++ b/dom/base/nsAttrValueOrString.h
@@ -78,6 +78,20 @@ public:
return aOther.EqualsAsStrings(*mAttrValue);
}
+ /*
+ * Returns true if the value stored is empty
+ */
+ bool IsEmpty() const
+ {
+ if (mStringPtr) {
+ return mStringPtr->IsEmpty();
+ }
+ if (mAttrValue) {
+ return mAttrValue->IsEmptyString();
+ }
+ return true;
+ }
+
protected:
const nsAttrValue* mAttrValue;
mutable const nsAString* mStringPtr;