HTMLOListElement.h [plain text]
#ifndef HTMLOListElement_h
#define HTMLOListElement_h
#include "HTMLElement.h"
#include <wtf/Optional.h>
namespace WebCore {
class HTMLOListElement final : public HTMLElement {
public:
static Ref<HTMLOListElement> create(Document&);
static Ref<HTMLOListElement> create(const QualifiedName&, Document&);
int start() const { return m_start ? m_start.value() : (m_isReversed ? itemCount() : 1); }
void setStart(int);
bool isReversed() const { return m_isReversed; }
void itemCountChanged() { m_shouldRecalculateItemCount = true; }
private:
HTMLOListElement(const QualifiedName&, Document&);
void updateItemValues();
unsigned itemCount() const
{
if (m_shouldRecalculateItemCount)
const_cast<HTMLOListElement*>(this)->recalculateItemCount();
return m_itemCount;
}
void recalculateItemCount();
void parseAttribute(const QualifiedName&, const AtomicString&) final;
bool isPresentationAttribute(const QualifiedName&) const final;
void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) final;
Optional<int> m_start;
unsigned m_itemCount;
bool m_isReversed : 1;
bool m_shouldRecalculateItemCount : 1;
};
}
#endif