From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/rendering/CounterNode.h | 44 ++++++++++++++++------------------ 1 file changed, 20 insertions(+), 24 deletions(-) (limited to 'Source/WebCore/rendering/CounterNode.h') 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 #include @@ -42,15 +41,15 @@ class RenderElement; class CounterNode : public RefCounted { public: - static PassRefPtr create(RenderElement*, bool isReset, int value); + static Ref 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 -- cgit v1.2.1