This source file includes following definitions.
- next
- next
- setIndexToLastItem
#include "config.h"
#include "core/rendering/RenderLayerStackingNodeIterator.h"
#include "core/rendering/RenderLayer.h"
#include "core/rendering/RenderLayerStackingNode.h"
namespace WebCore {
RenderLayerStackingNode* RenderLayerStackingNodeIterator::next()
{
if (m_remainingChildren & NegativeZOrderChildren) {
Vector<RenderLayerStackingNode*>* negZOrderList = m_root.negZOrderList();
if (negZOrderList && m_index < negZOrderList->size())
return negZOrderList->at(m_index++);
m_index = 0;
m_remainingChildren &= ~NegativeZOrderChildren;
}
if (m_remainingChildren & NormalFlowChildren) {
Vector<RenderLayerStackingNode*>* normalFlowList = m_root.normalFlowList();
if (normalFlowList && m_index < normalFlowList->size())
return normalFlowList->at(m_index++);
m_index = 0;
m_remainingChildren &= ~NormalFlowChildren;
}
if (m_remainingChildren & PositiveZOrderChildren) {
Vector<RenderLayerStackingNode*>* posZOrderList = m_root.posZOrderList();
if (posZOrderList && m_index < posZOrderList->size())
return posZOrderList->at(m_index++);
m_index = 0;
m_remainingChildren &= ~PositiveZOrderChildren;
}
return 0;
}
RenderLayerStackingNode* RenderLayerStackingNodeReverseIterator::next()
{
if (m_remainingChildren & NegativeZOrderChildren) {
Vector<RenderLayerStackingNode*>* negZOrderList = m_root.negZOrderList();
if (negZOrderList && m_index >= 0)
return negZOrderList->at(m_index--);
m_remainingChildren &= ~NegativeZOrderChildren;
setIndexToLastItem();
}
if (m_remainingChildren & NormalFlowChildren) {
Vector<RenderLayerStackingNode*>* normalFlowList = m_root.normalFlowList();
if (normalFlowList && m_index >= 0)
return normalFlowList->at(m_index--);
m_remainingChildren &= ~NormalFlowChildren;
setIndexToLastItem();
}
if (m_remainingChildren & PositiveZOrderChildren) {
Vector<RenderLayerStackingNode*>* posZOrderList = m_root.posZOrderList();
if (posZOrderList && m_index >= 0)
return posZOrderList->at(m_index--);
m_remainingChildren &= ~PositiveZOrderChildren;
setIndexToLastItem();
}
return 0;
}
void RenderLayerStackingNodeReverseIterator::setIndexToLastItem()
{
if (m_remainingChildren & NegativeZOrderChildren) {
Vector<RenderLayerStackingNode*>* negZOrderList = m_root.negZOrderList();
if (negZOrderList) {
m_index = negZOrderList->size() - 1;
return;
}
m_remainingChildren &= ~NegativeZOrderChildren;
}
if (m_remainingChildren & NormalFlowChildren) {
Vector<RenderLayerStackingNode*>* normalFlowList = m_root.normalFlowList();
if (normalFlowList) {
m_index = normalFlowList->size() - 1;
return;
}
m_remainingChildren &= ~NormalFlowChildren;
}
if (m_remainingChildren & PositiveZOrderChildren) {
Vector<RenderLayerStackingNode*>* posZOrderList = m_root.posZOrderList();
if (posZOrderList) {
m_index = posZOrderList->size() - 1;
return;
}
m_remainingChildren &= ~PositiveZOrderChildren;
}
ASSERT(!m_remainingChildren);
m_index = -1;
}
}