RenderNamedFlowThread.h [plain text]
#ifndef RenderNamedFlowThread_h
#define RenderNamedFlowThread_h
#include "RenderFlowThread.h"
#include <wtf/HashCountedSet.h>
#include <wtf/ListHashSet.h>
#include <wtf/text/AtomicString.h>
namespace WebCore {
class Node;
class RenderNamedFlowThread;
class WebKitNamedFlow;
typedef ListHashSet<RenderNamedFlowThread*> RenderNamedFlowThreadList;
typedef HashCountedSet<RenderNamedFlowThread*> RenderNamedFlowThreadCountedSet;
typedef ListHashSet<Node*> NamedFlowContentNodes;
class RenderNamedFlowThread : public RenderFlowThread {
public:
RenderNamedFlowThread(Node*, const AtomicString&);
AtomicString flowThreadName() const { return m_flowThreadName; }
RenderObject* nextRendererForNode(Node*) const;
RenderObject* previousRendererForNode(Node*) const;
void addFlowChild(RenderObject* newChild, RenderObject* beforeChild = 0);
void removeFlowChild(RenderObject*);
bool hasChildren() const { return !m_flowThreadChildList.isEmpty(); }
#ifndef NDEBUG
bool hasChild(RenderObject* child) const { return m_flowThreadChildList.contains(child); }
#endif
void pushDependencies(RenderNamedFlowThreadList&);
virtual void addRegionToThread(RenderRegion*) OVERRIDE;
virtual void removeRegionFromThread(RenderRegion*) OVERRIDE;
WebKitNamedFlow* ensureNamedFlow();
void registerNamedFlowContentNode(Node*);
void unregisterNamedFlowContentNode(Node*);
const NamedFlowContentNodes& contentNodes() const { return m_contentNodes; }
bool hasContentNode(Node* contentNode) const { ASSERT(contentNode); return m_contentNodes.contains(contentNode); }
private:
virtual const char* renderName() const OVERRIDE;
virtual bool isRenderNamedFlowThread() const OVERRIDE { return true; }
bool dependsOn(RenderNamedFlowThread* otherRenderFlowThread) const;
void addDependencyOnFlowThread(RenderNamedFlowThread*);
void removeDependencyOnFlowThread(RenderNamedFlowThread*);
void checkInvalidRegions();
private:
AtomicString m_flowThreadName;
RenderNamedFlowThreadCountedSet m_observerThreadsSet;
RenderNamedFlowThreadCountedSet m_layoutBeforeThreadsSet;
typedef ListHashSet<RenderObject*> FlowThreadChildList;
FlowThreadChildList m_flowThreadChildList;
NamedFlowContentNodes m_contentNodes;
RefPtr<WebKitNamedFlow> m_namedFlow;
};
inline RenderNamedFlowThread* toRenderNamedFlowThread(RenderObject* object)
{
ASSERT(!object || object->isRenderNamedFlowThread());
return static_cast<RenderNamedFlowThread*>(object);
}
inline const RenderNamedFlowThread* toRenderNamedFlowThread(const RenderObject* object)
{
ASSERT(!object || object->isRenderNamedFlowThread());
return static_cast<const RenderNamedFlowThread*>(object);
}
void toRenderNamedFlowThread(const RenderNamedFlowThread*);
}
#endif // RenderNamedFlowThread_h