summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/CounterNode.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/rendering/CounterNode.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/rendering/CounterNode.h')
-rw-r--r--Source/WebCore/rendering/CounterNode.h44
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