diff options
Diffstat (limited to 'Source/WebCore/rendering/CounterNode.h')
-rw-r--r-- | Source/WebCore/rendering/CounterNode.h | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/Source/WebCore/rendering/CounterNode.h b/Source/WebCore/rendering/CounterNode.h index a5397ecc0..040bdd8bc 100644 --- a/Source/WebCore/rendering/CounterNode.h +++ b/Source/WebCore/rendering/CounterNode.h @@ -19,8 +19,7 @@ * */ -#ifndef CounterNode_h -#define CounterNode_h +#pragma once #include <wtf/Forward.h> #include <wtf/Noncopyable.h> @@ -42,15 +41,15 @@ class RenderElement; class CounterNode : public RefCounted<CounterNode> { public: - static PassRefPtr<CounterNode> create(RenderElement*, bool isReset, int value); + static Ref<CounterNode> create(RenderElement&, bool isReset, int value); ~CounterNode(); bool actsAsReset() const { return m_hasResetType || !m_parent; } bool hasResetType() const { return m_hasResetType; } int value() const { return m_value; } int countInParent() const { return m_countInParent; } - RenderElement* owner() const { return m_owner; } - void addRenderer(RenderCounter*); - void removeRenderer(RenderCounter*); + RenderElement& owner() const { return m_owner; } + void addRenderer(RenderCounter&); + void removeRenderer(RenderCounter&); // Invalidates the text in the renderers of this counter, if any. void resetRenderers(); @@ -62,16 +61,15 @@ public: CounterNode* lastChild() const { return m_lastChild; } CounterNode* lastDescendant() const; CounterNode* previousInPreOrder() const; - CounterNode* nextInPreOrder(const CounterNode* stayWithin = 0) const; - CounterNode* nextInPreOrderAfterChildren(const CounterNode* stayWithin = 0) const; - - void insertAfter(CounterNode* newChild, CounterNode* beforeChild, const AtomicString& identifier); + CounterNode* nextInPreOrder(const CounterNode* stayWithin = nullptr) const; + CounterNode* nextInPreOrderAfterChildren(const CounterNode* stayWithin = nullptr) const; + void insertAfter(CounterNode& newChild, CounterNode* beforeChild, const AtomicString& identifier); // identifier must match the identifier of this counter. - void removeChild(CounterNode*); + void removeChild(CounterNode&); private: - CounterNode(RenderElement*, bool isReset, int value); + CounterNode(RenderElement&, bool isReset, int value); int computeCountInParent() const; // Invalidates the text in the renderer of this counter, if any, // and in the renderers of all descendants of this counter, if any. @@ -81,21 +79,19 @@ private: bool m_hasResetType; int m_value; int m_countInParent; - RenderElement* m_owner; - RenderCounter* m_rootRenderer; - - CounterNode* m_parent; - CounterNode* m_previousSibling; - CounterNode* m_nextSibling; - CounterNode* m_firstChild; - CounterNode* m_lastChild; + RenderElement& m_owner; + RenderCounter* m_rootRenderer { nullptr }; + + CounterNode* m_parent { nullptr }; + CounterNode* m_previousSibling { nullptr }; + CounterNode* m_nextSibling { nullptr }; + CounterNode* m_firstChild { nullptr }; + CounterNode* m_lastChild { nullptr }; }; } // namespace WebCore -#ifndef NDEBUG -// Outside the WebCore namespace for ease of invocation from gdb. +#if ENABLE(TREE_DEBUGGING) +// Outside the WebCore namespace for ease of invocation from the debugger. void showCounterTree(const WebCore::CounterNode*); #endif - -#endif // CounterNode_h |