summaryrefslogtreecommitdiffstats
path: root/dom/base/Element.h
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2017-08-18 13:39:37 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-03-12 10:01:04 +0100
commitea44e60b7ed5f674b6de65fad669ac43a45438cc (patch)
tree38b4e34c1859e6881c428f962cf47a1cc52cbd5b /dom/base/Element.h
parent6be9e507077bfdd2b8c82c203cf70f010ecce086 (diff)
downloadUXP-ea44e60b7ed5f674b6de65fad669ac43a45438cc.tar
UXP-ea44e60b7ed5f674b6de65fad669ac43a45438cc.tar.gz
UXP-ea44e60b7ed5f674b6de65fad669ac43a45438cc.tar.lz
UXP-ea44e60b7ed5f674b6de65fad669ac43a45438cc.tar.xz
UXP-ea44e60b7ed5f674b6de65fad669ac43a45438cc.zip
HTML - implement the labels attribute (follow up)
Diffstat (limited to 'dom/base/Element.h')
-rw-r--r--dom/base/Element.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/dom/base/Element.h b/dom/base/Element.h
index 5d878df60..cf1d197e2 100644
--- a/dom/base/Element.h
+++ b/dom/base/Element.h
@@ -544,6 +544,18 @@ public:
virtual uint32_t GetAttrCount() const override;
virtual bool IsNodeOfType(uint32_t aFlags) const override;
+ /**
+ * Get the class list of this element (this corresponds to the value of the
+ * class attribute). This may be null if there are no classes, but that's not
+ * guaranteed (e.g. we could have class="").
+ */
+ const nsAttrValue* GetClasses() const {
+ if (HasFlag(NODE_MAY_HAVE_CLASS)) {
+ return DoGetClasses();
+ }
+ return nullptr;
+ }
+
#ifdef DEBUG
virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override
{
@@ -1372,6 +1384,12 @@ protected:
private:
/**
+ * Hook for implementing GetClasses. This is guaranteed to only be
+ * called if the NODE_MAY_HAVE_CLASS flag is set.
+ */
+ const nsAttrValue* DoGetClasses() const;
+
+ /**
* Get this element's client area rect in app units.
* @return the frame's client area
*/